Index: hal/arm/e7t/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/arm/e7t/current/ChangeLog,v retrieving revision 1.12 diff -u -5 -b -p -r1.12 ChangeLog --- hal/arm/e7t/current/ChangeLog 6 Oct 2003 16:29:49 -0000 1.12 +++ hal/arm/e7t/current/ChangeLog 8 Oct 2003 14:51:15 -0000 @@ -1,5 +1,38 @@ +2003-10-08 Chris Garry + + * cdl/hal_arm_e7t.cdl: + Added CYG_HAL_SUPPORT_E7TDBOARD and CYG_HAL_RAM_SELECT to + allow E7T-DBoard support to be controlled. + + * include/hal_platform_setup.h: + Added alternate definitiom for PLATFORM_SETUP1 for setting + up E7T with E7T-DBoard fitted. + + * src/e7t_misc.c: + Added extra code to support E7T-DBoard, including + cyg_plf_memory_segment() function to allow memory map + [segment] support for RedBoot. + + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_rom.h + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_rom.ldi + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_rom.mlt + New memory layout files for when E7T-DBoard support is enabled and + ROM startup type is selected. + + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sdram.h + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sdram.ldi + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sdram.mlt + New memory layout files for when E7T-DBoard support is enabled, + RAM startup type is selected and RAM selection is SDRAM. + + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sram.h + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sram.ldi + * hal/arm/e7t/current/include/pkgconf/mlt_arm_e7tdboard_sram.mlt + New memory layout files for when E7T-DBoard support is enabled, + RAM startup type is selected and RAM selection is SRAM. + 2003-10-06 Chris Garry * include/plf_io.h: Correct (unused) defines for E7T_ROMCON_BASE_MASK and E7T_ROMCON_NEXT_MASK. Index: hal/arm/e7t/current/include/hal_platform_setup.h =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/arm/e7t/current/include/hal_platform_setup.h,v retrieving revision 1.5 diff -u -5 -b -p -r1.5 hal_platform_setup.h --- hal/arm/e7t/current/include/hal_platform_setup.h 5 Nov 2002 02:31:12 -0000 1.5 +++ hal/arm/e7t/current/include/hal_platform_setup.h 8 Oct 2003 14:51:17 -0000 @@ -66,10 +66,12 @@ #undef CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE #define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 2048 #endif #if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) +#ifndef CYG_HAL_SUPPORT_E7TDBOARD +/* PLATFORM_SETUP1 define for Evaluator-7T without E7T-DBoard */ #define PLATFORM_SETUP1 ;\ ldr r1,=E7T_IOPMOD ;\ ldr r2,=0x0001fcf0 /* set led + seg to output */ ;\ str r2,[r1,#0x00] ;\ ldr r1,=E7T_IOPDATA ;\ @@ -127,10 +129,83 @@ .long 0x00000000 ;\ /* .long E7T_REFEXTCON */ ;\ .long 0x9c218360 ;\ ;\ 33: +#else +/* PLATFORM_SETUP1 define for Evaluator-7T with E7T-DBoard */ +#define PLATFORM_SETUP1 ;\ + ldr r1,=E7T_IOPMOD ;\ + ldr r2,=0x0001fcf0 /* set led + seg to output */ ;\ + str r2,[r1,#0x00] ;\ + ldr r1,=E7T_IOPDATA ;\ + ldr r2,=0x00000050 /* set leds */ ;\ + str r2,[r1,#0x00] ;\ + ldr r1,=E7T_SYSCFG /* Enable STM bit in SYSCGF reg */ ;\ + ldr r2,=0x87ffff91 ;\ + str r2,[r1] ;\ + ;\ +20: ldr lr,=33f ;\ + ldr r0,=12f ;\ + ldmia r0,{r1-r12} ;\ + ldr r0,=E7T_EXTDBWTH ;\ + stmia r0,{r1-r12} ;\ + mov pc,lr ;\ + ;\ + /* The below are set with a store-multiple instruction */ ;\ + /* Flash is 16 bit, SRAM is 32 bit */ ;\ + /* .long E7T_EXTDBWTH */ ;\ +12: .long ( (E7T_EXTDBWTH_16BIT<> 16) << E7T_ROMCON_BASE_shift) \ + |((0x01880000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\ + /* SRAM at 0x00000000-0x00400000, 5 cycles, 2 cycles */ ;\ + /* .long E7T_ROMCON1 */ ;\ + .long ( (E7T_ROMCON_PMC_ROM) \ + |(E7T_ROMCON_TPA_5C) \ + |(E7T_ROMCON_TACC_2C) \ + |((0x00000000 >> 16) << E7T_ROMCON_BASE_shift) \ + |((0x00040000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\ + /* SRAM at 0x00400000-0x00800000, 5 cycles, 2 cycles */ ;\ + /* .long E7T_ROMCON2 */ ;\ + .long ( (E7T_ROMCON_PMC_ROM) \ + |(E7T_ROMCON_TPA_5C) \ + |(E7T_ROMCON_TACC_2C) \ + |((0x00040000 >> 16) << E7T_ROMCON_BASE_shift) \ + |((0x00080000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\ + /* Below values are what Boot Monitor sets up */ ;\ + /* .long E7T_ROMCON3 */ ;\ + .long 0x08018020 ;\ + /* .long E7T_ROMCON4 */ ;\ + .long 0x0a020040 ;\ + /* .long E7T_ROMCON5 */ ;\ + .long 0x0c028040 ;\ + /* SDRAM at 0x01900000-0x03900000 */ ;\ + /* .long E7T_DRAMCON0 */ ;\ + .long ( 0x40000110 \ + | ((0x01900000 >> 16) << 10) \ + | ((0x03900000 >> 16) << 20)) ;\ + /* .long E7T_DRAMCON1 */ ;\ + .long 0x00000000 ;\ + /* .long E7T_DRAMCON2 */ ;\ + .long 0x00000000 ;\ + /* .long E7T_DRAMCON3 */ ;\ + .long 0x00000000 ;\ + /* .long E7T_REFEXTCON */ ;\ + .long ( 0x9EA78000 \ + | (0x03A00000 >> 16)) ;\ + ;\ +33: +#endif #else #define PLATFORM_SETUP1 #endif //----------------------------------------------------------------------------- Index: hal/arm/e7t/current/src/e7t_misc.c =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/arm/e7t/current/src/e7t_misc.c,v retrieving revision 1.4 diff -u -5 -b -p -r1.4 e7t_misc.c --- hal/arm/e7t/current/src/e7t_misc.c 23 May 2002 23:01:54 -0000 1.4 +++ hal/arm/e7t/current/src/e7t_misc.c 8 Oct 2003 14:51:18 -0000 @@ -66,10 +66,16 @@ #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT #include // HAL ISR support #endif #include // platform registers +#if defined(CYGPKG_REDBOOT) && defined(CYG_HAL_SUPPORT_E7TDBOARD) +#include // diag_printf() +#include CYGHWR_MEMORY_LAYOUT_H // CYGMEM_REGION_sdram +#include // NO_MEMORY +#endif + static cyg_uint32 _period; #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT static cyg_interrupt abort_interrupt; static cyg_handle_t abort_interrupt_handle; @@ -180,16 +186,27 @@ void hal_delay_us(cyg_int32 usecs) // Hardware init void hal_hardware_init(void) { cyg_uint32 intmask; +#ifdef CYG_HAL_SUPPORT_E7TDBOARD + HAL_WRITE_UINT32(E7T_EXTACON0, 0x00000049); // Setup times for FPGA interace + HAL_WRITE_UINT32(E7T_IOPCON, 0x00000018); // ExtInt0 is level triggered, active high +#endif + // Set up eCos/ROM interfaces hal_if_init(); // Enable cache +#ifndef CYG_HAL_SUPPORT_E7TDBOARD HAL_WRITE_UINT32(E7T_SYSCFG, 0x07FFFF80|E7T_SYSCFG_CM_0R_8C|E7T_SYSCFG_WE); +#else + // Note E7T_SYSCFG_SDM bit is first set in hal_platform_setup.h + HAL_WRITE_UINT32(E7T_SYSCFG, + 0x07FFFF80|E7T_SYSCFG_CM_0R_8C|E7T_SYSCFG_WE|E7T_SYSCFG_SDM); +#endif HAL_UCACHE_INVALIDATE_ALL(); HAL_UCACHE_ENABLE(); // Clear global interrupt mask bit HAL_READ_UINT32(E7T_INTMSK, intmask); @@ -254,8 +271,27 @@ void hal_interrupt_set_level(int vector, } void hal_show_IRQ(int vector, int data, int handler) { } + +#if defined(CYGPKG_REDBOOT) && defined(CYG_HAL_SUPPORT_E7TDBOARD) +// +// Memory map [segment] support for RedBoot +// +void +cyg_plf_memory_segment(int seg, unsigned char **start, unsigned char **end) +{ + if (seg == 1) { + *start = (unsigned char *)CYGMEM_REGION_sdram; + *end = (unsigned char *)(CYGMEM_REGION_sdram + CYGMEM_REGION_sdram_SIZE); + } else { + diag_printf("** Invalid memory segment #%d - ignored\n", seg); + *start = NO_MEMORY; + *end = NO_MEMORY; + } +} +#endif + //-------------------------------------------------------------------------- // EOF hal_misc.c Index: hal/arm/e7t/current/cdl/hal_arm_e7t.cdl =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/arm/e7t/current/cdl/hal_arm_e7t.cdl,v retrieving revision 1.6 diff -u -5 -b -p -r1.6 hal_arm_e7t.cdl --- hal/arm/e7t/current/cdl/hal_arm_e7t.cdl 24 Jul 2003 20:23:58 -0000 1.6 +++ hal/arm/e7t/current/cdl/hal_arm_e7t.cdl 8 Oct 2003 14:51:21 -0000 @@ -85,10 +85,34 @@ cdl_package CYGPKG_HAL_ARM_E7T { debug software such as Angel or eCos GDB stubs. Select 'rom' when building a stand-alone application which will be put into ROM." } + cdl_component CYG_HAL_SUPPORT_E7TDBOARD { + display "Include support for E7T-DBoard daughterboard" + flavor bool + default_value 0 + description " + Selecting this option includes support for the E7T-DBoard (daughterboard + for the Evaluator-7T containing ethernet PHY, FPGA and SDRAM)." + + cdl_option CYG_HAL_RAM_SELECT { + display "RAM selection" + active_if { CYG_HAL_STARTUP == "RAM" } + flavor data + default_value {"SDRAM"} + legal_values {"SDRAM" "SRAM"} + no_define + description " + This option specifies which RAM to use. Choices are the SDRAM + (32MB) on the E7T-DBoard or the SRAM (512KB) on the Evaluator-7T + board. The fixed_vectors section is placed in the SRAM regrdless + of this option. When support for E7T-DBoard is not enabled or + ROM Startup type is selected this option has no effect." + } + } + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { display "Number of communication channels on the board" flavor data calculated 2 } @@ -197,28 +221,37 @@ cdl_package CYGPKG_HAL_ARM_E7T { cdl_component CYGHWR_MEMORY_LAYOUT { display "Memory layout" flavor data no_define - calculated { (CYG_HAL_STARTUP == "RAM") ? "arm_e7t_ram" : "arm_e7t_rom" } - + calculated { ((CYG_HAL_STARTUP == "RAM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "arm_e7t_ram" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SDRAM")) ? "arm_e7tdboard_sdram" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SRAM")) ? "arm_e7tdboard_sram" : \ + ((CYG_HAL_STARTUP == "ROM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "arm_e7t_rom" : \ + "arm_e7tdboard_rom" } cdl_option CYGHWR_MEMORY_LAYOUT_LDI { display "Memory layout linker script fragment" flavor data no_define define -file system.h CYGHWR_MEMORY_LAYOUT_LDI - calculated { (CYG_HAL_STARTUP == "RAM") ? "" : - "" } + calculated { ((CYG_HAL_STARTUP == "RAM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SDRAM")) ? "" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SRAM")) ? "" : \ + ((CYG_HAL_STARTUP == "ROM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "" : \ + "" } } cdl_option CYGHWR_MEMORY_LAYOUT_H { display "Memory layout header file" flavor data no_define define -file system.h CYGHWR_MEMORY_LAYOUT_H - calculated { (CYG_HAL_STARTUP == "RAM") ? "" : \ - "" } + calculated { ((CYG_HAL_STARTUP == "RAM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SDRAM")) ? "" : \ + ((CYG_HAL_STARTUP == "RAM") && (CYG_HAL_RAM_SELECT == "SRAM")) ? "" : \ + ((CYG_HAL_STARTUP == "ROM") && (!CYG_HAL_SUPPORT_E7TDBOARD)) ? "" : \ + "" } } } cdl_option CYGSEM_HAL_ROM_MONITOR { display "Behave as a ROM monitor"