/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */
#ifndef __VERSAIOS_H__
#define __VERSAIOS_H__

#define IN_RANGE(p, s, e) ((p) >= (s) && (p) < (e))

#ifndef IO_READ
#define IO_READ(addr)           (*(volatile u32 *)(addr))
#define IO_READ16(addr)           (*(volatile u16 *)(addr))
#endif
#ifndef IO_WRITE
#define IO_WRITE(addr, val)     (*(volatile u32 *)(addr)) = (val)
#define IO_WRITE16(addr, val)     (*(volatile u16 *)(addr)) = (val)
#endif

#define busRd32(addr)  IO_READ(addr)
#define busWrt32(addr, val) IO_WRITE(addr, val)

#define CPU_TO_BUS_ADDR(a)      (a)

/* Should match def in VersaIOSaddrs */
#define SDRAM_IOSHEAP_START 0x02000000
#define SDRAM_IOSHEAP_END 0x03000000
#define SDRAM_MAX_TESTS 16 

/* File generated from fiddle description of system */
#include <versa_arm9.h>

#define SYS_TIMER0_INTR       0x10
#define SYS_TIMER_EN          0x80
#define SYS_TIMER_INTREN      0x20
#define SYS_TIMER_32BIT       0x02   

/* Timer modes */
#define SYS_TIMER_FREERUN     0x00
#define SYS_TIMER_PERIODIC    0x40
#define SYS_TIMER_ONESHOT     0x01
#endif /*__VERSAIOS_H__*/
