1/*
2 *  linux/include/asm-arm/arch-imx/hardware.h
3 *
4 *  Copyright (C) 1999 ARM Limited.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20#ifndef __ASM_ARCH_HARDWARE_H
21#define __ASM_ARCH_HARDWARE_H
22
23#include <asm/sizes.h>
24#include "imx-regs.h"
25
26#ifndef __ASSEMBLY__
27# define __REG(x)	(*((volatile u32 *)IO_ADDRESS(x)))
28
29# define __REG2(x,y)        (*(volatile u32 *)((u32)&__REG(x) + (y)))
30#endif
31
32/*
33 * Memory map
34 */
35
36#define IMX_IO_PHYS		0x00200000
37#define IMX_IO_SIZE		0x00100000
38#define IMX_IO_BASE		0xe0000000
39
40#define IMX_CS0_PHYS		0x10000000
41#define IMX_CS0_SIZE		0x02000000
42#define IMX_CS0_VIRT		0xe8000000
43
44#define IMX_CS1_PHYS		0x12000000
45#define IMX_CS1_SIZE		0x01000000
46#define IMX_CS1_VIRT		0xea000000
47
48#define IMX_CS2_PHYS		0x13000000
49#define IMX_CS2_SIZE		0x01000000
50#define IMX_CS2_VIRT		0xeb000000
51
52#define IMX_CS3_PHYS		0x14000000
53#define IMX_CS3_SIZE		0x01000000
54#define IMX_CS3_VIRT		0xec000000
55
56#define IMX_CS4_PHYS		0x15000000
57#define IMX_CS4_SIZE		0x01000000
58#define IMX_CS4_VIRT		0xed000000
59
60#define IMX_CS5_PHYS		0x16000000
61#define IMX_CS5_SIZE		0x01000000
62#define IMX_CS5_VIRT		0xee000000
63
64#define IMX_FB_VIRT		0xF1000000
65#define IMX_FB_SIZE		(256*1024)
66
67/* macro to get at IO space when running virtually */
68#define IO_ADDRESS(x) ((x) | IMX_IO_BASE)
69
70#ifndef __ASSEMBLY__
71/*
72 * Handy routine to set GPIO functions
73 */
74extern void imx_gpio_mode( int gpio_mode );
75
76/* get frequencies in Hz */
77extern unsigned int imx_get_system_clk(void);
78extern unsigned int imx_get_mcu_clk(void);
79extern unsigned int imx_get_perclk1(void); /* UART[12], Timer[12], PWM */
80extern unsigned int imx_get_perclk2(void); /* LCD, SD, SPI[12]         */
81extern unsigned int imx_get_perclk3(void); /* SSI                      */
82extern unsigned int imx_get_hclk(void);    /* SDRAM, CSI, Memory Stick,*/
83                                           /* I2C, DMA                 */
84#endif
85
86#define MAXIRQNUM                       62
87#define MAXFIQNUM                       62
88#define MAXSWINUM                       62
89
90/*
91 * Use SDRAM for memory
92 */
93#define MEM_SIZE		0x01000000
94
95#ifdef CONFIG_ARCH_MX1ADS
96#include "mx1ads.h"
97#endif
98
99#endif
100