All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: S5PV310: Add support ethernet for SMDKV310 and SMDKC210
@ 2010-10-13 12:15 ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, kgene.kim

This patch adds support ethernet for SMDKV310 and SMDKC210 boards.

NOTE: Depends on EINT and GPIOlib.

[PATCH 1/2] ARM: S5PV310: Add support SROMC
[PATCH 2/2] ARM: S5PV310: Support ethernet for SMDKV310 and SMDKC210

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] ARM: S5PV310: Add support ethernet for SMDKV310 and SMDKC210
@ 2010-10-13 12:15 ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support ethernet for SMDKV310 and SMDKC210 boards.

NOTE: Depends on EINT and GPIOlib.

[PATCH 1/2] ARM: S5PV310: Add support SROMC
[PATCH 2/2] ARM: S5PV310: Support ethernet for SMDKV310 and SMDKC210

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add support SROMC
  2010-10-13 12:15 ` Sangbeom Kim
@ 2010-10-13 12:15   ` Sangbeom Kim
  -1 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc
  Cc: ben-linux, kgene.kim, Daein Moon, Sangbeom Kim

From: Daein Moon <moon9124@samsung.com>

This patch adds support SROMC for S5PV310 and S5PC210.

Signed-off-by: Daein Moon <moon9124@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
---
 arch/arm/mach-s5pv310/cpu.c                    |    5 ++
 arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
 arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50 ++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h

diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index ffed262..873783a 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
 		.pfn		= __phys_to_pfn(S3C_PA_UART),
 		.length		= SZ_512K,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_SROMC,
+		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
 	},
 };
 
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
index 1429510..37294f1 100644
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ b/arch/arm/mach-s5pv310/include/mach/map.h
@@ -25,6 +25,8 @@
 
 #define S5PV310_PA_SYSRAM		(0x02025000)
 
+#define S5PV310_PA_SROM_BANK(x)		(0x04000000 + ((x) * 0x01000000))
+
 #define S5PC210_PA_ONENAND		(0x0C000000)
 #define S5P_PA_ONENAND			S5PC210_PA_ONENAND
 
@@ -58,6 +60,8 @@
 
 #define S5PV310_PA_HSMMC(x)		(0x12510000 + ((x) * 0x10000))
 
+#define S5PV310_PA_SROMC		(0x12570000)
+
 #define S5PV310_PA_UART			(0x13800000)
 
 #define S5P_PA_UART(x)			(S5PV310_PA_UART + ((x) * S3C_UART_OFFSET))
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-srom.h b/arch/arm/mach-s5pv310/include/mach/regs-srom.h
new file mode 100644
index 0000000..1898b3e
--- /dev/null
+++ b/arch/arm/mach-s5pv310/include/mach/regs-srom.h
@@ -0,0 +1,50 @@
+/* linux/arch/arm/mach-s5pv310/include/mach/regs-srom.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * S5PV310 - SROMC register definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_SROM_H
+#define __ASM_ARCH_REGS_SROM_H __FILE__
+
+#include <mach/map.h>
+
+#define S5PV310_SROMREG(x)	(S5P_VA_SROMC + (x))
+
+#define S5PV310_SROM_BW		S5PV310_SROMREG(0x0)
+#define S5PV310_SROM_BC0	S5PV310_SROMREG(0x4)
+#define S5PV310_SROM_BC1	S5PV310_SROMREG(0x8)
+#define S5PV310_SROM_BC2	S5PV310_SROMREG(0xc)
+#define S5PV310_SROM_BC3	S5PV310_SROMREG(0x10)
+
+/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
+
+#define S5PV310_SROM_BW__DATAWIDTH__SHIFT	0
+#define S5PV310_SROM_BW__ADDRMODE__SHIFT	1
+#define S5PV310_SROM_BW__WAITENABLE__SHIFT	2
+#define S5PV310_SROM_BW__BYTEENABLE__SHIFT	3
+
+#define S5PV310_SROM_BW__CS_MASK		0xf
+
+#define S5PV310_SROM_BW__NCS0__SHIFT		0
+#define S5PV310_SROM_BW__NCS1__SHIFT		4
+#define S5PV310_SROM_BW__NCS2__SHIFT		8
+#define S5PV310_SROM_BW__NCS3__SHIFT		12
+
+/* applies to same to BCS0 - BCS3 */
+
+#define S5PV310_SROM_BCX__PMC__SHIFT		0
+#define S5PV310_SROM_BCX__TACP__SHIFT		4
+#define S5PV310_SROM_BCX__TCAH__SHIFT		8
+#define S5PV310_SROM_BCX__TCOH__SHIFT		12
+#define S5PV310_SROM_BCX__TACC__SHIFT		16
+#define S5PV310_SROM_BCX__TCOS__SHIFT		24
+#define S5PV310_SROM_BCX__TACS__SHIFT		28
+
+#endif /* __ASM_ARCH_REGS_SROM_H */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add support SROMC
@ 2010-10-13 12:15   ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Daein Moon <moon9124@samsung.com>

