OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [xscale/] [iq80321/] [current/] [src/] [iq80321_misc.c] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      iq80321_misc.c
4
//
5
//      HAL misc board support code for Intel XScale IQ80321
6
//
7
//==========================================================================
8
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
9
// -------------------------------------------                              
10
// This file is part of eCos, the Embedded Configurable Operating System.   
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under    
14
// the terms of the GNU General Public License as published by the Free     
15
// Software Foundation; either version 2 or (at your option) any later      
16
// version.                                                                 
17
//
18
// eCos is distributed in the hope that it will be useful, but WITHOUT      
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
21
// for more details.                                                        
22
//
23
// You should have received a copy of the GNU General Public License        
24
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
25
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
26
//
27
// As a special exception, if other files instantiate templates or use      
28
// macros or inline functions from this file, or you compile this file      
29
// and link it with other works to produce a work based on this file,       
30
// this file does not by itself cause the resulting work to be covered by   
31
// the GNU General Public License. However the source code for this file    
32
// must still be made available in accordance with section (3) of the GNU   
33
// General Public License v2.                                               
34
//
35
// This exception does not invalidate any other reasons why a work based    
36
// on this file might be covered by the GNU General Public License.         
37
// -------------------------------------------                              
38
// ####ECOSGPLCOPYRIGHTEND####                                              
39
//==========================================================================
40
//#####DESCRIPTIONBEGIN####
41
//
42
// Author(s):    msalter
43
// Contributors: msalter
44
// Date:         2001-12-03
45
// Purpose:      HAL board support
46
// Description:  Implementations of HAL board interfaces
47
//
48
//####DESCRIPTIONEND####
49
//
50
//========================================================================*/
51
 
52
#include <pkgconf/hal.h>
53
#include <pkgconf/system.h>
54
#include CYGBLD_HAL_PLATFORM_H
55
 
56
#include <cyg/infra/cyg_type.h>         // base types
57
#include <cyg/infra/cyg_trac.h>         // tracing macros
58
#include <cyg/infra/cyg_ass.h>          // assertion macros
59
 
60
#include <cyg/hal/hal_io.h>             // IO macros
61
#include <cyg/hal/hal_arch.h>           // Register state info
62
#include <cyg/hal/hal_diag.h>
63
#include <cyg/hal/hal_intr.h>           // Interrupt names
64
#include <cyg/hal/hal_cache.h>
65
#include <cyg/hal/hal_verde.h>          // Hardware definitions
66
#include <cyg/hal/iq80321.h>            // Platform specifics
67
 
68
#include <cyg/infra/diag.h>             // diag_printf
69
 
70
#ifdef CYGPKG_IO_PCI
71
cyg_uint32 cyg_pci_window_real_base = 0;
72
#endif
73
 
74
//
75
// Platform specific initialization
76
//
77
 
78
void
79
plf_hardware_init(void)
80
{
81
    INTCTL_WRITE(0);  // mask all irqs
82
    INTSTR_WRITE(0);  // everything goes to IRQ
83
    *PIRSR = 0x0f;
84
 
85
// RAM startup only - rewrite relevent bits depending on config
86
#ifndef CYG_HAL_STARTUP_ROM
87
    HAL_DCACHE_SYNC();            // Force data out
88
    HAL_DCACHE_INVALIDATE_ALL();  // Flush TLBs: make new mmu state effective
89
#endif // ! CYG_HAL_STARTUP_ROM - RAM start only
90
}
91
 
92
//
93
// Memory layout - runtime variations of all kinds.
94
//
95
externC cyg_uint8 *
96
hal_arm_mem_real_region_top( cyg_uint8 *regionend )
97
{
98
    CYG_ASSERT( hal_dram_size > 0, "Didn't detect DRAM size!" );
99
    CYG_ASSERT( hal_dram_size <=  256<<20,
100
                "More than 256MB reported - that can't be right" );
101
    CYG_ASSERT( 0 == (hal_dram_size & 0xfffff),
102
                "hal_dram_size not whole Mb" );
103
    // is it the "normal" end of the DRAM region? If so, it should be
104
    // replaced by the real size
105
    if ( regionend ==
106
         ((cyg_uint8 *)CYGMEM_REGION_ram + CYGMEM_REGION_ram_SIZE) ) {
107
        regionend = (cyg_uint8 *)CYGMEM_REGION_ram + hal_dram_size;
108
    }
109
    // Also, we must check for the top of the heap having moved.  This is
110
    // because the heap does not abut the top of memory.
111
#ifdef CYGMEM_SECTION_heap1
112
    if ( regionend ==
113
         ((cyg_uint8 *)CYGMEM_SECTION_heap1 + CYGMEM_SECTION_heap1_SIZE) ) {
114
        // hal_dram_size excludes the PCI window on this platform.
115
        if ( regionend > (cyg_uint8 *)CYGMEM_REGION_ram + hal_dram_size )
116
            regionend = (cyg_uint8 *)CYGMEM_REGION_ram + hal_dram_size;
117
    }
118
#endif
119
    return regionend;
120
}
121
 
122
// ------------------------------------------------------------------------
123
// EOF iq80321_misc.c

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.