sysLib.c
资源名称:ixp425BSP.rar [点击查看]
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:41k
源码类别:
VxWorks
开发平台:
C/C++
- /* sysLib.c - IXP425 ixdp425 Emulator Board Specific routines */
- /* Copyright 2002 Wind River Systems, Inc. */
- #include "copyright_wrs.h"
- /*
- modification history
- --------------------
- 01l,23oct02,jb Adding CS1 setup
- 01k,22oct02,jb Changing to correct reserved memory name
- 01j,07oct02,jb Fix print statement
- 01i,07oct02,jb Remove IP address size change
- 01h,23sep02,jb Changing sysPhysMemDesc to use LOCAL_MEM_SIZE
- 01g,18sep02,jb Rename appinit
- 01f,19aug02,jb Force redefines for ixe driver
- 01e,15aug02,jb Enabling ixp425IfConfig
- 01d,01aug02,jb Fixing sysToMonitor with ixe
- 01c,26jun02,jb Adding ixp425 End support
- 01b,13jun02,jb Fixing sysToMonitor
- 01a,05jun02,jb initial version... from Peter
- */
- /*
- DESCRIPTION
- This library provides board-specific routines.
- INCLUDE FILES: sysLib.h
- SEE ALSO:
- .pG "Configuration"
- */
- /* includes */
- #include "vxWorks.h"
- #include "config.h"
- #include "stdio.h"
- #include "usrLib.h"
- #include "sysLib.h"
- #include "string.h"
- #include "intLib.h"
- #include "taskLib.h"
- #include "vxLib.h"
- #include "inetLib.h"
- #include "fioLib.h"
- #include "ctype.h"
- #include "logLib.h"
- #include "errnoLib.h"
- #include "bootLib.h"
- #include "vme.h"
- #include "in.h"
- #include "memLib.h"
- #include "cacheLib.h"
- #include "arch/arm/mmuArmLib.h"
- #include "arch/arm/cacheArmLib.h"
- #include "private/vmLibP.h"
- #include "debugutils.h"
- /* Source Drivers */
- #ifdef INCLUDE_FLASH
- #include "mem/flashMem.c"
- #ifdef USE_FLASH_STORAGE
- #include "mem/nvRamToFlash.c"
- #endif
- #endif /* INCLUDE_FLASH */
- #ifdef INCLUDE_EEPROM
- #include "ixp425I2c.c"
- #include "ixp425Eeprom.c"
- #endif /* INCLUDE_EEPROM */
- /* No non-volatile storage available */
- #if !defined(INCLUDE_FLASH) && !defined(INCLUDE_EEPROM)
- #include "mem/nullNvRam.c"
- #endif
- #include "ixp425Gpio.c"
- #ifdef INCLUDE_PCI
- #include "ixp425Pci.c"
- #include "ixp425PciIntLib.c"
- #include "ixp425PciConfigLib.c"
- #include "ixp425PciConfigShow.c"
- #ifdef INCLUDE_PCI_DMA
- #include "ixp425PciDma.c"
- #endif
- #endif
- #if defined(INCLUDE_END)
- #include "end.h"
- #if defined(INCLUDE_FEI82557END)
- #include "sysEnd.c"
- STATUS sysLanPciInit (void);
- #ifdef IXDP_FEIEND_USE_NVRAM_IP
- #if defined(IXDP_FEI557_IP0_DEFAULT) && defined(IXDP_FEI557_IP1_DEFAULT) && defined(IXDP_FEI557_IP2_DEFAULT) && defined(IXDP_FEI557_IP3_DEFAULT)
- LOCAL char *defaultfeiInetAddr[IXP425_MAX_FEI_DEVS] =
- {
- IXDP_FEI557_IP0_DEFAULT,
- IXDP_FEI557_IP1_DEFAULT,
- IXDP_FEI557_IP2_DEFAULT,
- IXDP_FEI557_IP3_DEFAULT,
- };
- #endif /* All DEFAULTS */
- #endif /* IXDP_FEIEND_USE_NVRAM_IP */
- #endif /* INCLUDE_FEI82557END */
- #if defined(INCLUDE_IXETHACCEND)
- #include "IxEthAcc.h" /* Always include this */
- STATUS ixdp425EthEndMuxInit(void);
- STATUS ixdp425EthEndStartUp(void);
- #endif /* defined(INCLUDE_IXETHACCEND) */
- IMPORT int ipAttach ();
- #endif /* INCLUDE_END */
- #include "ixdp425.h"
- /*
- * Ixp425 Interrupt Controller Board Specifics.
- */
- /*
- * This array maps interrupt levels to mask patterns. The interrupt level
- * is the index, the data is the mask value. A mask bit enables one
- * level. The mask value is 'and'd with the ixp425IntLvlEnabled value
- * before writing to the chip.
- */
- #include "ixp425IntrCtl.h"
- LOCAL UINT32 ixp425IntLvlMask [IXP425_INT_NUM_LEVELS + 1] = /* int lvl mask */
- {
- 0x0000, /* level 0, all disabled */
- 0x00000001, 0x00000003, 0x00000007, 0x0000000f,
- 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
- 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
- 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
- 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff,
- 0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff,
- 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff,
- 0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff,
- /* level 32 all enabled */
- };
- #if IXP425_INT_NUM_LEVELS != 32
- #error ixp425IntLvlMask is wrong size for number of levels
- #endif
- #include "ixp425IntrCtl.c"
- #include "ixp425Timer.c"
- #include "sysSerial.c"
- /* enable interrupts/fiqs on XScale */
- extern void sysEnableIRQMasks ();
- extern void sysToMonSwitchFlashRam();
- /* retrieve auto-sized memory */
- extern UINT32 sysPhysMemSize ();
- /* find a device using its string name */
- extern END_OBJ* endFindByName (char* pName, int unit);
- /* externals */
- IMPORT char end; /* end of system, created by ld */
- IMPORT VOIDFUNCPTR _func_armIntStackSplit; /* ptr to fn to split stack */
- IMPORT void sysIntStackSplit (char *, long);
- /* globals */
- /*
- * The following structure describes the various different parts of the
- * memory map to be used only during initialisation by
- * vm(Base)GlobalMapInit() when INCLUDE_MMU_BASIC or INCLUDE_MMU_FULL are
- * defined.
- *
- * The following are not the smallest areas that could be allocated for a
- * working system. If the amount of memory used by the page tables is
- * critical, they could be reduced.
- */
- #ifdef INCLUDE_MMU
- void *mmuPhysToVirt(void *physicalAddress);
- void *mmuVirtToPhys(void *virtualAddress);
- PHYS_MEM_DESC sysPhysMemDesc [] =
- {
- { /* Init Boot Code From Flash Bank 1 */
- (void *) IXP425_SDRAM_BASE, /* virtual address */
- (void *) IXP425_SDRAM_BASE, /* physical address */
- LOCAL_MEM_SIZE, /* length, then initial state: */ /* Entire SDRAM space */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE | VM_STATE_BUFFERABLE
- },
- { /* PCI Config space */
- (void *) IXP425_PCI_CONFIG_BASE , /* virtual address */
- (void *) IXP425_PCI_CONFIG_BASE, /* physical address */
- SZ_4K , /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Expansion bus Register Block */
- (void *) IXP425_EXP_CONFIG_BASE , /* virtual address */
- (void *) IXP425_EXP_CONFIG_BASE, /* physical address */
- SZ_4K, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Peripheral Register Block */
- (void *) IXP425_PERIPHERAL_BASE , /* virtual address */
- (void *) IXP425_PERIPHERAL_BASE, /* physical address */
- SZ_64K, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* QMgr Register Block */
- (void *) IXP425_QMGR_BASE , /* virtual address */
- (void *) IXP425_QMGR_BASE, /* physical address */
- SZ_16K, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* SDRAM Config register space */
- (void *) IXP425_SDRAM_CONFIG_BASE , /* virtual address */
- (void *) IXP425_SDRAM_CONFIG_BASE, /* physical address */
- SZ_4K , /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- #ifdef INCLUDE_FAST_DRAM
- { /* data cache fast dram option */
- /* No external memory request is made, which means software can map any
- * unallocated area of memory as data RAM. However, the line-allocate operation
- * does validate the target address with the MMU, so system software must ensure
- * that the memory has a valid descriptor in the page table.
- */
- (void *) FD_ORIGIN, /* virtual address */
- (void *) FD_ORIGIN, /* physical address */
- FD_MAX_SIZE, /* length (plus rounded-up), then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE
- },
- #endif
- { /* Flash Bank CS0 - Relocated base */
- (void *) IXP425_EXPANSION_BUS_BASE2, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_BASE2, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 1 - CS1 */
- (void *) IXP425_EXPANSION_BUS_CS1_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS1_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 2 - CS2 */
- (void *) IXP425_EXPANSION_BUS_CS2_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS2_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 3 - CS3 */
- (void *) IXP425_EXPANSION_BUS_CS3_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS3_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 4 - CS4 */
- (void *) IXP425_EXPANSION_BUS_CS4_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS4_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 5 - CS5 */
- (void *) IXP425_EXPANSION_BUS_CS5_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS5_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 6 - CS6 */
- (void *) IXP425_EXPANSION_BUS_CS6_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS6_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- { /* Chip Select 7 - CS7 */
- (void *) IXP425_EXPANSION_BUS_CS7_BASE, /* virtual address */
- (void *) IXP425_EXPANSION_BUS_CS7_BASE, /* physical address */
- SZ_16M, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- #ifdef INCLUDE_PCI
- { /* PCI Memory,IO,Config */
- (void *) IXP425_PCI_BASE, /* virtual address */
- (void *) IXP425_PCI_BASE, /* physical address */
- IXP425_PCI_SP_SIZE, /* length, then initial state: */
- VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_BUFFERABLE,
- VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_BUFFERABLE_NOT
- },
- #endif
- };
- int sysPhysMemDescNumEnt = NELEMENTS (sysPhysMemDesc);
- #endif /* INCLUDE_MMU */
- int sysCpu = CPU; /* system CPU type */
- char * sysBootLine = BOOT_LINE_ADRS; /* address of boot line */
- char sysBootHost [BOOT_FIELD_LEN]; /* name of host from which we booted */
- char sysBootFile [BOOT_FIELD_LEN]; /* name of file from which we booted */
- int sysFlags; /* boot flags */
- int sysProcNum = 0; /* processor number of this CPU */
- /* Area used to flush D-cache */
- UINT32 sysCacheFlushReadArea[D_CACHE_SIZE/sizeof(UINT32)];
- /* Area used to flush mini-cache */
- UINT32 sysMinicacheFlushReadArea[MINI_CACHE_SIZE/sizeof(UINT32)];
- char *sysExcMsg = EXC_MSG_ADRS; /* catastrophic message area */
- /* forward LOCAL function declarations */
- /* forward declarations */
- char * sysPhysMemTop (void);
- /*** Init Routines ***/
- /******************************************************************************
- *
- * sysHwInit0 - Intialize _func_armVirtToPhys before sysHwInit is called
- *
- * This function initialises _func_armVirtToPhys and _func_armPhysToVirt
- * before sysHwInit is called. It is called from usrInit in bootConfig.c
- * before cacheLibInit is called.
- *
- * RETURNS: N/A
- */
- void sysHwInit0()
- {
- #ifdef LOCAL_MEM_AUTOSIZE
- int i;
- #endif
- DEBUG_OUT_INIT;
- ixp425GPIOReset();
- DEBUG_OUT_VAL(INFO_CODE_10);
- #if defined(INCLUDE_CACHE_SUPPORT) || defined(INCLUDE_MMU)
- /*
- * Install the appropriate cache libary, using the our
- * address translation routines.
- */
- cacheArmXSCALELibInstall(mmuPhysToVirt, mmuVirtToPhys);
- #endif
- DEBUG_OUT_VAL(INFO_CODE_11);
- #ifdef INCLUDE_MMU
- /* Install the appropriate MMU library and translation routines */
- mmuArmXSCALELibInstall (mmuPhysToVirt, mmuVirtToPhys);
- #endif /* INCLUDE_MMU */
- DEBUG_OUT_VAL(INFO_CODE_12);
- #ifdef LOCAL_MEM_AUTOSIZE
- for (i = 0; i < sysPhysMemDescNumEnt; i++)
- {
- if ((sysPhysMemDesc[i].virtualAddr == (void *) IXP425_SDRAM_BASE_ADRS) &&
- (sysPhysMemDesc[i].physicalAddr == (void *) IXP425_SDRAM_BASE_ADRS))
- sysPhysMemDesc[i].len = sysPhysMemSize();
- }
- #endif
- DEBUG_OUT_VAL(INFO_CODE_13);
- }
- /*******************************************************************************
- *
- * sysHwInit - initialise the CPU board hardware
- *
- * This routine initialises various features of the hardware.
- * Normally, it is called from usrInit() in usrConfig.c.
- *
- * NOTE: This routine should not be called directly by the user.
- *
- * RETURNS: N/A
- */
- void sysHwInit (void)
- {
- DEBUG_OUT_VAL(INFO_CODE_14);
- /* Call back from the kernel for Interrupt stack setup */
- _func_armIntStackSplit = sysIntStackSplit;
- /* disable all interrupt sources */
- IXP425_MASK_ALL_INTERRUPTS()
- /* Make sure Expansion Bus CS1 is set */
- *((unsigned long *) IXP425_EXP_CS0_REG) = IXDP425_FLASH_CS_SETTING_WR_EN;
- *((unsigned long *) IXP425_EXP_CS1_REG) = IXDP425_FLASH_CS_SETTING_WR_EN;
- *((unsigned long *) IXP425_EXP_CS2_REG) = IXDP425_FLASH_CS_SETTING_WR_EN;
- /* If booted with visionClick, the bootline may be bad */
- if ( strncmp("fei",BOOT_LINE_ADRS, 3) && strncmp("ixe",BOOT_LINE_ADRS, 3))
- {
- /* Not a valid bootline */
- sysNvRamGet (BOOT_LINE_ADRS, BOOT_LINE_SIZE, 0);
- if ( strncmp("fei",BOOT_LINE_ADRS, 3) && strncmp("ixe",BOOT_LINE_ADRS, 3))
- /* bootline in 'nvram' not correct either, override with config.h */
- bcopy(DEFAULT_BOOT_LINE, BOOT_LINE_ADRS, strlen(DEFAULT_BOOT_LINE) + 1);
- }
- DEBUG_OUT_VAL(INFO_CODE_15);
- /* initialise the serial devices */
- sysSerialHwInit ();
- DEBUG_OUT_VAL(INFO_CODE_16);
- #ifdef INCLUDE_PCI
- sysPciInit();
- DEBUG_OUT_VAL(INFO_CODE_17);
- sysPciAssignAddrs();
- #endif
- DEBUG_OUT_VAL(INFO_CODE_18);
- sysEnableIRQMasks ();
- DEBUG_OUT_VAL(INFO_CODE_19);
- }
- /*******************************************************************************
- *
- * sysHwInit2 - additional system configuration and initialisation
- *
- * This routine connects system interrupts and does any additional
- * configuration necessary.
- *
- * RETURNS: N/A
- *
- * NOMANUAL
- */
- void sysHwInit2 (void)
- {
- DEBUG_OUT_VAL(INFO_CODE_20);
- /* Allocate vector table and init handlers */
- intLibInit (IXP425_INT_NUM_LEVELS, IXP425_INT_NUM_LEVELS, IXP425_INT_MODE);
- DEBUG_OUT_VAL(INFO_CODE_21);
- /* initialise the interrupt controller */
- ixp425IntDevInit ();
- DEBUG_OUT_VAL(INFO_CODE_22);
- /* connect serial interrupt */
- sysSerialHwInit2 ();
- DEBUG_OUT_VAL(INFO_CODE_23);
- #ifdef INCLUDE_PCI
- /*connect the PCI interrupts*/
- sysPciIntConnect();
- DEBUG_OUT_VAL(INFO_CODE_24);
- /*Enable the PCI interrupt*/
- sysPciIntEnable();
- #endif
- DEBUG_OUT_VAL(INFO_CODE_25);
- #if defined(INCLUDE_FEI82557END)
- /* map FEI Ethernet PCI device memory and I/O addresses */
- sysLanPciInit ();
- #endif /* INCLUDE_FEI82557END */
- DEBUG_OUT_VAL(INFO_CODE_26);
- #if defined(INCLUDE_IXETHACCEND)
- ixdp425EthEndMuxInit();
- #endif /* INCLUDE_IXETHACCEND */
- DEBUG_OUT_VAL(INFO_CODE_27);
- }
- /******************************************************************************
- *
- * ixdp425AppInit - final system configuration
- *
- * This routine is invoked after all other system initialisation has completed.
- * It configures and enables any Ethernet interfaces other than the boot device
- * and then invokes IXP425_APPL_INIT, which must be a valid C block.
- *
- */
- void
- ixdp425AppInit()
- {
- #if defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- END_OBJ *pEnd;
- UINT32 fei557EndMask;
- UINT8 nvImage[NV_RAM_IF_SIZE+1];
- UINT8 inetAddr[INET_ADDR_LEN];
- UINT8 nameAndUnit[32];
- UINT8 pNetDev[32];
- UINT32 i=0;
- char *colon;
- int index,ipaddrOk;
- /*If there are fei devices that are not already attached, we should
- attach them here*/
- /* Get a copy of the image from EEPROM/FLASH */
- sysNvRamGet(nvImage, NV_RAM_IF_SIZE, NV_RAM_IF_START_OFFSET);
- for (i=0;i<IXP425_MAX_FEI_DEVS;i++)
- {
- sprintf(pNetDev,"%s","fei");
- sprintf(nameAndUnit,"%s%d","fei",i);
- pEnd = endFindByName (pNetDev, i);
- if (pEnd == NULL)
- {
- continue;
- }
- /*need to figure out if this has been configured already*/
- if (ifAddrGet(nameAndUnit,inetAddr)==ERROR)
- {
- if (ipAttach(i, pNetDev) != OK)
- {
- logMsg ("Failed to attach to device %s, unit: %d",
- (int)pNetDev, i, 0, 0, 0, 0);
- continue;
- }
- index = NV_IP_ADRS_PCIEND1 + i*SIZE_OF_IP_ADDRESS - NV_RAM_IF_START_OFFSET;
- memcpy(inetAddr, &nvImage[index],SIZE_OF_IP_ADDRESS);
- inetAddr[SIZE_OF_IP_ADDRESS]=0;
- #if defined(IXDP_FEI557_IP0_DEFAULT) && defined(IXDP_FEI557_IP1_DEFAULT) && defined(IXDP_FEI557_IP2_DEFAULT) && defined(IXDP_FEI557_IP3_DEFAULT)
- feiaddrRetry:
- #endif
- ipaddrOk = 1;
- /* See if there is a mask */
- if ( (colon = strchr(inetAddr, ':')) )
- {
- *colon = 0;
- colon++;
- for(index = 0; index < 6; index++)
- {
- if( isxdigit(colon[index] == 0 ) )
- {
- printf("ixdp425AppInit: Invalid Mask for fei%d IP: %s:%s Discarding Maskn"
- ,i,inetAddr, colon);
- colon = NULL;
- break;
- }
- }
- if(colon != NULL)
- {
- sscanf(colon, "%x", &fei557EndMask);
- }
- }
- /* Check to see if its a valid IP address */
- for(index = 0; index < SIZE_OF_IP_ADDRESS; )
- {
- if ( !isdigit(inetAddr[index]) && inetAddr[index] != '.' )
- {
- #if defined(IXDP_FEI557_IP0_DEFAULT) && defined(IXDP_FEI557_IP1_DEFAULT) && defined(IXDP_FEI557_IP2_DEFAULT) && defined(IXDP_FEI557_IP3_DEFAULT)
- printf("ixdp425AppInit: Forcing Hard Coded IP Address for fei%dn",i);
- sprintf(inetAddr, "%s", defaultfeiInetAddr[i]);
- goto feiaddrRetry;
- #else
- ipaddrOk = 0;
- printf("ixdp425AppInit: Invalid Address for fei%d IP: %s Ignoringn",i,inetAddr);
- break;
- #endif
- }
- if ( inetAddr[++index] == 0 )
- break;
- }
- if ( ipaddrOk )
- {
- ifAddrSet(nameAndUnit, inetAddr);
- if( colon != NULL )
- {
- ifMaskSet(nameAndUnit, fei557EndMask);
- printf("ixdp425AppInit: fei%d: IP Addr set to %s:%xn"
- ,i, inetAddr, fei557EndMask);
- }
- else
- {
- printf("ixdp425AppInit: fei%d: IP Addr set to %sn",i, inetAddr);
- }
- }
- }
- }
- #endif
- #if defined(INCLUDE_IXETHACCEND)
- if ( ixdp425EthEndStartUp() != OK )
- {
- ;
- }
- #endif /* INCLUDE_IXETHACCEND */
- }
- /*******************************************************************************
- *
- * sysPhysMemTop - get the address of the top of physical memory
- *
- * This routine returns the address of the first missing byte of memory,
- * which indicates the top of memory.
- *
- * Normally, the user specifies the amount of physical memory with the
- * macro LOCAL_MEM_SIZE in config.h. BSPs that support run-time
- * memory sizing do so only if the macro LOCAL_MEM_AUTOSIZE is defined.
- * If not defined, then LOCAL_MEM_SIZE is assumed to be, and must be, the
- * true size of physical memory.
- *
- * NOTE: Do not adjust LOCAL_MEM_SIZE to reserve memory for application
- * use. See sysMemTop() for more information on reserving memory.
- *
- * RETURNS: The address of the top of physical memory.
- *
- * SEE ALSO: sysMemTop()
- */
- char *sysPhysMemTop (void)
- {
- static char * physTop = NULL;
- if (physTop == NULL)
- {
- #ifdef LOCAL_MEM_AUTOSIZE
- /* auto-sizing is possible */
- physTop = (char *)(LOCAL_MEM_LOCAL_ADRS + sysPhysMemSize ());
- #else
- /* Don't do autosizing, if size is given */
- physTop = (char *)(LOCAL_MEM_LOCAL_ADRS + LOCAL_MEM_SIZE);
- #endif /* LOCAL_MEM_AUTOSIZE */
- }
- return physTop;
- }
- /*******************************************************************************
- *
- * sysMemTop - get the address of the top of memory
- *
- * This routine returns the address of the first missing byte of memory,
- * which indicates the top of memory.
- *
- * RETURNS: The address of the top of memory.
- */
- char *sysMemTop (void)
- {
- #ifdef LOCAL_MEM_AUTOSIZE
- /* auto-sizing is possible */
- return((char *)LOCAL_MEM_LOCAL_ADRS + (sysPhysMemSize () - USER_RESERVED_MEM));
- #else
- /* Don't do autosizing, if size is given */
- return((char *)LOCAL_MEM_LOCAL_ADRS + (LOCAL_MEM_SIZE - USER_RESERVED_MEM));
- #endif /* LOCAL_MEM_AUTOSIZE */
- }
- /*******************************************************************************
- *
- * sysToMonitor - transfer control to the ROM monitor
- *
- * This routine transfers control to the ROM monitor. It is usually called
- * only by reboot() -- which services ^X -- and bus errors at interrupt
- * level. However, in some circumstances, the user may wish to introduce a
- * new <startType> to enable special boot ROM facilities.
- *
- * startType - passed to ROM to tell it how to boot
- *
- * RETURNS: Does not return.
- */
- STATUS sysToMonitor (int startType)
- {
- FUNCPTR pRom;
- #if defined(INCLUDE_END)
- END_OBJ * pEnd;
- UINT32 i;
- #endif /* INCLUDE_END */
- #if defined(INCLUDE_END)
- #ifdef INCLUDE_FEI82557END
- /*
- * If the Ethernet driver were left alone, the controller chip might
- * alter memory, so we stop the controller before jumping to the bootrom.
- */
- for (i = 0; i < IXP425_PCI_MAX_DEV; i++)
- {
- if ( (pEnd = endFindByName ("fei", i)) != NULL)
- pEnd->pFuncTable->stop(pEnd->devObject.pDevice);
- }
- #endif /* INCLUDE_FEI82557END */
- #ifdef INCLUDE_IXETHACCEND
- for (i = 0; i < IX_ETH_ACC_NUMBER_OF_PORTS; i++)
- {
- if ( (pEnd = endFindByName ("ixe", i)) != NULL)
- pEnd->pFuncTable->stop(pEnd->devObject.pDevice);
- }
- #endif /* INCLUDE_IXETHACCEND */
- #endif /* INCLUDE_END */
- #if defined(INCLUDE_SERIAL)
- sysSerialReset (); /* put serial devices into quiet state */
- #endif
- sysClkDisable();
- intIFLock ();
- IXP425_MASK_ALL_INTERRUPTS()
- #ifdef INCLUDE_MMU
- cacheArmXSCALEDClearDisable ();
- cacheArmXSCALEIClearDisable ();
- mmuArmXSCALETLBIDFlushAll ();
- mmuArmXSCALEADisable ();
- #endif
- /* The problem at this point is that the ROM is mapped to
- * is alternate position and ram is at zero.
- * We need to jump to an aliased version of the SDRAM.
- * Then put the flash back to zero.
- * Then jump to the real ROM_TEXT_ADRS.
- */
- sysToMonSwitchFlashRam();
- /* Now running on aliased memory and flash at 0 */
- if (startType != BOOT_COLD)
- pRom = (FUNCPTR) (0x1000 + 4); /* warm boot */
- else
- pRom = (FUNCPTR) (0x1000); /* cold boot */
- (*pRom)(startType); /* jump to boot ROM */
- return OK; /* in case we ever continue from ROM monitor */
- }
- /*** BSP Info Routines ***/
- /****************************************************************************
- *
- * sysProcNumGet - get the processor number
- *
- * This routine returns the processor number for the CPU board, which is
- * set with sysProcNumSet().
- *
- * RETURNS: The processor number for the CPU board.
- *
- * SEE ALSO: sysProcNumSet()
- */
- int sysProcNumGet (void)
- {
- return sysProcNum;
- }
- /****************************************************************************
- *
- * sysProcNumSet - set the processor number
- *
- * Set the processor number for the CPU board. Processor numbers should be
- * unique on a single backplane.
- *
- * NOTE
- * By convention, only processor 0 should dual-port its memory.
- *
- * RETURNS: N/A
- *
- * SEE ALSO: sysProcNumGet()
- */
- void sysProcNumSet
- (
- int procNum /* processor number */
- )
- {
- sysProcNum = procNum;
- }
- /*******************************************************************************
- *
- * sysModel - return the model name of the CPU board
- *
- * This routine returns the model name of the CPU board.
- *
- * RETURNS: A pointer to a string identifying the board and CPU.
- */
- char *sysModel (void)
- {
- return(BOARD_DESC);
- }
- /*******************************************************************************
- *
- * sysBspRev - return the bsp version with the revision eg 1.1/<x>
- *
- * This function returns a pointer to a bsp version with the revision.
- * for eg. 1.1/<x>. BSP_REV is concatanated to BSP_VERSION to form the
- * BSP identification string.
- *
- * RETURNS: A pointer to the BSP version/revision string.
- */
- char * sysBspRev (void)
- {
- return(BSP_VERSION BSP_REV);
- }
- /*******************************************************************************
- *
- * ixp425BoardRev - returns board revision
- *
- * RETURNS: the 4bit integer value contained in the board revision register
- */
- int ixp425BoardRev (void)
- {
- return(0x0); /* Return a dummy version for the simulator */
- }
- /* Wrappers */
- /********************************************************************************
- * sysIntDisable - disable an external interrupt level
- *
- * This routine disables a specified interrupt level.
- *
- * .nT
- *
- * RETURNS: OK, or ERROR if <intLevel> is out of range.
- *
- * SEE ALSO: sysIntEnable(),
- * .sA
- */
- STATUS sysIntDisable
- (
- int intLevel /* interrupt level to disable */
- )
- {
- return(ixp425IntLvlDisable (intLevel)); /* see ixp425IntrCtl.c */
- }
- /********************************************************************************
- * sysIntEnable - enable an interrupt level
- *
- * This routine enables a specified IXP425 interrupt level.
- *
- * .nT
- *
- * RETURNS: OK, or ERROR if <intLevel> is out of range.
- *
- * SEE ALSO: sysIntDisable(),
- * .sA
- */
- STATUS sysIntEnable
- (
- int intLevel /* interrupt level to enable (1-31) */
- )
- {
- return(ixp425IntLvlEnable (intLevel)); /* see ixp425IntrCtl.c */
- }
- /*******************************************************************************
- * sysFlashWriteEnable - enable writes to flash
- *
- * This routine enables the writes to cs0
- *
- * .nT
- *
- * RETURNS: N/A
- *
- * SEE ALSO: sysFlashWriteDisable(),
- * .sA
- */
- void sysFlashWriteEnable(void)
- {
- return;
- }
- /*******************************************************************************
- * sysFlashWriteDisable - Disable writes to flash
- *
- * This routine Disable the writes to cs0
- *
- * .nT
- *
- * RETURNS: void
- *
- * SEE ALSO: sysFlashWriteEnable(),
- * .sA
- */
- void sysFlashWriteDisable(void)
- {
- return;
- }
- #define MAX_LINE 160 /* max line length for input to 'm' routine */
- #define MAX_ADR_SIZE 6
- LOCAL STATUS modMac(UINT8* storage, char *inline)
- {
- UINT8 line[8];
- UINT8 *pLine,*pInline = inline;
- UINT32 value; /* value found in line */
- UINT8 excess;
- UINT32 i;
- for (i = 0; i < 6; i++)
- {
- bcopy(pInline, line,2);
- line[2] = 0;
- for (pLine = line; isspace ((int) *pLine); ++pLine) /* skip leading spaces*/
- ;
- if (*pLine == EOS) /* skip field if just CR */
- continue;
- if (sscanf (pLine, "%x%1s", &value, &excess) != 1)
- {
- return ERROR;
- }
- storage[i] = (UINT8)value; /* assign new value */
- pInline += 2;
- if(*pInline == ':')
- pInline++;
- }
- return OK;
- }
- /*****************************************************************************
- * ixdp425IfConfig - configure MAC and IP addresses of all ethernet interfaces
- *
- * This routine permits the programming of all ethernet MAC addresses along
- * with the specification of the IP address to be associated with a
- * given interface.
- *
- * RETURNS: OK or ERROR
- *
- */
- STATUS ixdp425IfConfig(void)
- {
- UINT32 i;
- UINT32 changed = 0;
- UINT8 nvImage[NV_RAM_IF_SIZE+1];
- UINT32 index;
- char *colon;
- #if defined(INCLUDE_IXETHACCEND)
- UINT8 macAddr[IX_ETH_ACC_NUMBER_OF_PORTS][SIZE_OF_MAC_ADDRESS+1];
- UINT8 inetAddr[IX_ETH_ACC_NUMBER_OF_PORTS][SIZE_OF_IP_ADDRESS+1];
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- UINT8 inetAddrPci[IXP425_MAX_FEI_DEVS][SIZE_OF_IP_ADDRESS+1];
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- UINT8 line[256];
- sysNvRamGet(nvImage, NV_RAM_IF_SIZE, NV_RAM_IF_START_OFFSET);
- #if defined(INCLUDE_IXETHACCEND)
- bzero((char *)inetAddr, sizeof(inetAddr));
- bzero((char *)macAddr, sizeof(macAddr));
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- bzero((char *)inetAddrPci, sizeof(inetAddrPci));
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- #if defined(INCLUDE_IXETHACCEND)
- /* Transfer to individual arrays */
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS; i++)
- {
- /* Get MAC address */
- index = (NV_MAC_ADRS_NPE1 + i*SIZE_OF_MAC_ADDRESS) - NV_RAM_IF_START_OFFSET;
- memcpy(macAddr[i], &nvImage[index],SIZE_OF_MAC_ADDRESS);
- /* Get IP address */
- index = NV_IP_ADRS_NPE1 + i*SIZE_OF_IP_ADDRESS - NV_RAM_IF_START_OFFSET;
- memcpy(inetAddr[i], &nvImage[index],SIZE_OF_IP_ADDRESS);
- inetAddr[i][SIZE_OF_IP_ADDRESS]=0;
- }
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- /*PCI END IP addresses*/
- for (i=0;i<IXP425_MAX_FEI_DEVS;i++)
- {
- index = NV_IP_ADRS_PCIEND1 + i*SIZE_OF_IP_ADDRESS - NV_RAM_IF_START_OFFSET;
- memcpy(inetAddrPci[i], &nvImage[index],SIZE_OF_IP_ADDRESS);
- inetAddrPci[i][SIZE_OF_IP_ADDRESS]=0;
- }
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- while(TRUE)
- {
- printf("n");
- /* Display the values */
- #if defined(INCLUDE_IXETHACCEND)
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS; i++)
- {
- printf("ixe%d MAC address: %02x:%02x:%02x:%02x:%02x:%02x n",i, macAddr[i][0], macAddr[i][1],
- macAddr[i][2], macAddr[i][3], macAddr[i][4], macAddr[i][5]);
- }
- printf("n");
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS; i++)
- {
- printf("ixe%d IP address: %s n",i,inetAddr[i]);
- }
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- printf("n");
- for (i=0;i<IXP425_MAX_FEI_DEVS;i++)
- {
- printf("fei%d IP address: %sn",i,inetAddrPci[i]);
- }
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- printf("nAny Changes (y/n)> ");
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] != 'y')
- break;
- #if defined(INCLUDE_IXETHACCEND)
- printf("nChange a MAC address (y/n)> ");
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == 'y')
- {
- /*NPE MACs next*/
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS; )
- {
- printf("ixe%d MAC address: %02x:%02x:%02x:%02x:%02x:%02x ",i, macAddr[i][0], macAddr[i][1],
- macAddr[i][2], macAddr[i][3], macAddr[i][4], macAddr[i][5]);
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == '-')
- {
- if (i > 0)
- i--;
- continue;
- }
- if (line[0] != 0 )
- {
- if (modMac(macAddr[i], line)==OK)
- {
- index = (NV_MAC_ADRS_NPE1 + i*SIZE_OF_MAC_ADDRESS) - NV_RAM_IF_START_OFFSET;
- memcpy(&nvImage[index], macAddr[i], 6);
- changed++;
- }
- else
- {
- printf("Invalid entry, changes discardedn");
- continue;
- }
- }
- i++;
- }
- }
- printf("nChange ixe IP address (y/n)> ");
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == 'y')
- {
- /*NPE IP addresses*/
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS;)
- {
- printf("ixe%d IP address: %s ",i,inetAddr[i]);
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == '-')
- {
- if (i > 0)
- i--;
- continue;
- }
- if (line[0] != 0 )
- {
- bzero(inetAddr[i], SIZE_OF_IP_ADDRESS);
- /* Do not save "0x" in the mask */
- if ( (colon = strchr(line, ':')) )
- {
- colon++;
- if(strncmp("0x",colon, 2) == 0)
- sprintf(colon, "%s", colon+2);
- }
- memcpy(inetAddr[i],line, strlen(line));
- changed++;
- }
- i++;
- }
- }
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- printf("nChange fei IP address (y/n)> ");
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == 'y')
- {
- /*PCI END IP addresses*/
- for (i=0;i<IXP425_MAX_FEI_DEVS;)
- {
- printf("fei%d IP address: %s ",i,inetAddrPci[i]);
- fioRdString (STD_IN, line, MAX_LINE);
- if (line[0] == '-')
- {
- if (i > 0)
- i--;
- continue;
- }
- if (line[0] != 0 )
- {
- bzero(inetAddrPci[i], SIZE_OF_IP_ADDRESS);
- /* Do not save "0x" in the mask */
- if ( (colon = strchr(line, ':')) )
- {
- colon++;
- if(strncmp("0x",colon, 2) == 0)
- sprintf(colon, "%s", colon+2);
- }
- memcpy(inetAddrPci[i],line, strlen(line));
- changed++;
- }
- i++;
- }
- }
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- }
- if( changed != 0 )
- {
- printf("nWriting interface data to non-volatile storage...n");
- #if defined(INCLUDE_IXETHACCEND)
- /* Move data back to serial array */
- for (i=0;i<IX_ETH_ACC_NUMBER_OF_PORTS; i++)
- {
- /* Get MAC address */
- index = (NV_MAC_ADRS_NPE1 + i*SIZE_OF_MAC_ADDRESS) - NV_RAM_IF_START_OFFSET;
- memcpy(&nvImage[index], macAddr[i],SIZE_OF_MAC_ADDRESS);
- /* Get IP address */
- index = NV_IP_ADRS_NPE1 + i*SIZE_OF_IP_ADDRESS - NV_RAM_IF_START_OFFSET;
- memcpy(&nvImage[index], inetAddr[i],SIZE_OF_IP_ADDRESS);
- }
- #endif /* INCLUDE_IXETHACCEND */
- #if defined(INCLUDE_PCI) && defined(INCLUDE_FEI82557END) && defined(IXDP_FEIEND_USE_NVRAM_IP)
- /*PCI END IP addresses*/
- for (i=0;i<IXP425_MAX_FEI_DEVS;i++)
- {
- index = NV_IP_ADRS_PCIEND1 + i*SIZE_OF_IP_ADDRESS - NV_RAM_IF_START_OFFSET;
- memcpy(&nvImage[index], inetAddrPci[i], SIZE_OF_IP_ADDRESS);
- }
- #endif /* INCLUDE_PCI && INCLUDE_FEI82557END && IXDP_FEIEND_USE_NVRAM_IP */
- if ( sysNvRamSet(nvImage,NV_RAM_IF_SIZE,NV_RAM_IF_START_OFFSET) == ERROR)
- {
- puts("Error writing interface data to non-volatile storage");
- return ERROR;
- }
- printf("New configuration written, changes will take effect after a rebootn");
- }
- return OK;
- }
- /*****************************************************************************
- * sysMicroDelay - Microsecond delay
- *
- * RETURNS: N/A
- *
- */
- void sysMicroDelay(int microseconds)
- {
- UINT32 delay = 0;
- UINT32 lastTimestamp = *((volatile int *)IXP425_OSTS);
- UINT32 currentTimestamp;
- UINT32 delta;
- while (delay < microseconds * IXP425_PERIPHERAL_BUS_CLOCK)
- {
- currentTimestamp = *((volatile int *)IXP425_OSTS);
- delta = currentTimestamp > lastTimestamp ? currentTimestamp - lastTimestamp : 0xffffffff - lastTimestamp + currentTimestamp;
- delay += delta;
- lastTimestamp = currentTimestamp;
- }
- }
- #ifdef INCLUDE_IXP425_UART_DEBUG
- void serialLog (char *pMsg, UINT32 nValue);
- void serialStringOut (char *pMsg);
- void serialMemDump (UINT32 *addr, UINT32 size);
- void serialHexOut (UINT32 value);
- void serialHexDig (UINT8 value);
- void serialTx (UINT8 value);
- #define UART_LineStatus 5
- #define UART_Transmit 0
- #define UARTLSR_TXHoldingEmpty (1 << 5)
- void serialLog (char *pMsg, UINT32 nValue)
- {
- serialStringOut (pMsg);
- serialHexOut (nValue);
- serialStringOut ("rn");
- }
- void serialStringOut (char *pMsg)
- {
- while (*pMsg) serialTx (*pMsg++);
- }
- void serialMemDump (UINT32 *addr, UINT32 size)
- {
- while (size)
- {
- serialHexOut((UINT32)addr);
- serialTx (':');
- serialHexOut (*addr++);
- serialTx (13);
- serialTx (10);
- size -= 4;
- }
- }
- void serialHexOut (UINT32 value)
- {
- UINT8 dig, ch;
- UINT8 count = 28;
- UINT32 temp;
- for (dig = 0 ; dig < 8; dig++)
- {
- temp = (value >> count);
- temp = temp & 0x0000000f;
- ch = (UINT8)temp;
- serialHexDig (ch);
- count -= 4;
- }
- }
- void serialHexDig (UINT8 value)
- {
- UINT8 hex;
- hex = (value < 10) ? (value + 0x30) : (value + 55);
- serialTx (hex);
- }
- void serialTx (UINT8 value)
- {
- volatile UINT8 status = 0;
- while (status == 0)
- status = *(UINT32*)(IXP425_UART2_BASE + UART_LineStatus);
- *(UINT8*)(IXP425_UART2_BASE + UART_Transmit) = value;
- }
- #endif
- #ifdef INCLUDE_MMU_VIRTUAL_MEM_EQUAL_PHY_MEM
- void *mmuPhysToVirt(void *physicalAddress)
- {
- return(physicalAddress);
- }
- void *mmuVirtToPhys(void *virtualAddress)
- {
- return(virtualAddress);
- }
- #endif