/*
 *  Copyright 2004 Freescale Semiconductor, Inc. All Rights Reserved.
 *
 * This program 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 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#include <linux/config.h>

/*!
 * @defgroup Memory Memory Map
 * @ingroup MSL
 */

/*!
 * @file memory.h
 * @brief This file contains macros needed by the Linux kernel and drivers.
 * 
 * @ingroup Memory
 */

/*
 * Include Files
 */
#include <linux/config.h>

/*!
 * Physical start address of the first bank of RAM
 */
#ifdef CONFIG_ARCH_ARGONPLUSEVB_PSRAM
#define PHYS_OFFSET             (0xB5000000UL)
#define PHYS_OFFSET_ASM         0xB5000000
#define PAGE_OFFSET_ASM         0xC0000000
#elif CONFIG_ARCH_ARGONPLUSEVB
#define PHYS_OFFSET             (0x80000000UL)
/*! This is needed for L2 Cache support */
#define PHYS_OFFSET_ASM         0x80000000
#define PAGE_OFFSET_ASM         0xC0000000
#elif CONFIG_ARCH_ARGONPLUSODYSSEY
#define PHYS_OFFSET             (0x90000000UL)
/*! This is needed for L2 Cache support */
#define PHYS_OFFSET_ASM         0x90000000
#define PAGE_OFFSET_ASM         0xC0000000
#endif

/*!
 * Virtual view <-> DMA view memory address translations
 * This macro is used to translate the virtual address to an address 
 * suitable to be passed to set_dma_addr()
 */
#define __virt_to_bus(a)	__virt_to_phys(a)

/*!
 * Used to convert an address for DMA operations to an address that the 
 * kernel can use.
 */
#define __bus_to_virt(a)	__phys_to_virt(a)

#endif /* __ASM_ARCH_MEMORY_H */
