latest sparc32 patch from Blueswirl

git-svn-id: svn://coreboot.org/openbios/openbios-devel@13 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Stefan Reinauer
2006-05-07 16:40:13 +00:00
parent d80454d07a
commit 1ab6b463ad
27 changed files with 2723 additions and 37 deletions

View File

@@ -60,7 +60,7 @@ extern char *strncpy_nopad( char *dest, const char *src, size_t n );
#define _X 0x40 /* hex digit */
#define _SP 0x80 /* hard space (0x20) */
extern unsigned char _ctype[];
extern const unsigned char _ctype[];
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])

View File

@@ -112,11 +112,11 @@ static const int name##_flags_ = flags; \
static const int name##_size_ = size;
#define DECLARE_NODE( name, flags, size, paths... ) \
static char *name##_p[] = { paths }; \
static const char * const name##_p[] = { paths }; \
DECLARE_UNNAMED_NODE(name, flags, size)
#define NODE_METHODS( name ) \
static method_t name##_m[]
static const method_t name##_m[]
#define REGISTER_NODE( name ) do { \
bind_node( name##_flags_, name##_size_, \

28
include/sparc32/crs.h Normal file
View File

@@ -0,0 +1,28 @@
/*
* Parts of asm-sparc/contregs.h
*
* contregs.h: Addresses of registers in the ASI_CONTROL alternate address
* space. These are for the mmu's context register, etc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
/* s=Swift, h=Ross_HyperSPARC, v=TI_Viking, t=Tsunami, r=Ross_Cypress */
#define AC_M_PCR 0x0000 /* shv Processor Control Reg */
#define AC_M_CTPR 0x0100 /* shv Context Table Pointer Reg */
#define AC_M_CXR 0x0200 /* shv Context Register */
#define AC_M_SFSR 0x0300 /* shv Synchronous Fault Status Reg */
#define AC_M_SFAR 0x0400 /* shv Synchronous Fault Address Reg */
/*
* Parts of asm-sparc/contregs.h
*
* contregs.h: Addresses of registers in the ASI_CONTROL alternate address
* space. These are for the mmu's context register, etc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
/* s=Swift, h=Ross_HyperSPARC, v=TI_Viking, t=Tsunami, r=Ross_Cypress */
#define AC_M_PCR 0x0000 /* shv Processor Control Reg */
#define AC_M_CTPR 0x0100 /* shv Context Table Pointer Reg */
#define AC_M_CXR 0x0200 /* shv Context Register */
#define AC_M_SFSR 0x0300 /* shv Synchronous Fault Status Reg */
#define AC_M_SFAR 0x0400 /* shv Synchronous Fault Address Reg */

View File

@@ -3,9 +3,43 @@
#include "asm/types.h"
extern unsigned int va_shift; // Set in entry.S
extern char _start, _data, _end, _vmem, _evmem, _iomem; // Defined in ldscript
static inline unsigned long
va2pa(unsigned long va)
{
if ((va >= (unsigned long)&_data) &&
(va < (unsigned long)&_end))
return va - va_shift;
else
return va;
}
static inline unsigned long
pa2va(unsigned long pa)
{
if ((pa + va_shift >= (unsigned long)&_data) &&
(pa + va_shift< (unsigned long)&_end))
return pa + va_shift;
else
return pa;
}
// XXX check use and merge
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys)))
#define virt_to_phys(virt) ((unsigned long) (virt))
struct mem;
void *mem_alloc(struct mem *t, int size, int align);
void *mem_zalloc(struct mem *t, int size, int align);
int map_page(unsigned long *pgd, unsigned long va,
unsigned long epa, int type);
void *map_io(unsigned pa, int size);
void init_mmu_swift();
void *dvma_alloc(int size, unsigned int *pphys);
#ifndef BOOTSTRAP
#ifndef _IO_BASE