Commit 161363cd authored by Kyungmin Park's avatar Kyungmin Park Committed by Tony Lindgren

ARM: OMAP: cleanup apollon board

- Add etherent gpmc handling
- Remove unused mux setting
- Add MMC switch pin comments
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ab0b9df1
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -187,16 +189,42 @@ static struct platform_device *apollon_devices[] __initdata = { ...@@ -187,16 +189,42 @@ static struct platform_device *apollon_devices[] __initdata = {
static inline void __init apollon_init_smc91x(void) static inline void __init apollon_init_smc91x(void)
{ {
unsigned long base; unsigned long base;
unsigned int rate;
struct clk *l3ck;
int eth_cs;
l3ck = clk_get(NULL, "core_l3_ck");
if (IS_ERR(l3ck))
rate = 100000000;
else
rate = clk_get_rate(l3ck);
eth_cs = APOLLON_ETH_CS;
/* Make sure CS1 timings are correct */ /* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011203; gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
GPMC_CONFIG2_1 = 0x001f1f01;
GPMC_CONFIG3_1 = 0x00080803; if (rate >= 160000000) {
GPMC_CONFIG4_1 = 0x1c091c09; gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
GPMC_CONFIG5_1 = 0x041f1f1f; gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
GPMC_CONFIG6_1 = 0x000004c4; gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, &base) < 0) { gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
} else if (rate >= 130000000) {
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
} else {/* rate = 100000000 */
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
}
if (gpmc_cs_request(eth_cs, SZ_16M, &base) < 0) {
printk(KERN_ERR "Failed to request GPMC CS for smc91x\n"); printk(KERN_ERR "Failed to request GPMC CS for smc91x\n");
return; return;
} }
...@@ -208,7 +236,7 @@ static inline void __init apollon_init_smc91x(void) ...@@ -208,7 +236,7 @@ static inline void __init apollon_init_smc91x(void)
if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) { if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) {
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
APOLLON_ETHR_GPIO_IRQ); APOLLON_ETHR_GPIO_IRQ);
gpmc_cs_free(APOLLON_ETH_CS); gpmc_cs_free(eth_cs);
return; return;
} }
omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1); omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1);
...@@ -232,6 +260,7 @@ static struct omap_mmc_config apollon_mmc_config __initdata = { ...@@ -232,6 +260,7 @@ static struct omap_mmc_config apollon_mmc_config __initdata = {
.wire4 = 1, .wire4 = 1,
.wp_pin = -1, .wp_pin = -1,
.power_pin = -1, .power_pin = -1,
/* Note: If you want to detect card feature, please assign 37 */
.switch_pin = -1, .switch_pin = -1,
}, },
}; };
...@@ -336,9 +365,6 @@ static void __init omap_apollon_init(void) ...@@ -336,9 +365,6 @@ static void __init omap_apollon_init(void)
apollon_flash_init(); apollon_flash_init();
apollon_usb_init(); apollon_usb_init();
/* REVISIT: where's the correct place */
omap_cfg_reg(W19_24XX_SYS_NIRQ);
/* Use Interal loop-back in MMC/SDIO Module Input Clock selection */ /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
CONTROL_DEVCONF |= (1 << 24); CONTROL_DEVCONF |= (1 << 24);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment