📄 hal_platform_setup.h
字号:
#ifndef CYGONCE_HAL_PLATFORM_SETUP_H#define CYGONCE_HAL_PLATFORM_SETUP_H/*=============================================================================//// hal_platform_setup.h//// Platform specific support for HAL (assembly code)////=============================================================================//####COPYRIGHTBEGIN####// // ------------------------------------------- // The contents of this file are subject to the Red Hat eCos Public License // Version 1.1 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://www.redhat.com/ // // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations under // the License. // // The Original Code is eCos - Embedded Configurable Operating System, // released September 30, 1998. // // The Initial Developer of the Original Code is Red Hat. // Portions created by Red Hat are // Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. // All Rights Reserved. // ------------------------------------------- // //####COPYRIGHTEND####//=============================================================================//#####DESCRIPTIONBEGIN####//// Author(s): gthomas// Contributors: gthomas// Date: 2001-04-23// Purpose: Cirrus Logic EP92xx platform specific support routines// Description: // Usage: #include <cyg/hal/hal_platform_setup.h>// Only used by "vectors.S" ////####DESCRIPTIONEND####////===========================================================================*/#include <pkgconf/system.h> // System-wide configuration info#include CYGBLD_HAL_VARIANT_H // Variant specific configuration#include CYGBLD_HAL_PLATFORM_H // Platform specific configuration#include <cyg/hal/hal_mmu.h> // MMU definitions#include <cyg/hal/ep93xx.h> // Platform specific hardware definitions#include <cyg/hal/sdramcfg.h>#if defined(CYG_HAL_ARM_ARM9_EP93XX_PREAMBLE)#define PLATFORM_PREAMBLE _platform_preamble#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) .macro _platform_preamble .org 0x1000 .long 0x53555243 // Put a CRUS in there so this is bootable. .org 0x1080 .endm#endif#endif#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)#define PLATFORM_SETUP1 _platform_setup1#define CYGHWR_HAL_ARM_HAS_MMU#define CYGSEM_HAL_ROM_RESET_USES_JUMP// This macro represents the initial startup code for the platform .macro _platform_setup1 // // Make sure caches are off // ldr r1,=0 mcr p15,0,r1,c1,c0,0 nop nop nop nop // // Go back to running from the external clock. // ldr r1, =EP9312_CLKSET1 mov r0, #0 str r0, [r1] nop nop nop nop nop // // Turn off both LEDs // ldr r1, =EP9312_LED_DATA ldr r0, [r1] // // Turn on both LEDs // orr r0, r0, #(EP9312_LED_GREEN_ON | EP9312_LED_RED_ON) str r0, [r1] // // Turn off auto-precharge. // ldr r1, =EP9312_SDRAMCTRL ldr r0, [r1,#EP9312_SDRAMCTRL_DEVCFG_3] bic r0, r0, #EP9312_SDRAMCTRL_DEVCFG_AUTOPRE str r0, [r1,#EP9312_SDRAMCTRL_DEVCFG_3] // // Turn off the Green LED and leave the Red LED on. // ldr r1, =EP9312_LED_DATA ldr r0, [r1] bic r0, r0, #(EP9312_LED_GREEN_ON) str r0, [r1] // // If booting from flash the code needs to be moved to RAM //#ifdef CYG_HAL_STARTUP_ROMRAM // // Need to make sure that SDRAM is configured correctly before // coping the code into it. // SdramCfg ldr r0,=__rom_vectors_lma // Relocate FLASH/ROM to RAM ldr r1,=__rom_vectors_vma // ram base & length ldr r2,=__ram_data_end20: ldr r3,[r0],#4 str r3,[r1],#4 cmp r1,r2 bne 20b ldr r0,=30f mov pc,r0 nop nop nop nop30: #endif // // Turn on Green LED, Turn off the Red LED. // ldr r1, =EP9312_LED_DATA ldr r0, [r1] eor r0, r0, #(EP9312_LED_GREEN_ON | EP9312_LED_RED_ON) strb r0,[r1] .endm #else // defined(CYG_HAL_STARTUP_ROM) or ROMRAM#define PLATFORM_SETUP1#endif//-----------------------------------------------------------------------------// end of hal_platform_setup.h#endif // CYGONCE_HAL_PLATFORM_SETUP_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -