aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-2430sdp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-2430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 64235dee5614..1c12d7c6c7fc 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -33,7 +33,6 @@
33#include <asm/arch/board.h> 33#include <asm/arch/board.h>
34#include <asm/arch/common.h> 34#include <asm/arch/common.h>
35#include <asm/arch/gpmc.h> 35#include <asm/arch/gpmc.h>
36#include "prcm-regs.h"
37 36
38#include <asm/io.h> 37#include <asm/io.h>
39 38
@@ -125,15 +124,18 @@ static inline void __init sdp2430_init_smc91x(void)
125 int eth_cs; 124 int eth_cs;
126 unsigned long cs_mem_base; 125 unsigned long cs_mem_base;
127 unsigned int rate; 126 unsigned int rate;
128 struct clk *l3ck; 127 struct clk *gpmc_fck;
129 128
130 eth_cs = SDP2430_SMC91X_CS; 129 eth_cs = SDP2430_SMC91X_CS;
131 130
132 l3ck = clk_get(NULL, "core_l3_ck"); 131 gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */
133 if (IS_ERR(l3ck)) 132 if (IS_ERR(gpmc_fck)) {
134 rate = 100000000; 133 WARN_ON(1);
135 else 134 return;
136 rate = clk_get_rate(l3ck); 135 }
136
137 clk_enable(gpmc_fck);
138 rate = clk_get_rate(gpmc_fck);
137 139
138 /* Make sure CS1 timings are correct, for 2430 always muxed */ 140 /* Make sure CS1 timings are correct, for 2430 always muxed */
139 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200); 141 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
@@ -160,7 +162,7 @@ static inline void __init sdp2430_init_smc91x(void)
160 162
161 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { 163 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
162 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); 164 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
163 return; 165 goto out;
164 } 166 }
165 167
166 sdp2430_smc91x_resources[0].start = cs_mem_base + 0x300; 168 sdp2430_smc91x_resources[0].start = cs_mem_base + 0x300;
@@ -171,10 +173,13 @@ static inline void __init sdp2430_init_smc91x(void)
171 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", 173 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
172 OMAP24XX_ETHR_GPIO_IRQ); 174 OMAP24XX_ETHR_GPIO_IRQ);
173 gpmc_cs_free(eth_cs); 175 gpmc_cs_free(eth_cs);
174 return; 176 goto out;
175 } 177 }
176 omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1); 178 omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
177 179
180out:
181 clk_disable(gpmc_fck);
182 clk_put(gpmc_fck);
178} 183}
179 184
180static void __init omap_2430sdp_init_irq(void) 185static void __init omap_2430sdp_init_irq(void)