summaryrefslogtreecommitdiff
path: root/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current
diff options
context:
space:
mode:
Diffstat (limited to 'ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current')
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/ChangeLog103
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl648
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/hal_kinetis_flexbus.h143
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.h32
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.ldi41
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h40
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi49
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.h26
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.ldi35
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.h28
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.ldi39
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h32
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi47
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.h24
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.ldi43
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_arch.h63
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_intr.h62
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_io.h194
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/misc/redboot_K60_FXM_SST25XX_ROM.ecm81
-rw-r--r--ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/src/twr_k60n512_fxm_misc.c446
20 files changed, 2176 insertions, 0 deletions
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/ChangeLog b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/ChangeLog
new file mode 100644
index 0000000..9f52f91
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/ChangeLog
@@ -0,0 +1,103 @@
+2013-04-28 Ilija Kocho <ilijak@siva.com.mk>
+
+ * cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl:
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.h: (New)
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.ldi: (New)
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h:
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi:
+ * include/pkgconf/mlt_kinetis_flash_sram2s_ram.h: (Remove)
+ * include/pkgconf/mlt_kinetis_flash_sram2s_ram.ldi: (Remove)
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.h:
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.ldi:
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h:
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi:
+ * include/plf_io.h:
+ * misc/redboot_K60_FXM_SST25XX_ROM.ecm: (New)
+ * src/twr_k60n512_fxm_misc.c:
+ Rich memory layout for FlexBus RAM with support for caching.
+ Remove redundant MLT files. [ Bugzilla 1001837 ]
+
+2013-04-09 Ilija Kocho <ilijak@siva.com.mk>
+
+ * cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl:
+ * include/plf_io.h:
+ Implemented support for I2C [Bugzilla 1001397]
+
+2013-04-01 Ilija Kocho <ilijak@siva.com.mk>
+
+ * src/twr_k60n512_fxm_misc.c: Clock gating synchronised with variant.
+ [ Bugzilla 1001814 ]
+
+2012-11-06 Ilija Kocho <ilijak@siva.com.mk>
+
+ * cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl:
+ Removed (obsolete) implementation of CYGINT_HAL_CORTEXM4_CODE.
+
+2012-10-25 Ilija Kocho <ilijak@siva.com.mk>
+
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi:
+ * src/twr_k60n512_misc_fxm.c: Initialization for separate SRAM regions
+ synchronized with variant. [Bugzilla 1001606]
+
+2012-01-06 Ilija Kocho <ilijak@siva.com.mk>
+
+ * cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl,
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h
+ * include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h
+ * include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi
+ * /src/twr_k60n512_fxm_misc.c
+ Fixed memory layout for FlexBus memory. Add different pin options
+ [Bugzilla 1001579]
+
+2012-01-06 Ilija Kocho <ilijak@siva.com.mk>
+
+ * cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl:
+ * include/plf_arch.h:
+ * include/plf_intr.h:
+ * include/plf_io.h:
+ * include/hal_kinetis_flexbus.h
+ * src/twr_k60n512_fxm_misc.c:
+ * include/pkgconf/mltkinetis_flash_sram2s_extram_rom.h
+ * include/pkgconf/mltkinetis_flash_sram2s_extram_rom.ldi
+ * include/pkgconf/mltkinetis_flash_sram2s_jtag.h
+ * include/pkgconf/mltkinetis_flash_sram2s_jtag.ldi
+ * include/pkgconf/mltkinetis_flash_sram2s_ram.h
+ * include/pkgconf/mltkinetis_flash_sram2s_ram.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_extram.h
+ * include/pkgconf/mltkinetis_flash_unisram_extram_jtag.h
+ * include/pkgconf/mltkinetis_flash_unisram_extram_jtag.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_extram.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_extram_ram.h
+ * include/pkgconf/mltkinetis_flash_unisram_extram_ram.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_extram_rom.h
+ * include/pkgconf/mltkinetis_flash_unisram_extram_rom.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_jtag.h
+ * include/pkgconf/mltkinetis_flash_unisram_jtag.ldi
+ * include/pkgconf/mltkinetis_flash_unisram_ram.h
+ * include/pkgconf/mltkinetis_flash_unisram_ram.ldi
+ New package -- Freescale TWR-K60N512-FXM board. [Bugzilla 1001450]
+
+//===========================================================================
+// ####GPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// This program 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.
+//
+// This program 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 this program; if not, write to the
+// Free Software Foundation, Inc., 51 Franklin Street,
+// Fifth Floor, Boston, MA 02110-1301, USA.
+// -------------------------------------------
+// ####GPLCOPYRIGHTEND####
+//===========================================================================
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl
new file mode 100644
index 0000000..5f370ce
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/cdl/hal_cortexm_kinetis_twr_k60n512_fxm.cdl
@@ -0,0 +1,648 @@
+##==========================================================================
+##
+## hal_cortexm_kinetis_twr_k60n512_fxm.cdl
+##
+## Cortex-M Freescale TWR-K60N512 + TWR-FXM platform HAL configuration
+##
+##==========================================================================
+## ####ECOSGPLCOPYRIGHTBEGIN####
+## -------------------------------------------
+## This file is part of eCos, the Embedded Configurable Operating System.
+## Copyright (C) 2011 Free Software Foundation, 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.,
+## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+##
+## 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 Kocho <ilijak@siva.com.mk>
+## Date: 2011-09-26
+##
+######DESCRIPTIONEND####
+##
+##==========================================================================
+
+cdl_package CYGPKG_HAL_CORTEXM_KINETIS_TWR_K60N512_FXM {
+ display "Freescale Kinetis TWR-K60N512-FXM Platform"
+ parent CYGPKG_HAL_CORTEXM_KINETIS
+ define_header hal_cortexm_kinetis_twr_k60n512_fxm.h
+ include_dir cyg/hal
+ hardware
+ requires { CYGHWR_HAL_CORTEXM_SYSTICK_CLK_SOURCE == "INTERNAL" }
+
+ implements CYGINT_HAL_CORTEXM_KINETIS_RTC
+ implements CYGINT_IO_FREESCALE_I2C0
+ implements CYGINT_IO_SERIAL_FREESCALE_UART4
+ implements CYGINT_HAL_FREESCALE_UART4
+
+ description "
+ The Freescale TWR K60N512 FXM Platform package provides the support
+ needed to run eCos on the TWR K60N512 development system equipped
+ with TWR-FXM external memory board. This package
+ can also be used for other boards that employ a controller from Kinetis
+ families."
+
+ compile twr_k60n512_fxm_misc.c
+
+ requires { is_active(CYGPKG_DEVS_ETH_PHY) implies
+ (1 == CYGHWR_DEVS_ETH_PHY_KSZ8041) }
+ requires { is_active(CYGPKG_HAL_FREESCALE_EDMA) implies
+ (CYGNUM_HAL_FREESCALE_EDMA_CHAN_NUM == 16) }
+
+ define_proc {
+ puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_cortexm_kinetis_twr_k60n512_fxm.h>"
+ puts $::cdl_header "#define HAL_PLATFORM_CPU \"Cortex-M4\""
+ puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Freescale TWR-K60N512-FXM\""
+ puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
+ }
+
+ cdl_component CYG_HAL_STARTUP_ENV {
+ display "Startup type"
+ flavor data
+ no_define
+ calculated {
+ !CYG_HAL_STARTUP_PLF ? CYG_HAL_STARTUP :
+ ((CYG_HAL_STARTUP_PLF == "ByVariant") ?
+ (CYG_HAL_STARTUP . "(Variant)") :
+ (CYG_HAL_STARTUP . "(Platform)"))
+ }
+ description "
+ Startup type configuration defines the system memory layout.
+ Startup type can be defined by the variant (CYG_HAL_STARTUP_VAR)
+ or a platform (CYG_HAL_STARTUP_PLF). If CYG_HAL_STARTUP_PLF
+ is defined and not equal to 'ByVariant' then it shall
+ override CYG_HAL_STARTUP_VAR."
+ }
+
+ cdl_option CYG_HAL_STARTUP_PLF {
+ display "By platform"
+ flavor data
+ parent CYG_HAL_STARTUP_ENV
+ default_value { "ROM" }
+ legal_values { "ByVariant" "ROM" "RAM" }
+ requires { CYG_HAL_STARTUP_PLF != "ByVariant" implies
+ CYGPKG_HAL_CORTEXM_KINETIS_FBRAM == 1 }
+
+ description "
+ Startup tupes provided by the platform, in addition to variant
+ startup types.
+ If 'ByVariant' is selected, then startup type shall be selected from
+ the variant (CYG_HAL_STARTUP_VAR). Platform's 'ROM' startup builds
+ application similar to Variant's 'ROM' but using external RAM (FlexBus).
+ 'RAM' startup builds application intended for loading by RedBoot into
+ external RAM."
+ }
+
+ cdl_component CYGHWR_MEMORY_LAYOUT_PLF {
+ display "Memory layout by platform"
+ flavor data
+ no_define
+ active_if { CYG_HAL_STARTUP_PLF != "ByVariant" }
+ implements CYGINT_HAL_CORTEXM_KINETIS_FBRAM
+ parent CYGHWR_MEMORY_LAYOUT
+ calculated {
+ (CYG_HAL_STARTUP_PLF == "ByVariant" ) ? "by variant" :
+ (CYG_HAL_STARTUP == "RAM") ? "kinetis_"
+ . CYGHWR_HAL_CORTEXM_KINETIS_OC_MEM_LAYOUT . "_extram_ram" :
+ (CYG_HAL_STARTUP == "ROM") ? "kinetis_"
+ . CYGHWR_HAL_CORTEXM_KINETIS_OC_MEM_LAYOUT . "_extram_rom" :
+ "Error!" }
+ description "Combination of 'Startup type' and 'Kinetis member in use'
+ produces the memory layout."
+
+ cdl_option CYGHWR_MEMORY_RAM_RESERVED {
+ display "Reserved RAM space \[Bytes\]"
+ flavor data
+ legal_values 0 to 0x40000
+ default_value 0x20000
+ }
+ }
+
+ cdl_option CYGHWR_HAL_CORTEXM_KINETIS_PLF_XTAL_OR_OSC_FREQ {
+ display "Platform Clock Frequency"
+ flavor data
+ parent CYGOPT_HAL_CORTEXM_KINETIS_MCG_REF_EXT
+ default_value 50000000
+ legal_values { 25000000 50000000 }
+ }
+
+ cdl_option CYGHWR_HAL_CORTEXM_KINETIS_PLF_OSC_CAP {
+ display "Platform requred XTAL || C \[pF\]"
+ flavor bool
+ default_value { CYGOPT_HAL_CORTEXM_KINETIS_MCG_REF_EXT_IS == "XTAL" }
+ parent CYGOPT_HAL_CORTEXM_KINETIS_MCG_REF_EXT
+ active_if { CYGOPT_HAL_CORTEXM_KINETIS_MCG_REF_EXT_IS == "XTAL" }
+ requires { CYGHWR_HAL_CORTEXM_KINETIS_OSC_CAP == 20 }
+ }
+
+ cdl_option CYGHWR_HAL_CORTEXM_KINETIS_PLF_RTC {
+ display "Platform requred RTC XTAL || C \[pF\]"
+ flavor bool
+ default_value 1
+ parent CYGHWR_HAL_CORTEXM_KINETIS_RTC
+ requires { CYGHWR_HAL_CORTEXM_KINETIS_RTC_OSC_CAP == 20 }
+ }
+
+ cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
+ display "Number of communication channels on the board"
+ flavor data
+ legal_values 0 to 2
+ default_value 1
+ }
+
+ 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 TWR board has one serial port fitted to RS232 connector. 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 TWR has one serial port fitted to RS232 connector. This option
+ chooses which port will be used for diagnostic output."
+ }
+
+ cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
+ display "Console serial port baud rate"
+ flavor data
+ legal_values 9600 19200 38400 57600 115200
+ default_value 38400
+ description "
+ This option controls the default baud rate used for the
+ console connection.
+ 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 57600 115200
+ default_value 38400
+ description "
+ This option controls the default baud rate used for the
+ GDB connection.
+ Note: this should match the value chosen for the console port if the
+ console and GDB port are the same."
+ }
+
+ cdl_component CYGHWR_DEVS_DISK_MMC_FREESCALE_DSPI_BUS {
+ display "MMC Disk SPI bus"
+ flavor data
+ parent CYGPKG_DEVS_DISK_MMC_FREESCALE_DSPI
+ calculated 1
+
+ requires CYGHWR_DEVS_SPI_FREESCALE_DSPI1 == 1
+ implements CYGINT_DEVS_SPI_FREESCALE_DSPI1
+ implements CYGINT_FREESCALE_DSPI1_HAS_MASS
+
+ cdl_option CYGHWR_DEVS_DISK_MMC_FREESCALE_DSPI_CS {
+ display "Device number (CS)"
+ flavor data
+ calculated 0
+ implements CYGINT_FREESCALE_DSPI1_CS0
+ }
+ }
+
+ cdl_option CYGNUM_DEVS_FLASH_SPI_SST25XX_DEV0_MAP_ADDR {
+ display "SST25XX Flash Mapping Address"
+ flavor data
+ parent CYGHWR_DEVS_FLASH_SPI_SST25XX_DEV0
+ default_value 0xD0000000
+ }
+ cdl_component CYGHWR_DEVS_FLASH_SST25XX_DEV0_SPI_BUS {
+ display "SST25xx SPI bus"
+ flavor data
+ parent CYGHWR_DEVS_FLASH_SPI_SST25XX_DEV0
+ calculated 1
+
+ requires CYGHWR_DEVS_SPI_FREESCALE_DSPI1 == 1
+ implements CYGINT_DEVS_SPI_FREESCALE_DSPI1
+
+ cdl_option CYGHWR_DEVS_FLASH_SST25XX_DEV0_SPI_CS {
+ display "Device number (CS)"
+ flavor data
+ calculated 1
+ implements CYGINT_FREESCALE_DSPI1_CS1
+ }
+ }
+
+ cdl_component CYGHWR_HAL_DEVS_IRQ_PRIO_SCHEME {
+ display "Interrupt priority scheme"
+ flavor none
+ description "Consolidated interrupt priority scheme setting."
+ }
+
+ cdl_component CYGPKG_HAL_EXTRN_MEMORY {
+ display "External memory devices"
+ parent CYGPKG_HAL_CORTEXM_KINETIS_FLEXBUS
+ flavor none
+ active_if {
+ CYGHWR_HAL_KINETIS_FB_CS0 || CYGHWR_HAL_KINETIS_FB_CS1 ||
+ CYGHWR_HAL_KINETIS_FB_CS2 || CYGHWR_HAL_KINETIS_FB_CS3 ||
+ CYGHWR_HAL_KINETIS_FB_CS4 || CYGHWR_HAL_KINETIS_FB_CS5
+ }
+ description "
+ This is a container for memory devices attached to
+ external bus such as RAM, FLASH, etc."
+ }
+# FlexBus Implementation
+ implements CYGINT_HAL_CORTEXM_KINETIS_FLEXBUS
+ implements CYGINT_HAL_EXTRN_MEMORY
+
+# CS0 Implementation
+ implements CYGINT_HAL_KINETIS_FB_CS0
+ implements CYGINT_DEVS_RAM0_MICRON_CELLULAR
+ requires { is_active(CYGPKG_HAL_CORTEXM_KINETIS_FBRAM) implies
+ CYGHWR_HAL_KINETIS_FBR_SIZE == CYGHWR_HAL_KINETIS_FB_CS0_SIZE }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_AR {
+ display "Base address"
+ flavor data
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+ default_value 0x60000000
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_SIZE {
+ display "Size \[Bytes\]"
+ flavor data
+ legal_values { 0x00040000 0x00400000 CYGHWR_RAM0_MICRON_CELLULAR_SIZE }
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+ default_value CYGHWR_RAM0_MICRON_CELLULAR_SIZE
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_BASE {
+ display "Memory base address"
+ flavor data
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+ calculated CYGHWR_HAL_KINETIS_FB_CS0_AR
+ }
+
+ cdl_component CYGHWR_HAL_KINETIS_FB_CS0_MR {
+ display "Mask register"
+ flavor data
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+ default_value 0x00FF0001
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_MR_WP {
+ display "Write protect"
+ flavor bool
+ default_value 0
+ }
+ }
+
+ cdl_component CYGHWR_HAL_KINETIS_FB_CS0_CR {
+ display "Control register"
+ flavor none
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_WS {
+ display "Wait states"
+ flavor data
+ default_value 3
+ legal_values 0 to 63
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_BLS {
+ display "Byte lane shift"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_AA {
+ display "Auto acknowledge enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_component CYGHWR_HAL_KINETIS_FB_CS0_CR_PSB {
+ display "Port size (bits)"
+ flavor data
+ legal_values { 32 8 16 "-16" }
+ default_value 16
+
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_SWSEN {
+ display "Secondary wait states enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_SWS {
+ display "Secondary wait states"
+ flavor data
+ legal_values 0 to 63
+ default_value 0
+
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_EXALE {
+ display "Extended address latch enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_ASET {
+ display "Address setup"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_RDAH {
+ display "Read address hold or deselect"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_WRAH {
+ display "Write address hold or deselect"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_BEM {
+ display "Byte enable mode"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_BSTR {
+ display "Burst read enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_BSTW {
+ display "Burst write enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 0
+ }
+ }
+
+ cdl_component CYGHWR_HAL_KINETIS_FB_CS0_CR_IS {
+ display "Control register initial setting."
+ flavor none
+ parent CYGHWR_HAL_KINETIS_FB_CS0
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_WS {
+ display "Wait states"
+ flavor data
+ default_value 3
+ legal_values 0 to 63
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_AA {
+ display "Auto acknowledge enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_SWSEN {
+ display "Secondary wait states enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_SWS {
+ display "Secondary wait states"
+ flavor data
+ legal_values 0 to 63
+ default_value 0
+
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_EXALE {
+ display "Extended address latch enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_ASET {
+ display "Address setup"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_RDAH {
+ display "Read address hold or deselect"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_WRAH {
+ display "Write address hold or deselect"
+ flavor data
+ legal_values { 0 1 2 3 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_BEM {
+ display "Byte enable mode"
+ flavor data
+ legal_values { 0 1 }
+ default_value 1
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_BSTR {
+ display "Burst read enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 0
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_CS0_CR_IS_BSTW {
+ display "Burst write enable"
+ flavor data
+ legal_values { 0 1 }
+ default_value 0
+ }
+ }
+# CS0 Implementation End
+# FlexBus Implementation End
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_EXTRAM_SIZE {
+ display "External RAM size"
+ flavor data
+ calculated CYGHWR_HAL_KINETIS_FB_CS0_SIZE
+ }
+
+ cdl_option CYGHWR_HAL_KINETIS_FB_EXTRAM_BASE {
+ display "External RAM base address"
+ flavor data
+ calculated CYGHWR_HAL_KINETIS_FB_CS0_BASE
+ }
+
+ cdl_option CYGHWR_FREESCALE_ENET_MII_MDC_HAL_CLOCK {
+ display "ENET MII MDC clock provided by HAL"
+ flavor data
+ active_if CYGPKG_DEVS_ETH_FREESCALE_ENET
+ parent CYGPKG_DEVS_ETH_FREESCALE_ENET
+ calculated CYGHWR_HAL_CORTEXM_KINETIS_CLK_PER_BUS
+ description "
+ ENET needs a clock with typical frequency of up to 2.5 MHz for
+ MII MDC. The input clock, typically provided by HAL, is further
+ divided by ENET according to setting of ENET MSCR register in order to
+ provide frequency within 2.5 MHz range."
+ }
+
+ cdl_option CYGHWR_HAL_FREESCALE_ENET_E0_1588_PORT {
+ display "IEEE 1588 Port"
+ active_if CYGSEM_DEVS_ETH_FREESCALE_ENET_1588
+ parent CYGSEM_DEVS_ETH_FREESCALE_ENET_1588
+ flavor data
+ default_value { "B" }
+ legal_values { "B" "C" "User" }
+ description "
+ Digital I/O provided by HAL for ENET IEEE 1588 timers."
+ }
+
+
+
+ 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-eabi" }
+ 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 { CYGBLD_GLOBAL_WARNFLAGS . "-mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" }
+ 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 { "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" }
+ description "
+ This option controls the global linker flags. Individual
+ packages may define options which override these global flags."
+ }
+ }
+
+ 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" }
+ requires { CYGDBG_HAL_CRCTABLE_LOCATION == "ROM" }
+ description "
+ Enable this option if this program is to be used as a ROM monitor,
+ i.e. applications will be loaded into RAM on the board, and this
+ ROM monitor may process exceptions or interrupts generated from the
+ application. This enables features such as utilizing a separate
+ interrupt stack when exceptions are generated."
+ }
+
+ cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+ display "Work with a ROM monitor"
+ flavor booldata
+ legal_values { "Generic" "GDB_stubs" }
+ default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
+ parent CYGPKG_HAL_ROM_MONITOR
+ requires { CYG_HAL_STARTUP == "RAM" }
+ description "
+ Support can be enabled for different varieties of ROM monitor.
+ This support changes various eCos semantics such as the encoding
+ of diagnostic output, or the overriding of hardware interrupt
+ vectors.
+ Firstly there is \"Generic\" support which prevents the HAL
+ from overriding the hardware vectors that it does not use, to
+ instead allow an installed ROM monitor to handle them. This is
+ the most basic support which is likely to be common to most
+ implementations of ROM monitor.
+ \"GDB_stubs\" provides support when GDB stubs are included in
+ the ROM monitor or boot ROM."
+ }
+
+ cdl_component CYGBLD_HAL_CORTEXM_TWR_MK60N512_GDB_STUBS {
+ display "Create StubROM SREC and binary files"
+ active_if CYGBLD_BUILD_COMMON_GDB_STUBS
+ no_define
+ calculated 1
+ requires { CYG_HAL_STARTUP == "ROM" }
+
+ make -priority 325 {
+ <PREFIX>/bin/stubrom.srec : <PREFIX>/bin/gdb_module.img
+ $(OBJCOPY) -O srec $< $@
+ }
+ make -priority 325 {
+ <PREFIX>/bin/stubrom.bin : <PREFIX>/bin/gdb_module.img
+ $(OBJCOPY) -O binary $< $@
+ }
+
+ description "This component causes the ELF image generated by the
+ build process to be converted to S-Record and binary
+ files."
+ }
+}
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/hal_kinetis_flexbus.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/hal_kinetis_flexbus.h
new file mode 100644
index 0000000..ac10c73
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/hal_kinetis_flexbus.h
@@ -0,0 +1,143 @@
+#ifndef CYGONCE_FLEXBUS_H
+#define CYGONCE_FLEXBUS_H
+//=============================================================================
+//
+// flexbus.h
+//
+// Kinetis FlexBus specific registers
+//
+//=============================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2011 Free Software Foundation, 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.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+//
+// 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): ilijak
+// Date: 2011-08-05
+// Purpose: Kinetis FlexBus specific registers
+// Description:
+// Usage: #include <cyg/hal/flexbus.h>
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+//--------------------------------------------------------------------------
+// Flexbus pins
+
+#define KINETIS_PIN_FB_OPT CYGHWR_HAL_KINETIS_PORT_PCR_DSE_M
+#define KINETIS_PIN_FB 5
+#define KINETIS_PIN_FB6 6
+
+#define CYGHWR_KINETIS_FB_PIN_AD0 CYGHWR_HAL_KINETIS_PIN(D, 6, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD1 CYGHWR_HAL_KINETIS_PIN(D, 5, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD2 CYGHWR_HAL_KINETIS_PIN(D, 4, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD3 CYGHWR_HAL_KINETIS_PIN(D, 3, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD4 CYGHWR_HAL_KINETIS_PIN(D, 2, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD5 CYGHWR_HAL_KINETIS_PIN(C, 10, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD6 CYGHWR_HAL_KINETIS_PIN(C, 9, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD7 CYGHWR_HAL_KINETIS_PIN(C, 8, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD8 CYGHWR_HAL_KINETIS_PIN(C, 7, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD9 CYGHWR_HAL_KINETIS_PIN(C, 6, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD10 CYGHWR_HAL_KINETIS_PIN(C, 5, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD11 CYGHWR_HAL_KINETIS_PIN(C, 4, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD12 CYGHWR_HAL_KINETIS_PIN(C, 2, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD13 CYGHWR_HAL_KINETIS_PIN(C, 1, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD14 CYGHWR_HAL_KINETIS_PIN(C, 0, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD15 CYGHWR_HAL_KINETIS_PIN(B, 18, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD16 CYGHWR_HAL_KINETIS_PIN(B, 17, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD17 CYGHWR_HAL_KINETIS_PIN(B, 16, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD18 CYGHWR_HAL_KINETIS_PIN(B, 11, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD19 CYGHWR_HAL_KINETIS_PIN(B, 10, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD20 CYGHWR_HAL_KINETIS_PIN(B, 9, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD21 CYGHWR_HAL_KINETIS_PIN(B, 8, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD22 CYGHWR_HAL_KINETIS_PIN(B, 7, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD23 CYGHWR_HAL_KINETIS_PIN(B, 6, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD24 CYGHWR_HAL_KINETIS_PIN(C, 15, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD25 CYGHWR_HAL_KINETIS_PIN(C, 14, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD26 CYGHWR_HAL_KINETIS_PIN(C, 13, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD27 CYGHWR_HAL_KINETIS_PIN(C, 12, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD28 CYGHWR_HAL_KINETIS_PIN(B, 23, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD29 CYGHWR_HAL_KINETIS_PIN(B, 22, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD30 CYGHWR_HAL_KINETIS_PIN(B, 21, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_AD31 CYGHWR_HAL_KINETIS_PIN(B, 20, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+
+#define CYGHWR_KINETIS_FB_PIN_A16 CYGHWR_HAL_KINETIS_PIN(D, 8, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A17 CYGHWR_HAL_KINETIS_PIN(D, 9, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A18 CYGHWR_HAL_KINETIS_PIN(D, 10, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A19 CYGHWR_HAL_KINETIS_PIN(D, 11, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A20 CYGHWR_HAL_KINETIS_PIN(D, 12, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A21 CYGHWR_HAL_KINETIS_PIN(D, 13, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A22 CYGHWR_HAL_KINETIS_PIN(D, 14, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_A23 CYGHWR_HAL_KINETIS_PIN(D, 15, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+
+#define CYGHWR_KINETIS_FB_PIN_CLKOUT CYGHWR_HAL_KINETIS_PIN(C, 3, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CLKOUT_OFF \
+ CYGHWR_HAL_KINETIS_PIN(C, 3, CYGHWR_HAL_KINETIS_PORT_PCR_MUX_GPIO, \
+ CYGHWR_HAL_KINETIS_PORT_PCR_PE_M)
+
+#define CYGHWR_KINETIS_FB_PIN_RW CYGHWR_HAL_KINETIS_PIN(C, 11, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_OE CYGHWR_HAL_KINETIS_PIN(B, 19, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+
+// Following pins are additionally multiplexed by FB_CSPMCR
+
+#define CYGHWR_KINETIS_FB_PIN_BE23_16 CYGHWR_HAL_KINETIS_PIN(C, 16, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BE31_24 CYGHWR_HAL_KINETIS_PIN(C, 17, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BE15_8 CYGHWR_HAL_KINETIS_PIN(C, 18, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BE7_0 CYGHWR_HAL_KINETIS_PIN(C, 19, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+
+#define CYGHWR_KINETIS_FB_PIN_BLS15_8 CYGHWR_HAL_KINETIS_PIN(C, 16, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BLS7_0 CYGHWR_HAL_KINETIS_PIN(C, 17, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BLS23_16 CYGHWR_HAL_KINETIS_PIN(C, 18, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_BLS31_24 CYGHWR_HAL_KINETIS_PIN(C, 19, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+
+#define CYGHWR_KINETIS_FB_PIN_CS5 CYGHWR_HAL_KINETIS_PIN(C, 16, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS4 CYGHWR_HAL_KINETIS_PIN(C, 17, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS2 CYGHWR_HAL_KINETIS_PIN(C, 18, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS3 CYGHWR_HAL_KINETIS_PIN(C, 19, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS1 CYGHWR_HAL_KINETIS_PIN(D, 0, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS0 CYGHWR_HAL_KINETIS_PIN(D, 1, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_CS0_LOW \
+ CYGHWR_HAL_KINETIS_PIN(D, 1, CYGHWR_HAL_KINETIS_PORT_PCR_MUX_GPIO, \
+ CYGHWR_HAL_KINETIS_PORT_PCR_PE_M)
+
+#define CYGHWR_KINETIS_FB_PIN_TSIZ0 CYGHWR_HAL_KINETIS_PIN(C, 16, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_TSIZ1 CYGHWR_HAL_KINETIS_PIN(C, 17, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_TST CYGHWR_HAL_KINETIS_PIN(C, 18, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_ALE CYGHWR_HAL_KINETIS_PIN(D, 0, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+#define CYGHWR_KINETIS_FB_PIN_TS CYGHWR_HAL_KINETIS_PIN(D, 0, KINETIS_PIN_FB, KINETIS_PIN_FB_OPT)
+
+#define CYGHWR_KINETIS_FB_PIN_TA CYGHWR_HAL_KINETIS_PIN(C, 19, KINETIS_PIN_FB6, KINETIS_PIN_FB_OPT)
+
+//-----------------------------------------------------------------------------
+// end of flexbus.h
+#endif // CYGONCE_FLEXBUS_H
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.h
new file mode 100644
index 0000000..daf0474
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.h
@@ -0,0 +1,32 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_sram_l (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_l_SIZE (CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_l_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_sram (0x20000000)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FBR_CACHED_BASE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramcod (CYGHWR_HAL_KINETIS_FBR_CODE_BASE)
+#define CYGMEM_REGION_ramcod_SIZE (CYGHWR_HAL_KINETIS_FBR_CODE_SIZE)
+#define CYGMEM_REGION_ramcod_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramnc (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE)
+#define CYGMEM_REGION_ramnc_SIZE (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE)
+#define CYGMEM_REGION_ramnc_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 (CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1))
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.ldi
new file mode 100644
index 0000000..6095daa
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_ram.ldi
@@ -0,0 +1,41 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+ sram_l : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_SIZE
+ sram : ORIGIN = 0x20000000, LENGTH = CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+ ramcod : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CODE_SIZE
+ ram : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ ramnc : ORIGIN = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ USER_SECTION (code_sram, sram_l, 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE + 0x400 + 0x100, LMA_EQ_VMA)
+ SECTION_sram (sram, 0x20000000, LMA_EQ_VMA)
+ SECTION_rom_vectors (ramcod, CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LMA_EQ_VMA)
+ SECTION_RELOCS (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (ram, CYGHWR_HAL_KINETIS_FBR_CACHED_BASE+CYGHWR_MEMORY_RAM_RESERVED, LMA_EQ_VMA)
+ SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ USER_SECTION (noncache, ramnc, CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE (NOLOAD), LMA_EQ_VMA)
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = 0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE;
+
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h
new file mode 100644
index 0000000..a00ce95
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.h
@@ -0,0 +1,40 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_sram_l (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_l_SIZE (CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_l_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_sram (0x20000000)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_flash (0x00000000)
+#define CYGMEM_REGION_flash_SIZE (CYGHWR_HAL_KINETIS_FLASH_SIZE)
+#define CYGMEM_REGION_flash_ATTR (CYGMEM_REGION_ATTR_R)
+
+#define CYGMEM_REGION_ramcod (CYGHWR_HAL_KINETIS_FBR_CODE_BASE)
+#define CYGMEM_REGION_ramcod_SIZE (CYGHWR_HAL_KINETIS_FBR_CODE_SIZE)
+#define CYGMEM_REGION_ramcod_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FBR_CACHED_BASE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+//#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FBR_BASE)
+//#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE)
+//#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramnc (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE)
+#define CYGMEM_REGION_ramnc_SIZE (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE)
+#define CYGMEM_REGION_ramnc_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 (CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1))
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi
new file mode 100644
index 0000000..3888a13
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_sram2s_extram_rom.ldi
@@ -0,0 +1,49 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+ sram_l : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE
+ sram : ORIGIN = 0x20000000, LENGTH = CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+ ramcod : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CODE_SIZE
+ ram : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE
+ ramnc : ORIGIN = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (flash, 0x00000000, LMA_EQ_VMA)
+ USER_SECTION(kinetis_misc, flash, ALIGN (0x8), LMA_EQ_VMA)
+
+ // Kinetis FLASH configuration field. Must be present at 0x00000400
+ // Warning: Omitting FLASH configuration field or moving it to
+ // other location may lock Kinetis controller.
+ // See src/kinetis_mis.c for definition
+
+ .flash_conf 0x00000400 : { KEEP (*(.flash_conf)) } > flash
+
+ SECTION_RELOCS (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata1 (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (flash, ALIGN (0x8), LMA_EQ_VMA)
+ USER_SECTION (code_sram, sram_l, 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE + 0x400 (NOLOAD), LMA_EQ_VMA)
+ SECTION_sram (sram, 0x20000000, FOLLOWING (.got))
+ SECTION_data (ram, CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, FOLLOWING (.sram))
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ USER_SECTION (noncache, ramnc, CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE (NOLOAD), LMA_EQ_VMA)
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = (0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.h
new file mode 100644
index 0000000..53dceb8
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.h
@@ -0,0 +1,26 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FB_EXTRAM_BASE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FB_EXTRAM_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_sram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_flash (0x00000000)
+#define CYGMEM_REGION_flash_SIZE (CYGHWR_HAL_KINETIS_FLASH_SIZE)
+#define CYGMEM_REGION_flash_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/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.ldi
new file mode 100644
index 0000000..f8330ee
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram.ldi
@@ -0,0 +1,35 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+ ram : ORIGIN = CYGHWR_HAL_KINETIS_FB_EXTRAM_BASE, LENGTH = CYGHWR_HAL_KINETIS_FB_EXTRAM_SIZE
+ sram : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (ram, 0x20000400 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LMA_EQ_VMA)
+ SECTION_RELOCS (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_sram (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = 0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE;
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.h
new file mode 100644
index 0000000..b466a08
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.h
@@ -0,0 +1,28 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_sram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FBR_CACHED_BASE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramcod (CYGHWR_HAL_KINETIS_FBR_CODE_BASE)
+#define CYGMEM_REGION_ramcod_SIZE (CYGHWR_HAL_KINETIS_FBR_CODE_SIZE)
+#define CYGMEM_REGION_ramcod_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramnc (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE)
+#define CYGMEM_REGION_ramnc_SIZE (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE)
+#define CYGMEM_REGION_ramnc_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 (CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1))
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.ldi
new file mode 100644
index 0000000..bab581b
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_ram.ldi
@@ -0,0 +1,39 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+
+MEMORY
+{
+ sram : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+ ramcod : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CODE_SIZE
+ ram : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ ramnc : ORIGIN = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_sram (sram, 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE + 0x400 + 0x100, LMA_EQ_VMA)
+ SECTION_rom_vectors (ramcod, CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LMA_EQ_VMA)
+ SECTION_RELOCS (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (ram, CYGHWR_HAL_KINETIS_FBR_CACHED_BASE + CYGHWR_MEMORY_RAM_RESERVED, LMA_EQ_VMA)
+ SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (ramcod, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ USER_SECTION (noncache, ramnc, CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE (NOLOAD), LMA_EQ_VMA)
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = 0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE;
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h
new file mode 100644
index 0000000..5c6db56
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.h
@@ -0,0 +1,32 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_sram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_flash (0x00000000)
+#define CYGMEM_REGION_flash_SIZE (CYGHWR_HAL_KINETIS_FLASH_SIZE)
+#define CYGMEM_REGION_flash_ATTR (CYGMEM_REGION_ATTR_R)
+
+#define CYGMEM_REGION_ramcod (CYGHWR_HAL_KINETIS_FBR_CODE_BASE)
+#define CYGMEM_REGION_ramcod_SIZE (CYGHWR_HAL_KINETIS_FBR_CODE_SIZE)
+#define CYGMEM_REGION_ramcod_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ram (CYGHWR_HAL_KINETIS_FBR_CACHED_BASE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ramnc (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE)
+#define CYGMEM_REGION_ramnc_SIZE (CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE)
+#define CYGMEM_REGION_ramnc_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 (CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1))
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi
new file mode 100644
index 0000000..b43ce41
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_extram_rom.ldi
@@ -0,0 +1,47 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+ sram : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+ ramcod : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CODE_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CODE_SIZE
+ ram : ORIGIN = CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_CACHED_SIZE
+ ramnc : ORIGIN = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE, LENGTH = CYGHWR_HAL_KINETIS_FBR_NON_CACHED_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (flash, 0x00000000, LMA_EQ_VMA)
+ USER_SECTION(kinetis_misc, flash, ALIGN (0x8), LMA_EQ_VMA)
+
+ // Kinetis FLASH configuration field. Must be present at 0x00000400
+ // Warning: Omitting FLASH configuration field or moving it to
+ // other location may lock Kinetis controller.
+ // See src/kinetis_mis.c for definition
+
+ .flash_conf 0x00000400 : { KEEP (*(.flash_conf)) } > flash
+
+ SECTION_RELOCS (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata1 (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_sram (sram, 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE + 0x400, FOLLOWING (.got))
+ SECTION_data (ram, CYGHWR_HAL_KINETIS_FBR_CACHED_BASE, FOLLOWING (.sram))
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ USER_SECTION (noncache, ramnc, CYGHWR_HAL_KINETIS_FBR_NON_CACHED_BASE (NOLOAD), LMA_EQ_VMA)
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = 0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE;
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.h
new file mode 100644
index 0000000..5370f8f
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.h
@@ -0,0 +1,24 @@
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_sram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_sram_SIZE (CYGHWR_HAL_KINETIS_SRAM_SIZE)
+#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_ram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
+#define CYGMEM_REGION_ram_SIZE (CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+
+#define CYGMEM_REGION_flash (0x00000000)
+#define CYGMEM_REGION_flash_SIZE (CYGHWR_HAL_KINETIS_FLASH_SIZE)
+#define CYGMEM_REGION_flash_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/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.ldi b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.ldi
new file mode 100644
index 0000000..e74d8a9
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/pkgconf/mlt_kinetis_flash_unisram_ram.ldi
@@ -0,0 +1,43 @@
+// eCos memory layout
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+ ram : ORIGIN = 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE, LENGTH = CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
+ flash : ORIGIN = 0x00000000, LENGTH = CYGHWR_HAL_KINETIS_FLASH_SIZE
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (flash, 0x00000000, LMA_EQ_VMA)
+ USER_SECTION(kinetis_misc, flash, ALIGN (0x8), LMA_EQ_VMA)
+
+ // Kinetis FLASH security configuration. Must be present at 0x00000400
+ // Warning: Omitting FLASH security configuration or moving it to
+ // other location may lock Kinetis controller.
+ // See src/kinetis_mis.c for definition
+
+ .flash_security 0x00000400 : { KEEP (*(.flash_security)) } > flash
+
+ SECTION_RELOCS (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_text (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fini (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_rodata1 (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_fixup (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_gcc_except_table (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_eh_frame (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_got (flash, ALIGN (0x8), LMA_EQ_VMA)
+ SECTION_data (ram, 0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE + 0x400, FOLLOWING (.got))
+ SECTION_sram (ram, ALIGN (0x8), FOLLOWING (.data))
+ SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+ SECTIONS_END
+}
+
+hal_vsr_table = (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE);
+hal_virtual_vector_table = hal_vsr_table + 128*4;
+hal_startup_stack = 0x20000000 + CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE;
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_arch.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_arch.h
new file mode 100644
index 0000000..329056b
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_arch.h
@@ -0,0 +1,63 @@
+#ifndef CYGONCE_HAL_PLF_ARCH_H
+#define CYGONCE_HAL_PLF_ARCH_H
+//=============================================================================
+//
+// plf_arch.h
+//
+// Platform specific architecture overrides
+//
+//=============================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2011 Free Software Foundation, 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.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+//
+// 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): ilijak
+// Contributor(s):
+// Date: 2011-02-05
+// Purpose: TWR-K60N512-FXM platform specific architecture overrides
+// Description:
+// Usage: #include <cyg/hal/plf_arch.h>
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+#include <pkgconf/hal.h>
+#include <pkgconf/hal_cortexm_kinetis_twr_k60n512_fxm.h>
+
+
+//=============================================================================
+
+//-----------------------------------------------------------------------------
+// end of plf_arch.h
+#endif // CYGONCE_HAL_PLF_ARCH_H
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_intr.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_intr.h
new file mode 100644
index 0000000..a443eed
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_intr.h
@@ -0,0 +1,62 @@
+#ifndef CYGONCE_HAL_PLF_INTR_H
+#define CYGONCE_HAL_PLF_INTR_H
+//=============================================================================
+//
+// plf_intr.h
+//
+// Platform specific interrupt overrides
+//
+//=============================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2011 Free Software Foundation, 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.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+//
+// 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): ilijak
+// Date: 2011-02-05
+// Purpose: TWR-K60N512-FXM platform specific interrupt overrides
+// Description:
+// Usage: #include <cyg/hal/plf_intr.h>
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+#include <pkgconf/hal.h>
+#include <pkgconf/hal_cortexm_kinetis_twr_k60n512_fxm.h>
+
+
+//=============================================================================
+
+//-----------------------------------------------------------------------------
+// end of plf_intr.h
+#endif // CYGONCE_HAL_PLF_INTR_H
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_io.h b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_io.h
new file mode 100644
index 0000000..6b2ddab
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/include/plf_io.h
@@ -0,0 +1,194 @@
+#ifndef CYGONCE_HAL_PLF_IO_H
+#define CYGONCE_HAL_PLF_IO_H
+//=============================================================================
+//
+// plf_io.h
+//
+// Platform specific registers
+//
+//=============================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2011 Free Software Foundation, 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.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+//
+// 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): ilijak
+// Date: 2011-02-05
+// Purpose: TWR-K60N512 platform specific registers
+// Description:
+// Usage: #include <cyg/hal/plf_io.h>
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+#include <pkgconf/hal.h>
+#include <pkgconf/hal_cortexm_kinetis_twr_k60n512_fxm.h>
+
+// UART PINs
+
+#ifndef CYGHWR_HAL_FREESCALE_UART3_PIN_RX
+# if 0
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_RX CYGHWR_HAL_KINETIS_PIN(E, 5, 3, 0)
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_TX CYGHWR_HAL_KINETIS_PIN(E, 4, 3, 0)
+# elif 0
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_RX CYGHWR_HAL_KINETIS_PIN(C, 16, 3, 0)
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_TX CYGHWR_HAL_KINETIS_PIN(C, 17, 3, 0)
+# else
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_RX CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_TX CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+# endif
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_RTS CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+# define CYGHWR_HAL_FREESCALE_UART3_PIN_CTS CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+
+# if 0
+# define CYGHWR_IO_FREESCALE_UART3_PIN_RX CYGHWR_HAL_FREESCALE_UART3_PIN_RX
+# define CYGHWR_IO_FREESCALE_UART3_PIN_TX CYGHWR_HAL_FREESCALE_UART3_PIN_TX
+# define CYGHWR_IO_FREESCALE_UART3_PIN_RTS CYGHWR_HAL_FREESCALE_UART3_PIN_RTS
+# define CYGHWR_IO_FREESCALE_UART3_PIN_CTS CYGHWR_HAL_FREESCALE_UART3_PIN_CTS
+# endif
+#endif
+
+#if 1
+#ifndef CYGHWR_HAL_FREESCALE_UART4_PIN_RX
+# define CYGHWR_HAL_FREESCALE_UART4_PIN_RX CYGHWR_HAL_KINETIS_PIN(E, 25, 3, 0)
+# define CYGHWR_HAL_FREESCALE_UART4_PIN_TX CYGHWR_HAL_KINETIS_PIN(E, 24, 3, 0)
+# define CYGHWR_HAL_FREESCALE_UART4_PIN_RTS CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+# define CYGHWR_HAL_FREESCALE_UART4_PIN_CTS CYGHWR_HAL_KINETIS_PORT_PIN_NONE
+
+
+# define CYGHWR_IO_FREESCALE_UART4_PIN_RX CYGHWR_HAL_FREESCALE_UART4_PIN_RX
+# define CYGHWR_IO_FREESCALE_UART4_PIN_TX CYGHWR_HAL_FREESCALE_UART4_PIN_TX
+# define CYGHWR_IO_FREESCALE_UART4_PIN_RTS CYGHWR_HAL_FREESCALE_UART4_PIN_RTS
+# define CYGHWR_IO_FREESCALE_UART4_PIN_CTS CYGHWR_HAL_FREESCALE_UART4_PIN_CTS
+
+#endif
+#endif
+
+
+// ENET PINs
+
+// MDIO
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_MDIO CYGHWR_HAL_KINETIS_PIN(B, 0, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_MDC CYGHWR_HAL_KINETIS_PIN(B, 1, 4, 0)
+// Both RMII and MII interface
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_RXER CYGHWR_HAL_KINETIS_PIN(A, 5, 4, \
+ CYGHWR_HAL_KINETIS_PORT_PCR_PE_M)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_RXD1 CYGHWR_HAL_KINETIS_PIN(A, 12, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_RXD0 CYGHWR_HAL_KINETIS_PIN(A, 13, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_TXEN CYGHWR_HAL_KINETIS_PIN(A, 15, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_TXD0 CYGHWR_HAL_KINETIS_PIN(A, 16, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_TXD1 CYGHWR_HAL_KINETIS_PIN(A, 17, 4, 0)
+// RMII interface only
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_RMII0_CRS_DV CYGHWR_HAL_KINETIS_PIN(A, 14, 4, 0)
+// MII interface only
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_RXD3 CYGHWR_HAL_KINETIS_PIN(A, 9, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_RXD2 CYGHWR_HAL_KINETIS_PIN(A, 10, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_RXCLK CYGHWR_HAL_KINETIS_PIN(A, 11, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_TXD2 CYGHWR_HAL_KINETIS_PIN(A, 24, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_TXCLK CYGHWR_HAL_KINETIS_PIN(A, 25, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_TXD3 CYGHWR_HAL_KINETIS_PIN(A, 26, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_CRS CYGHWR_HAL_KINETIS_PIN(A, 27, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MIIO_TXER CYGHWR_HAL_KINETIS_PIN(A, 28, 4, 0)
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_MII0_COL CYGHWR_HAL_KINETIS_PIN(A, 29, 4, 0)
+// IEEE 1588 timers
+#define CYGHWR_IO_FREESCALE_ENET0_PIN_1588_CLKIN CYGHWR_HAL_KINETIS_PIN(E, 26, 4, 0)
+
+#if defined(CYGHWR_HAL_FREESCALE_ENET_E0_1588_PORT_B)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR0 CYGHWR_HAL_KINETIS_PIN(B, 2, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR1 CYGHWR_HAL_KINETIS_PIN(B, 3, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR2 CYGHWR_HAL_KINETIS_PIN(B, 4, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR3 CYGHWR_HAL_KINETIS_PIN(B, 5, 4, 0)
+#elif defined(CYGHWR_HAL_FREESCALE_ENET_E0_1588_PORT_C)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR0 CYGHWR_HAL_KINETIS_PIN(C, 16, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR1 CYGHWR_HAL_KINETIS_PIN(C, 17, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR2 CYGHWR_HAL_KINETIS_PIN(C, 18, 4, 0)
+# define CYGHWR_IO_FREESCALE_ENET0_PIN_E0_1588_TMR3 CYGHWR_HAL_KINETIS_PIN(C, 19, 4, 0)
+#endif
+
+// FlexBus Memory
+#define CYGHWR_HAL_FB_CSPMCR_G1_SEL CYGHWR_HAL_FB_CSPMCR_G1_TS
+#define CYGHWR_HAL_FB_CSPMCR_G2_SEL CYGHWR_HAL_FB_CSPMCR_G2_BE_31_24
+#define CYGHWR_HAL_FB_CSPMCR_G3_SEL CYGHWR_HAL_FB_CSPMCR_G3_BE_23_16
+#define CYGHWR_HAL_FB_CSPMCR_G4_SEL CYGHWR_HAL_FB_CSPMCR_G4_CS2
+#define CYGHWR_HAL_FB_CSPMCR_G5_SEL CYGHWR_HAL_FB_CSPMCR_G5_TA
+
+#define CYGHWR_HAL_FB_CSPMCR_SETSEL (CYGHWR_HAL_FB_CSPMCR_G1_SEL + \
+ CYGHWR_HAL_FB_CSPMCR_G2_SEL + \
+ CYGHWR_HAL_FB_CSPMCR_G3_SEL + \
+ CYGHWR_HAL_FB_CSPMCR_G4_SEL + \
+ CYGHWR_HAL_FB_CSPMCR_G5_SEL )
+
+// DSPI
+// DSPI Pins
+
+#define KINETIS_PIN_SPI1_OUT_OPT (CYGHWR_HAL_KINETIS_PORT_PCR_DSE_M)
+
+#define KINETIS_PIN_SPI1_CS_OPT (CYGHWR_HAL_KINETIS_PORT_PCR_DSE_M)
+
+#define KINETIS_PIN_SPI1_IN_OPT (CYGHWR_HAL_KINETIS_PORT_PCR_PE_M | \
+ CYGHWR_HAL_KINETIS_PORT_PCR_PS_M)
+
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_SIN CYGHWR_HAL_KINETIS_PIN(E, 3, 2, KINETIS_PIN_SPI1_IN_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_SOUT CYGHWR_HAL_KINETIS_PIN(E, 1, 2, KINETIS_PIN_SPI1_OUT_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_SCK CYGHWR_HAL_KINETIS_PIN(E, 2, 2, KINETIS_PIN_SPI1_OUT_OPT)
+
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS0 CYGHWR_HAL_KINETIS_PIN(E, 4, 2, KINETIS_PIN_SPI1_CS_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS1 CYGHWR_HAL_KINETIS_PIN(E, 0, 2, KINETIS_PIN_SPI1_CS_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS2 CYGHWR_HAL_KINETIS_PIN(E, 5, 2, KINETIS_PIN_SPI1_CS_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS3 CYGHWR_HAL_KINETIS_PIN(E, 6, 2, KINETIS_PIN_SPI1_CS_OPT)
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS4 CYGHWR_HAL_KINETIS_PIN_NONE
+#define CYGHWR_IO_FREESCALE_SPI1_PIN_CS5 CYGHWR_HAL_KINETIS_PIN_NONE
+
+// I2C
+// I2C Pins
+
+# define CYGHWR_IO_I2C_FREESCALE_I2C0_PIN_SDA CYGHWR_HAL_KINETIS_PIN(D, 9, 2, 0)
+# define CYGHWR_IO_I2C_FREESCALE_I2C0_PIN_SCL CYGHWR_HAL_KINETIS_PIN(D, 8, 2, 0)
+
+//=============================================================================
+// Memory access checks.
+//
+// Accesses to areas not backed by real devices or memory can cause
+// the CPU to hang. These macros allow the GDB stubs to avoid making
+// accidental accesses to these areas.
+
+__externC int cyg_hal_stub_permit_data_access( void* addr, cyg_uint32 count );
+
+#define CYG_HAL_STUB_PERMIT_DATA_READ(_addr_, _count_) cyg_hal_stub_permit_data_access( _addr_, _count_ )
+
+#define CYG_HAL_STUB_PERMIT_DATA_WRITE(_addr_, _count_ ) cyg_hal_stub_permit_data_access( _addr_, _count_ )
+
+
+//-----------------------------------------------------------------------------
+// end of plf_io.h
+#endif // CYGONCE_HAL_PLF_IO_H
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/misc/redboot_K60_FXM_SST25XX_ROM.ecm b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/misc/redboot_K60_FXM_SST25XX_ROM.ecm
new file mode 100644
index 0000000..59dd5b0
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/misc/redboot_K60_FXM_SST25XX_ROM.ecm
@@ -0,0 +1,81 @@
+# Redboot minimal configuration
+# Target: TWR-K70F120M
+# Startup: ROM with external RAM
+
+
+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 "RedBoot Kinetis TWR-K60N512-FXM" ;
+ package CYGPKG_IO_FLASH current ;
+ package CYGPKG_IO_ETH_DRIVERS current ;
+};
+
+cdl_component CYGHWR_DEVS_FLASH_SPI_SST25XX_DEV0 {
+ user_value 1
+};
+
+cdl_option CYGNUM_HAL_CORTEXM_KINETIS_MCGOUT_FREQ_SP {
+ user_value 100000000
+};
+
+cdl_option CYGNUM_REDBOOT_FLASH_CONFIG_SIZE {
+ user_value 16384
+};
+
+cdl_option CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG {
+ user_value 0
+};
+
+#cdl_option CYGBLD_REDBOOT_LOAD_INTO_FLASH {
+# user_value 1
+#};
+
+cdl_option CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK {
+ user_value -4
+};
+
+cdl_option CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK {
+ user_value -8
+};
+
+#cdl_option CYGNUM_REDBOOT_FIS_DIRECTORY_ENTRY_COUNT {
+# user_value 16
+#};
+
+#cdl_option CYGNUM_REDBOOT_FLASH_RESERVED_BASE {
+# user_value 0x20000
+#};
+
+cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK {
+ user_value 0
+};
+
+cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
+ user_value 4096
+};
+
+cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
+ user_value 0
+};
+
+cdl_option CYGDBG_HAL_CRCTABLE_LOCATION {
+ user_value ROM
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+ user_value 1
+};
+
+cdl_component CYGPKG_DEVS_ETH_FREESCALE_ENET_REDBOOT_HOLDS_ESA {
+ user_value 1
+};
+
+
diff --git a/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/src/twr_k60n512_fxm_misc.c b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/src/twr_k60n512_fxm_misc.c
new file mode 100644
index 0000000..5a17836
--- /dev/null
+++ b/ecos/packages/hal/cortexm/kinetis/twr_k60n512_fxm/current/src/twr_k60n512_fxm_misc.c
@@ -0,0 +1,446 @@
+//==========================================================================
+//
+// twr_k60n512_fxm_misc.c
+//
+// Cortex-M3 TWR-K60N512 EVAL + TWR_FXM HAL functions
+//
+//==========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2008 Free Software Foundation, 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.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2.
+//
+// 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): ilijak
+// Contributor(s):
+// Date: 2011-02-05
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/hal.h>
+#include <pkgconf/hal_cortexm.h>
+#include <pkgconf/hal_cortexm_kinetis.h>
+#include <pkgconf/hal_cortexm_kinetis_twr_k60n512_fxm.h>
+#ifdef CYGPKG_KERNEL
+#include <pkgconf/kernel.h>
+#endif
+
+#include <cyg/infra/diag.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/infra/cyg_trac.h> // tracing macros
+#include <cyg/infra/cyg_ass.h> // assertion macros
+
+#include <cyg/hal/hal_arch.h> // HAL header
+#include <cyg/hal/hal_intr.h> // HAL header
+
+#ifdef CYGPKG_HAL_CORTEXM_KINETIS_FLEXBUS
+#include <cyg/hal/hal_kinetis_flexbus.h>
+#include <cyg/devs/ram_micron_cellularram.h>
+
+// Dependent on FlexBus memory properties up to two flexbus setting stages
+// may be needed
+
+// Macro for final setting of CSCR
+// Final settings take place when system clock is completely initialized and
+// it is possible to program FlexBus memory with desired setting.
+#define CYGHWR_HAL_FB_CSCR(__bits,__cs) \
+ VALUE_(CYGHWR_HAL_FB_CSCR_##__bits##_S, \
+ CYGHWR_HAL_KINETIS_FB_CS##__cs##_CR_##__bits)
+
+#define CYGHWR_HAL_KINETIS_FB_CS_CR(__cs) ( CYGHWR_HAL_FB_CSCR(SWS, __cs) + \
+ CYGHWR_HAL_FB_CSCR(SWSEN, __cs) + CYGHWR_HAL_FB_CSCR(EXALE, __cs) + \
+ CYGHWR_HAL_FB_CSCR(ASET, __cs) + CYGHWR_HAL_FB_CSCR(RDAH, __cs) + \
+ CYGHWR_HAL_FB_CSCR(WRAH, __cs) + CYGHWR_HAL_FB_CSCR(WS, __cs) + \
+ CYGHWR_HAL_FB_CSCR(BLS, __cs) + CYGHWR_HAL_FB_CSCR(AA, __cs) + \
+ CYGHWR_HAL_FB_CSCR(PS, __cs) + CYGHWR_HAL_FB_CSCR(BEM, __cs) + \
+ CYGHWR_HAL_FB_CSCR(BSTR, __cs) + CYGHWR_HAL_FB_CSCR(BSTW, __cs))
+
+// Macros for initial settings of CSCR
+// Initial settings are used immediately after boot and make it possible to
+// utilize FlexBus memory with it's power-up setting.
+#define CYGHWR_HAL_FB_CSCR_IS(__bits,__cs) \
+ VALUE_(CYGHWR_HAL_FB_CSCR_##__bits##_S, \
+ CYGHWR_HAL_KINETIS_FB_CS##__cs##_CR_IS_##__bits)
+
+#define CYGHWR_HAL_KINETIS_FB_CS_CR_IS(__cs) ( CYGHWR_HAL_FB_CSCR_IS(SWS, __cs) + \
+ CYGHWR_HAL_FB_CSCR_IS(SWSEN, __cs) + CYGHWR_HAL_FB_CSCR_IS(EXALE, __cs) + \
+ CYGHWR_HAL_FB_CSCR_IS(ASET, __cs) + CYGHWR_HAL_FB_CSCR_IS(RDAH, __cs) + \
+ CYGHWR_HAL_FB_CSCR_IS(WRAH, __cs) + CYGHWR_HAL_FB_CSCR_IS(WS, __cs) + \
+ CYGHWR_HAL_FB_CSCR(BLS, __cs) + CYGHWR_HAL_FB_CSCR_IS(AA, __cs) + \
+ CYGHWR_HAL_FB_CSCR(PS, __cs) + CYGHWR_HAL_FB_CSCR_IS(BEM, __cs) + \
+ CYGHWR_HAL_FB_CSCR_IS(BSTR, __cs) + CYGHWR_HAL_FB_CSCR_IS(BSTW, __cs))
+
+// Functions for final and initial FlexBus setting
+// Description is with the code below.
+static inline void hal_flexbus_init_initial(void);
+static inline void hal_flexbus_init_final(void);
+#endif // CYGPKG_HAL_CORTEXM_KINETIS_FLEXBUS
+
+static inline void hal_misc_init(void);
+
+// DATA and BSS locations
+__externC cyg_uint32 __ram_data_start;
+__externC cyg_uint32 __ram_data_end;
+__externC cyg_uint32 __rom_data_start;
+__externC cyg_uint32 __sram_data_start;
+__externC cyg_uint32 __sram_data_end;
+__externC cyg_uint32 __srom_data_start;
+__externC cyg_uint32 __bss_start;
+__externC cyg_uint32 __bss_end;
+
+//==========================================================================
+// System init
+//
+// This is run to set up the basic system, including GPIO setting,
+// clock feeds, power supply, and memory initialization. This code
+// runs before the DATA is copied from ROM and the BSS cleared, hence
+// it cannot make use of static variables or data tables.
+
+__externC void CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION_ATTR
+hal_system_init( void )
+{
+#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_SRAM)
+ hal_wdog_disable();
+ hal_misc_init();
+# ifdef CYGPKG_HAL_CORTEXM_KINETIS_FLEXBUS
+ {
+ // This delay is needed for Micron RAM wake-up.
+ cyg_uint32 busy_delay;
+ for(busy_delay = 0x100000; busy_delay; busy_delay--)
+ __asm__ volatile ("nop\n");
+
+ hal_flexbus_init_initial();
+
+ hal_start_clocks();
+
+ for(busy_delay = 0x100000; busy_delay; busy_delay--)
+ __asm__ volatile ("nop\n");
+
+ hal_flexbus_init_final();
+ }
+# else
+ hal_start_clocks();
+# endif
+#endif
+}
+
+//===========================================================================
+// hal_misc_init
+//===========================================================================
+#define CYGHWR_HAL_KINETIS_SIM_SCGC5_PORT_M \
+ (CYGHWR_HAL_KINETIS_SIM_SCGC5_PORTA_M | \
+ CYGHWR_HAL_KINETIS_SIM_SCGC5_PORTB_M | \
+ CYGHWR_HAL_KINETIS_SIM_SCGC5_PORTC_M | \
+ CYGHWR_HAL_KINETIS_SIM_SCGC5_PORTD_M | \
+ CYGHWR_HAL_KINETIS_SIM_SCGC5_PORTE_M)
+
+static inline void CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION_ATTR
+hal_misc_init(void)
+{
+ cyghwr_hal_kinetis_sim_t *sim_p = CYGHWR_HAL_KINETIS_SIM_P;
+ cyghwr_hal_kinetis_mpu_t *mpu_p = CYGHWR_HAL_KINETIS_MPU_P;
+
+ // Enable some peripherals' clocks.
+ sim_p->scgc5 |= CYGHWR_HAL_KINETIS_SIM_SCGC5_PORT_M;
+ sim_p->scgc6 |= CYGHWR_HAL_KINETIS_SIM_SCGC6_RTC_M;
+
+ // Disable MPU
+ mpu_p->cesr = 0;
+}
+
+#ifdef CYGPKG_HAL_CORTEXM_KINETIS_FLEXBUS
+
+// FlexBus
+
+static const cyg_uint32 const flexbus_pins[] = {
+ CYGHWR_KINETIS_FB_PIN_CLKOUT_OFF,
+
+ CYGHWR_KINETIS_FB_PIN_CS0,
+ CYGHWR_KINETIS_FB_PIN_OE,
+ CYGHWR_KINETIS_FB_PIN_RW,
+# if 0 //(CYGHWR_HAL_KINETIS_FB_CS_CR(0) & CYGHWR_HAL_FB_CSCR_BLS_M)
+ CYGHWR_KINETIS_FB_PIN_BLS7_0,
+ CYGHWR_KINETIS_FB_PIN_BLS15_8,
+# else
+ CYGHWR_KINETIS_FB_PIN_BE23_16,
+ CYGHWR_KINETIS_FB_PIN_BE31_24,
+# endif
+ CYGHWR_KINETIS_FB_PIN_TS,
+
+ CYGHWR_KINETIS_FB_PIN_AD0,
+ CYGHWR_KINETIS_FB_PIN_AD1,
+ CYGHWR_KINETIS_FB_PIN_AD2,
+ CYGHWR_KINETIS_FB_PIN_AD3,
+ CYGHWR_KINETIS_FB_PIN_AD4,
+ CYGHWR_KINETIS_FB_PIN_AD5,
+ CYGHWR_KINETIS_FB_PIN_AD6,
+ CYGHWR_KINETIS_FB_PIN_AD7,
+ CYGHWR_KINETIS_FB_PIN_AD8,
+ CYGHWR_KINETIS_FB_PIN_AD9,
+ CYGHWR_KINETIS_FB_PIN_AD10,
+ CYGHWR_KINETIS_FB_PIN_AD11,
+ CYGHWR_KINETIS_FB_PIN_AD12,
+ CYGHWR_KINETIS_FB_PIN_AD13,
+ CYGHWR_KINETIS_FB_PIN_AD14,
+ CYGHWR_KINETIS_FB_PIN_AD15,
+ CYGHWR_KINETIS_FB_PIN_AD16,
+ CYGHWR_KINETIS_FB_PIN_AD17
+# if CYGHWR_HAL_KINETIS_FB_CS0_SIZE > 0x00040000
+ ,
+ CYGHWR_KINETIS_FB_PIN_AD18,
+ CYGHWR_KINETIS_FB_PIN_AD19,
+ CYGHWR_KINETIS_FB_PIN_AD20,
+ CYGHWR_KINETIS_FB_PIN_AD21
+# if CYGHWR_HAL_KINETIS_FB_CS0_SIZE > 0x00400000
+ ,
+ CYGHWR_KINETIS_FB_PIN_AD22,
+ CYGHWR_KINETIS_FB_PIN_AD23
+# if 0 //!(CYGHWR_HAL_KINETIS_FB_CS_CR(0) & CYGHWR_HAL_FB_CSCR_BLS_M)
+ ,
+ CYGHWR_KINETIS_FB_PIN_AD24,
+ CYGHWR_KINETIS_FB_PIN_AD25,
+ CYGHWR_KINETIS_FB_PIN_AD26,
+ CYGHWR_KINETIS_FB_PIN_AD27,
+ CYGHWR_KINETIS_FB_PIN_AD28,
+ CYGHWR_KINETIS_FB_PIN_AD29,
+ CYGHWR_KINETIS_FB_PIN_AD30,
+ CYGHWR_KINETIS_FB_PIN_AD31
+# endif
+# endif // CYGHWR_HAL_KINETIS_FB_CS0_SIZE > 0x00400000
+# endif // CYGHWR_HAL_KINETIS_FB_CS0_SIZE > 0x00040000
+};
+
+static const cyg_uint32 const flexbus_pins_final_diff[] = {
+ CYGHWR_KINETIS_FB_PIN_CLKOUT
+};
+
+// Initialize FlexBus for use until we have main clock.
+// Asynchronous mode.
+static inline void CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION_ATTR
+hal_flexbus_init_initial(void)
+{
+ cyghwr_hal_kinetis_fb_t *fb_p = CYGHWR_HAL_KINETIS_FB_P;
+
+ CYGHWR_IO_CLOCK_ENABLE(CYGHWR_HAL_KINETIS_SIM_SCGC_FLEXBUS);
+
+# ifdef CYGHWR_HAL_KINETIS_FB_CS0
+ fb_p->csel[0] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS0_AR,
+ CYGHWR_HAL_KINETIS_FB_CS0_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(0) };
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS1
+ fb_p->csel[1] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS1_AR,
+ CYGHWR_HAL_KINETIS_FB_CS1_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(1) };
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS2
+ fb_p->csel[2] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS2_AR,
+ CYGHWR_HAL_KINETIS_FB_CS2_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(2) };
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS3
+ fb_p->csel[3] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS3_AR,
+ CYGHWR_HAL_KINETIS_FB_CS3_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(3) };
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS4
+ fb_p->csel[4] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS4_AR,
+ CYGHWR_HAL_KINETIS_FB_CS4_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(4) };
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS4
+ fb_p->csel[5] = (cyghwr_hal_kinetis_fbcs_t) { CYGHWR_HAL_KINETIS_FB_CS5_AR,
+ CYGHWR_HAL_KINETIS_FB_CS5_MR, CYGHWR_HAL_KINETIS_FB_CS_CR_IS(5) };
+# endif
+
+ fb_p->cspmcr = CYGHWR_HAL_FB_CSPMCR_SETSEL;
+
+ HAL_SET_PINS(flexbus_pins);
+}
+
+// Initialize FlexBus to it's normal working condition
+// Synchronous mode with burst support
+static inline void CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION_ATTR
+hal_flexbus_init_final(void)
+{
+ cyghwr_hal_kinetis_fb_t *fb_p = CYGHWR_HAL_KINETIS_FB_P;
+
+ // Enable RAM synchronous/burst mode
+ ram_micron_reg_set(CYGHWR_DEVS_RAM_MICRON_BCR,
+ CYGHWR_RAM0_MICRON_BCR_SETTO,
+ (cyg_uint16 *)CYGHWR_HAL_KINETIS_FB_CS0_AR,
+ CYGHWR_RAM0_MICRON_CELLULAR_SIZE);
+
+ // Apply FlexBus clock...
+ HAL_SET_PINS(flexbus_pins_final_diff);
+
+ // ...and final CS setting for burst, etc.
+# ifdef CYGHWR_HAL_KINETIS_FB_CS0
+ fb_p->csel[0].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(0);
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS1
+ fb_p->csel[1].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(1);
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS2
+ fb_p->csel[2].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(2);
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS3
+ fb_p->csel[3].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(3);
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS4
+ fb_p->csel[4].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(4);
+# endif
+# ifdef CYGHWR_HAL_KINETIS_FB_CS5
+ fb_p->csel[5].cscr = CYGHWR_HAL_KINETIS_FB_CS_CR(5);
+# endif
+}
+
+#endif // CYGHWR_HAL_CORTEXM_KINETIS_FLEXBUS
+
+//==========================================================================
+
+__externC void hal_platform_init( void )
+{
+}
+
+//==========================================================================
+
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+
+#include CYGHWR_MEMORY_LAYOUT_H
+
+//--------------------------------------------------------------------------
+// Accesses to areas not backed by real devices or memory can cause
+// the CPU to hang.
+//
+// The following table defines the memory areas that GDB is allowed to
+// touch. All others are disallowed.
+// This table needs to be kept up to date with the set of memory areas
+// that are available on the board.
+
+static struct {
+ CYG_ADDRESS start; // Region start address
+ CYG_ADDRESS end; // End address (last byte)
+} hal_data_access[] =
+{
+ { CYGMEM_REGION_ram, CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE-1 }, // System bus RAM partition
+#if 1 //def CYGMEM_REGION_sram
+ { CYGMEM_REGION_sram, CYGMEM_REGION_sram+CYGMEM_REGION_sram_SIZE-1 }, // On-chip SRAM
+#elif defined CYGMEM_REGION_sram_l
+ { CYGMEM_REGION_sram_l, CYGMEM_REGION_sram_l+CYGMEM_REGION_sram_l_SIZE-1 }, // On-chip SRAM lower bank
+#endif
+#ifdef CYGMEM_REGION_ramcod
+ { CYGMEM_REGION_ramcod, CYGMEM_REGION_ramcod+CYGMEM_REGION_ramcod_SIZE-1 }, // Code bus RAM partition
+#endif
+#ifdef CYGMEM_REGION_ramnc
+ { CYGMEM_REGION_ramnc, CYGMEM_REGION_ramnc+CYGMEM_REGION_ramnc_SIZE-1 }, // Non cachable RAM partition
+#endif
+#ifdef CYGMEM_REGION_flash
+ { CYGMEM_REGION_flash, CYGMEM_REGION_flash+CYGMEM_REGION_flash_SIZE-1 }, // On-chip flash
+#endif
+#ifdef CYGMEM_REGION_rom
+ { CYGMEM_REGION_rom, CYGMEM_REGION_rom+CYGMEM_REGION_rom_SIZE-1 }, // External flash [currently none]
+#endif
+ { 0xE0000000, 0x00000000-1 }, // Cortex-M peripherals
+ { 0x40000000, 0x60000000-1 } // Chip specific peripherals
+};
+
+__externC int cyg_hal_stub_permit_data_access( void* addr, cyg_uint32 count )
+{
+ int i;
+ for( i = 0; i < sizeof(hal_data_access)/sizeof(hal_data_access[0]); i++ ) {
+ if( ((CYG_ADDRESS)addr >= hal_data_access[i].start) &&
+ ((CYG_ADDRESS)addr+count) <= hal_data_access[i].end)
+ return true;
+ }
+ return false;
+}
+
+#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+
+//==========================================================================
+
+#ifdef CYGPKG_REDBOOT
+#include <redboot.h>
+#include CYGHWR_MEMORY_LAYOUT_H
+
+//--------------------------------------------------------------------------
+// Memory layout
+//
+// We report the on-chip SRAM and external RAM.
+
+void
+cyg_plf_memory_segment(int seg, unsigned char **start, unsigned char **end)
+{
+ switch (seg) {
+ case 0:
+ *start = (unsigned char *)CYGMEM_REGION_ram;
+ *end = (unsigned char *)(CYGMEM_REGION_ram + CYGMEM_REGION_ram_SIZE);
+ break;
+#ifdef CYGMEM_REGION_sram
+ case 1:
+ *start = (unsigned char *)CYGMEM_REGION_sram;
+ *end = (unsigned char *)(CYGMEM_REGION_sram + CYGMEM_REGION_sram_SIZE);
+ break;
+#endif
+#ifdef CYGMEM_REGION_sram_l
+# define CASE_CODE 3
+# define CASE_RAMNC 4
+ case 2:
+ *start = (unsigned char *)CYGMEM_REGION_sram_l;
+ *end = (unsigned char *)(CYGMEM_REGION_sram_l + CYGMEM_REGION_sram_l_SIZE);
+ break;
+#else
+# define CASE_CODE 2
+# define CASE_RAMNC 3
+#endif
+
+#ifdef CYGMEM_REGION_ramcod
+ case CASE_CODE:
+ *start = (unsigned char *)CYGMEM_REGION_ramcod;
+ *end = (unsigned char *)(CYGMEM_REGION_ramcod + CYGMEM_REGION_ramcod_SIZE);
+ break;
+#endif
+
+#ifdef CYGMEM_REGION_ramnc
+ case CASE_RAMNC:
+ *start = (unsigned char *)CYGMEM_REGION_ramnc;
+ *end = (unsigned char *)(CYGMEM_REGION_ramnc + CYGMEM_REGION_ramnc_SIZE);
+ break;
+#endif
+ default:
+ *start = *end = NO_MEMORY;
+ break;
+ }
+} // cyg_plf_memory_segment()
+
+#endif // CYGPKG_REDBOOT
+
+//==========================================================================
+// EOF twr_k60n512_fxm_misc.c