aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c6410/mach-smdk6410.c
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2009-12-29 09:40:36 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-17 21:41:03 -0500
commitf01fdac005d44e6c36af5b5eb841c4804570f0ad (patch)
tree0dc639711c946e84d92ddf8ebe2523317c7af9cf /arch/arm/mach-s3c6410/mach-smdk6410.c
parenta7c9194cdc9a858bbf5a4cdae289e28dea149aeb (diff)
ARM: SMDK6410: Add nC1 chipselect SROM setup
Since the mach-smdk6410.c file claims it can start up the smsc9115 ethernet device on the board, it should take care about configuring the necessary chip select nCS1 so it can see the chip. The select defaults to 8-bit mode so without config the Ethernet doesn't work. This patch uses the new SROM definitions to set nCS1 to the state found in the Samsung U-Boot port for 6410. It may be more conservative that it needs to be since those settings were marked as for CS8900A also using this chip select. But this change is enough to get the ethernet working when booted with Qi. Signed-off-by: Andy Green <andy@warmcat.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c6410/mach-smdk6410.c')
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index 8969fe73b83f..e7bae539af43 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -49,6 +49,7 @@
49#include <plat/regs-modem.h> 49#include <plat/regs-modem.h>
50#include <plat/regs-gpio.h> 50#include <plat/regs-gpio.h>
51#include <plat/regs-sys.h> 51#include <plat/regs-sys.h>
52#include <plat/regs-srom.h>
52#include <plat/iic.h> 53#include <plat/iic.h>
53#include <plat/fb.h> 54#include <plat/fb.h>
54#include <plat/gpio-cfg.h> 55#include <plat/gpio-cfg.h>
@@ -156,8 +157,8 @@ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
156 157
157static struct resource smdk6410_smsc911x_resources[] = { 158static struct resource smdk6410_smsc911x_resources[] = {
158 [0] = { 159 [0] = {
159 .start = 0x18000000, 160 .start = S3C64XX_PA_XM0CSN1,
160 .end = 0x18000000 + SZ_64K - 1, 161 .end = S3C64XX_PA_XM0CSN1 + SZ_64K - 1,
161 .flags = IORESOURCE_MEM, 162 .flags = IORESOURCE_MEM,
162 }, 163 },
163 [1] = { 164 [1] = {
@@ -430,10 +431,32 @@ static void __init smdk6410_map_io(void)
430 431
431static void __init smdk6410_machine_init(void) 432static void __init smdk6410_machine_init(void)
432{ 433{
434 u32 cs1;
435
433 s3c_i2c0_set_platdata(NULL); 436 s3c_i2c0_set_platdata(NULL);
434 s3c_i2c1_set_platdata(NULL); 437 s3c_i2c1_set_platdata(NULL);
435 s3c_fb_set_platdata(&smdk6410_lcd_pdata); 438 s3c_fb_set_platdata(&smdk6410_lcd_pdata);
436 439
440 /* configure nCS1 width to 16 bits */
441
442 cs1 = __raw_readl(S3C64XX_SROM_BW) &
443 ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
444 cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
445 (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
446 (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
447 S3C64XX_SROM_BW__NCS1__SHIFT;
448 __raw_writel(cs1, S3C64XX_SROM_BW);
449
450 /* set timing for nCS1 suitable for ethernet chip */
451
452 __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
453 (6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
454 (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
455 (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
456 (0xe << S3C64XX_SROM_BCX__TACC__SHIFT) |
457 (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
458 (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);
459
437 gpio_request(S3C64XX_GPN(5), "LCD power"); 460 gpio_request(S3C64XX_GPN(5), "LCD power");
438 gpio_request(S3C64XX_GPF(13), "LCD power"); 461 gpio_request(S3C64XX_GPF(13), "LCD power");
439 gpio_request(S3C64XX_GPF(15), "LCD power"); 462 gpio_request(S3C64XX_GPF(15), "LCD power");