⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hal_platform_setup.h

📁 ecos在三星44b0上的移植
💻 H
字号:
#ifndef CYGONCE_HAL_PLATFORM_SETUP_H
#define CYGONCE_HAL_PLATFORM_SETUP_H

/*=============================================================================
//
//      hal_platform_setup.h
//
//      Platform specific support for HAL (assembly code)
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):   jskov
// Contributors:jskov
// Date:        2001-03-16
// Purpose:     study platform specific support routines
// Description: 
// Usage:       #include <cyg/hal/hal_platform_setup.h>
//
//####DESCRIPTIONEND####
//
//===========================================================================*/

#include <cyg/hal/plf_io.h>

#define CYGHWR_LED_MACRO                                                  \
        ldr     r0,=study_PDATC                                          ;\
        mov     r1, #((15 & (\x)) << 8)                                  ;\
        str     r1, [r0]                                                 ;

#if CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE==4096
// Override default to a more sensible value
#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)
#define PLATFORM_SETUP1                                                  \
    	ldr	r0,=study_WTCON	    /* watch dog disable */		;\
    	ldr	r1,=0x0 						;\
    	str	r1,[r0]							;\
									;\
    	ldr	r0,=study_INTMSK					;\
    	ldr	r1,=0x07ffffff  /* all interrupt disable */		;\
    	str	r1,[r0]							;\
									;\
    	ldr	r0,=study_INTCON					;\
    	ldr	r1,=5           /* non-vector & irq ennable */		;\
    	str	r1,[r0]							;\
									;\
    	ldr	r0,=study_LOCKTIME					;\
    	ldr	r1,=0xfff						;\
    	str	r1,[r0]							;\
									;\
    	ldr	r0,=study_PLLCON					;\
    	ldr	r1,=((40<<12)+(2<<4)+1)	/* Fin=10MHz,Fout=60MHz */	;\
    	str	r1,[r0]							;\
									;\
    	ldr	r0,=study_CLKCON		 			;\
    	ldr	r1,=0x7ff8	    /* All unit block CLK enable */	;\
    	str	r1,[r0]							;\
									;\
        ldr     lr,=66f                                                 ;\
    	ldr	r0,=33f							;\
    	ldmia   r0,{r1-r13}						;\
    	ldr	r0,=study_BWSCON					;\
    	stmia   r0,{r1-r13}						;\
    	ldr	r0,=44f							;\
    	ldmia   r0,{r1-r13}						;\
    	ldr	r0,=study_PCONA						;\
    	stmia   r0,{r1-r13}						;\
    	ldr	r0,=55f							;\
    	ldmia   r0,{r1-r7}						;\
    	ldr	r0,=study_PCONF						;\
    	stmia   r0,{r1-r7}						;\
        mov     pc,lr                                                   ;\
									;\
33:    	.long	0x11101002						;\
	.long	((B0_Tacs<<13)+(B0_Tcos<<11)+(B0_Tacc<<8)+(B0_Tcoh<<6)+(B0_Tah<<4)+(B0_Tacp<<2)+(B0_PMC))	;\
	.long	((B1_Tacs<<13)+(B1_Tcos<<11)+(B1_Tacc<<8)+(B1_Tcoh<<6)+(B1_Tah<<4)+(B1_Tacp<<2)+(B1_PMC)) 	;\
	.long	((B2_Tacs<<13)+(B2_Tcos<<11)+(B2_Tacc<<8)+(B2_Tcoh<<6)+(B2_Tah<<4)+(B2_Tacp<<2)+(B2_PMC))	;\
	.long	((B3_Tacs<<13)+(B3_Tcos<<11)+(B3_Tacc<<8)+(B3_Tcoh<<6)+(B3_Tah<<4)+(B3_Tacp<<2)+(B3_PMC))	;\
	.long	((B4_Tacs<<13)+(B4_Tcos<<11)+(B4_Tacc<<8)+(B4_Tcoh<<6)+(B4_Tah<<4)+(B4_Tacp<<2)+(B4_PMC))	;\
	.long	((B5_Tacs<<13)+(B5_Tcos<<11)+(B5_Tacc<<8)+(B5_Tcoh<<6)+(B5_Tah<<4)+(B5_Tacp<<2)+(B5_PMC))	;\
	.long	((B6_MT<<15)+(B6_Trcd<<2)+(B6_SCAN))								;\
	.long	((B7_MT<<15)+(B7_Trcd<<2)+(B7_SCAN))								;\
	.long	((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT)				;\
	.long	0x10												;\
	.long	0x20												;\
	.long	0x20												;\
									;\
44:	.long	0x3fe							;\
	.long	0x3ff							;\
	.long	0x3ff							;\
	.long	0x3ff							;\
	.long	0x55555500						;\
	.long	0xe0f0							;\
	.long	0x0							;\
	.long	0xaaaa							;\
	.long	0x0							;\
	.long	0x0							;\
	.long	0x28							;\
	.long	0x0							;\
	.long	0x0							;\
									;\
55:    	.long	0x24010							;\
    	.long	0x04							;\
    	.long	0x0							;\
    	.long	0x0							;\
    	.long	0x0							;\
    	.long	0x0	 						;\
    	.long	0x3							;\
66:									;\

#else
#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 + -