# HG changeset patch # User asl # Date 1150574699 0 # Node ID 3a4028c88f35cce1b706b30d694926790ecbb0ec # Parent 42c9e3ed9654edcee91076677b759eb89e2a8546 * cdl/hal_arm_mac7100_mac7100evb.cdl: * include/plf_io.h: * include/hal_platform_ints.h: * include/hal_platform_setup.h: * include/mac7100evb_misc.h: * include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.ldi: * include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.h: * src/mac7100evb_misc.c: New HAL added to support the Freescale MAC7100 board. Adapted from MACE1 diff --git a/packages/hal/arm/mac7100/mac7100evb/current/ChangeLog b/packages/hal/arm/mac7100/mac7100evb/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/ChangeLog @@ -0,0 +1,46 @@ +2006-06-08 Ilija Koco + + * cdl/hal_arm_mac7100_mac7100evb.cdl: + * include/plf_io.h: + * include/hal_platform_ints.h: + * include/hal_platform_setup.h: + * include/mac7100evb_misc.h: + * include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.ldi: + * include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.h: + * src/mac7100evb_misc.c: + New HAL added to support the Freescale MAC7100 board. + Adapted from MACE1 + + +//=========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2003 Nick Garnett +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/arm/mac7100/mac7100evb/current/cdl/hal_arm_mac7100_mac7100evb.cdl b/packages/hal/arm/mac7100/mac7100evb/current/cdl/hal_arm_mac7100_mac7100evb.cdl new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/cdl/hal_arm_mac7100_mac7100evb.cdl @@ -0,0 +1,377 @@ + +# ==================================================================== +# +# hal_arm_mac7100_mac7100evb.cdl +# +# ARM MAC7100 MAC7100EVB HAL package configuration data +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## Copyright (C) 2003 Nick Garnett +## Copyright (C) 2006 eCosCentric Ltd +## +## 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. +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): Ilija Koco +# Contributors: +# Date: 2006-06-07 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_HAL_ARM_MAC7100_MAC7100EVB { + display "MAC7100EVB evaluation board HAL" + parent CYGPKG_HAL_ARM_MAC7100 + define_header hal_arm_mac7100_mac7100evb.h + include_dir cyg/hal + hardware + description " + The MAC7100EVB HAL package provides the support needed to run + eCos on the Freescale MAC7100EVB eval board." + + compile mac7100evb_misc.c + + requires { CYGHWR_HAL_ARM_MAC7100 == "MAC7111" } + requires { CYGNUM_PIT_CHAN_CLOCK_PRIORITY == + CYGNUM_KERNEL_COUNTERS_CLOCK_ISR_PRIORITY } + + define_proc { + puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H " + puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H " + puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H " + puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM7TDMI\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Freescale MAC7100/MAC7100EVB\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" + } + + cdl_component CYG_PIT_CLOCKS { + display "Real time clock configuration." + flavor none + description " + Periodic Interrupt Timer Module - PIT comprise of 11 timer + channels. RTI channel (PIT0) as well as PIT1 .. PIT4 can + generate interrupts and are eligible for the real time + clock." + + cdl_option CYGNUM_PIT_CHAN_CLOCK { + display "System CLOCK device" + flavor data + legal_values 0 to 4 + default_value 3 + requires {CYGNUM_PIT_CHAN_CLOCK != CYGNUM_PIT_CHAN_US} + description " + RTI (PIT0) and PIT1 .. PIT4 can be used for real time + clock. RTI is clocked by oscillator clock while + channels 1 to 4 by 1/2 system clock frequency. + Selection of RTI vs PIT1 .. PIT4 affects Real-time + clock period (see Real-time clock constants). NOTE: + Real time clock channel must not be the same as US + delay channel. + " + } + + cdl_option CYGNUM_PIT_CHAN_CLOCK_PRIORITY { + display "System clock's INTC priority" + flavor data + legal_values 0 to 15 + default_value 12 + description " + INTC has 16 interrupt levels: 0 (lowest) to 15 (highest). + " + } + + cdl_option CYGNUM_PIT_CHAN_US { + display "PIT channel for us delay" + flavor data + legal_values 0 to 4 + default_value 0 + requires {CYGNUM_PIT_CHAN_CLOCK != CYGNUM_PIT_CHAN_US} + description " + RTI is clocked by oscillator while channels PIT1 + .. PIT4 by half system clock frequency, hence RTI + should allow for larger maximal period. NOTE: US + delay channel must not be the same as real time clock + channel. + " + } + } + + 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 + default_value 1000000000 + } + cdl_option CYGNUM_HAL_RTC_DENOMINATOR { + display "Real-time clock denominator" + flavor data + default_value 100 + } + cdl_option CYGNUM_HAL_RTC_PERIOD { + display "Real-time clock period" + flavor data + default_value (CYGNUM_PIT_CHAN_CLOCK !=0 ? \ + (CYGNUM_HAL_ARM_MAC7100_CLOCK_SPEED / 2 / CYGNUM_HAL_RTC_DENOMINATOR - 1) : \ + (CYGNUM_HAL_ARM_MAC7100_Q_FREQ / CYGNUM_HAL_RTC_DENOMINATOR - 1)) + } + } + + cdl_component CYG_HAL_STARTUP { + display "Startup type" + flavor data + calculated {"ROM"} + no_define + define -file system.h CYG_HAL_STARTUP + description " + Current MAC7100EVB port supports only ROM startup type." + } + + # Real-time clock/counter specifics + + cdl_component CYG_HAL_MAC7100_OSC { + display "System Clocks Module" + flavor none + + cdl_option CYGNUM_HAL_ARM_MAC7100_F_OSC { + display "FOSC - Oscillator clock" + flavor data + default_value 8000000 + } + + cdl_option CYGNUM_HAL_ARM_MAC7100_FDIV { + display "FDIV - Frequency divider for PLL" + flavor booldata + legal_values 0 to 16 + default_value 2 + description " + If enabled (FDIV != 0), + you set divider for PLL. + Then REFDV is calculated as REFDV=FDIV-1; + If disabled (FDIV == 0), + REFDV is calculated from FOSC so that referent frequency + for PLL is 500kHz. + SYNR is then derived from desired CPU clock, FOSC and REFDV. + " + } + } + + cdl_option CYGNUM_HAL_ARM_MAC7100_CLOCK_SPEED { + display "CPU clock - PLL frequency" + flavor data + default_value 48000000 + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { + display "Number of communication channels on the board" + flavor data + legal_values 0 1 2 + default_value 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 MAC7100 MAC7100EVB board has two serial ports. This option + chooses which port will be used to connect to a host + running GDB." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL { + display "Diagnostic serial port" + active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The MAC7100 MAC7100EVB board has two serial ports. This option + chooses which port will be used for diagnostic output." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD { + display "Diagnostic serial port baud rate" + flavor data + legal_values 9600 19200 38400 + default_value 38400 + description " + This option selects the baud rate used for the diagnostic port." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD { + display "GDB serial port baud rate" + flavor data + legal_values 9600 19200 38400 + default_value 38400 + description " + This option controls the baud rate used for the GDB connection." + } + + 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" || + CYG_HAL_STARTUP == "ROMRAM" } + description " + Enable this option if this program is to be used as a ROM monitor, + i.e. applications will be loaded into RAM on the board, and this + ROM monitor may process exceptions or interrupts generated from the + application. This enables features such as utilizing a separate + interrupt stack when exceptions are generated." + } + + cdl_option CYGSEM_HAL_USE_ROM_MONITOR { + display "Work with a ROM monitor" + flavor booldata + legal_values { "Generic" "GDB_stubs" } + default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 } + parent CYGPKG_HAL_ROM_MONITOR + requires { CYG_HAL_STARTUP == "RAM" } + description " + Support can be enabled for different varieties of ROM monitor. + This support changes various eCos semantics such as the encoding + of diagnostic output, or the overriding of hardware interrupt + vectors. + Firstly there is \"Generic\" support which prevents the HAL + from overriding the hardware vectors that it does not use, to + instead allow an installed ROM monitor to handle them. This is + the most basic support which is likely to be common to most + implementations of ROM monitor. + \"GDB_stubs\" provides support when GDB stubs are included in + the ROM monitor or boot ROM." + } + + 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 { + /bin/redboot.bin : /bin/redboot.elf + $(OBJCOPY) --strip-debug $< $(@:.bin=.img) + $(OBJCOPY) -O srec $< $(@:.bin=.srec) + $(OBJCOPY) -O binary $< $@ + } + + } + } + + 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 " : "") . (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . "-mcpu=arm7tdmi -mbig-endian -mno-short-load-words -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -gdwarf-2 -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 " : "") . (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . "-mcpu=arm7tdmi -mbig-endian -mno-short-load-words -Wl,--gc-sections -Wl,-static -gdwarf-2 -nostdlib" } + description " + This option controls the global linker flags. Individual + packages may define options which override these global flags." + } + } + + cdl_component CYGHWR_MEMORY_LAYOUT { + display "Memory layout" + flavor data + no_define + calculated { (CYG_HAL_STARTUP == "RAM") ? "arm_mac7100_mac7100evb_ram" : + (CYG_HAL_STARTUP == "ROMRAM") ? "arm_mac7100_mac7100evb_romram" : + "arm_mac7100_mac7100evb_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") ? "" : + (CYG_HAL_STARTUP == "ROMRAM") ? "" : + "" } + } + + 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") ? "" : + (CYG_HAL_STARTUP == "ROMRAM") ? "" : + "" } + } + } +} diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_ints.h b/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_ints.h new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_ints.h @@ -0,0 +1,144 @@ +#ifndef CYGONCE_HAL_PLATFORM_INTS_H +#define CYGONCE_HAL_PLATFORM_INTS_H +//========================================================================== +// +// hal_platform_ints.h +// +// HAL Interrupt and clock assignments for MAC7100EVB +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2003 Nick Garnett +// Copyright (C) 2996 eCosCentric Ltd +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Ilija Koco +// Contributors: +// Date: 2006-06-07 +// Purpose: Define Interrupt support +// Description: The interrupt specifics for the MAC7100EVB board/platform +// are defined here. +// +// Usage: #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#define CYGNUM_HAL_ISR_MIN 0 +#define CYGNUM_HAL_ISR_MAX 63 +#define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX + 1) + +// INTC levels + +#define MAC7100_EDMA0_LEVEL (0) +#define MAC7100_EDMA1_LEVEL (0) +#define MAC7100_EDMA2_LEVEL (0) +#define MAC7100_EDMA3_LEVEL (0) +#define MAC7100_EDMA4_LEVEL (0) +#define MAC7100_EDMA5_LEVEL (0) +#define MAC7100_EDMA6_LEVEL (0) +#define MAC7100_EDMA7_LEVEL (0) +#define MAC7100_EDMA8_LEVEL (0) +#define MAC7100_EDMA9_LEVEL (0) +#define MAC7100_EDMA10_LEVEL (0) +#define MAC7100_EDMA11_LEVEL (0) +#define MAC7100_EDMA12_LEVEL (0) +#define MAC7100_EDMA13_LEVEL (0) +#define MAC7100_EDMA14_LEVEL (0) +#define MAC7100_EDMA15_LEVEL (0) +#define MAC7100_EDMA_Error_LEVEL (0) +#define MAC7100_MCM_SWT_LEVEL (0) +#define MAC7100_CRG_LEVEL (0) +#define MAC7100_PIT1_LEVEL (9) +#define MAC7100_PIT2_LEVEL (9) +#define MAC7100_PIT3_LEVEL (10) +#define MAC7100_PIT4_RTI_LEVEL (9) +#define MAC7100_VREG_LEVEL (4) +#define MAC7100_CAN_A_MB_LEVEL (4) +#define MAC7100_CAN_A_MB14_LEVEL (4) +#define MAC7100_CAN_A_Error_LEVEL (4) +#define MAC7100_CAN_B_MB_LEVEL (4) +#define MAC7100_CAN_B_MB14_LEVEL (4) +#define MAC7100_CAN_B_Error_LEVEL (4) +#define MAC7100_CAN_C_MB_LEVEL (4) +#define MAC7100_CAN_C_MB14_LEVEL (4) +#define MAC7100_CAN_C_Error_LEVEL (4) +#define MAC7100_CAN_D_MB_LEVEL (4) +#define MAC7100_CAN_D_MB14_LEVEL (4) +#define MAC7100_CAN_D_Error_LEVEL (4) +#define MAC7100_I2C_LEVEL (4) +#define MAC7100_DSPI_A_LEVEL (5) +#define MAC7100_DSPI_B_LEVEL (5) +#define MAC7100_ESCI_A_LEVEL (8) +#define MAC7100_ESCI_B_LEVEL (8) +#define MAC7100_ESCI_C_LEVEL (8) +#define MAC7100_ESCI_D_LEVEL (8) +#define MAC7100_EMIOS0_LEVEL (7) +#define MAC7100_EMIOS1_LEVEL (7) +#define MAC7100_EMIOS2_LEVEL (7) +#define MAC7100_EMIOS3_LEVEL (7) +#define MAC7100_EMIOS4_LEVEL (7) +#define MAC7100_EMIOS5_LEVEL (7) +#define MAC7100_EMIOS6_LEVEL (7) +#define MAC7100_EMIOS7_LEVEL (7) +#define MAC7100_EMIOS8_LEVEL (7) +#define MAC7100_EMIOS9_LEVEL (7) +#define MAC7100_EMIOS10_LEVEL (7) +#define MAC7100_EMIOS11_LEVEL (7) +#define MAC7100_EMIOS12_LEVEL (7) +#define MAC7100_EMIOS13_LEVEL (7) +#define MAC7100_EMIOS14_LEVEL (7) +#define MAC7100_EMIOS15_LEVEL (7) +#define MAC7100_ATD_LEVEL (11) +#define MAC7100_CFM_LEVEL (7) +#define MAC7100_PIM_LEVEL (11) +#define MAC7100_IRQ_LEVEL (12) +#define MAC7100_XIRQ_LEVEL (12) + +// The vector used by the Real time clock +#if CYGNUM_PIT_CHAN_CLOCK==0 +#define CYGNUM_HAL_INTERRUPT_RTC MAC7100_PIT4_RTI_IV +#else +#define CYGNUM_HAL_INTERRUPT_RTC (MAC7100_PIT1_IV+CYGNUM_PIT_CHAN_CLOCK-1) +#endif + +//---------------------------------------------------------------------------- +// Reset. +__externC void hal_mac7100_reset_cpu(void); +#define HAL_PLATFORM_RESET() hal_mac7100_reset_cpu() + +#define HAL_PLATFORM_RESET_ENTRY 0x01000000 + +#endif // CYGONCE_HAL_PLATFORM_INTS_H diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_setup.h b/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_setup.h new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/hal_platform_setup.h @@ -0,0 +1,133 @@ +#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. +// Copyright (C) 2003 Nick Garnett +// Copyright (C) 2006 eCosCentric Ltd +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Ilija Koco +// Contributors: +// Date: 2006-06-07 +// Purpose: MAC7100EVB platform specific support routines +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include +#include +//=========================================================================== + + .macro _led y + ldr r0,=MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET) + ldrh r1,[r0] + and r1,r1,#0x00ff + orr r1,r1,#(((~\y)&0xff)<<8) + strh r1,[r0] + .endm + + +// Initialize LED PORT +// Set appropriate peripheral pins + .macro _led_init + _led 0 // Set initial LED state. + mov r1, #MAC7100_PIM_DDR // Pin setting: Output+Low + ldr r0,=MAC7100_PIM_CONFIG(MAC7100_PORT_F_OFFSET, 8) // LED pin cfg + strh r1,[r0],#2 // LED: LSB ... + strh r1,[r0],#2 + strh r1,[r0],#2 + strh r1,[r0],#2 + strh r1,[r0],#2 + strh r1,[r0],#2 + strh r1,[r0],#2 + strh r1,[r0],#2 // LED: ... MSB + .endm + + +// Clock initilalization + .macro _pclock_init + _mac7100_setpll + .endm + +// Memory re-mapping + .macro _memory_remap + _mac7100_remap_single_chip + .endm + + +// Initialize paralel port + .macro _pio_init + .endm + + +#define CYGHWR_LED_MACRO _led \x + +//=========================================================================== + +#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) + + .macro _setup + ldr r0,=VAE_MAC7100_FlashSecurity + _led_init + _memory_remap + _pclock_init + _pio_init + .endm + +#define CYGSEM_HAL_ROM_RESET_USES_JUMP + +#else + + .macro _setup + _led_init + _led 16 + _pclock_init + _pio_init + .endm + +#endif + +#define PLATFORM_SETUP1 _setup + +//----------------------------------------------------------------------------- +// end of hal_platform_setup.h +#endif // CYGONCE_HAL_PLATFORM_SETUP_H diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/mac7100evb_misc.h b/packages/hal/arm/mac7100/mac7100evb/current/include/mac7100evb_misc.h new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/mac7100evb_misc.h @@ -0,0 +1,67 @@ +#ifndef CYGONCE_HAL_MAC7100EVB_MISC_H +#define CYGONCE_HAL_MAC7100EVB_MISC_H +//============================================================================= +// +// mac7100evb_misc.h +// +// MAC7100EVB board specific functions +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2003 Nick Garnett +// Copyright (C) 2006 eCosCentric Ltd +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Ilija Koco +// Contributors: +// Date: 2006-05-07 +// Purpose: MAC7100EVB board specific registers +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +void hal_mac7100evb_set_leds(int); +void hal_mac7100evb_led_on(int); +void hal_mac7100evb_led_off(int); +int hal_mac7100evb_get_leds(void); + +#define HAL_MAC7100_SET_LEDS(x) hal_mac7100evb_set_leds(x) +#define HAL_MAC7100_LED_ON(x) hal_mac7100evb_led_on(x) +#define HAL_MAC7100_LED_OFF(x) hal_mac7100evb_led_off(x) +#define HAL_MAC7100_GET_LEDS(x) hal_mac7100evb_get_leds(x) + +//----------------------------------------------------------------------------- +// end of mac7100evb_misc.h +#endif // CYGONCE_HAL_MAC7100EVB_MISC_H diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.h b/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.h new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.h @@ -0,0 +1,24 @@ +// eCos memory layout - Wed Apr 11 13:49:55 2001 + +// This is a generated file - do not edit + +#ifndef __ASSEMBLER__ +#include +#include + +#endif +// Initially RAM is at 0x40000000 but we ramap to 0x0 +#define CYGMEM_REGION_ram (0x00000000) +#define CYGMEM_REGION_ram_SIZE (0x00008000) +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) +#define CYGMEM_REGION_rom (0x20000000) +#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 \ + ((CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE) - \ + (size_t) CYG_LABEL_NAME (__heap1)) + diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.ldi b/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.ldi new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/pkgconf/mlt_arm_mac7100_mac7100evb_rom.ldi @@ -0,0 +1,39 @@ +// eCos memory layout - Wed Apr 11 13:49:55 2001 + +// This is a generated file - do not edit + +#include + +MEMORY +{ + ram : ORIGIN = 0x00000000, LENGTH = 0x8000 + rom : ORIGIN = 0x20000000, LENGTH = 0x80000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (rom, 0x20000000, LMA_EQ_VMA) + +// MAC7100 Flash Security +// Following section is manually added to address MAC7100 flash security area +// It should actually be something like this +// SECTION_sgfm_config (rom, 0x20000400, LMA_EQ_VMA) + + .mac7100_flash_security 0x20000400 : { KEEP (*(.mac7100_flash_security))} > rom + +// END MAC7100 Flash Security + + SECTION_text (rom, ALIGN (0x1), 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, 0x00000020, LMA_EQ_VMA) + SECTION_data (ram, ALIGN(0x4), FOLLOWING(.gcc_except_table)) + SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) + CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); + SECTIONS_END +} diff --git a/packages/hal/arm/mac7100/mac7100evb/current/include/plf_io.h b/packages/hal/arm/mac7100/mac7100evb/current/include/plf_io.h new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/include/plf_io.h @@ -0,0 +1,60 @@ +#ifndef CYGONCE_HAL_PLF_IO_H +#define CYGONCE_HAL_PLF_IO_H +//============================================================================= +// +// plf_io.h +// +// MAC7100EVB board specific registers +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2003 Nick Garnett +// Copyright (C) 2006 eCosCentric Ltd +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Ilija Koco +// Contributors: +// Date: 2006-06-07 +// Purpose: MAC7100EVB board specific registers +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= +// On-chip device base addresses + +#define CYGARC_PHYSICAL_ADDRESS(_x_) + +#endif // CYGONCE_HAL_PLF_IO_H +//----------------------------------------------------------------------------- +// end of plf_io.h diff --git a/packages/hal/arm/mac7100/mac7100evb/current/src/mac7100evb_misc.c b/packages/hal/arm/mac7100/mac7100evb/current/src/mac7100evb_misc.c new file mode 100644 --- /dev/null +++ b/packages/hal/arm/mac7100/mac7100evb/current/src/mac7100evb_misc.c @@ -0,0 +1,102 @@ +//========================================================================== +// +// mac7100evb_misc.c +// +// HAL misc board support code for MAC7100EVB board +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2003 Nick Garnett +// Copyright (C) 2006 eCosCentric Ltd +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Ilija Koco +// Contributors: +// Date: 2006-06-07 +// Purpose: HAL board support +// Description: Implementations of HAL board interfaces +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include + +#include // base types +#include // low level i/o +#include // common registers +#include // platform registers +#include // mac7100evb misc functions + +void +hal_mac7100evb_set_leds(int val) +{ + HAL_WRITE_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), + ~((val<<8)&0xff00)); // turn all LEDs off +} + +void +hal_mac7100evb_led_on(int val) +{ + cyg_uint16 leds; + + // read old LED state + HAL_READ_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), leds); + leds&=~(1<<(8+val)); + // Write new state + HAL_WRITE_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), leds); +} + +void +hal_mac7100evb_led_off(int val) +{ + cyg_uint16 leds; + + // read old LED state + HAL_READ_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), leds); + leds|=1<<(8+val); + // Write new state + HAL_WRITE_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), leds); +} + +int +hal_mac7100evb_get_leds(void) +{ + cyg_uint16 leds = 0; + + // read old LED state + HAL_READ_UINT16(MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET), leds); + return ~(leds>>8&0xFF); +} + +//-------------------------------------------------------------------------- +// EOF mac7100evb_misc.c