diff options
author | Sekhar Nori <nsekhar@ti.com> | 2009-11-16 06:51:32 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-02-04 16:29:32 -0500 |
commit | d2de05827cce9438dfc61d5a4cf13b6ca82ebdee (patch) | |
tree | d01e5756f23f6ffce94ae0891b9b1e7148d9d4ea | |
parent | f2a4c59df62f4493c7cf7dfd349ec66bdd4b9fec (diff) |
davinci: da8xx/omapl1: add support for the second sysconfig module
OMAP-L138 adds a second SYSCFG region having useful functionality
like deep sleep, pull up/down control and SATA clock stop.
This patch makes provision for accessing registers from second
SYSCFG region in da8xx code.
Note that OMAP-L137 has a single SYSCFG region.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r-- | arch/arm/mach-davinci/board-da830-evm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/da830.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-davinci/da850.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/da8xx.h | 10 |
6 files changed, 28 insertions, 19 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 31dc9901e556..dc19870b23cd 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -112,7 +112,7 @@ static __init void da830_evm_usb_init(void) | |||
112 | * Set up USB clock/mode in the CFGCHIP2 register. | 112 | * Set up USB clock/mode in the CFGCHIP2 register. |
113 | * FYI: CFGCHIP2 is 0x0000ef00 initially. | 113 | * FYI: CFGCHIP2 is 0x0000ef00 initially. |
114 | */ | 114 | */ |
115 | cfgchip2 = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG)); | 115 | cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); |
116 | 116 | ||
117 | /* USB2.0 PHY reference clock is 24 MHz */ | 117 | /* USB2.0 PHY reference clock is 24 MHz */ |
118 | cfgchip2 &= ~CFGCHIP2_REFFREQ; | 118 | cfgchip2 &= ~CFGCHIP2_REFFREQ; |
@@ -139,7 +139,7 @@ static __init void da830_evm_usb_init(void) | |||
139 | cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN; | 139 | cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN; |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | __raw_writel(cfgchip2, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG)); | 142 | __raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); |
143 | 143 | ||
144 | /* USB_REFCLKIN is not used. */ | 144 | /* USB_REFCLKIN is not used. */ |
145 | ret = davinci_cfg_reg(DA830_USB0_DRVVBUS); | 145 | ret = davinci_cfg_reg(DA830_USB0_DRVVBUS); |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 07de8db14581..dba22419db0a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -537,7 +537,7 @@ static int __init da850_evm_config_emac(void) | |||
537 | if (!machine_is_davinci_da850_evm()) | 537 | if (!machine_is_davinci_da850_evm()) |
538 | return 0; | 538 | return 0; |
539 | 539 | ||
540 | cfg_chip3_base = DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG); | 540 | cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); |
541 | 541 | ||
542 | val = __raw_readl(cfg_chip3_base); | 542 | val = __raw_readl(cfg_chip3_base); |
543 | 543 | ||
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index b22b5cf04250..54796050a2ff 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c | |||
@@ -1208,13 +1208,13 @@ static struct davinci_soc_info davinci_soc_info_da830 = { | |||
1208 | 1208 | ||
1209 | void __init da830_init(void) | 1209 | void __init da830_init(void) |
1210 | { | 1210 | { |
1211 | da8xx_syscfg_base = ioremap(DA8XX_SYSCFG_BASE, SZ_4K); | 1211 | da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); |
1212 | if (WARN(!da8xx_syscfg_base, "Unable to map syscfg module")) | 1212 | if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module")) |
1213 | return; | 1213 | return; |
1214 | 1214 | ||
1215 | davinci_soc_info_da830.jtag_id_base = | 1215 | davinci_soc_info_da830.jtag_id_base = |
1216 | DA8XX_SYSCFG_VIRT(DA8XX_JTAG_ID_REG); | 1216 | DA8XX_SYSCFG0_VIRT(DA8XX_JTAG_ID_REG); |
1217 | davinci_soc_info_da830.pinmux_base = DA8XX_SYSCFG_VIRT(0x120); | 1217 | davinci_soc_info_da830.pinmux_base = DA8XX_SYSCFG0_VIRT(0x120); |
1218 | 1218 | ||
1219 | davinci_common_init(&davinci_soc_info_da830); | 1219 | davinci_common_init(&davinci_soc_info_da830); |
1220 | } | 1220 | } |
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 717806c6cef9..4f84ab4bb221 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -838,12 +838,12 @@ static void da850_set_async3_src(int pllnum) | |||
838 | } | 838 | } |
839 | } | 839 | } |
840 | 840 | ||
841 | v = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG)); | 841 | v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); |
842 | if (pllnum) | 842 | if (pllnum) |
843 | v |= CFGCHIP3_ASYNC3_CLKSRC; | 843 | v |= CFGCHIP3_ASYNC3_CLKSRC; |
844 | else | 844 | else |
845 | v &= ~CFGCHIP3_ASYNC3_CLKSRC; | 845 | v &= ~CFGCHIP3_ASYNC3_CLKSRC; |
846 | __raw_writel(v, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG)); | 846 | __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); |
847 | } | 847 | } |
848 | 848 | ||
849 | #ifdef CONFIG_CPU_FREQ | 849 | #ifdef CONFIG_CPU_FREQ |
@@ -996,9 +996,9 @@ static int da850_set_pll0rate(struct clk *clk, unsigned long index) | |||
996 | postdiv = opp->postdiv; | 996 | postdiv = opp->postdiv; |
997 | 997 | ||
998 | /* Unlock writing to PLL registers */ | 998 | /* Unlock writing to PLL registers */ |
999 | v = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP0_REG)); | 999 | v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); |
1000 | v &= ~CFGCHIP0_PLL_MASTER_LOCK; | 1000 | v &= ~CFGCHIP0_PLL_MASTER_LOCK; |
1001 | __raw_writel(v, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP0_REG)); | 1001 | __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); |
1002 | 1002 | ||
1003 | ret = davinci_set_pllrate(pll, prediv, mult, postdiv); | 1003 | ret = davinci_set_pllrate(pll, prediv, mult, postdiv); |
1004 | if (WARN_ON(ret)) | 1004 | if (WARN_ON(ret)) |
@@ -1053,13 +1053,17 @@ static struct davinci_soc_info davinci_soc_info_da850 = { | |||
1053 | 1053 | ||
1054 | void __init da850_init(void) | 1054 | void __init da850_init(void) |
1055 | { | 1055 | { |
1056 | da8xx_syscfg_base = ioremap(DA8XX_SYSCFG_BASE, SZ_4K); | 1056 | da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); |
1057 | if (WARN(!da8xx_syscfg_base, "Unable to map syscfg module")) | 1057 | if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module")) |
1058 | return; | ||
1059 | |||
1060 | da8xx_syscfg1_base = ioremap(DA8XX_SYSCFG1_BASE, SZ_4K); | ||
1061 | if (WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module")) | ||
1058 | return; | 1062 | return; |
1059 | 1063 | ||
1060 | davinci_soc_info_da850.jtag_id_base = | 1064 | davinci_soc_info_da850.jtag_id_base = |
1061 | DA8XX_SYSCFG_VIRT(DA8XX_JTAG_ID_REG); | 1065 | DA8XX_SYSCFG0_VIRT(DA8XX_JTAG_ID_REG); |
1062 | davinci_soc_info_da850.pinmux_base = DA8XX_SYSCFG_VIRT(0x120); | 1066 | davinci_soc_info_da850.pinmux_base = DA8XX_SYSCFG0_VIRT(0x120); |
1063 | 1067 | ||
1064 | davinci_common_init(&davinci_soc_info_da850); | 1068 | davinci_common_init(&davinci_soc_info_da850); |
1065 | 1069 | ||
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index a5105f03fd86..745534eb63c7 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -42,7 +42,8 @@ | |||
42 | #define DA8XX_MDIO_REG_OFFSET 0x4000 | 42 | #define DA8XX_MDIO_REG_OFFSET 0x4000 |
43 | #define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K | 43 | #define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K |
44 | 44 | ||
45 | void __iomem *da8xx_syscfg_base; | 45 | void __iomem *da8xx_syscfg0_base; |
46 | void __iomem *da8xx_syscfg1_base; | ||
46 | 47 | ||
47 | static struct plat_serial8250_port da8xx_serial_pdata[] = { | 48 | static struct plat_serial8250_port da8xx_serial_pdata[] = { |
48 | { | 49 | { |
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 90704910d343..bddc4d4a806e 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #include <mach/mmc.h> | 21 | #include <mach/mmc.h> |
22 | #include <mach/usb.h> | 22 | #include <mach/usb.h> |
23 | 23 | ||
24 | extern void __iomem *da8xx_syscfg_base; | 24 | extern void __iomem *da8xx_syscfg0_base; |
25 | extern void __iomem *da8xx_syscfg1_base; | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * The cp_intc interrupt controller for the da8xx isn't in the same | 28 | * The cp_intc interrupt controller for the da8xx isn't in the same |
@@ -34,13 +35,16 @@ extern void __iomem *da8xx_syscfg_base; | |||
34 | #define DA8XX_CP_INTC_SIZE SZ_8K | 35 | #define DA8XX_CP_INTC_SIZE SZ_8K |
35 | #define DA8XX_CP_INTC_VIRT (IO_VIRT - DA8XX_CP_INTC_SIZE - SZ_4K) | 36 | #define DA8XX_CP_INTC_VIRT (IO_VIRT - DA8XX_CP_INTC_SIZE - SZ_4K) |
36 | 37 | ||
37 | #define DA8XX_SYSCFG_BASE (IO_PHYS + 0x14000) | 38 | #define DA8XX_SYSCFG0_BASE (IO_PHYS + 0x14000) |
38 | #define DA8XX_SYSCFG_VIRT(x) (da8xx_syscfg_base + (x)) | 39 | #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) |
39 | #define DA8XX_JTAG_ID_REG 0x18 | 40 | #define DA8XX_JTAG_ID_REG 0x18 |
40 | #define DA8XX_CFGCHIP0_REG 0x17c | 41 | #define DA8XX_CFGCHIP0_REG 0x17c |
41 | #define DA8XX_CFGCHIP2_REG 0x184 | 42 | #define DA8XX_CFGCHIP2_REG 0x184 |
42 | #define DA8XX_CFGCHIP3_REG 0x188 | 43 | #define DA8XX_CFGCHIP3_REG 0x188 |
43 | 44 | ||
45 | #define DA8XX_SYSCFG1_BASE (IO_PHYS + 0x22C000) | ||
46 | #define DA8XX_SYSCFG1_VIRT(x) (da8xx_syscfg1_base + (x)) | ||
47 | |||
44 | #define DA8XX_PSC0_BASE 0x01c10000 | 48 | #define DA8XX_PSC0_BASE 0x01c10000 |
45 | #define DA8XX_PLL0_BASE 0x01c11000 | 49 | #define DA8XX_PLL0_BASE 0x01c11000 |
46 | #define DA8XX_TIMER64P0_BASE 0x01c20000 | 50 | #define DA8XX_TIMER64P0_BASE 0x01c20000 |