URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/rtos/ecos-2.0/packages/hal/arm/pid
- from Rev 27 to Rev 174
- ↔ Reverse comparison
Rev 27 → Rev 174
/v2_0/cdl/hal_arm_pid.cdl
0,0 → 1,460
# ==================================================================== |
# |
# hal_arm_pid.cdl |
# |
# PID 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): bartv |
# Original data: gthomas |
# Contributors: |
# Date: 1999-06-13 |
# |
#####DESCRIPTIONEND#### |
# |
# ==================================================================== |
|
cdl_package CYGPKG_HAL_ARM_PID { |
display "ARM PID evaluation board" |
parent CYGPKG_HAL_ARM |
define_header hal_arm_pid.h |
include_dir cyg/hal |
hardware |
description " |
The pid HAL package provides the support needed to run |
eCos on an ARM PID evaluation board." |
|
compile hal_diag.c pid_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_THUMB_ARCH |
implements CYGINT_HAL_ARM_BIGENDIAN |
implements CYGINT_HAL_ARM_ARCH_ARM7 |
implements CYGINT_HAL_ARM_ARCH_ARM9 |
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_pid.h>" |
puts $::cdl_header "" |
puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 7TDMI\"" |
puts $::cdl_header "#define HAL_PLATFORM_BOARD \"PID\"" |
puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" |
puts $::cdl_header "" |
|
puts $::cdl_header "#define CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES 100000" |
} |
|
|
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 PID eval 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 CYGSEM_HAL_ARM_PID_ANGEL_BOOT { |
display "Support startup from Angel" |
default_value 0 |
description " |
The Angel monitor can be used for some simple initial bootstrap |
operations. However, since Angel starts applications in user |
mode, the eCos startup code must jump through certain hoops |
to get started." |
} |
|
cdl_option CYGHWR_HAL_ARM_PID_DIAG_LEDS { |
display "Enable use of PPx LEDs" |
default_value 0 |
description " |
The PID board has four LEDs labelled PP0-PP3. These can be |
controlled by eCos if jumpers 9-16 on LK11 are |
shorted. Note that this prevents the parallel port from |
being used. See the PID board manual for details. |
|
Enabling this option causes eCos to flash the LEDs during |
early board initialization. See vectors.S for |
details. Before calling cyg_start, PP0 is switched on, |
PP1-3 are switched off. The application code can use the |
function hal_diag_led() to control the LEDs after this |
point." |
} |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT { |
display "Default console channel." |
flavor data |
calculated 0 |
} |
|
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 PID 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 CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT |
description " |
The PID 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 12500 |
} |
} |
|
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 " : ((CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") ? "-mcpu=arm9 " : "-mcpu=arm7tdmi ")) . |
(CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . |
(CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "") . |
"-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 CYGBLD_GLOBAL_LDFLAGS { |
display "Global linker flags" |
flavor data |
no_define |
default_value { (CYGHWR_THUMB ? "-mthumb " : ((CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") ? "-mcpu=arm9 " : "-mcpu=arm7tdmi ")) . |
((CYGBLD_ARM_ENABLE_THUMB_INTERWORK || CYGSEM_HAL_ROM_MONITOR) ? "-mthumb-interwork " : "") . |
(CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "") . |
"-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. The address of the ELF headers in the image are |
adjusted to ensure loading at an address in memory used |
by the flash tool." |
|
make -priority 320 { |
<PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img |
@mv $< $(<:.img=.elf) |
$(OBJCOPY) --strip-debug --change-addresses=0xFC060000 $(<:.img=.elf) $< |
$(OBJCOPY) -O binary $(<:.img=.elf) $@ |
} |
} |
|
cdl_option CYGBLD_BUILD_FLASH_TOOL { |
display "Build flash programming tool" |
default_value 0 |
requires { CYG_HAL_STARTUP == "RAM" } |
requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1 |
requires CYGPKG_LIBC |
requires CYGPKG_KERNEL |
no_define |
description "This option enables the building of the flash programming tool for copying the GDB stubs into flash memory." |
make -priority 320 { |
<PREFIX>/bin/prog_flash.img : <PACKAGE>/src/prog_flash.c |
@sh -c "mkdir -p src $(dir $@)" |
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/prog_flash.o $< |
@echo $@ ": \\" > $(notdir $@).deps |
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps |
@tail +2 deps.tmp >> $(notdir $@).deps |
@echo >> $(notdir $@).deps |
@rm deps.tmp |
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash.o |
} |
} |
|
cdl_option CYGBLD_BUILD_FLASH_TOOL_BE { |
display "Build flash programming tool for BE images on LE boards" |
default_value 0 |
requires { CYG_HAL_STARTUP == "RAM" } |
requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1 |
requires CYGPKG_LIBC |
requires CYGPKG_KERNEL |
no_define |
description "This option enables the building of the flash |
programming tool for copying the GDB stubs |
into flash memory. The tool built by enabling |
this option must be used when programming BE |
images on LE boards." |
make -priority 320 { |
<PREFIX>/bin/prog_flash_BE_image_LE_system.img : <PACKAGE>/src/prog_flash.c |
@sh -c "mkdir -p src $(dir $@)" |
$(CC) -DBE_IMAGE -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/prog_flash_be.o $< |
@echo $@ ": \\" > $(notdir $@).deps |
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps |
@tail +2 deps.tmp >> $(notdir $@).deps |
@echo >> $(notdir $@).deps |
@rm deps.tmp |
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash_be.o |
} |
} |
} |
|
cdl_component CYGHWR_MEMORY_LAYOUT { |
display "Memory layout" |
flavor data |
no_define |
calculated { CYG_HAL_STARTUP == "RAM" ? "arm_pid_ram" : \ |
"arm_pid_rom" } |
|
cdl_option CYGHWR_MEMORY_LAYOUT_LDI { |
display "Memory layout linker script fragment" |
flavor data |
no_define |
define -file system.h CYGHWR_MEMORY_LAYOUT_LDI |
calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.ldi>" : \ |
"<pkgconf/mlt_arm_pid_rom.ldi>" } |
} |
|
cdl_option CYGHWR_MEMORY_LAYOUT_H { |
display "Memory layout header file" |
flavor data |
no_define |
define -file system.h CYGHWR_MEMORY_LAYOUT_H |
calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.h>" : \ |
"<pkgconf/mlt_arm_pid_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_component CYGPKG_CYGMON_HAL_OPTIONS { |
display "CygMon HAL options" |
flavor none |
no_define |
parent CYGPKG_CYGMON |
active_if CYGPKG_CYGMON |
description " |
This option also lists the target's requirements for a valid CygMon |
configuration." |
|
|
cdl_option CYGBLD_BUILD_CYGMON_BIN { |
display "Build CygMon ROM binary image" |
active_if CYGBLD_BUILD_CYGMON |
default_value 1 |
no_define |
description "This option enables the conversion of the CygMon ELF |
image to a binary image suitable for ROM programming." |
|
make -priority 325 { |
<PREFIX>/bin/cygmon.bin : <PREFIX>/bin/cygmon.elf |
$(OBJCOPY) --strip-debug --change-addresses=0xFC060000 $< $(@:.bin=.img) |
$(OBJCOPY) -O srec $< $(@:.bin=.srec) |
$(OBJCOPY) -O binary $< $@ |
} |
} |
} |
|
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." |
} |
|
# custom rule to create a shell script to execute SID |
make { |
<PREFIX>/runsid : <PREFIX>/include/pkgconf/hal_arm_pid.h |
@echo "arm-elf-sid CYGTST_SID_FLAGS \$$@" > $(notdir $@).tmp |
$(CC) -E -P -c -xc -undef -imacros $< -o $@ $(notdir $@).tmp |
@rm $(notdir $@).tmp |
} |
|
cdl_option CYGTST_SID_FLAGS { |
display "SID execution flags" |
flavor data |
default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "--board=pid7t -EB" : "--board=pid7t -EL" } |
} |
|
cdl_component CYGPKG_REDBOOT_HAL_OPTIONS { |
display "Redboot HAL options" |
flavor none |
no_define |
parent CYGPKG_REDBOOT |
active_if CYGPKG_REDBOOT |
description " |
This option lists the target's requirements for a valid Redboot |
configuration." |
|
cdl_option CYGBLD_BUILD_REDBOOT_BIN { |
display "Build Redboot ROM binary image" |
active_if CYGBLD_BUILD_REDBOOT |
default_value 1 |
no_define |
description "This option enables the conversion of the Redboot ELF |
image to a binary image suitable for ROM programming." |
|
make -priority 325 { |
<PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf |
$(OBJCOPY) --strip-debug $< $(@:.bin=.img) |
$(OBJCOPY) -O srec $< $(@:.bin=.srec) |
$(OBJCOPY) -O binary $< $@ |
} |
} |
} |
} |
/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 |
// Date: 1999-02-15 |
// Purpose: Platform HAL stub support for ARM/PID boards. |
// Usage: #include <cyg/hal/plf_stub.h> |
// |
//####DESCRIPTIONEND#### |
// |
//============================================================================= |
|
#include <pkgconf/hal.h> |
#include <pkgconf/hal_arm_pid.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_pid_rom.mlt
0,0 → 1,14
version 0 |
region ram 0 80000 0 ! |
region rom 4000000 80000 1 ! |
section fixed_vectors 0 1 0 1 1 0 1 0 20 20 ! |
section data 0 1 1 1 1 1 0 0 800 bss ! |
section bss 0 4 0 1 0 1 0 1 heap1 heap1 ! |
section heap1 0 8 0 0 0 0 0 0 ! |
section rom_vectors 0 1 0 1 1 1 1 1 4000000 4000000 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 ! |
/v2_0/include/pkgconf/mlt_arm_pid_ram.mlt
0,0 → 1,13
version 0 |
region ram 0 80000 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 8 0 0 0 0 0 0 ! |
/v2_0/include/pkgconf/mlt_arm_pid_rom.h
0,0 → 1,20
// eCos memory layout - Fri Oct 20 05:30:30 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 (0x80000) |
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) |
#define CYGMEM_REGION_rom (0x4000000) |
#define CYGMEM_REGION_rom_SIZE (0x80000) |
#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 (0x80000 - (size_t) CYG_LABEL_NAME (__heap1)) |
/v2_0/include/pkgconf/mlt_arm_pid_rom.ldi
0,0 → 1,28
// eCos memory layout - Fri Oct 20 05:30:30 2000 |
|
// This is a generated file - do not edit |
|
#include <cyg/infra/cyg_type.inc> |
|
MEMORY |
{ |
ram : ORIGIN = 0, LENGTH = 0x80000 |
rom : ORIGIN = 0x4000000, LENGTH = 0x80000 |
} |
|
SECTIONS |
{ |
SECTIONS_BEGIN |
SECTION_rom_vectors (rom, 0x4000000, 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, 0x800, FOLLOWING (.gcc_except_table)) |
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) |
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); |
SECTIONS_END |
} |
/v2_0/include/pkgconf/mlt_arm_pid_ram.h
0,0 → 1,17
// eCos memory layout - Fri Oct 20 05:31:09 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 (0x80000) |
#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 (0x80000 - (size_t) CYG_LABEL_NAME (__heap1)) |
/v2_0/include/pkgconf/mlt_arm_pid_ram.ldi
0,0 → 1,27
// eCos memory layout - Fri Oct 20 05:31:09 2000 |
|
// This is a generated file - do not edit |
|
#include <cyg/infra/cyg_type.inc> |
|
MEMORY |
{ |
ram : ORIGIN = 0, LENGTH = 0x80000 |
} |
|
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 (0x8); |
SECTIONS_END |
} |
/v2_0/include/hal_platform_ints.h
0,0 → 1,92
#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-02-20 |
// Purpose: Define Interrupt support |
// Description: The interrupt details for the PID are defined here. |
// Usage: |
// #include <cyg/hal/hal_platform_ints.h> |
// ... |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
#define CYGNUM_HAL_INTERRUPT_unused 0 |
#define CYGNUM_HAL_INTERRUPT_PROGRAMMED_INTERRUPT 1 |
#define CYGNUM_HAL_INTERRUPT_DEBUG_Rx 2 |
#define CYGNUM_HAL_INTERRUPT_DEBUG_Tx 3 |
#define CYGNUM_HAL_INTERRUPT_TIMER1 4 |
#define CYGNUM_HAL_INTERRUPT_TIMER2 5 |
#define CYGNUM_HAL_INTERRUPT_PC_SLOTA 6 |
#define CYGNUM_HAL_INTERRUPT_PC_SLOTB 7 |
#define CYGNUM_HAL_INTERRUPT_SERIALA 8 |
#define CYGNUM_HAL_INTERRUPT_SERIALB 9 |
#define CYGNUM_HAL_INTERRUPT_PARALLEL_PORT 10 |
#define CYGNUM_HAL_INTERRUPT_ASB0 11 |
#define CYGNUM_HAL_INTERRUPT_ASB1 12 |
#define CYGNUM_HAL_INTERRUPT_APB0 13 |
#define CYGNUM_HAL_INTERRUPT_APB1 14 |
#define CYGNUM_HAL_INTERRUPT_APB2 15 |
#define CYGNUM_HAL_INTERRUPT_EXTERNAL_FIQ 16 |
|
#define CYGNUM_HAL_ISR_MIN 0 |
#define CYGNUM_HAL_ISR_MAX 16 |
#define CYGNUM_HAL_ISR_COUNT 17 |
|
// The vector used by the Real time clock |
#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_TIMER2 |
|
|
//---------------------------------------------------------------------------- |
// Reset. |
|
#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT |
|
#define HAL_PLATFORM_RESET_ENTRY 0x4000000 |
|
#endif // CYGONCE_HAL_PLATFORM_INTS_H |
/v2_0/include/hal_cache.h
0,0 → 1,192
#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 |
// Date: 1998-09-28 |
// Purpose: Cache control API |
// Description: The macros defined here provide the HAL APIs for handling |
// cache control operations. |
// Usage: |
// #include <cyg/hal/hal_cache.h> |
// ... |
// |
// |
//####DESCRIPTIONEND#### |
// |
//============================================================================= |
|
#include <cyg/infra/cyg_type.h> |
|
//----------------------------------------------------------------------------- |
// 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() |
|
// Query the state of the data cache (does not affect the caching) |
#define HAL_DCACHE_IS_ENABLED(_state_) \ |
CYG_MACRO_START \ |
(_state_) = 0; \ |
CYG_MACRO_END |
|
// 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() |
|
// Query the state of the instruction cache (does not affect the caching) |
#define HAL_ICACHE_IS_ENABLED(_state_) \ |
CYG_MACRO_START \ |
(_state_) = 0; \ |
CYG_MACRO_END |
|
// 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 CYGONCE_HAL_CACHE_H |
// End of hal_cache.h |
/v2_0/include/hal_diag.h
0,0 → 1,101
#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 <cyg/hal/hal_diag.h> |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
#include <pkgconf/hal.h> |
|
#include <cyg/infra/cyg_type.h> |
|
#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) |
|
#include <cyg/hal/hal_if.h> |
|
#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 |
|
/*---------------------------------------------------------------------------*/ |
// LED |
|
externC void hal_diag_led(int n); |
|
/*---------------------------------------------------------------------------*/ |
// delay |
|
extern void hal_delay_us(cyg_int32 usecs); |
#define HAL_DELAY_US(n) hal_delay_us(n); |
|
/*---------------------------------------------------------------------------*/ |
/* end of hal_diag.h */ |
#endif /* CYGONCE_HAL_DIAG_H */ |
/v2_0/include/hal_platform_setup.h
0,0 → 1,80
#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-13 |
// Purpose: ARM/PID platform specific support routines |
// Description: |
// Usage: #include <cyg/hal/hal_platform_setup.h> |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
|
// Define macro used to diddle the LEDs during early initialization. |
// Can use r0+r1. Argument in \x. |
// Control the LEDs PP0-PP3. This requires the jumpers on pins 9-16 to |
// be set on LK11 in order to be visible. Otherwise the parallel port |
// data pins are diddled instead. |
#ifdef CYGHWR_HAL_ARM_PID_DIAG_LEDS |
#define CYGHWR_LED_MACRO \ |
ldr r0,=0x0d800040 ;\ |
mov r1, #((15 & (\x)) << 4) ;\ |
strb r1, [r0] ; |
#endif |
|
#define MEM_RESET 0x0B000020 // Write to this location to enable RAM |
|
#define PLATFORM_SETUP1 \ |
ldr r0,=10f ;\ |
mov pc,r0 ;\ |
10: ldr r0,=MEM_RESET /* enable RAM */ ;\ |
str r0,[r0] |
|
/*---------------------------------------------------------------------------*/ |
/* end of hal_platform_setup.h */ |
#endif /* CYGONCE_HAL_PLATFORM_SETUP_H */ |
/v2_0/include/plf_io.h
0,0 → 1,64
#ifndef CYGONCE_HAL_ARM_PID_PLF_IO_H |
#define CYGONCE_HAL_ARM_PID_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 <cyg/hal/hal_io.h> |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
//----------------------------------------------------------------------------- |
// Memory map is 1-1 |
|
#define CYGARC_PHYSICAL_ADDRESS(_x_) (_x_) |
|
//----------------------------------------------------------------------------- |
#endif // CYGONCE_HAL_ARM_PID_PLF_IO_H |
// EOF plf_io.h |
/v2_0/ChangeLog
0,0 → 1,852
2003-04-11 Bart Veer <bartv@ecoscentric.com> |
|
* cdl/hal_arm_pid.cdl: building for thumb now involves arm-elf-gcc |
-mthumb, not thumb-elf-gcc |
|
2003-02-05 Nick Garnett <nickg@calivar.com> |
|
* include/plf_io.h (CYGARC_PHYSICAL_ADDRESS): Added this |
definition to keep redboot_linux_exec.c happy. |
|
2002-05-23 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Don't run cache tests. |
|
2002-05-13 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Removed implemntation of |
CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_NOT_GUARANTEED. |
|
2002-05-07 Gary Thomas <gthomas@redhat.com> |
|
* cdl/hal_arm_pid.cdl: |
Standardize CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT usage. |
|
2002-04-24 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES defined. |
|
2002-01-28 Jesper Skov <jskov@redhat.com> |
|
* include/plf_io.h: Added. |
|
2001-06-08 Jonathan Larmour <jlarmour@redhat.com> |
|
* include/hal_cache.h: Correctly indicate absence of cache. |
|
2001-04-16 Gary Thomas <gthomas@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Add CDL to describe CPU family. |
|
2001-04-13 Gary Thomas <gthomas@redhat.com> |
|
* include/hal_platform_setup.h (PLATFORM_SETUP1): Ensure running |
in proper address space (in ROM startup mode). |
|
2001-03-08 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Does not guarantee virtual vector support. |
|
2001-02-27 Jesper Skov <jskov@redhat.com> |
|
* include/hal_cache.h: Added HAL_DCACHE_IS_ENABLED and |
HAL_ICACHE_IS_ENABLED. |
|
2001-02-24 Gary Thomas <gthomas@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Add CYGSEM_HAL_ARM_PID_ANGEL_BOOT so |
startup code only includes this cruft when necessary. |
|
2001-02-22 Jesper Skov <jskov@redhat.com> |
|
* include/hal_diag.h: Added delay function [yes, this is a bad |
location]. It uses Timer1 for delays. |
|
* cdl/hal_arm_pid.cdl: Added RedBoot options. |
|
* src/pid_misc.c (hal_delay_us): Added. |
|
2001-02-20 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.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 <gthomas@redhat.com> |
|
* src/pid_misc.c (hal_IRQ_handler): |
Return CYGNUM_HAL_INTERRUPT_NONE for spurious interrupts. |
|
2001-02-08 Jesper Skov <jskov@redhat.com> |
|
* src/hal_diag.c: Replace CYGSEM_HAL_DIAG_MANGLER_None with |
CYGDBG_HAL_DIAG_TO_DEBUG_CHAN. |
|
* cdl/hal_arm_pid.cdl: Respect channel configuration constraints. |
|
* src/pid_misc.c (hal_hardware_init): Safe to call hal_if_init in |
thumb mode now. |
|
2001-01-31 Jesper Skov <jskov@redhat.com> |
|
* src/hal_diag.c: Replaced CYGDBG_HAL_DIAG_DISABLE_GDB_PROTOCOL |
with CYGSEM_HAL_DIAG_MANGLER_None |
|
2001-01-26 Jesper Skov <jskov@redhat.com> |
|
* 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-10-20 Jonathan Larmour <jlarmour@redhat.com> |
|
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_rom.h: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
Regenerate |
|
2000-07-25 Jonathan Larmour <jlarmour@redhat.co.uk> |
|
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_ram.mlt: |
* include/pkgconf/mlt_arm_pid_rom.h: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
* include/pkgconf/mlt_arm_pid_rom.mlt: |
Add heap1 section to allow malloc to use it |
|
2000-07-22 Jonathan Larmour <jlarmour@redhat.co.uk> |
|
* cdl/hal_arm_pid.cdl: Fix comments about number of ports in |
CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL and |
CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL |
|
2000-07-17 Jesper Skov <jskov@redhat.com> |
|
* src/pid_misc.c (hal_hardware_init): Hack to allow thumb tests to |
run in farm until vector table Thumb/ARM API is fixed. |
|
2000-07-07 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: CygMon changed to use virtual vectors. |
|
2000-07-05 Jesper Skov <jskov@redhat.com> |
|
* src/hal_diag.c: |
* cdl/hal_arm_pid.cdl: |
Clean up channel options. |
|
2000-07-04 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: |
* include/hal_diag.h: |
* include/plf_stub.h: |
* src/hal_diag.c: |
* src/pid_misc.c: |
* src/plf_stub.c: [deleted] |
Changed to use virtual vector table. |
|
2000-06-18 Gary Thomas <gthomas@redhat.com> |
|
* include/pkgconf/mlt_arm_pid9_ram.ldi: |
* include/pkgconf/mlt_arm_pid9_ram.mlt: |
* include/pkgconf/mlt_arm_pid9_rom.ldi: |
* include/pkgconf/mlt_arm_pid9_rom.mlt: |
* include/pkgconf/mlt_arm_pidBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidTBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidTBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidTBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidTBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidT_ram.ldi: |
* include/pkgconf/mlt_arm_pidT_ram.mlt: |
* include/pkgconf/mlt_arm_pidT_rom.ldi: |
* include/pkgconf/mlt_arm_pidT_rom.mlt: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_ram.mlt: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
* include/pkgconf/mlt_arm_pid_rom.mlt: |
Incorporate new fixed vectors (used on all ARM platforms). |
|
2000-03-24 Jesper Skov <jskov@redhat.com> |
|
* src/hal_diag.c (hal_diag_write_char): Fix compiler warning. |
|
2000-02-29 Jonathan Larmour <jlarmour@redhat.co.uk> |
|
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_ram.mlt: |
* include/pkgconf/mlt_arm_pid_rom.h: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
* include/pkgconf/mlt_arm_pid_rom.mlt: |
Align all sections on word boundaries |
|
2000-02-18 Jonathan Larmour <jlarmour@redhat.co.uk> |
|
* cdl/hal_arm_pid.cdl (CYGBLD_BUILD_GDB_STUBS): When |
building stubs, define every dependency required here rather than |
in the template |
|
2000-02-15 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Remove stubs startup type. |
|
2000-02-10 Jesper Skov <jskov@redhat.com> |
|
* include/plf_stub.h: |
HAL_STUB_PLATFORM_STUBS_INIT->HAL_STUB_PLATFORM_INIT |
|
* misc/STUBS_config: |
* include/pkgconf/hal_arm_pid.h: |
Removed stubs as a legal startup type. |
|
2000-02-09 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Added remaining build dependencies. |
|
2000-02-07 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Use cpu option when linking. |
|
2000-02-03 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Implements stubs. |
|
2000-02-01 Jesper Skov <jskov@redhat.com> |
|
* include/plf_stub.h: Changes due to STUBS startup removal. |
|
2000-01-28 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Moved files from misc to src dir. Use |
common stub code. Got rid of stubs startup type. |
|
* include/pkgconf/mlt_arm_pid9_ram.h: |
* include/pkgconf/mlt_arm_pid9_ram.ldi: |
* include/pkgconf/mlt_arm_pid9_ram.mlt: |
* include/pkgconf/mlt_arm_pid9_rom.h: |
* include/pkgconf/mlt_arm_pid9_rom.ldi: |
* include/pkgconf/mlt_arm_pid9_rom.mlt: |
* include/pkgconf/mlt_arm_pid9_stubs.h: |
* include/pkgconf/mlt_arm_pid9_stubs.ldi: |
* include/pkgconf/mlt_arm_pid9_stubs.mlt: |
* include/pkgconf/mlt_arm_pidBE_ram.h: |
* include/pkgconf/mlt_arm_pidBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidBE_rom.h: |
* include/pkgconf/mlt_arm_pidBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidBE_stubs.h: |
* include/pkgconf/mlt_arm_pidBE_stubs.ldi: |
* include/pkgconf/mlt_arm_pidBE_stubs.mlt: |
* include/pkgconf/mlt_arm_pidTBE_ram.h: |
* include/pkgconf/mlt_arm_pidTBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidTBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidTBE_rom.h: |
* include/pkgconf/mlt_arm_pidTBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidTBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidT_ram.h: |
* include/pkgconf/mlt_arm_pidT_ram.ldi: |
* include/pkgconf/mlt_arm_pidT_ram.mlt: |
* include/pkgconf/mlt_arm_pidT_rom.h: |
* include/pkgconf/mlt_arm_pidT_rom.ldi: |
* include/pkgconf/mlt_arm_pidT_rom.mlt: |
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_ram.mlt: |
* include/pkgconf/mlt_arm_pid_rom.h: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
* include/pkgconf/mlt_arm_pid_rom.mlt: |
* include/pkgconf/mlt_arm_pid_stubs.h: |
* include/pkgconf/mlt_arm_pid_stubs.ldi: |
* include/pkgconf/mlt_arm_pid_stubs.mlt: |
Increase memory reserved for stub to 32kB. |
|
2000-01-28 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl: Corrected build runes. Changed description. |
|
2000-01-27 Jesper Skov <jskov@redhat.com> |
|
* cdl/hal_arm_pid.cdl (CYGBLD_CYGMON_TARGET_REQUIREMENTS): |
Improved serial expression. |
Moved options into a CygMon HAL component. |
|
2000-01-26 Jonathan Larmour <jlarmour@redhat.co.uk> |
|
* cdl/hal_arm_pid.cdl (CYGBLD_CYGMON_TARGET_REQUIREMENTS): Only |
activate when CYGPKG_CYGMON enabled |
|
2000-01-26 Jesper Skov <jskov@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Added rule for flash tool BE. |
Fix display string. |
Added CygMon options. |
|
2000-01-24 Jesper Skov <jskov@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Add stubs build rule. |
|
2000-01-24 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/*.cdl: |
|
Remove obsolete option CYGTST_TESTING_IDENTIFIER. |
|
2000-01-19 Hugo Tyson <hmt@cygnus.co.uk> |
|
* 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-22 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Add the -mbig-endian and -mthumb-interwork ARCHFLAGS to |
the LDFLAGS as appropriate. |
|
1999-12-20 Gary Thomas <gthomas@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Add -Wl for linker options |
|
1999-12-16 Jonathan Larmour <jlarmour@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Add support for pidT and pidTBE targets |
|
1999-12-15 Jonathan Larmour <jlarmour@cygnus.co.uk> |
|
* misc/STUBS_config: updated patch due to hal.h changes |
|
1999-12-14 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Relocate the GDB stubs elf image file. |
|
1999-12-13 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Install both the elf and raw binary versions of the |
GDB stubs image. |
|
1999-12-10 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Add custom rules to build GDB stubs and the flash |
programming tool. |
|
1999-12-09 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Modify testing parameters according to |
CYGHWR_HAL_ARM_BIGENDIAN. |
|
1999-12-09 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Add SID execution flags option. |
|
1999-12-07 Gary Thomas <gthomas@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Add descriptive strings used by CygMon. |
|
1999-12-07 Jesper Skov <jskov@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Adjust CFLAGS according to CPU family. |
|
1999-12-06 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h (HAL_PLATFORM_BOARD): |
(HAL_PLATFORM_CPU): |
(HAL_PLATFORM_EXTRA): Add - used by CygMon. |
|
* misc/prog_flash.c: Increase flash image size (needed to |
build CygMon image). |
|
1999-11-25 Jonathan Larmour <jlarmour@cygnus.co.uk> |
|
* include/pkgconf/mlt_arm_pidTBE_stubs.h, |
include/pkfconf/mlt_arm_pidT_stubs.h: |
Delete - we don't have stubs startup for thumb mode |
|
* include/pkgconf/hal_arm_pid.h: |
Allow selection of big-endian mode |
Allow selection of thumb mode |
Allow selection of thumb big-endian 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 <gthomas@cygnus.co.uk> |
|
* include/pkgconf/mlt_arm_pidT_rom.h: |
* include/pkgconf/mlt_arm_pidT_ram.h: |
* include/pkgconf/mlt_arm_pidTBE_rom.h: |
* include/pkgconf/mlt_arm_pidTBE_ram.h: |
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_rom.h: |
* include/pkgconf/mlt_arm_pidBE_rom.h: |
* include/pkgconf/mlt_arm_pidBE_ram.h: Update 'do not edit' strings. |
|
* include/pkgconf/mlt_arm_pidTBE_stubs.h: |
* include/pkgconf/mlt_arm_pidT_stubs.h: |
* include/pkgconf/mlt_arm_pid_stubs.h: |
* include/pkgconf/mlt_arm_pidBE_stubs.h: |
* include/pkgconf/mlt_arm_pid9_stubs.h: |
* include/pkgconf/mlt_arm_pid9_rom.h: |
* include/pkgconf/mlt_arm_pid9_ram.h: New file(s). |
|
1999-11-09 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/mlt_arm_pidBE_ram.h: |
* include/pkgconf/mlt_arm_pidBE_rom.h: |
* include/pkgconf/mlt_arm_pidTBE_ram.h: |
* include/pkgconf/mlt_arm_pidTBE_rom.h: |
* include/pkgconf/mlt_arm_pidT_ram.h: |
* include/pkgconf/mlt_arm_pidT_rom.h: |
* include/pkgconf/mlt_arm_pid_ram.h: |
* include/pkgconf/mlt_arm_pid_rom.h: New file(s). |
|
* include/pkgconf/mlt_arm_pidBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidTBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidTBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidTBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidTBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidT_ram.ldi: |
* include/pkgconf/mlt_arm_pidT_ram.mlt: |
* include/pkgconf/mlt_arm_pidT_rom.ldi: |
* include/pkgconf/mlt_arm_pidT_rom.mlt: |
* include/pkgconf/mlt_arm_pid_ram.ldi: |
* include/pkgconf/mlt_arm_pid_ram.mlt: |
* include/pkgconf/mlt_arm_pid_rom.ldi: |
* include/pkgconf/mlt_arm_pid_rom.mlt: Update with correct memory layout. |
|
* src/hal_diag.c: Honor GDB_DISABLE option. |
|
1999-11-01 Jesper Skov <jskov@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: Remove define_proc comments. |
|
1999-10-29 Jesper Skov <jskov@cygnus.co.uk> |
|
* misc/PKGconf.mak: Also generate stripped .img files. |
|
1999-10-29 Jesper Skov <jskov@cygnus.co.uk> |
|
* include/plf_stub.h (HAL_STUB_PLATFORM_RESET): Call stub entry on |
GDB kill. But only do it for stubs startup. |
|
1999-10-28 Jesper Skov <jskov@cygnus.co.uk> |
|
* misc/PKGconf.mak: Don't strip symbols when making .img. |
|
1999-10-27 Jesper Skov <jskov@cygnus.co.uk> |
|
* include/pkgconf/mlt_arm_pid9_stubs.ldi: |
* include/pkgconf/mlt_arm_pid9_stubs.mlt: |
Added some linker files. |
|
* misc/Notes: |
* misc/STUBS_config: |
Updated. |
|
* src/hal_diag.c: Fixed conditional include. |
|
1999-10-26 Hugo Tyson <hmt@cygnus.co.uk> |
|
* 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 Jesper Skov <jskov@cygnus.co.uk> |
* include/hal_platform_setup.h (CYGHWR_LED_MACRO): define. |
* cdl/hal_arm_pid.cdl: |
* include/pkgconf/hal_arm_pid.h: |
* src/hal_diag.c: |
* include/hal_diag.h: |
Added CDL for CYGHWR_HAL_ARM_PID_DIAG_LEDS. |
|
1999-10-26 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Rename CYGBLD_GLOBAL_PREFIX to |
CYGBLD_GLOBAL_COMMAND_PREFIX |
|
1999-10-26 Jesper Skov <jskov@cygnus.co.uk> |
* include/pkgconf/mlt_arm_pidTBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidTBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidTBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidTBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidBE_ram.ldi: |
* include/pkgconf/mlt_arm_pidBE_ram.mlt: |
* include/pkgconf/mlt_arm_pidBE_rom.ldi: |
* include/pkgconf/mlt_arm_pidBE_rom.mlt: |
* include/pkgconf/mlt_arm_pidBE_stubs.ldi: |
* include/pkgconf/mlt_arm_pidBE_stubs.mlt: |
* include/pkgconf/mlt_arm_pid9_ram.ldi: |
* include/pkgconf/mlt_arm_pid9_ram.mlt: |
* include/pkgconf/mlt_arm_pid9_rom.ldi: |
* include/pkgconf/mlt_arm_pid9_rom.mlt: |
Added some linker files. |
|
1999-10-25 Jesper Skov <jskov@cygnus.co.uk> |
|
* misc/STUBS_config: Updated. |
* src/hal_diag.c (hal_diag_led): Added LED diag. |
* misc/prog_flash.c: Fixed compiler warning. |
|
* misc/prog_flash.c: |
* misc/PKGconf.mak: |
Add support for programming BE images on LE system. |
|
1999-10-20 Simon FitzMaurice <sdf@cygnus.co.uk> |
* cdl/hal_arm_aeb.cdl: |
|
Remove -Wl options from compiler flags |
|
1999-10-19 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Define cdl_options for the memory layout linker script |
fragment and the memory layout header file. |
|
1999-10-19 Jesper Skov <jskov@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: Added ARM9 options. |
|
1999-10-18 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Define CYGTST_TESTING_IDENTIFIER as a functions of |
CYGHWR_THUMB. |
|
1999-10-18 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
|
Define CYGBLD_GLOBAL_PREFIX and CYGBLD_GLOBAL_CFLAGS as |
functions of CYGHWR_THUMB. |
|
1999-10-18 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
Update CYGBLD_GLOBAL_CFLAGS. Define CYG_HAL_ARM_PID. |
Reparent global build flags. |
|
1999-10-15 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
Define CYGBLD_GLOBAL_CFLAGS and CYGBLD_GLOBAL_LDFLAGS. |
|
1999-10-15 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_diag.c: Force diag channel to be "raw" if it is |
not the same as the GDB port (RAM based applications only). |
|
1999-10-06 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
Define CYGTST_TESTING_IDENTIFIER. |
|
1999-09-16 Jesper Skov <jskov@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: |
Removed arm/thumb options [defined by platform template]. |
|
Added ldi/mdi files for pidT. |
|
1999-09-09 Jesper Skov <jskov@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: |
Added thumb option. |
|
1999-08-16 John Dallaway <jld@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: |
|
Proper case various display strings. |
|
1999-08-12 John Dallaway <jld@cygnus.co.uk> |
|
* cdl/hal_arm_pid.cdl: |
Define CYG_HAL_STARTUP and CYGHWR_MEMORY_LAYOUT. |
|
1999-05-24 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_diag.c: Clean up direct hardware access code. |
|
1999-05-20 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: Move RTC setup here. |
|
1999-04-13 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/hal_platform_setup.h: New file |
|
1999-04-08 John Dallaway <jld@cygnus.co.uk> |
|
* include/pkgconf/*.ldi: Revised SECTION_* macro arguments to |
avoid padded output sections (PR 19787) |
|
1999-03-23 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_diag.c (hal_diag_write_char): Make GDB 'O' transaction run |
with interrupts disabled. |
|
1999-03-17 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_diag.c (hal_diag_write_char): Don't disable all interrupts, |
just the ones from the diag serial port. |
|
1999-03-16 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/plf_stub.h: |
* src/plf_stub.c: |
* src/hal_diag.c: Add suport for GDB break. |
|
1999-03-12 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/hal_cache.h (HAL_DCACHE_PURGE_ALL): Add macro. |
|
1999-03-04 John Dallaway <jld@cygnus.co.uk> |
|
* include/pkgconf/*.ldi: give all LDI files unique names so |
that they can co-exist in an eCos build tree (PR 19184) |
* include/pkgconf/*.mlt: give all MLT files unique names so |
that they can co-exist in an eCos build tree (PR 19184) |
|
1999-02-20 Jonathan Larmour <jlarmour@cygnus.co.uk> |
|
* include/hal_platform_ints.h: |
Reorganise vector/interrupt/exception names according to purpose |
QA improvements |
|
* src/pid_misc.c: |
Change interrupt names due to above |
QA improvements |
|
|
1999-02-16 Jesper Skov <jskov@cygnus.co.uk> |
|
* src/hal_diag.c (hal_diag_write_char): Changed |
__output_gdb_string to hal_output_gdb_string. |
|
* include/hal_stub.h: [removed] |
* include/plf_stub.h: [added] |
* src/hal_stub.c: [removed] |
* src/plf_stub.c: [added] |
* src/PKGconf.mak: |
Changed hal_stub to plf_stub. Moved generic HAL stub code to |
common/.../hal_stub.c. |
|
1999-02-16 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/hal_platform_ints.h: Some interrupt assignments were wrong. |
|
1999-02-08 John Dallaway <jld@cygnus.co.uk> |
|
* include/pkgconf/*.mlt: New memory layout save files |
|
1999-02-05 John Dallaway <jld@cygnus.co.uk> |
|
* include/pkgconf/*.ldi: Remove LMA_EQ_VMA macro definition. |
|
1999-01-27 Gary Thomas <gthomas@cygnus.co.uk> |
|
* misc/PKGconf.mak: Fix for building on Win/NT. Also create raw binary |
file suitable for putting into EPROM. |
|
1999-01-26 Hugo Tyson <hmt@masala.cygnus.co.uk> |
|
* include/pkgconf/stubs.ldi: |
* include/pkgconf/ram.ldi: |
* include/pkgconf/rom.ldi: |
Add copyright notice. (Though these files will later be generated |
by a tool and so not copyright, these default setups are.) |
|
1999-01-26 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: Fix option descriptions. |
|
1999-01-25 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: |
* src/hal_stub.c: Add serial port parameterization (CDL) |
(serial_init): Remove 'dummy' call which fixed a GCC bug. Note: |
is this bug still lurking out there? |
|
1999-01-25 Jesper Skov <jskov@cygnus.co.uk> |
|
* src/hal_diag.c: Removed HAL_IO_BARRIER macros. Not necessary on |
ARM. |
|
1999-01-19 Gary Thomas <gthomas@cygnus.co.uk> |
|
* misc/PKGconf.mak: Fix for new startup types (STUBS). |
|
* include/pkgconf/rom.ldi: Modified for new layouts. |
|
* include/pkgconf/stubs.ldi: New File. |
|
* src/hal_stub.c: Reorg - move common routines to "arch" directory. |
|
1999-01-18 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/rom.ldi: Add configurations for GDB stubs/normal ROM. |
|
1999-01-15 Gary Thomas <gthomas@cygnus.co.uk> |
|
* misc/Notes: New file. |
|
* include/pkgconf/rom.ldi: Reorg GDB stubs memory use. |
|
* misc/gdb_module.c: |
* misc/prog_flash.c: New program(s). |
|
* src/hal_stub.c: |
* src/hal_diag.c: Reduce/remove trace buffers (debug only) |
|
* include/hal_diag.h: Add prototype for 'hal_diag_read_char()' |
|
1999-01-14 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: Change diag port to match GDB port. |
|
* misc/PKGconf.mak: Change 'TESTS' to 'PROGS' due to |
changes in "makrules.prv". |
|
* include/pkgconf/rom.ldi: |
* include/pkgconf/ram.ldi: New files. |
|
* src/PKGconf.mak: Change to MLT script linking. |
|
1999-01-08 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: |
* src/hal_diag.c: Make diagnostic port configurable. |
|
1998-12-22 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/hal_cache.h: New [moved] file |
|
1998-12-20 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_stub.c (cyg_hal_gdb_isr): Remove unused '__set_mem_fault' |
|
1998-12-16 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/hal_platform_ints.h: New file. |
|
1998-12-15 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: Fix comment. |
|
* src/hal_diag.c: Changes for kernel-less configuration. |
|
* src/pid_misc.c: Renamed from 'hal_misc.c' |
|
* src/PKGconf.mak (COMPILE): Rename 'hal_misc.c' to 'pid_misc.c' |
to avoid confusion with "arch/current/src/hal_misc.c" which is |
a truly platform independent file. |
|
1998-12-10 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_misc.c (dump_frame): Change in parameter type for |
caused problems with adding pointers -> huge dumps! |
|
1998-12-09 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_misc.c (exception_handler_returned): Change exception |
[debug] functions to have proper type for 'register frame' param. |
|
1998-12-03 Gary Thomas <gthomas@cygnus.co.uk> |
|
* tests/flash.c: |
* tests/dl.c (SYNC_COUNT): Update download for improved performance |
now that target FIFO is working. |
|
* src/hal_stub.c (serial_init): Work around compiler code generation |
bug (was quietly writing over location 0x4!) |
|
1998-12-02 Gary Thomas <gthomas@cygnus.co.uk> |
|
* include/pkgconf/hal_arm_pid.h: New file |
|
* src/hal_misc.c (exception_handler_returned): Make quiet in GDB version |
|
1998-12-01 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_stub.c (serial_init): Enable serial FIFO! |
|
* src/hal_diag.c (hal_diag_init): Enable serial FIFO! |
Don't try to support diag via GDB port (yet). |
|
1998-11-26 Gary Thomas <gthomas@cygnus.co.uk> |
|
* src/hal_diag.c (hal_diag_write_char): Allow separate debug output |
even when GDB stubs are included. Remove this later - FIXME! |
|
* src/hal_stub.c: |
* include/hal_stub.h: New files, GDB stub support |
|
* src/PKGconf.mak (COMPILE): Add hal_stub.c |
|
1998-11-18 Gary Thomas <gthomas@cygnus.co.uk> |
|
* tests/flash.c: |
* tests/dl.c: |
* tests/PKGconf.mak: Set of programs which will download and program |
the FLASH on the PID7 eval board. |
|
* src/hal_misc.c: Add clock latency support. |
|
* src/pid.ld: Rework memory layout. Fix DWARF2 debugging stuff. |
|
|
//=========================================================================== |
//####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#### |
//=========================================================================== |
/v2_0/src/Notes_GDB_stub
0,0 → 1,195
=========================================================================== |
#####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#### |
=========================================================================== |
|
27 Oct 1999, revised on 2000.01.28 |
|
How to build and install the GDB module on the PID |
|
Make GDB module |
~~~~~~~~~~~~~~~ |
Configure and build using the 'stubs' template for the PID |
target. These are the necessary CLI instructions. It can also be done |
from the Configtool by selecting the appropriate templates. |
|
% cd /tmp |
% mkdir stubs |
% cd stubs |
% ecosconfig new pid stubs |
% ecosconfig tree |
% make |
|
This will install some files in ./install/bin: |
|
cygmon.elf: The built stubs image |
cygmon.bin: The image converted to binary (suitable for burning to ROM) |
cygmon.img: The relocated ELF image (suitable for FLASH writing, see below) |
|
|
Make FLASH tool |
~~~~~~~~~~~~~~~ |
|
Again, these are the necessary CLI instructions. It can also be done |
from the Configtool by selecting the appropriate templates, and |
enabling the option. |
|
% cd /tmp |
% mkdir pid-flash |
% cd pid-flash |
% ecosconfig new pid |
% <edit ecos.ecc, enabling the CYGBLD_BUILD_FLASH_TOOL option:> |
--- ecos.ecc.orig Fri Jan 28 11:21:43 2000 |
+++ ecos.ecc Fri Jan 28 11:22:01 2000 |
@@ -150,7 +150,7 @@ |
cdl_option CYGBLD_BUILD_FLASH_TOOL { |
# Flavor: bool |
# No user value, uncomment the following line to provide one. |
- # user_value 0 |
+ user_value 1 |
# value_source default |
# Default value: 0 |
# Requires: CYG_HAL_STARTUP == "RAM" |
% ecosconfig resolve |
% ecosconfig tree |
% make |
|
The flash tool is installed in ./install/bin |
|
|
Prepare board for eCos |
~~~~~~~~~~~~~~~~~~~~~~ |
1. Set jumper 7-8 on LK6 [using the Angle code in the 16 bit EPROM] |
2. Set jumper 5-6 on LK6 [select 8bit ROM mode] |
3. Set jumper LK18 [ROM remap - this is also required for eCos] |
4. Set S1 to 0-0-1-1 [20MHz operation] |
|
|
Program FLASH |
~~~~~~~~~~~~~ |
1. Download the image onto the PID board: |
% cd /tmp |
% arm-elf-gdb -nw stubs/install/bin/gdb_image.img |
|
(gdb) target rdi s=<serial device> |
Angel Debug Monitor V1.04 (Advanced RISC Machines SDT 2.11a) for PID |
Built with Serial(x1), Parallel, DCC |
Rebuilt on Apr 7 1998 at 22:20:43 |
Serial Rate: 9600 |
Connected to ARM RDI target. |
(gdb) load |
Loading section .rom_vectors, size 0x60 lma 0x60000 |
Loading section .text, size 0xeea8 lma 0x60060 |
Loading section .rodata, size 0x304c lma 0x6ef08 |
Loading section .data, size 0x7f8 lma 0x71f54 |
Start address 0x60060 , load size 75596 |
Transfer rate: 5548 bits/sec. |
(gdb) quit |
|
This will download the stubs onto the board at 0x60000..0x80000 |
|
Use /dev/ttyS0, COM1 or similar for the <serial device> name. |
|
2. Now download the FLASH programmer tool |
% arm-elf-gdb -nw pid-flash/install/bin/prog_flash.img |
|
(gdb) target rdi s=<serial device> |
Angel Debug Monitor V1.04 (Advanced RISC Machines SDT 2.11a) for PID |
Built with Serial(x1), Parallel, DCC |
Rebuilt on Apr 7 1998 at 22:20:43 |
Serial Rate: 9600 |
Connected to ARM RDI target. |
(gdb) load |
Loading section .rom_vectors, size 0x60 lma 0x4000 |
Loading section .text, size 0x4964 lma 0x4060 |
Loading section .rodata, size 0x384 lma 0x89c4 |
Loading section .data, size 0x28c lma 0x8d48 |
Start address 0x4060 , load size 20436 |
Transfer rate: 5449 bits/sec. |
(gdb) cont |
|
3. The FLASH tool will output some text on the board serial port B at |
38400 baud: |
|
ARM eCos |
FLASH here! |
manuf: 8, device: 40 |
Error: Wrong Manufaturer: 08 |
... Please change FLASH jumper |
|
4. This text is repeated until you remove the jumper 7-8 on LK6. Then |
the output should be: |
|
manuf: 1F, device: A4 |
AT29C040A recognised |
About to program FLASH using data at 60000..80000 |
*** Press RESET now to abort! |
|
5. You have about 10 seconds to abort the operation by pressing |
reset. After this timeout, the FLASH programming happens: |
|
...Programming FLASH |
All done! |
|
6. Quit/kill the GDB process which will hang. |
|
7. Next time you reset the board, the stub will be in control, communicating |
on serial port A at 38400 baud. See documentation for further details |
on how to connect with GDB. |
|
|
|
Big-Endian operation |
~~~~~~~~~~~~~~~~~~~~ |
|
1) If the board is to be used in big-endian mode, the stub should be |
configured for platform 'pidbe' instead of 'pid'. |
|
2a) If a big-endian rom controller is installed on the board, the |
programming of a new stub into flash is covered in the ARM PID |
manual. |
|
2b) If a big-endian rom controller is _not_ used, this is what you |
must do: |
|
1) Follow the above instructions (including jumper settings) , |
but instead of building and using the 'prog_flash' FLASH |
tool, use the 'prog_flash_BE_image_LE_system' FLASH tool |
(build it by enabling CYGBLD_BUILD_FLASH_TOOL_BE) |
|
2) Instead of resetting the board after the FLASH has been |
programmed, switch off the power and enable jumper LK4. |
|
If you have to re-program the FLASH later, you can follow the |
steps above again, but also disable jumper LK4 when changing the |
other jumpers. |
/v2_0/src/prog_flash.c
0,0 → 1,223
//========================================================================== |
// |
// prog_flash.c |
// |
// ARM PID7 eval board FLASH program tool |
// |
//========================================================================== |
//####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: 1998-11-18 |
// Description: Tool used to program onboard FLASH image |
//####DESCRIPTIONEND#### |
|
// |
// This program will program the FLASH on the PID board |
// It is similar to 'flash' (which also downloads S records) but it always |
// programs from a fixed buffer. This is sufficient to load/update the GDB |
// stubs on the board. |
// |
|
#include <pkgconf/libc.h> // Configuration header |
|
#include <cyg/kernel/kapi.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <cyg/infra/testcase.h> |
#include <sys/cstartup.h> |
|
#ifndef FALSE |
#define FALSE 0 |
#define TRUE 1 |
#endif |
|
extern void diag_printf(const char *, ...); |
int identify_FLASH(void); |
void write_sector(int, char *); |
|
char *flash_buffer = (char *)0x60000; |
char *flash_buffer_end = (char *)0x80000; |
|
#ifdef BE_IMAGE |
#define BUF(x) buf[x^3] |
#else |
#define BUF(x) buf[x] |
#endif |
|
// FUNCTIONS |
|
externC void |
cyg_package_start( void ) |
{ |
#ifdef CYGPKG_LIBC |
cyg_iso_c_start(); |
#else |
(void)main(0, NULL); |
#endif |
} // cyg_package_start() |
|
int |
main( int argc, char *argv[] ) |
{ |
int i; |
|
diag_printf("FLASH here!\n"); |
while (identify_FLASH() == 0) { |
diag_printf("... Please change FLASH jumper\n"); |
cyg_thread_delay(5*100); |
} |
diag_printf("About to program FLASH using data at %x..%x\n", flash_buffer, flash_buffer_end); |
diag_printf("*** Press RESET now to abort!\n"); |
cyg_thread_delay(5*100); |
diag_printf("\n"); |
diag_printf("...Programming FLASH\n"); |
|
i = 0; |
while (flash_buffer < flash_buffer_end) { |
write_sector(i++, flash_buffer); |
flash_buffer += 256; |
} |
diag_printf("All done!\n"); |
while (1) ; |
} |
|
// Adapted from ARM sample code |
#define SEQ_ADD1 0x5555 |
#define SEQ_ADD2 0xAAAA |
#define START_CMD1 0xAA |
#define START_CMD2 0x55 |
#define ID_CMD 0x90 |
#define PROG_CMD 0xA0 |
#define STOP_CMD 0xF0 |
|
#define MAN_ATMEL 0x1F |
#define ATMEL_AT29C040_ID 0X5B |
#define ATMEL_AT29C040A_ID 0XA4 |
#define ATMEL_AT29C1024_ID 0X25 |
#define ATMEL_SECTOR_SIZE 256 |
#define ATMEL_MAX_SECTORS 2048 |
|
int manuf_code, device_code, sector_size, max_no_of_sectors, word_mode; |
volatile char *FLASH = (volatile char *)0x04000000; |
|
int |
identify_FLASH(void ) |
{ |
// Enter Software Product Identification Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = ID_CMD; |
|
// Wait at least 10ms |
cyg_thread_delay(2); |
|
// Read Manufacturer and device code from the device |
manuf_code = FLASH[0]; |
device_code = FLASH[1]; |
|
diag_printf("manuf: %x, device: %x\n", manuf_code, device_code); |
|
// Exit Software Product Identification Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = STOP_CMD; |
|
// Wait at least 10ms |
cyg_thread_delay(5); |
|
if (manuf_code != MAN_ATMEL) { |
diag_printf ( "Error: Wrong Manufaturer: %02x\n",manuf_code ); |
return (0); |
} |
|
switch (device_code) { |
case ATMEL_AT29C040A_ID: |
diag_printf ("AT29C040A recognised\n"); |
sector_size = ATMEL_SECTOR_SIZE; |
max_no_of_sectors = ATMEL_MAX_SECTORS; |
word_mode = FALSE; |
break; |
case ATMEL_AT29C1024_ID: |
diag_printf ("AT29C1024 recognised\n"); |
sector_size = ATMEL_SECTOR_SIZE; |
max_no_of_sectors = ATMEL_MAX_SECTORS; |
word_mode = TRUE; |
break; |
default : |
diag_printf ( "Error: Unsupported device: %02x\n", device_code); |
return (0); |
} |
return (1); |
} |
|
void |
write_sector(int num, char *buf) |
{ |
int i, cnt; |
volatile char *wrt = (volatile char *)&FLASH[num*sector_size]; |
|
// diag_printf("Writing to %08x\n", wrt); |
// Enter Program Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = PROG_CMD; |
|
// Note: write bytes as longs regardless of bus width |
for (i = 0; i < sector_size; i++) { |
wrt[i] = BUF(i); |
} |
|
// Wait for sector to program |
cnt = 0; |
i = sector_size - 1; |
while (wrt[i] != BUF(i)) { |
if (cnt++ > 0x01000000) break; |
} |
// diag_printf("Out - i: %d, wrt[i] = %08X.%08X, BUF(i) = %08X, count = %x\n", i, &wrt[i], wrt[i], BUF(i), cnt); |
|
// Verify |
for (i = 0; i < sector_size; i++) { |
for (cnt = 0; cnt < 10; cnt++) { |
if (wrt[i] == BUF(i)) break; |
cyg_thread_delay(1); |
} |
if (cnt == 10) { |
diag_printf("Can't program at 0x%08X: %02X not %02X\n", wrt, *wrt, BUF(0)); |
} |
} |
} |
/v2_0/src/pid_misc.c
0,0 → 1,255
//========================================================================== |
// |
// pid_misc.c |
// |
// HAL misc board support code for ARM PID7 |
// |
//========================================================================== |
//####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 <pkgconf/hal.h> |
|
#include <cyg/infra/cyg_type.h> // base types |
#include <cyg/infra/cyg_trac.h> // tracing macros |
#include <cyg/infra/cyg_ass.h> // assertion macros |
|
#include <cyg/hal/hal_io.h> // IO macros |
#include <cyg/hal/hal_arch.h> // Register state info |
#include <cyg/hal/hal_diag.h> |
#include <cyg/hal/hal_intr.h> // necessary? |
#include <cyg/hal/hal_if.h> // calling interface |
|
/*------------------------------------------------------------------------*/ |
// On-board timer |
/*------------------------------------------------------------------------*/ |
|
// Timer registers |
#define CYG_DEVICE_TIMER1_BASE 0x0A800020 |
#define CYG_DEVICE_TIMER1_LOAD \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER1_BASE + 0x00)) |
// Load value, read/write |
#define CYG_DEVICE_TIMER1_CURRENT \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER1_BASE + 0x04)) |
// Current value, read |
#define CYG_DEVICE_TIMER1_CONTROL \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER1_BASE + 0x08)) |
// Control register, read/write |
#define CYG_DEVICE_TIMER1_CLEAR \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER1_BASE + 0x0C)) |
// Clears interrrupt, write only |
|
#define CYG_DEVICE_TIMER_BASE 0x0A800020 |
#define CYG_DEVICE_TIMER_LOAD \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER_BASE + 0x00)) |
// Load value, read/write |
#define CYG_DEVICE_TIMER_CURRENT \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER_BASE + 0x04)) |
// Current value, read |
#define CYG_DEVICE_TIMER_CONTROL \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER_BASE + 0x08)) |
// Control register, read/write |
#define CYG_DEVICE_TIMER_CLEAR \ |
((volatile cyg_uint32 *) (CYG_DEVICE_TIMER_BASE + 0x0C)) |
// Clears interrrupt, write only |
|
// Clock/timer control register |
#define CTL_ENABLE 0x80 // Bit 7: 1 - counter enabled |
#define CTL_DISABLE 0x00 // 0 - counter disabled |
#define CTL_FREERUN 0x00 // Bit 6: 0 - free running counter |
#define CTL_PERIODIC 0x40 // 1 - periodic timer mode |
#define CTL_SCALE_1 0x00 // Bits 32: 00 - Scale clock by 1 |
#define CTL_SCALE_16 0x04 // 01 - Scale by 16 |
#define CTL_SCALE_256 0x08 // 10 - Scale by 256 |
// 12.8us/tick |
|
// Interrupt controller registers |
#define CYG_DEVICE_ICTL_BASE 0x0A000000 |
#define CYG_DEVICE_IRQ_Status \ |
((volatile cyg_uint32 *) (CYG_DEVICE_ICTL_BASE + 0x00)) |
// Current status, read only |
#define CYG_DEVICE_IRQ_Enable \ |
((volatile cyg_uint32 *) (CYG_DEVICE_ICTL_BASE + 0x08)) |
// Enable status, read only |
#define CYG_DEVICE_IRQ_EnableSet \ |
((volatile cyg_uint32 *) (CYG_DEVICE_ICTL_BASE + 0x08)) |
// Enable (1's only), write only |
#define CYG_DEVICE_IRQ_EnableClear \ |
((volatile cyg_uint32 *) (CYG_DEVICE_ICTL_BASE + 0x0C)) |
// Disable (1's only), write only |
|
static cyg_uint32 _period; |
|
void hal_clock_initialize(cyg_uint32 period) |
{ |
//diag_init(); diag_printf("%s(%d)\n", __PRETTY_FUNCTION__, period); |
//diag_printf("psr = %x\n", psr()); |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER_CONTROL, CTL_DISABLE); // Turn off |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER_LOAD, period); |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER_CONTROL, |
CTL_ENABLE | CTL_PERIODIC | CTL_SCALE_16); |
_period = period; |
} |
|
void hal_clock_reset(cyg_uint32 vector, cyg_uint32 period) |
{ |
//diag_init(); diag_printf("%s\n", __PRETTY_FUNCTION__); |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER_CLEAR, 0); |
_period = period; |
} |
|
void hal_clock_read(cyg_uint32 *pvalue) |
{ |
cyg_uint32 value; |
// diag_init(); diag_printf("%s\n", __PRETTY_FUNCTION__); |
HAL_READ_UINT32(CYG_DEVICE_TIMER_CURRENT, value); |
value &= 0xFFFF; |
*pvalue = _period - (value & 0xFFFF); // Note: counter is only 16 bits |
// and decreases |
} |
|
// ------------------------------------------------------------------------- |
// |
// Delay for some number of micro-seconds |
// |
void hal_delay_us(cyg_int32 usecs) |
{ |
cyg_uint32 value; |
cyg_uint64 ticks = ((usecs*CYGNUM_HAL_RTC_PERIOD*CYGNUM_HAL_RTC_DENOMINATOR)/1000000); |
|
HAL_WRITE_UINT32(CYG_DEVICE_TIMER1_CONTROL, CTL_DISABLE); // Turn off |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER1_LOAD, ticks); |
HAL_WRITE_UINT32(CYG_DEVICE_TIMER1_CONTROL, |
CTL_ENABLE | CTL_FREERUN | CTL_SCALE_16); |
|
// Wait for timer to underflow |
do { |
HAL_READ_UINT32(CYG_DEVICE_TIMER_CURRENT, value); |
value &= 0xFFFF; |
} while (value < 0x7fff); |
|
HAL_WRITE_UINT32(CYG_DEVICE_TIMER1_CONTROL, CTL_DISABLE); // Turn off |
} |
|
// ------------------------------------------------------------------------- |
|
void hal_hardware_init(void) |
{ |
// Any hardware/platform initialization that needs to be done. |
HAL_WRITE_UINT32(CYG_DEVICE_IRQ_EnableClear, 0xFFFF); // Clear all |
// interrupt sources |
// 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. |
|
int hal_IRQ_handler(void) |
{ |
// Do hardware-level IRQ handling |
int irq_status, vector; |
HAL_READ_UINT32(CYG_DEVICE_IRQ_Status, irq_status); |
//diag_init(); diag_printf("%s, status: %x\n", __PRETTY_FUNCTION__, irq_status); |
for (vector = 1; vector < 16; vector++) { |
if (irq_status & (1<<vector)) return vector; |
} |
return CYGNUM_HAL_INTERRUPT_NONE; // This shouldn't happen! |
} |
|
// |
// Interrupt control |
// |
|
void hal_interrupt_mask(int vector) |
{ |
//diag_init(); diag_printf("%s(%d)\n", __PRETTY_FUNCTION__, vector); |
HAL_WRITE_UINT32(CYG_DEVICE_IRQ_EnableClear, 1<<vector); |
} |
|
#if 0 |
void hal_interrupt_status(void) |
{ |
int irq_status, irq_enable, timer_status, timer_value, timer_load; |
HAL_READ_UINT32(CYG_DEVICE_IRQ_Status, irq_status); |
HAL_READ_UINT32(CYG_DEVICE_IRQ_Enable, irq_enable); |
HAL_READ_UINT32(CYG_DEVICE_TIMER_LOAD, timer_load); |
HAL_READ_UINT32(CYG_DEVICE_TIMER_CURRENT, timer_value); |
HAL_READ_UINT32(CYG_DEVICE_TIMER_CONTROL, timer_status); |
diag_printf("Interrupt: IRQ: %x.%x, TIMER: %x.%x.%x, psr: %x\n", |
irq_status, irq_enable, timer_status, timer_value, |
timer_load, psr()); |
} |
#endif |
|
void hal_interrupt_unmask(int vector) |
{ |
//diag_init(); diag_printf("%s(%d)\n", __PRETTY_FUNCTION__, vector); |
HAL_WRITE_UINT32(CYG_DEVICE_IRQ_EnableSet, 1<<vector); |
} |
|
void hal_interrupt_acknowledge(int vector) |
{ |
//diag_init(); diag_printf("%s(%d)\n", __PRETTY_FUNCTION__, vector); |
} |
|
void hal_interrupt_configure(int vector, int level, int up) |
{ |
//diag_init(); diag_printf("%s(%d,%d,%d)\n", __PRETTY_FUNCTION__, vector, level, up); |
} |
|
void hal_interrupt_set_level(int vector, int level) |
{ |
//diag_init(); diag_printf("%s(%d,%d)\n", __PRETTY_FUNCTION__, vector, level); |
} |
|
void hal_show_IRQ(int vector, int data, int handler) |
{ |
// diag_printf("IRQ - vector: %x, data: %x, handler: %x\n", vector, data, handler); |
} |
|
/*---------------------------------------------------------------------------*/ |
/* End of hal_misc.c */ |
/v2_0/src/hal_diag.c
0,0 → 1,609
/*============================================================================= |
// |
// hal_diag.c |
// |
// HAL diagnostic output code |
// |
//============================================================================= |
//####ECOSGPLCOPYRIGHTBEGIN#### |
// ------------------------------------------- |
// This file is part of eCos, the Embedded Configurable Operating System. |
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
// |
// eCos is free software; you can redistribute it and/or modify it under |
// the terms of the GNU General Public License as published by the Free |
// Software Foundation; either version 2 or (at your option) any later version. |
// |
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
// for more details. |
// |
// You should have received a copy of the GNU General Public License along |
// with eCos; if not, write to the Free Software Foundation, Inc., |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
// |
// As a special exception, if other files instantiate templates or use macros |
// or inline functions from this file, or you compile this file and link it |
// with other works to produce a work based on this file, this file does not |
// by itself cause the resulting work to be covered by the GNU General Public |
// License. However the source code for this file must still be made available |
// in accordance with section (3) of the GNU General Public License. |
// |
// This exception does not invalidate any other reasons why a work based on |
// this file might be covered by the GNU General Public License. |
// |
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
// at http://sources.redhat.com/ecos/ecos-license/ |
// ------------------------------------------- |
//####ECOSGPLCOPYRIGHTEND#### |
//============================================================================= |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): nickg, gthomas |
// Contributors:nickg, gthomas |
// Date: 1998-03-02 |
// Purpose: HAL diagnostic output |
// Description: Implementations of HAL diagnostic output support. |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
#include <pkgconf/hal.h> |
#include <pkgconf/hal_arm_pid.h> // board specifics |
|
#include <cyg/infra/cyg_type.h> // base types |
#include <cyg/infra/cyg_trac.h> // tracing macros |
#include <cyg/infra/cyg_ass.h> // assertion macros |
|
#include <cyg/hal/hal_arch.h> // basic machine info |
#include <cyg/hal/hal_intr.h> // interrupt macros |
#include <cyg/hal/hal_io.h> // IO macros |
#include <cyg/hal/hal_diag.h> |
#include <cyg/hal/drv_api.h> |
#include <cyg/hal/hal_if.h> // interface API |
#include <cyg/hal/hal_misc.h> // Helper functions |
|
/*---------------------------------------------------------------------------*/ |
/* From serial_16550.h */ |
#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==9600 |
#define CYG_DEVICE_SERIAL_BAUD_MSB 0x00 |
#define CYG_DEVICE_SERIAL_BAUD_LSB 0x0C |
#endif |
#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==19200 |
#define CYG_DEVICE_SERIAL_BAUD_MSB 0x00 |
#define CYG_DEVICE_SERIAL_BAUD_LSB 0x06 |
#endif |
#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==38400 |
#define CYG_DEVICE_SERIAL_BAUD_MSB 0x00 |
#define CYG_DEVICE_SERIAL_BAUD_LSB 0x03 |
#endif |
#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==115200 |
#define CYG_DEVICE_SERIAL_BAUD_MSB 0x00 |
#define CYG_DEVICE_SERIAL_BAUD_LSB 0x01 |
#endif |
|
#ifndef CYG_DEVICE_SERIAL_BAUD_MSB |
#error Missing/incorrect serial baud rate defined - CDL error? |
#endif |
|
// Define the serial registers. |
#define CYG_DEV_RBR 0x00 // receiver buffer register, read, dlab = 0 |
#define CYG_DEV_THR 0x00 // transmitter holding register, write, dlab = 0 |
#define CYG_DEV_DLL 0x00 // divisor latch (LS), read/write, dlab = 1 |
#define CYG_DEV_IER 0x04 // interrupt enable register, read/write, dlab = 0 |
#define CYG_DEV_DLM 0x04 // divisor latch (MS), read/write, dlab = 1 |
#define CYG_DEV_IIR 0x08 // interrupt identification register, read, dlab = 0 |
#define CYG_DEV_FCR 0x08 // fifo control register, write, dlab = 0 |
#define CYG_DEV_LCR 0x0C // line control register, read/write |
#define CYG_DEV_MCR 0x10 // modem control register, read/write |
#define CYG_DEV_LSR 0x14 // line status register, read |
#define CYG_DEV_MSR 0x18 // modem status register, read |
|
// Interrupt Enable Register |
#define SIO_IER_RCV 0x01 |
#define SIO_IER_XMT 0x02 |
#define SIO_IER_LS 0x04 |
#define SIO_IER_MS 0x08 |
|
// 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 |
|
// Modem Control Register |
#define SIO_MCR_DTR 0x01 |
#define SIO_MCR_RTS 0x02 |
#define SIO_MCR_INT 0x08 // Enable interrupts |
|
//----------------------------------------------------------------------------- |
typedef struct { |
cyg_uint8* base; |
cyg_int32 msec_timeout; |
int isr_vector; |
} channel_data_t; |
|
//----------------------------------------------------------------------------- |
|
static void |
cyg_hal_plf_serial_init_channel(void* __ch_data) |
{ |
cyg_uint8* base = ((channel_data_t*)__ch_data)->base; |
cyg_uint8 lcr; |
|
// 8-1-no parity. |
HAL_WRITE_UINT8(base+CYG_DEV_LCR, SIO_LCR_WLS0 | SIO_LCR_WLS1); |
|
HAL_READ_UINT8(base+CYG_DEV_LCR, lcr); |
lcr |= SIO_LCR_DLAB; |
HAL_WRITE_UINT8(base+CYG_DEV_LCR, lcr); |
HAL_WRITE_UINT8(base+CYG_DEV_DLL, CYG_DEVICE_SERIAL_BAUD_LSB); |
HAL_WRITE_UINT8(base+CYG_DEV_DLM, CYG_DEVICE_SERIAL_BAUD_MSB); |
lcr &= ~SIO_LCR_DLAB; |
HAL_WRITE_UINT8(base+CYG_DEV_LCR, lcr); |
HAL_WRITE_UINT8(base+CYG_DEV_FCR, 0x07); // Enable & clear FIFO |
} |
|
void |
cyg_hal_plf_serial_putc(void *__ch_data, char c) |
{ |
cyg_uint8* base = ((channel_data_t*)__ch_data)->base; |
cyg_uint8 lsr; |
CYGARC_HAL_SAVE_GP(); |
|
do { |
HAL_READ_UINT8(base+CYG_DEV_LSR, lsr); |
} while ((lsr & SIO_LSR_THRE) == 0); |
|
HAL_WRITE_UINT8(base+CYG_DEV_THR, c); |
|
CYGARC_HAL_RESTORE_GP(); |
} |
|
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_LSR, lsr); |
if ((lsr & SIO_LSR_DR) == 0) |
return false; |
|
HAL_READ_UINT8(base+CYG_DEV_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; |
} |
|
static channel_data_t pid_ser_channels[2] = { |
{ (cyg_uint8*)0x0D800000, 1000, CYGNUM_HAL_INTERRUPT_SERIALA }, |
{ (cyg_uint8*)0x0D800020, 1000, CYGNUM_HAL_INTERRUPT_SERIALB } |
}; |
|
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; |
int ret = 0; |
CYGARC_HAL_SAVE_GP(); |
|
switch (__func) { |
case __COMMCTL_IRQ_ENABLE: |
irq_state = 1; |
|
HAL_WRITE_UINT8(chan->base+CYG_DEV_IER, SIO_IER_RCV); |
HAL_WRITE_UINT8(chan->base+CYG_DEV_MCR, SIO_MCR_INT|SIO_MCR_DTR|SIO_MCR_RTS); |
|
HAL_INTERRUPT_UNMASK(chan->isr_vector); |
break; |
case __COMMCTL_IRQ_DISABLE: |
ret = irq_state; |
irq_state = 0; |
|
HAL_WRITE_UINT8(chan->base+CYG_DEV_IER, 0); |
|
HAL_INTERRUPT_MASK(chan->isr_vector); |
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) |
{ |
int res = 0; |
channel_data_t* chan = (channel_data_t*)__ch_data; |
char c; |
cyg_uint8 lsr; |
CYGARC_HAL_SAVE_GP(); |
|
cyg_drv_interrupt_acknowledge(chan->isr_vector); |
|
*__ctrlc = 0; |
HAL_READ_UINT8(chan->base+CYG_DEV_LSR, lsr); |
if ( (lsr & SIO_LSR_DR) != 0 ) { |
|
HAL_READ_UINT8(chan->base+CYG_DEV_RBR, c); |
if( cyg_hal_is_break( &c , 1 ) ) |
*__ctrlc = 1; |
|
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(pid_ser_channels[0].isr_vector); |
HAL_INTERRUPT_MASK(pid_ser_channels[1].isr_vector); |
|
// Init channels |
cyg_hal_plf_serial_init_channel(&pid_ser_channels[0]); |
cyg_hal_plf_serial_init_channel(&pid_ser_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, &pid_ser_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, &pid_ser_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); |
} |
|
void |
cyg_hal_plf_comms_init(void) |
{ |
static int initialized = 0; |
|
if (initialized) |
return; |
|
initialized = 1; |
|
cyg_hal_plf_serial_init(); |
} |
|
/*---------------------------------------------------------------------------*/ |
|
#ifdef CYGHWR_HAL_ARM_PID_DIAG_LEDS |
// Control the LEDs PP0-PP3. This requires the jumpers on pins 9-16 to |
// be set on LK11, thus preventing the use of the parallel port. |
|
#define CYG_DEVICE_PARALLEL_DATA 0x0d800040 |
|
void |
hal_diag_led(int n) |
{ |
HAL_WRITE_UINT8(CYG_DEVICE_PARALLEL_DATA, (n & 0xf) << 4); |
} |
#endif // CYGHWR_HAL_ARM_PID_DIAG_LEDS |
|
|
//============================================================================= |
// Compatibility with older stubs |
//============================================================================= |
|
#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG |
|
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
#include <cyg/hal/hal_stub.h> // cyg_hal_gdb_interrupt |
#endif |
|
#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL==0 |
// This is the base address of the A-channel |
#define CYG_DEV_SERIAL_BASE 0x0D800000 |
#define CYG_DEVICE_SERIAL_INT CYGNUM_HAL_INTERRUPT_SERIALA |
#else |
// This is the base address of the B-channel |
#define CYG_DEV_SERIAL_BASE 0x0D800020 |
#define CYG_DEVICE_SERIAL_INT CYGNUM_HAL_INTERRUPT_SERIALB |
#endif |
|
static channel_data_t pid_ser_channel = { |
(cyg_uint8*)CYG_DEV_SERIAL_BASE, 0, 0 |
}; |
|
// 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 |
|
#ifndef HAL_DIAG_USES_HARDWARE |
#if (CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL != CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL) |
#define HAL_DIAG_USES_HARDWARE |
#endif |
#endif |
|
#ifdef HAL_DIAG_USES_HARDWARE |
|
void hal_diag_init(void) |
{ |
static int init = 0; |
char *msg = "\n\rARM eCos\n\r"; |
|
if (init++) return; |
|
cyg_hal_plf_serial_init_channel(&pid_ser_channel); |
|
while (*msg) cyg_hal_plf_serial_putc(&pid_ser_channel, *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) |
{ |
hal_diag_init(); |
|
cyg_hal_plf_serial_putc(&pid_ser_channel, c); |
|
#ifdef DEBUG_DIAG |
diag_buffer[diag_bp++] = c; |
if (diag_bp == DIAG_BUFSIZE) diag_bp = 0; |
#endif |
} |
|
void hal_diag_read_char(char *c) |
{ |
*c = cyg_hal_plf_serial_getc(&pid_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) cyg_hal_plf_serial_init_channel(&pid_ser_channel); // avoid warning |
} |
|
// Actually send character down the wire |
static void |
hal_diag_write_char_serial(char c) |
{ |
hal_diag_init(); |
|
cyg_hal_plf_serial_putc(&pid_ser_channel, c); |
} |
|
static bool |
hal_diag_read_serial(char *c) |
{ |
long timeout = 1000000000; // A long time... |
while (!cyg_hal_plf_serial_getc_nonblock(&pid_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_DEVICE_SERIAL_INT); |
if( c1 == 3 ) { |
// Ctrl-C: breakpoint. |
cyg_hal_gdb_interrupt ((target_register_t)__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 */ |
/v2_0/src/flash.c
0,0 → 1,446
//========================================================================== |
// |
// flash.c |
// |
// ARM PID7 eval board FLASH program tool |
// |
//========================================================================== |
//####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: 1998-11-18 |
// Description: Tool used to program onboard FLASH image |
//####DESCRIPTIONEND#### |
|
// |
// This program will program the FLASH on the PID board |
// |
|
#include <pkgconf/libc.h> // Configuration header |
|
#include <cyg/kernel/kapi.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <cyg/infra/testcase.h> |
#include <sys/cstartup.h> |
|
#ifndef FALSE |
#define FALSE 0 |
#define TRUE 1 |
#endif |
|
#define SYNC_COUNT 63 |
|
extern void diag_printf(const char *, ...); |
int identify_FLASH(void); |
void write_sector(int, char *); |
bool load_srecords(char (*readc)(), CYG_ADDRESS *start, int *size); |
|
char dbuf[256]; |
char *raw = (char *)0x10000; |
char *flash_buffer = (char *)0x30000; |
int pos, len; |
|
// FUNCTIONS |
|
externC void |
cyg_package_start( void ) |
{ |
#ifdef CYGPKG_LIBC |
cyg_iso_c_start(); |
#else |
(void)main(0, NULL); |
#endif |
} // cyg_package_start() |
|
char nextch(void) |
{ |
return (raw[pos++]); |
} |
|
int |
main( int argc, char *argv[] ) |
{ |
int i, j, size; |
CYG_ADDRESS entry; |
char c; |
diag_printf("FLASH here!\n"); |
while (identify_FLASH() == 0) { |
diag_printf("... Please change FLASH jumper - hit C/R to continue:"); |
do { |
hal_diag_read_char(&c); |
} while ((c != '\r') && (c != '\n')); |
diag_printf("\n"); |
} |
restart: |
diag_printf("Ready file - hit C/R to continue:"); |
while (TRUE) { |
hal_diag_read_char(&c); |
if (c == '>') break; |
} |
i = 0; j = 0; |
while (1) { |
hal_diag_read_char(&c); |
if (c == '!') { |
diag_printf("... Reset\n"); |
goto restart; |
} |
raw[i++] = c; |
if (++j == SYNC_COUNT) { |
hal_diag_write_char(c); |
j = 0; |
} |
if (c == ':') break; |
} |
diag_printf("\n"); |
pos = 0; len = i; |
if (load_srecords(nextch, &entry, &size)) { |
diag_printf("Read %x bytes, entry: %x\n", size, entry); |
dump_buf(flash_buffer, 128); |
diag_printf("\nData loaded - hit '!' to continue:"); |
while (TRUE) { |
hal_diag_read_char(&c); |
if (c == '!') break; |
} |
diag_printf("\n"); |
diag_printf("...Programming FLASH\n"); |
pos = 0; i = 0; |
while (pos < size) { |
write_sector(i++, flash_buffer+pos); |
pos += 256; |
} |
} else { |
// Display buffer around failure |
dump_buf(&raw[pos-32], 64); |
} |
diag_printf("All done!\n"); |
while (1) ; |
} |
|
// Adapted from ARM sample code |
#define SEQ_ADD1 0x5555 |
#define SEQ_ADD2 0xAAAA |
#define START_CMD1 0xAA |
#define START_CMD2 0x55 |
#define ID_CMD 0x90 |
#define PROG_CMD 0xA0 |
#define STOP_CMD 0xF0 |
|
#define MAN_ATMEL 0x1F |
#define ATMEL_AT29C040_ID 0X5B |
#define ATMEL_AT29C040A_ID 0XA4 |
#define ATMEL_AT29C1024_ID 0X25 |
#define ATMEL_SECTOR_SIZE 256 |
#define ATMEL_MAX_SECTORS 2048 |
|
int manuf_code, device_code, sector_size, max_no_of_sectors, word_mode; |
volatile char *FLASH = (volatile char *)0x04000000; |
|
int |
identify_FLASH(void ) |
{ |
// Enter Software Product Identification Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = ID_CMD; |
|
// Wait at least 10ms |
cyg_thread_delay(2); |
|
// Read Manufacturer and device code from the device |
manuf_code = FLASH[0]; |
device_code = FLASH[1]; |
|
diag_printf("manuf: %x, device: %x\n", manuf_code, device_code); |
|
// Exit Software Product Identification Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = STOP_CMD; |
|
// Wait at least 10ms |
cyg_thread_delay(5); |
|
if (manuf_code != MAN_ATMEL) { |
diag_printf ( "Error: Wrong Manufaturer: %02x\n",manuf_code ); |
return (0); |
} |
|
switch (device_code) { |
case ATMEL_AT29C040A_ID: |
diag_printf ("AT29C040A recognised\n"); |
sector_size = ATMEL_SECTOR_SIZE; |
max_no_of_sectors = ATMEL_MAX_SECTORS; |
word_mode = FALSE; |
break; |
case ATMEL_AT29C1024_ID: |
diag_printf ("AT29C1024 recognised\n"); |
sector_size = ATMEL_SECTOR_SIZE; |
max_no_of_sectors = ATMEL_MAX_SECTORS; |
word_mode = TRUE; |
break; |
default : |
diag_printf ( "Error: Unsupported device: %02x\n", device_code); |
return (0); |
} |
return (1); |
} |
|
void |
write_sector(int num, char *buf) |
{ |
int i, cnt; |
volatile char *wrt = (volatile int *)&FLASH[num*sector_size]; |
|
// diag_printf("Writing to %08x\n", wrt); |
// Enter Program Mode |
FLASH[SEQ_ADD1] = START_CMD1; |
FLASH[SEQ_ADD2] = START_CMD2; |
FLASH[SEQ_ADD1] = PROG_CMD; |
|
// Note: write bytes as longs regardless of bus width |
for (i = 0; i < sector_size; i++) { |
wrt[i] = buf[i]; |
} |
|
// Wait for sector to program |
cnt = 0; |
i = sector_size - 1; |
while (wrt[i] != buf[i]) { |
if (cnt++ > 0x01000000) break; |
} |
// diag_printf("Out - i: %d, wrt[i] = %08X.%08X, buf[i] = %08X, count = %x\n", i, &wrt[i], wrt[i], buf[i], cnt); |
|
// Verify |
for (i = 0; i < sector_size; i++) { |
for (cnt = 0; cnt < 10; cnt++) { |
if (*wrt == *buf) break; |
cyg_thread_delay(1); |
} |
if (cnt == 10) { |
diag_printf("Can't program at 0x%08X: %02X not %02X\n", wrt, *wrt, *buf); |
} |
wrt++; buf++; |
} |
} |
|
// S-record download code - viciously 'adapted' from "kernel/src/sload/sload.c" |
|
/*---------------------------------------------------------------------------*/ |
/* |
// |
// An srecord looks like this: |
// |
// byte count-+ address |
// start ---+ | | data +- checksum |
// | | | | |
// S01000006F6B692D746573742E73726563E4 |
// S315000448600000000000000000FC00005900000000E9 |
// S31A0004000023C1400037DE00F023604000377B009020825000348D |
// S30B0004485A0000000000004E |
// S70500040000F6 |
// |
// S<type><length><address><data><checksum> |
// |
// Where |
// - length (2 characters) |
// is the number of bytes following upto the checksum. Note that |
// this is not the number of chars following, since it takes two |
// chars to represent a byte. |
// - type (2 characters) |
// is one of: |
// 0) header record |
// 1) two byte address data record |
// 2) three byte address data record |
// 3) four byte address data record |
// 5) record containing the number of S1, S2, or S3 records |
// 7) four byte address termination record |
// 8) three byte address termination record |
// 9) two byte address termination record |
// |
// - address (4, 6, or 8 characters) |
// is the start address of the data following, or in the case of |
// a termination record, the start address of the image |
// - data (0-2n characters) |
// is the data. |
// - checksum (2 characters) |
// is the sum of all the raw byte data in the record, from the length |
// upwards, modulo 256 and subtracted from 255. |
// |
// Useful S-records for testing purposes: |
// Start record: |
// S00B0000737461303030447563 |
// This sets the default address to be 0x02005000: |
// S31A020050002700801481C4E0B0A15000000100000091D02000018F |
// S31A0200501500000001000000010000002700801881C4E2E4A150C1 |
// S311020080A42407070A090B0A0781050000E1 |
// Termination record: |
// S70502005000A8 |
// |
*/ |
|
#define S0 0 |
#define S1 1 |
#define S2 2 |
#define S3 3 |
#define S5 5 |
#define S7 7 |
#define S8 8 |
#define S9 9 |
|
/*---------------------------------------------------------------------------*/ |
|
int hex2digit(char c) |
{ |
if( c & 0x40 ) c += 9;; |
return c &0x0f; |
|
// return ( c <= '9' ? c - '0' : |
// c <= 'Z' ? c - 'A' + 10 : |
// c - 'a' + 10); |
} |
|
/*---------------------------------------------------------------------------*/ |
|
bool load_srecords(char (*readc)(), |
CYG_ADDRESS *start, |
int *size) |
{ |
CYG_ADDRESS addr, load_addr; |
int addrsize; |
int length; |
int i; |
cyg_uint8 chksum, ochksum; |
cyg_uint8 val; |
cyg_uint8 *tdata; |
char s; |
char type; |
char len0; |
char len1; |
bool first = true; |
|
|
do { |
// Skip whitespace characters until we find something that |
// might be an 'S'. |
do { |
s = readc(); |
} while( s == '\r' || s == '\n' || s == ' '); |
|
// Check that this is an S record |
if( s != 'S' ) { |
diag_printf("Invalid 'S' record\n"); |
return false; |
} |
|
// First 4 bytes are standard S + type + len |
type = readc(); |
len0 = readc(); |
len1 = readc(); |
|
// decode the type |
type = hex2digit(type); |
|
// determine address size |
switch (type) { |
case S0: // start records have no address |
addrsize = 0; |
break; |
case S1: // two byte address |
case S9: |
addrsize = 4; |
break; |
case S2: // 3 byte address |
case S8: |
addrsize = 6; |
break; |
case S3: // 4 byte address |
case S7: |
addrsize = 8; |
break; |
} |
|
length = hex2digit (len0) << 4; |
length |= hex2digit (len1); |
chksum = length; |
|
// read the address |
addr = 0; |
for (i = 0; i < addrsize; i++) { |
val = hex2digit(readc()); |
addr = (addr << 4) | val; |
} |
|
// calculate the checksum, which is done by the byte, not the digit |
for (i = 0; i < addrsize*4; i += 8) { |
chksum += ((addr >> i) & 0xff); |
} |
|
// decide where to load this data |
if (first && (type != S0)) { |
load_addr = addr; |
first = false; |
} |
|
// read the data and put it directly into memory where it belongs |
tdata = (cyg_uint8 *)((addr - load_addr) + flash_buffer); |
if (type < S7) { |
*size = (addr - load_addr); |
} |
val = 0; |
for (i = 0; i < ((length - 1) * 2) - addrsize; i += 2 ) { |
val = hex2digit (readc()) << 4; |
val |= hex2digit (readc()); |
chksum += val; |
if( type != S0 ) *tdata++ = val; |
if (type < S7) *size = *size + 1; |
} |
|
// now get the old checksum |
ochksum = hex2digit(readc()) << 4; |
ochksum |= hex2digit(readc()); |
chksum = ~chksum; |
if (chksum != ochksum) { |
diag_printf("Bad checksum - addr: %x\n", addr); |
return false; |
} |
|
} while( type < S7 ); |
|
*start = addr; |
return true; |
} |
/v2_0/misc/dl.c
0,0 → 1,90
//========================================================================== |
// |
// dl.c |
// |
// ARM PID7 eval board FLASH program tool |
// |
//========================================================================== |
//####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: 1998-11-18 |
// Description: Tool used for simple handshake downloads. |
//####DESCRIPTIONEND#### |
|
#include <stdio.h> |
|
#define SYNC_COUNT 63 |
|
int |
main(int argc, char *argv[]) |
{ |
int c, count, j; |
char cout, cin; |
FILE *in, *log; |
if ((in = fopen(argv[1], "r")) == (FILE *)NULL) { |
fprintf(stderr, "Can't open '%s'\n", argv[1]); |
exit(1); |
} |
if ((log = fopen("/tmp/dl.log", "w")) == (FILE *)NULL) { |
fprintf(stderr, "Can't open log file\n"); |
exit(1); |
} |
fprintf(stderr, "Downloading '%s'\n", argv[1]); |
count = 0; j = 0; |
write(1, ">", 1); // Magic start |
while ((c = fgetc(in)) != EOF) { |
cout = c; |
write(1, &cout, 1); |
if (++j == SYNC_COUNT) { |
read(0, &cin, 1); |
if (cin != cout) { |
fprintf(stderr, "Sync problem - in: %x, out: %x, byte: %x\n", cin, cout, count); |
fprintf(log, "Sync problem - in: %x, out: %x, byte: %x\n", cin, cout, count); |
fflush(log); |
break; |
} |
j = 0; |
} |
count++; |
if ((count % 256) == 255) fprintf(stderr, "%08X\n", count); |
} |
sleep(2); |
write(1, ":", 1); |
fclose(log); |
exit(0); |
} |
/v2_0/misc/redboot_RAM.ecm
0,0 → 1,50
cdl_savefile_version 1; |
cdl_savefile_command cdl_savefile_version {}; |
cdl_savefile_command cdl_savefile_command {}; |
cdl_savefile_command cdl_configuration { description hardware template package }; |
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; |
|
cdl_configuration eCos { |
description "" ; |
hardware pid ; |
template redboot ; |
package -hardware CYGPKG_HAL_ARM v2_0 ; |
package -hardware CYGPKG_HAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_GENERIC_16X5X v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ATMEL_AT29CXXXX v2_0 ; |
package -template CYGPKG_HAL v2_0 ; |
package -template CYGPKG_INFRA v2_0 ; |
package -template CYGPKG_REDBOOT v2_0 ; |
package CYGPKG_IO_FLASH v2_0 ; |
}; |
|
cdl_option CYGBLD_BUILD_GDB_STUBS { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { |
inferred_value 0 |
}; |
|
cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR { |
inferred_value 0 0 |
}; |
|
cdl_component CYGBLD_BUILD_REDBOOT { |
user_value 1 |
}; |
|
|
/v2_0/misc/redboot_ROM-BE.ecm
0,0 → 1,62
cdl_savefile_version 1; |
cdl_savefile_command cdl_savefile_version {}; |
cdl_savefile_command cdl_savefile_command {}; |
cdl_savefile_command cdl_configuration { description hardware template package }; |
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; |
|
cdl_configuration eCos { |
description "" ; |
hardware pid ; |
template redboot ; |
package -hardware CYGPKG_HAL_ARM v2_0 ; |
package -hardware CYGPKG_HAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_GENERIC_16X5X v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ATMEL_AT29CXXXX v2_0 ; |
package -template CYGPKG_HAL v2_0 ; |
package -template CYGPKG_INFRA v2_0 ; |
package -template CYGPKG_REDBOOT v2_0 ; |
package CYGPKG_IO_FLASH v2_0 ; |
}; |
|
cdl_option CYGBLD_BUILD_GDB_STUBS { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { |
inferred_value 0 |
}; |
|
cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_ROM_MONITOR { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR { |
inferred_value 0 0 |
}; |
|
cdl_option CYGHWR_HAL_ARM_BIGENDIAN { |
user_value 1 |
}; |
|
cdl_component CYG_HAL_STARTUP { |
user_value ROM |
}; |
|
cdl_component CYGBLD_BUILD_REDBOOT { |
user_value 1 |
}; |
|
|
/v2_0/misc/redboot_RAM-BE.ecm
0,0 → 1,54
cdl_savefile_version 1; |
cdl_savefile_command cdl_savefile_version {}; |
cdl_savefile_command cdl_savefile_command {}; |
cdl_savefile_command cdl_configuration { description hardware template package }; |
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; |
|
cdl_configuration eCos { |
description "" ; |
hardware pid ; |
template redboot ; |
package -hardware CYGPKG_HAL_ARM v2_0 ; |
package -hardware CYGPKG_HAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_GENERIC_16X5X v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ATMEL_AT29CXXXX v2_0 ; |
package -template CYGPKG_HAL v2_0 ; |
package -template CYGPKG_INFRA v2_0 ; |
package -template CYGPKG_REDBOOT v2_0 ; |
package CYGPKG_IO_FLASH v2_0 ; |
}; |
|
cdl_option CYGBLD_BUILD_GDB_STUBS { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { |
inferred_value 0 |
}; |
|
cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR { |
inferred_value 0 0 |
}; |
|
cdl_option CYGHWR_HAL_ARM_BIGENDIAN { |
user_value 1 |
}; |
|
cdl_component CYGBLD_BUILD_REDBOOT { |
user_value 1 |
}; |
|
|
/v2_0/misc/redboot_ROM.ecm
0,0 → 1,58
cdl_savefile_version 1; |
cdl_savefile_command cdl_savefile_version {}; |
cdl_savefile_command cdl_savefile_command {}; |
cdl_savefile_command cdl_configuration { description hardware template package }; |
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; |
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; |
|
cdl_configuration eCos { |
description "" ; |
hardware pid ; |
template redboot ; |
package -hardware CYGPKG_HAL_ARM v2_0 ; |
package -hardware CYGPKG_HAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_GENERIC_16X5X v2_0 ; |
package -hardware CYGPKG_IO_SERIAL_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ARM_PID v2_0 ; |
package -hardware CYGPKG_DEVS_FLASH_ATMEL_AT29CXXXX v2_0 ; |
package -template CYGPKG_HAL v2_0 ; |
package -template CYGPKG_INFRA v2_0 ; |
package -template CYGPKG_REDBOOT v2_0 ; |
package CYGPKG_IO_FLASH v2_0 ; |
}; |
|
cdl_option CYGBLD_BUILD_GDB_STUBS { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { |
user_value 0 |
}; |
|
cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { |
inferred_value 0 |
}; |
|
cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_ROM_MONITOR { |
inferred_value 1 |
}; |
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR { |
inferred_value 0 0 |
}; |
|
cdl_component CYG_HAL_STARTUP { |
user_value ROM |
}; |
|
cdl_component CYGBLD_BUILD_REDBOOT { |
user_value 1 |
}; |
|
|