830ad209552c58d44f2751b2f063e0918d6f7732
1 /*
2 * AM33XX Power Management Routines
3 *
4 * Copyright (C) 2012 Texas Instruments Inc.
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 version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef __ARCH_ARM_MACH_OMAP2_PM33XX_H
12 #define __ARCH_ARM_MACH_OMAP2_PM33XX_H
14 #include <mach/hardware.h> /* XXX Is this the right one to include? */
16 #ifndef __ASSEMBLER__
17 extern void __iomem *am33xx_get_ram_base(void);
18 #endif /* ASSEMBLER */
20 /* DDR offsets */
21 #define DDR_CMD0_IOCTRL (AM33XX_CTRL_BASE + 0x1404)
22 #define DDR_CMD1_IOCTRL (AM33XX_CTRL_BASE + 0x1408)
23 #define DDR_CMD2_IOCTRL (AM33XX_CTRL_BASE + 0x140C)
24 #define DDR_DATA0_IOCTRL (AM33XX_CTRL_BASE + 0x1440)
25 #define DDR_DATA1_IOCTRL (AM33XX_CTRL_BASE + 0x1444)
27 #define DDR_IO_CTRL (AM33XX_CTRL_BASE + 0x0E04)
28 #define VTP0_CTRL_REG (AM33XX_CTRL_BASE + 0x0E0C)
29 #define DDR_CKE_CTRL (AM33XX_CTRL_BASE + 0x131C)
30 #define DDR_PHY_BASE_ADDR (AM33XX_CTRL_BASE + 0x2000)
32 #define CMD0_CTRL_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x01C)
33 #define CMD0_CTRL_SLAVE_FORCE_0 (DDR_PHY_BASE_ADDR + 0x020)
34 #define CMD0_CTRL_SLAVE_DELAY_0 (DDR_PHY_BASE_ADDR + 0x024)
35 #define CMD0_DLL_LOCK_DIFF_0 (DDR_PHY_BASE_ADDR + 0x028)
36 #define CMD0_INVERT_CLKOUT_0 (DDR_PHY_BASE_ADDR + 0x02C)
38 #define CMD1_CTRL_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x050)
39 #define CMD1_CTRL_SLAVE_FORCE_0 (DDR_PHY_BASE_ADDR + 0x054)
40 #define CMD1_CTRL_SLAVE_DELAY_0 (DDR_PHY_BASE_ADDR + 0x058)
41 #define CMD1_DLL_LOCK_DIFF_0 (DDR_PHY_BASE_ADDR + 0x05C)
42 #define CMD1_INVERT_CLKOUT_0 (DDR_PHY_BASE_ADDR + 0x060)
44 #define CMD2_CTRL_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x084)
45 #define CMD2_CTRL_SLAVE_FORCE_0 (DDR_PHY_BASE_ADDR + 0x088)
46 #define CMD2_CTRL_SLAVE_DELAY_0 (DDR_PHY_BASE_ADDR + 0x08C)
47 #define CMD2_DLL_LOCK_DIFF_0 (DDR_PHY_BASE_ADDR + 0x090)
48 #define CMD2_INVERT_CLKOUT_0 (DDR_PHY_BASE_ADDR + 0x094)
50 #define DATA0_RD_DQS_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x0C8)
51 #define DATA0_RD_DQS_SLAVE_RATIO_1 (DDR_PHY_BASE_ADDR + 0x0CC)
53 #define DATA0_WR_DQS_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x0DC)
54 #define DATA0_WR_DQS_SLAVE_RATIO_1 (DDR_PHY_BASE_ADDR + 0x0E0)
56 #define DATA0_WRLVL_INIT_RATIO_0 (DDR_PHY_BASE_ADDR + 0x0F0)
57 #define DATA0_WRLVL_INIT_RATIO_1 (DDR_PHY_BASE_ADDR + 0x0F4)
59 #define DATA0_GATELVL_INIT_RATIO_0 (DDR_PHY_BASE_ADDR + 0x0FC)
60 #define DATA0_GATELVL_INIT_RATIO_1 (DDR_PHY_BASE_ADDR + 0x100)
62 #define DATA0_FIFO_WE_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x108)
63 #define DATA0_FIFO_WE_SLAVE_RATIO_1 (DDR_PHY_BASE_ADDR + 0x10C)
65 #define DATA0_WR_DATA_SLAVE_RATIO_0 (DDR_PHY_BASE_ADDR + 0x120)
66 #define DATA0_WR_DATA_SLAVE_RATIO_1 (DDR_PHY_BASE_ADDR + 0x124)
68 #define DATA0_DLL_LOCK_DIFF_0 (DDR_PHY_BASE_ADDR + 0x138)
70 #define DATA0_RANK0_DELAYS_0 (DDR_PHY_BASE_ADDR + 0x134)
71 #define DATA1_RANK0_DELAYS_0 (DDR_PHY_BASE_ADDR + 0x1D8)
73 /* Temp placeholder for the values we want in the registers */
74 #define EMIF_READ_LATENCY 0x04
75 #define EMIF_TIM1 0x0666B3D6
76 #define EMIF_TIM2 0x143731DA
77 #define EMIF_TIM3 0x00000347
78 #define EMIF_SDCFG 0x43805332
79 #define EMIF_SDREF 0x0000081a
80 #define EMIF_SDMGT 0x80000000
81 #define EMIF_SDRAM 0x00004650
82 #define EMIF_PHYCFG 0x2
84 #define DDR2_DLL_LOCK_DIFF 0x0
85 #define DDR2_RD_DQS 0x12
86 #define DDR2_PHY_FIFO_WE 0x80
88 #define DDR_PHY_RESET (0x1 << 10)
89 #define DDR_PHY_READY (0x1 << 2)
90 #define DDR2_RATIO 0x80
91 #define CMD_FORCE 0x00
92 #define CMD_DELAY 0x00
94 #define DDR2_INVERT_CLKOUT 0x00
95 #define DDR2_WR_DQS 0x00
96 #define DDR2_PHY_WRLVL 0x00
97 #define DDR2_PHY_GATELVL 0x00
98 #define DDR2_PHY_WR_DATA 0x40
99 #define PHY_RANK0_DELAY 0x01
100 #define PHY_DLL_LOCK_DIFF 0x0
101 #define DDR_IOCTRL_VALUE 0x18B
103 #define VTP_CTRL_READY (0x1 << 5)
104 #define VTP_CTRL_ENABLE (0x1 << 6)
105 #define VTP_CTRL_LOCK_EN (0x1 << 4)
106 #define VTP_CTRL_START_EN (0x1)
108 #endif