This patch adds support SROMC for S5PV310 and S5PC210.

Signed-off-by: Daein Moon <moon9124@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
---
 arch/arm/mach-s5pv310/cpu.c                    |    5 ++
 arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
 arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50 ++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h

diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index ffed262..873783a 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
 		.pfn		= __phys_to_pfn(S3C_PA_UART),
 		.length		= SZ_512K,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_SROMC,
+		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
 	},
 };
 
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
index 1429510..37294f1 100644
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ b/arch/arm/mach-s5pv310/include/mach/map.h
@@ -25,6 +25,8 @@
 
 #define S5PV310_PA_SYSRAM		(0x02025000)
 
+#define S5PV310_PA_SROM_BANK(x)		(0x04000000 + ((x) * 0x01000000))
+
 #define S5PC210_PA_ONENAND		(0x0C000000)
 #define S5P_PA_ONENAND			S5PC210_PA_ONENAND
 
@@ -58,6 +60,8 @@
 
 #define S5PV310_PA_HSMMC(x)		(0x12510000 + ((x) * 0x10000))
 
+#define S5PV310_PA_SROMC		(0x12570000)
+
 #define S5PV310_PA_UART			(0x13800000)
 
 #define S5P_PA_UART(x)			(S5PV310_PA_UART + ((x) * S3C_UART_OFFSET))
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-srom.h b/arch/arm/mach-s5pv310/include/mach/regs-srom.h
new file mode 100644
index 0000000..1898b3e
--- /dev/null
+++ b/arch/arm/mach-s5pv310/include/mach/regs-srom.h
@@ -0,0 +1,50 @@
+/* linux/arch/arm/mach-s5pv310/include/mach/regs-srom.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * S5PV310 - SROMC register definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_SROM_H
+#define __ASM_ARCH_REGS_SROM_H __FILE__
+
+#include <mach/map.h>
+
+#define S5PV310_SROMREG(x)	(S5P_VA_SROMC + (x))
+
+#define S5PV310_SROM_BW		S5PV310_SROMREG(0x0)
+#define S5PV310_SROM_BC0	S5PV310_SROMREG(0x4)
+#define S5PV310_SROM_BC1	S5PV310_SROMREG(0x8)
+#define S5PV310_SROM_BC2	S5PV310_SROMREG(0xc)
+#define S5PV310_SROM_BC3	S5PV310_SROMREG(0x10)
+
+/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
+
+#define S5PV310_SROM_BW__DATAWIDTH__SHIFT	0
+#define S5PV310_SROM_BW__ADDRMODE__SHIFT	1
+#define S5PV310_SROM_BW__WAITENABLE__SHIFT	2
+#define S5PV310_SROM_BW__BYTEENABLE__SHIFT	3
+
+#define S5PV310_SROM_BW__CS_MASK		0xf
+
+#define S5PV310_SROM_BW__NCS0__SHIFT		0
+#define S5PV310_SROM_BW__NCS1__SHIFT		4
+#define S5PV310_SROM_BW__NCS2__SHIFT		8
+#define S5PV310_SROM_BW__NCS3__SHIFT		12
+
+/* applies to same to BCS0 - BCS3 */
+
+#define S5PV310_SROM_BCX__PMC__SHIFT		0
+#define S5PV310_SROM_BCX__TACP__SHIFT		4
+#define S5PV310_SROM_BCX__TCAH__SHIFT		8
+#define S5PV310_SROM_BCX__TCOH__SHIFT		12
+#define S5PV310_SROM_BCX__TACC__SHIFT		16
+#define S5PV310_SROM_BCX__TCOS__SHIFT		24
+#define S5PV310_SROM_BCX__TACS__SHIFT		28
+
+#endif /* __ASM_ARCH_REGS_SROM_H */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Support ethernet for SMDKV310 and SMDKC210
  2010-10-13 12:15 ` Sangbeom Kim
@ 2010-10-13 12:15   ` Sangbeom Kim
  -1 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc
  Cc: ben-linux, kgene.kim, Daein Moon, Sangbeom Kim

