xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-omap4/cpu.h (revision d417d1db5f9092d125ddea882ced77eaa5f3d236)
1d34efc76SSteve Sakoman /*
2d34efc76SSteve Sakoman  * (C) Copyright 2006-2010
3d34efc76SSteve Sakoman  * Texas Instruments, <www.ti.com>
4d34efc76SSteve Sakoman  *
5d34efc76SSteve Sakoman  * See file CREDITS for list of people who contributed to this
6d34efc76SSteve Sakoman  * project.
7d34efc76SSteve Sakoman  *
8d34efc76SSteve Sakoman  * This program is free software; you can redistribute it and/or
9d34efc76SSteve Sakoman  * modify it under the terms of the GNU General Public License as
10d34efc76SSteve Sakoman  * published by the Free Software Foundation; either version 2 of
11d34efc76SSteve Sakoman  * the License, or (at your option) any later version.
12d34efc76SSteve Sakoman  *
13d34efc76SSteve Sakoman  * This program is distributed in the hope that it will be useful,
14d34efc76SSteve Sakoman  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15d34efc76SSteve Sakoman  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16d34efc76SSteve Sakoman  * GNU General Public License for more details.
17d34efc76SSteve Sakoman  *
18d34efc76SSteve Sakoman  * You should have received a copy of the GNU General Public License
19d34efc76SSteve Sakoman  * along with this program; if not, write to the Free Software
20d34efc76SSteve Sakoman  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21d34efc76SSteve Sakoman  * MA 02111-1307 USA
22d34efc76SSteve Sakoman  *
23d34efc76SSteve Sakoman  */
24d34efc76SSteve Sakoman 
25d34efc76SSteve Sakoman #ifndef _CPU_H
26d34efc76SSteve Sakoman #define _CPU_H
27d34efc76SSteve Sakoman 
28d34efc76SSteve Sakoman #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
29d34efc76SSteve Sakoman #include <asm/types.h>
30d34efc76SSteve Sakoman #endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
31d34efc76SSteve Sakoman 
32d34efc76SSteve Sakoman #ifndef __KERNEL_STRICT_NAMES
33d34efc76SSteve Sakoman #ifndef __ASSEMBLY__
3427952014SSteve Sakoman struct gpmc_cs {
3527952014SSteve Sakoman 	u32 config1;		/* 0x00 */
3627952014SSteve Sakoman 	u32 config2;		/* 0x04 */
3727952014SSteve Sakoman 	u32 config3;		/* 0x08 */
3827952014SSteve Sakoman 	u32 config4;		/* 0x0C */
3927952014SSteve Sakoman 	u32 config5;		/* 0x10 */
4027952014SSteve Sakoman 	u32 config6;		/* 0x14 */
4127952014SSteve Sakoman 	u32 config7;		/* 0x18 */
4227952014SSteve Sakoman 	u32 nand_cmd;		/* 0x1C */
4327952014SSteve Sakoman 	u32 nand_adr;		/* 0x20 */
4427952014SSteve Sakoman 	u32 nand_dat;		/* 0x24 */
4527952014SSteve Sakoman 	u8 res[8];		/* blow up to 0x30 byte */
4627952014SSteve Sakoman };
4727952014SSteve Sakoman 
4827952014SSteve Sakoman struct gpmc {
4927952014SSteve Sakoman 	u8 res1[0x10];
5027952014SSteve Sakoman 	u32 sysconfig;		/* 0x10 */
5127952014SSteve Sakoman 	u8 res2[0x4];
5227952014SSteve Sakoman 	u32 irqstatus;		/* 0x18 */
5327952014SSteve Sakoman 	u32 irqenable;		/* 0x1C */
5427952014SSteve Sakoman 	u8 res3[0x20];
5527952014SSteve Sakoman 	u32 timeout_control;	/* 0x40 */
5627952014SSteve Sakoman 	u8 res4[0xC];
5727952014SSteve Sakoman 	u32 config;		/* 0x50 */
5827952014SSteve Sakoman 	u32 status;		/* 0x54 */
5927952014SSteve Sakoman 	u8 res5[0x8];	/* 0x58 */
6027952014SSteve Sakoman 	struct gpmc_cs cs[8];	/* 0x60, 0x90, .. */
6127952014SSteve Sakoman 	u8 res6[0x14];		/* 0x1E0 */
6227952014SSteve Sakoman 	u32 ecc_config;		/* 0x1F4 */
6327952014SSteve Sakoman 	u32 ecc_control;	/* 0x1F8 */
6427952014SSteve Sakoman 	u32 ecc_size_config;	/* 0x1FC */
6527952014SSteve Sakoman 	u32 ecc1_result;	/* 0x200 */
6627952014SSteve Sakoman 	u32 ecc2_result;	/* 0x204 */
6727952014SSteve Sakoman 	u32 ecc3_result;	/* 0x208 */
6827952014SSteve Sakoman 	u32 ecc4_result;	/* 0x20C */
6927952014SSteve Sakoman 	u32 ecc5_result;	/* 0x210 */
7027952014SSteve Sakoman 	u32 ecc6_result;	/* 0x214 */
7127952014SSteve Sakoman 	u32 ecc7_result;	/* 0x218 */
7227952014SSteve Sakoman 	u32 ecc8_result;	/* 0x21C */
7327952014SSteve Sakoman 	u32 ecc9_result;	/* 0x220 */
7427952014SSteve Sakoman };
7527952014SSteve Sakoman 
7627952014SSteve Sakoman /* Used for board specific gpmc initialization */
7727952014SSteve Sakoman extern struct gpmc *gpmc_cfg;
7827952014SSteve Sakoman 
79d34efc76SSteve Sakoman struct gptimer {
80d34efc76SSteve Sakoman 	u32 tidr;		/* 0x00 r */
81d34efc76SSteve Sakoman 	u8 res[0xc];
82d34efc76SSteve Sakoman 	u32 tiocp_cfg;		/* 0x10 rw */
83d34efc76SSteve Sakoman 	u32 tistat;		/* 0x14 r */
84d34efc76SSteve Sakoman 	u32 tisr;		/* 0x18 rw */
85d34efc76SSteve Sakoman 	u32 tier;		/* 0x1c rw */
86d34efc76SSteve Sakoman 	u32 twer;		/* 0x20 rw */
87d34efc76SSteve Sakoman 	u32 tclr;		/* 0x24 rw */
88d34efc76SSteve Sakoman 	u32 tcrr;		/* 0x28 rw */
89d34efc76SSteve Sakoman 	u32 tldr;		/* 0x2c rw */
90d34efc76SSteve Sakoman 	u32 ttgr;		/* 0x30 rw */
91d34efc76SSteve Sakoman 	u32 twpc;		/* 0x34 r */
92d34efc76SSteve Sakoman 	u32 tmar;		/* 0x38 rw */
93d34efc76SSteve Sakoman 	u32 tcar1;		/* 0x3c r */
94d34efc76SSteve Sakoman 	u32 tcicr;		/* 0x40 rw */
95d34efc76SSteve Sakoman 	u32 tcar2;		/* 0x44 r */
96d34efc76SSteve Sakoman };
97d34efc76SSteve Sakoman #endif /* __ASSEMBLY__ */
98d34efc76SSteve Sakoman #endif /* __KERNEL_STRICT_NAMES */
99d34efc76SSteve Sakoman 
100d34efc76SSteve Sakoman /* enable sys_clk NO-prescale /1 */
101d34efc76SSteve Sakoman #define GPT_EN			((0x0 << 2) | (0x1 << 1) | (0x1 << 0))
102d34efc76SSteve Sakoman 
103d34efc76SSteve Sakoman /* Watchdog */
104d34efc76SSteve Sakoman #ifndef __KERNEL_STRICT_NAMES
105d34efc76SSteve Sakoman #ifndef __ASSEMBLY__
106d34efc76SSteve Sakoman struct watchdog {
107d34efc76SSteve Sakoman 	u8 res1[0x34];
108d34efc76SSteve Sakoman 	u32 wwps;		/* 0x34 r */
109d34efc76SSteve Sakoman 	u8 res2[0x10];
110d34efc76SSteve Sakoman 	u32 wspr;		/* 0x48 rw */
111d34efc76SSteve Sakoman };
112d34efc76SSteve Sakoman #endif /* __ASSEMBLY__ */
113d34efc76SSteve Sakoman #endif /* __KERNEL_STRICT_NAMES */
114d34efc76SSteve Sakoman 
115d34efc76SSteve Sakoman #define WD_UNLOCK1		0xAAAA
116d34efc76SSteve Sakoman #define WD_UNLOCK2		0x5555
117d34efc76SSteve Sakoman 
118d34efc76SSteve Sakoman #define SYSCLKDIV_1		(0x1 << 6)
119d34efc76SSteve Sakoman #define SYSCLKDIV_2		(0x1 << 7)
120d34efc76SSteve Sakoman 
121d34efc76SSteve Sakoman #define CLKSEL_GPT1		(0x1 << 0)
122d34efc76SSteve Sakoman 
123d34efc76SSteve Sakoman #define EN_GPT1			(0x1 << 0)
124d34efc76SSteve Sakoman #define EN_32KSYNC		(0x1 << 2)
125d34efc76SSteve Sakoman 
126d34efc76SSteve Sakoman #define ST_WDT2			(0x1 << 5)
127d34efc76SSteve Sakoman 
128d34efc76SSteve Sakoman #define RESETDONE		(0x1 << 0)
129d34efc76SSteve Sakoman 
130d34efc76SSteve Sakoman #define TCLR_ST			(0x1 << 0)
131d34efc76SSteve Sakoman #define TCLR_AR			(0x1 << 1)
132d34efc76SSteve Sakoman #define TCLR_PRE		(0x1 << 5)
133d34efc76SSteve Sakoman 
13427952014SSteve Sakoman /* GPMC BASE */
13527952014SSteve Sakoman #define GPMC_BASE		(OMAP44XX_GPMC_BASE)
13627952014SSteve Sakoman 
137d34efc76SSteve Sakoman /* I2C base */
138d34efc76SSteve Sakoman #define I2C_BASE1		(OMAP44XX_L4_PER_BASE + 0x70000)
139d34efc76SSteve Sakoman #define I2C_BASE2		(OMAP44XX_L4_PER_BASE + 0x72000)
140d34efc76SSteve Sakoman #define I2C_BASE3		(OMAP44XX_L4_PER_BASE + 0x60000)
141d34efc76SSteve Sakoman 
1429b167577SSteve Sakoman /* MUSB base */
1439b167577SSteve Sakoman #define MUSB_BASE		(OMAP44XX_L4_CORE_BASE + 0xAB000)
1449b167577SSteve Sakoman 
14525223a68SAneesh V /* OMAP4 GPIO registers */
14625223a68SAneesh V #define OMAP_GPIO_REVISION		0x0000
14725223a68SAneesh V #define OMAP_GPIO_SYSCONFIG		0x0010
14825223a68SAneesh V #define OMAP_GPIO_SYSSTATUS		0x0114
14925223a68SAneesh V #define OMAP_GPIO_IRQSTATUS1		0x0118
15025223a68SAneesh V #define OMAP_GPIO_IRQSTATUS2		0x0128
15125223a68SAneesh V #define OMAP_GPIO_IRQENABLE2		0x012c
15225223a68SAneesh V #define OMAP_GPIO_IRQENABLE1		0x011c
15325223a68SAneesh V #define OMAP_GPIO_WAKE_EN		0x0120
15425223a68SAneesh V #define OMAP_GPIO_CTRL			0x0130
15525223a68SAneesh V #define OMAP_GPIO_OE			0x0134
15625223a68SAneesh V #define OMAP_GPIO_DATAIN		0x0138
15725223a68SAneesh V #define OMAP_GPIO_DATAOUT		0x013c
15825223a68SAneesh V #define OMAP_GPIO_LEVELDETECT0		0x0140
15925223a68SAneesh V #define OMAP_GPIO_LEVELDETECT1		0x0144
16025223a68SAneesh V #define OMAP_GPIO_RISINGDETECT		0x0148
16125223a68SAneesh V #define OMAP_GPIO_FALLINGDETECT		0x014c
16225223a68SAneesh V #define OMAP_GPIO_DEBOUNCE_EN		0x0150
16325223a68SAneesh V #define OMAP_GPIO_DEBOUNCE_VAL		0x0154
16425223a68SAneesh V #define OMAP_GPIO_CLEARIRQENABLE1	0x0160
16525223a68SAneesh V #define OMAP_GPIO_SETIRQENABLE1		0x0164
16625223a68SAneesh V #define OMAP_GPIO_CLEARWKUENA		0x0180
16725223a68SAneesh V #define OMAP_GPIO_SETWKUENA		0x0184
16825223a68SAneesh V #define OMAP_GPIO_CLEARDATAOUT		0x0190
16925223a68SAneesh V #define OMAP_GPIO_SETDATAOUT		0x0194
17025223a68SAneesh V 
171*d417d1dbSSRICHARAN R /*
172*d417d1dbSSRICHARAN R  * PRCM
173*d417d1dbSSRICHARAN R  */
174*d417d1dbSSRICHARAN R 
175*d417d1dbSSRICHARAN R /* PRM */
176*d417d1dbSSRICHARAN R #define PRM_BASE		0x4A306000
177*d417d1dbSSRICHARAN R #define PRM_DEVICE_BASE		(PRM_BASE + 0x1B00)
178*d417d1dbSSRICHARAN R 
179*d417d1dbSSRICHARAN R #define PRM_RSTCTRL		PRM_DEVICE_BASE
180*d417d1dbSSRICHARAN R #define PRM_RSTCTRL_RESET	0x01
181*d417d1dbSSRICHARAN R 
182d34efc76SSteve Sakoman #endif /* _CPU_H */
183