From: Daein Moon <moon9124@samsung.com>

This patch adds to support ethernet for SMDKV310 and SMDKC210 board.
  - define smc911x resources
  - define configurations of smc911x platform data
  - define platform device "smsc911x"
  - initialize srom controller for lan9215 chip

Signed-off-by: Daein Moon <moon9124@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
---
 arch/arm/mach-s5pv310/mach-smdkc210.c |   61 +++++++++++++++++++++++++++++++++
 arch/arm/mach-s5pv310/mach-smdkv310.c |   61 +++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index d2cf694..14aca19 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -12,6 +12,8 @@
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_device.h>
+#include <linux/smsc911x.h>
+#include <linux/io.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -24,6 +26,7 @@
 #include <plat/sdhci.h>
 
 #include <mach/map.h>
+#include <mach/regs-srom.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKC210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -106,6 +109,37 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
 	.clk_type		= S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
+static struct resource smdkc210_smsc911x_resources[] = {
+	[0] = {
+		.start	= S5PV310_PA_SROM_BANK(1),
+		.end	= S5PV310_PA_SROM_BANK(1) + SZ_64K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_EINT(5),
+		.end	= IRQ_EINT(5),
+		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
+	},
+};
+
+static struct smsc911x_platform_config smsc9215_config = {
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
+	.flags		= SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
+	.mac		= {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
+};
+
+static struct platform_device smdkc210_smsc911x = {
+	.name		= "smsc911x",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(smdkc210_smsc911x_resources),
+	.resource	= smdkc210_smsc911x_resources,
+	.dev		= {
+		.platform_data  = &smsc9215_config,
+	},
+};
+
 static struct platform_device *smdkc210_devices[] __initdata = {
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
@@ -113,8 +147,33 @@ static struct platform_device *smdkc210_devices[] __initdata = {
 	&s3c_device_hsmmc3,
 	&s3c_device_rtc,
 	&s3c_device_wdt,
+	&smdkc210_smsc911x,
 };
 
+static void __init smdkc210_smsc911x_init(void)
+{
+	u32 cs1;
+
+	/* configure nCS1 width to 16 bits */
+	cs1 = __raw_readl(S5PV310_SROM_BW) &
+		    ~(S5PV310_SROM_BW__CS_MASK <<
+				    S5PV310_SROM_BW__NCS1__SHIFT);
+	cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) |
+		(1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) |
+		(1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) <<
+		S5PV310_SROM_BW__NCS1__SHIFT;
+	__raw_writel(cs1, S5PV310_SROM_BW);
+
+	/* set timing for nCS1 suitable for ethernet chip */
+	__raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) |
+		     (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) |
+		     (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) |
+		     (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
+}
+
 static void __init smdkc210_map_io(void)
 {
 	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -124,6 +183,8 @@ static void __init smdkc210_map_io(void)
 
 static void __init smdkc210_machine_init(void)
 {
+	smdkc210_smsc911x_init();
+
 	s3c_sdhci0_set_platdata(&smdkc210_hsmmc0_pdata);
 	s3c_sdhci1_set_platdata(&smdkc210_hsmmc1_pdata);
 	s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index 10f8056..cd648d5 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -12,6 +12,8 @@
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_device.h>
+#include <linux/smsc911x.h>
+#include <linux/io.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -24,6 +26,7 @@
 #include <plat/sdhci.h>
 
 #include <mach/map.h>
+#include <mach/regs-srom.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV310_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -106,6 +109,37 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
 	.clk_type		= S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
+static struct resource smdkv310_smsc911x_resources[] = {
+	[0] = {
+		.start	= S5PV310_PA_SROM_BANK(1),
+		.end	= S5PV310_PA_SROM_BANK(1) + SZ_64K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_EINT(5),
+		.end	= IRQ_EINT(5),
+		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
+	},
+};
+
+static struct smsc911x_platform_config smsc9215_config = {
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
+	.flags		= SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
+	.mac		= {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
+};
+
+static struct platform_device smdkv310_smsc911x = {
+	.name		= "smsc911x",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(smdkv310_smsc911x_resources),
+	.resource	= smdkv310_smsc911x_resources,
+	.dev		= {
+		.platform_data  = &smsc9215_config,
+	},
+};
+
 static struct platform_device *smdkv310_devices[] __initdata = {
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
@@ -113,8 +147,33 @@ static struct platform_device *smdkv310_devices[] __initdata = {
 	&s3c_device_hsmmc3,
 	&s3c_device_rtc,
 	&s3c_device_wdt,
+	&smdkv310_smsc911x,
 };
 
+static void __init smdkv310_smsc911x_init(void)
+{
+	u32 cs1;
+
+	/* configure nCS1 width to 16 bits */
+	cs1 = __raw_readl(S5PV310_SROM_BW) &
+		    ~(S5PV310_SROM_BW__CS_MASK <<
+				    S5PV310_SROM_BW__NCS1__SHIFT);
+	cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) |
+		(1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) |
+		(1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) <<
+		S5PV310_SROM_BW__NCS1__SHIFT;
+	__raw_writel(cs1, S5PV310_SROM_BW);
+
+	/* set timing for nCS1 suitable for ethernet chip */
+	__raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) |
+		     (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) |
+		     (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) |
+		     (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
+}
+
 static void __init smdkv310_map_io(void)
 {
 	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -124,6 +183,8 @@ static void __init smdkv310_map_io(void)
 
 static void __init smdkv310_machine_init(void)
 {
+	smdkv310_smsc911x_init();
+
 	s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
 	s3c_sdhci1_set_platdata(&smdkv310_hsmmc1_pdata);
 	s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Support ethernet for SMDKV310 and SMDKC210
@ 2010-10-13 12:15   ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2010-10-13 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Daein Moon <moon9124@samsung.com>

This patch adds to support ethernet for SMDKV310 and SMDKC210 board.
  - define smc911x resources
  - define configurations of smc911x platform data
  - define platform device "smsc911x"
  - initialize srom controller for lan9215 chip

Signed-off-by: Daein Moon <moon9124@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
---
 arch/arm/mach-s5pv310/mach-smdkc210.c |   61 +++++++++++++++++++++++++++++++++
 arch/arm/mach-s5pv310/mach-smdkv310.c |   61 +++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index d2cf694..14aca19 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -12,6 +12,8 @@
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_device.h>
+#include <linux/smsc911x.h>
+#include <linux/io.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -24,6 +26,7 @@
 #include <plat/sdhci.h>
 
 #include <mach/map.h>
+#include <mach/regs-srom.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKC210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -106,6 +109,37 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
 	.clk_type		= S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
+static struct resource smdkc210_smsc911x_resources[] = {
+	[0] = {
+		.start	= S5PV310_PA_SROM_BANK(1),
+		.end	= S5PV310_PA_SROM_BANK(1) + SZ_64K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_EINT(5),
+		.end	= IRQ_EINT(5),
+		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
+	},
+};
+
+static struct smsc911x_platform_config smsc9215_config = {
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
+	.flags		= SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
+	.mac		= {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
+};
+
+static struct platform_device smdkc210_smsc911x = {
+	.name		= "smsc911x",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(smdkc210_smsc911x_resources),
+	.resource	= smdkc210_smsc911x_resources,
+	.dev		= {
+		.platform_data  = &smsc9215_config,
+	},
+};
+
 static struct platform_device *smdkc210_devices[] __initdata = {
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
@@ -113,8 +147,33 @@ static struct platform_device *smdkc210_devices[] __initdata = {
 	&s3c_device_hsmmc3,
 	&s3c_device_rtc,
 	&s3c_device_wdt,
+	&smdkc210_smsc911x,
 };
 
+static void __init smdkc210_smsc911x_init(void)
+{
+	u32 cs1;
+
+	/* configure nCS1 width to 16 bits */
+	cs1 = __raw_readl(S5PV310_SROM_BW) &
+		    ~(S5PV310_SROM_BW__CS_MASK <<
+				    S5PV310_SROM_BW__NCS1__SHIFT);
+	cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) |
+		(1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) |
+		(1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) <<
+		S5PV310_SROM_BW__NCS1__SHIFT;
+	__raw_writel(cs1, S5PV310_SROM_BW);
+
+	/* set timing for nCS1 suitable for ethernet chip */
+	__raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) |
+		     (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) |
+		     (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) |
+		     (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
+}
+
 static void __init smdkc210_map_io(void)
 {
 	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -124,6 +183,8 @@ static void __init smdkc210_map_io(void)
 
 static void __init smdkc210_machine_init(void)
 {
+	smdkc210_smsc911x_init();
+
 	s3c_sdhci0_set_platdata(&smdkc210_hsmmc0_pdata);
 	s3c_sdhci1_set_platdata(&smdkc210_hsmmc1_pdata);
 	s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index 10f8056..cd648d5 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -12,6 +12,8 @@
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_device.h>
+#include <linux/smsc911x.h>
+#include <linux/io.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -24,6 +26,7 @@
 #include <plat/sdhci.h>
 
 #include <mach/map.h>
+#include <mach/regs-srom.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV310_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -106,6 +109,37 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
 	.clk_type		= S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
+static struct resource smdkv310_smsc911x_resources[] = {
+	[0] = {
+		.start	= S5PV310_PA_SROM_BANK(1),
+		.end	= S5PV310_PA_SROM_BANK(1) + SZ_64K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_EINT(5),
+		.end	= IRQ_EINT(5),
+		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
+	},
+};
+
+static struct smsc911x_platform_config smsc9215_config = {
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
+	.flags		= SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
+	.mac		= {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
+};
+
+static struct platform_device smdkv310_smsc911x = {
+	.name		= "smsc911x",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(smdkv310_smsc911x_resources),
+	.resource	= smdkv310_smsc911x_resources,
+	.dev		= {
+		.platform_data  = &smsc9215_config,
+	},
+};
+
 static struct platform_device *smdkv310_devices[] __initdata = {
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
@@ -113,8 +147,33 @@ static struct platform_device *smdkv310_devices[] __initdata = {
 	&s3c_device_hsmmc3,
 	&s3c_device_rtc,
 	&s3c_device_wdt,
+	&smdkv310_smsc911x,
 };
 
+static void __init smdkv310_smsc911x_init(void)
+{
+	u32 cs1;
+
+	/* configure nCS1 width to 16 bits */
+	cs1 = __raw_readl(S5PV310_SROM_BW) &
+		    ~(S5PV310_SROM_BW__CS_MASK <<
+				    S5PV310_SROM_BW__NCS1__SHIFT);
+	cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) |
+		(1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) |
+		(1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) <<
+		S5PV310_SROM_BW__NCS1__SHIFT;
+	__raw_writel(cs1, S5PV310_SROM_BW);
+
+	/* set timing for nCS1 suitable for ethernet chip */
+	__raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) |
+		     (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) |
+		     (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) |
+		     (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) |
+		     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
+}
+
 static void __init smdkv310_map_io(void)
 {
 	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -124,6 +183,8 @@ static void __init smdkv310_map_io(void)
 
 static void __init smdkv310_machine_init(void)
 {
+	smdkv310_smsc911x_init();
+
 	s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
 	s3c_sdhci1_set_platdata(&smdkv310_hsmmc1_pdata);
 	s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] ARM: S5PV310: Add support SROMC
  2010-10-13 12:15   ` Sangbeom Kim
@ 2010-10-13 13:04     ` Marek Szyprowski
  -1 siblings, 0 replies; 12+ messages in thread
From: Marek Szyprowski @ 2010-10-13 13:04 UTC (permalink / raw)
  To: 'Sangbeom Kim', linux-arm-kernel, linux-samsung-soc
  Cc: 'Daein Moon', kgene.kim, ben-linux

Hello,

On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:

> From: Daein Moon <moon9124@samsung.com>
> 
> This patch adds support SROMC for S5PV310 and S5PC210.
> 
> Signed-off-by: Daein Moon <moon9124@samsung.com>
> Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> ---
>  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
>  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
>  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50 ++++++++++++++++++++++++
>  3 files changed, 59 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> 
> diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> index ffed262..873783a 100644
> --- a/arch/arm/mach-s5pv310/cpu.c
> +++ b/arch/arm/mach-s5pv310/cpu.c
> @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
>  		.pfn		= __phys_to_pfn(S3C_PA_UART),
>  		.length		= SZ_512K,
>  		.type		= MT_DEVICE,
> +	}, {
> +		.virtual	= (unsigned long)S5P_VA_SROMC,
> +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> +		.length		= SZ_4K,
> +		.type		= MT_DEVICE,
>  	},
>  };

Do You really need to make a permanent mapping for the SROMC area? Cannot the
setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the address it
got to the ethernet device? This area will be probably useless for boards other than
SMDK.

<snip>

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add support SROMC
@ 2010-10-13 13:04     ` Marek Szyprowski
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Szyprowski @ 2010-10-13 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:

> From: Daein Moon <moon9124@samsung.com>
> 
> This patch adds support SROMC for S5PV310 and S5PC210.
> 
> Signed-off-by: Daein Moon <moon9124@samsung.com>
> Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> ---
>  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
>  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
>  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50 ++++++++++++++++++++++++
>  3 files changed, 59 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> 
> diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> index ffed262..873783a 100644
> --- a/arch/arm/mach-s5pv310/cpu.c
> +++ b/arch/arm/mach-s5pv310/cpu.c
> @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
>  		.pfn		= __phys_to_pfn(S3C_PA_UART),
>  		.length		= SZ_512K,
>  		.type		= MT_DEVICE,
> +	}, {
> +		.virtual	= (unsigned long)S5P_VA_SROMC,
> +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> +		.length		= SZ_4K,
> +		.type		= MT_DEVICE,
>  	},
>  };

Do You really need to make a permanent mapping for the SROMC area? Cannot the
setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the address it
got to the ethernet device? This area will be probably useless for boards other than
SMDK.

<snip>

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] ARM: S5PV310: Add support SROMC
  2010-10-13 13:04     ` Marek Szyprowski
@ 2010-10-15  6:37       ` Daein Moon
  -1 siblings, 0 replies; 12+ messages in thread
From: Daein Moon @ 2010-10-15  6:37 UTC (permalink / raw)
  To: 'Marek Szyprowski', 'Sangbeom Kim',
	linux-arm-kernel, linux-samsung-soc
  Cc: kgene.kim, ben-linux

Marek Szyprowski wrote:
> 
> Hello,
> 
> On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:
> 
> > From: Daein Moon <moon9124@samsung.com>
> >
> > This patch adds support SROMC for S5PV310 and S5PC210.
> >
> > Signed-off-by: Daein Moon <moon9124@samsung.com>
> > Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> > ---
> >  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
> >  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
> >  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50
> ++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> >
> > diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> > index ffed262..873783a 100644
> > --- a/arch/arm/mach-s5pv310/cpu.c
> > +++ b/arch/arm/mach-s5pv310/cpu.c
> > @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata =
> {
> >  		.pfn		= __phys_to_pfn(S3C_PA_UART),
> >  		.length		= SZ_512K,
> >  		.type		= MT_DEVICE,
> > +	}, {
> > +		.virtual	= (unsigned long)S5P_VA_SROMC,
> > +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> > +		.length		= SZ_4K,
> > +		.type		= MT_DEVICE,
> >  	},
> >  };
> 
> Do You really need to make a permanent mapping for the SROMC area? Cannot
the
> setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the
address it
> got to the ethernet device? This area will be probably useless for boards
other than
> SMDK.
> 
Hi,

It seems to be useless because only ethernet device uses the SROM interface.
Will this mapping be ready for devices that will use the SROM interface in
boards
other than SMDK?

Best regards,
Daein Moon

> <snip>
> 
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add support SROMC
@ 2010-10-15  6:37       ` Daein Moon
  0 siblings, 0 replies; 12+ messages in thread
From: Daein Moon @ 2010-10-15  6:37 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Szyprowski wrote:
> 
> Hello,
> 
> On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:
> 
> > From: Daein Moon <moon9124@samsung.com>
> >
> > This patch adds support SROMC for S5PV310 and S5PC210.
> >
> > Signed-off-by: Daein Moon <moon9124@samsung.com>
> > Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> > ---
> >  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
> >  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
> >  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50
> ++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> >
> > diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> > index ffed262..873783a 100644
> > --- a/arch/arm/mach-s5pv310/cpu.c
> > +++ b/arch/arm/mach-s5pv310/cpu.c
> > @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata =
> {
> >  		.pfn		= __phys_to_pfn(S3C_PA_UART),
> >  		.length		= SZ_512K,
> >  		.type		= MT_DEVICE,
> > +	}, {
> > +		.virtual	= (unsigned long)S5P_VA_SROMC,
> > +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> > +		.length		= SZ_4K,
> > +		.type		= MT_DEVICE,
> >  	},
> >  };
> 
> Do You really need to make a permanent mapping for the SROMC area? Cannot
the
> setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the
address it
> got to the ethernet device? This area will be probably useless for boards
other than
> SMDK.
> 
Hi,

It seems to be useless because only ethernet device uses the SROM interface.
Will this mapping be ready for devices that will use the SROM interface in
boards
other than SMDK?

Best regards,
Daein Moon

> <snip>
> 
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] ARM: S5PV310: Add support SROMC
  2010-10-13 13:04     ` Marek Szyprowski
@ 2010-10-22  5:50       ` Kukjin Kim
  -1 siblings, 0 replies; 12+ messages in thread
From: Kukjin Kim @ 2010-10-22  5:50 UTC (permalink / raw)
  To: 'Marek Szyprowski', 'Sangbeom Kim',
	linux-arm-kernel, linux-samsung-soc
  Cc: 'Daein Moon', ben-linux

Marek Szyprowski wrote:
> 
> Hello,
> 
> On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:
> 
> > From: Daein Moon <moon9124@samsung.com>
> >
> > This patch adds support SROMC for S5PV310 and S5PC210.
> >
> > Signed-off-by: Daein Moon <moon9124@samsung.com>
> > Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> > ---
> >  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
> >  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
> >  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50
> ++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> >
> > diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> > index ffed262..873783a 100644
> > --- a/arch/arm/mach-s5pv310/cpu.c
> > +++ b/arch/arm/mach-s5pv310/cpu.c
> > @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata =
{
> >  		.pfn		= __phys_to_pfn(S3C_PA_UART),
> >  		.length		= SZ_512K,
> >  		.type		= MT_DEVICE,
> > +	}, {
> > +		.virtual	= (unsigned long)S5P_VA_SROMC,
> > +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> > +		.length		= SZ_4K,
> > +		.type		= MT_DEVICE,
> >  	},
> >  };
> 
> Do You really need to make a permanent mapping for the SROMC area? Cannot
the
> setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the
> address it
> got to the ethernet device? This area will be probably useless for boards
> other than
> SMDK.

Hi Marek,

I think, this mapping is no problem to me even though only SMDK needs it
now.
Actually, SROM bank can be used to connect other outside chips...we don't
know that now.
Also S3C64XX also mapped SROM bank with same method...

But seems need to update it for common usage when we implement SROMC for
other SoCs later.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add support SROMC
@ 2010-10-22  5:50       ` Kukjin Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Kukjin Kim @ 2010-10-22  5:50 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Szyprowski wrote:
> 
> Hello,
> 
> On Wednesday, October 13, 2010 2:16 PM Sangbeom Kim wrote:
> 
> > From: Daein Moon <moon9124@samsung.com>
> >
> > This patch adds support SROMC for S5PV310 and S5PC210.
> >
> > Signed-off-by: Daein Moon <moon9124@samsung.com>
> > Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> > ---
> >  arch/arm/mach-s5pv310/cpu.c                    |    5 ++
> >  arch/arm/mach-s5pv310/include/mach/map.h       |    4 ++
> >  arch/arm/mach-s5pv310/include/mach/regs-srom.h |   50
> ++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-srom.h
> >
> > diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> > index ffed262..873783a 100644
> > --- a/arch/arm/mach-s5pv310/cpu.c
> > +++ b/arch/arm/mach-s5pv310/cpu.c
> > @@ -81,6 +81,11 @@ static struct map_desc s5pv310_iodesc[] __initdata =
{
> >  		.pfn		= __phys_to_pfn(S3C_PA_UART),
> >  		.length		= SZ_512K,
> >  		.type		= MT_DEVICE,
> > +	}, {
> > +		.virtual	= (unsigned long)S5P_VA_SROMC,
> > +		.pfn		= __phys_to_pfn(S5PV310_PA_SROMC),
> > +		.length		= SZ_4K,
> > +		.type		= MT_DEVICE,
> >  	},
> >  };
> 
> Do You really need to make a permanent mapping for the SROMC area? Cannot
the
> setup code in the mach-smdk*.c call ioremap(S5PV310_PA_SROMC) and put the
> address it
> got to the ethernet device? This area will be probably useless for boards
> other than
> SMDK.

Hi Marek,

I think, this mapping is no problem to me even though only SMDK needs it
now.
Actually, SROM bank can be used to connect other outside chips...we don't
know that now.
Also S3C64XX also mapped SROM bank with same method...

But seems need to update it for common usage when we implement SROMC for
other SoCs later.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-10-22  5:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-13 12:15 [PATCH 0/2] ARM: S5PV310: Add support ethernet for SMDKV310 and SMDKC210 Sangbeom Kim
2010-10-13 12:15 ` Sangbeom Kim
2010-10-13 12:15 ` [PATCH 1/2] ARM: S5PV310: Add support SROMC Sangbeom Kim
2010-10-13 12:15   ` Sangbeom Kim
2010-10-13 13:04   ` Marek Szyprowski
2010-10-13 13:04     ` Marek Szyprowski
2010-10-15  6:37     ` Daein Moon
2010-10-15  6:37       ` Daein Moon
2010-10-22  5:50     ` Kukjin Kim
2010-10-22  5:50       ` Kukjin Kim
2010-10-13 12:15 ` [PATCH 2/2] ARM: S5PV310: Support ethernet for SMDKV310 and SMDKC210 Sangbeom Kim
2010-10-13 12:15   ` Sangbeom Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.