public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] plat-omap changes for 2430 SDP
@ 2006-11-14  1:19 Syed Mohammed, Khasim
  2006-11-14  2:47 ` David Brownell
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Syed Mohammed, Khasim @ 2006-11-14  1:19 UTC (permalink / raw)
  To: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Hi,

The attached patch adds 2430 support to arch/arm/plat-omap folder.

The following files are modified devices.c, dmtimer.c, gpio.c, mcbsp.c

Since the changes were very minimal I thought of sending them as a
single patch.

Changes:
--------
devices.c : Initialization of devices are commented for 2430, will
enable the relevant once as and when required.
dmtimer.c : Base address for Timer 1 is different from 2420.
gpio.c    : The code is modified in few places to support GPIO 5th
block.
mcbsp.c   : MUX settings are disabled for 2430 SDP.

Thanks & Regards, 
Khasim

[-- Attachment #2: plat-omap_for2430.patch --]
[-- Type: application/octet-stream, Size: 6348 bytes --]

This patch adds minimal OMAP2430 support to plat-omap files to get the kernel booting on 2430SDP.

Signed-off-by: Syed Mohammed Khasim  <x0khasim@ti.com>

Files Changed:
 devices.c |    6 +++++-
 dmtimer.c |    5 +++++
 gpio.c    |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 mcbsp.c   |   15 ++++++++++-----
 4 files changed, 70 insertions(+), 13 deletions(-)

=============================================================================
diff -purN linux-omap/arch/arm/plat-omap/devices.c mydev-linux-omap/arch/arm/plat-omap/devices.c
--- linux-omap/arch/arm/plat-omap/devices.c	2006-11-11 21:48:05.000000000 -0600
+++ mydev-linux-omap/arch/arm/plat-omap/devices.c	2006-11-13 18:07:09.000000000 -0600
@@ -493,6 +493,10 @@ static inline void omap_init_rng(void) {
  */
 static int __init omap_init_devices(void)
 {
+/*
+ * Need to enable relevant once for 2430 SDP
+ */ 
+#ifndef CONFIG_MACH_OMAP_2430SDP
 	/* please keep these calls, and their implementations above,
 	 * in alphabetical order so they're easier to sort through.
 	 */
@@ -503,7 +507,7 @@ static int __init omap_init_devices(void
 	omap_init_uwire();
 	omap_init_wdt();
 	omap_init_rng();
-
+#endif
 	return 0;
 }
 arch_initcall(omap_init_devices);
diff -purN linux-omap/arch/arm/plat-omap/dmtimer.c mydev-linux-omap/arch/arm/plat-omap/dmtimer.c
--- linux-omap/arch/arm/plat-omap/dmtimer.c	2006-11-11 21:48:05.000000000 -0600
+++ mydev-linux-omap/arch/arm/plat-omap/dmtimer.c	2006-11-13 18:08:34.000000000 -0600
@@ -100,7 +100,12 @@ static struct omap_dm_timer dm_timers[] 
 #define omap_dm_clk_disable(x) clk_disable(x)
 
 static struct omap_dm_timer dm_timers[] = {
+#ifdef CONFIG_ARCH_OMAP2420
 	{ .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 },
+#endif
+#ifdef CONFIG_ARCH_OMAP2430
+	{ .phys_base = 0x49018000, .irq = INT_24XX_GPTIMER1 },
+#endif		
 	{ .phys_base = 0x4802a000, .irq = INT_24XX_GPTIMER2 },
 	{ .phys_base = 0x48078000, .irq = INT_24XX_GPTIMER3 },
 	{ .phys_base = 0x4807a000, .irq = INT_24XX_GPTIMER4 },
diff -purN linux-omap/arch/arm/plat-omap/gpio.c mydev-linux-omap/arch/arm/plat-omap/gpio.c
--- linux-omap/arch/arm/plat-omap/gpio.c	2006-11-11 21:48:06.000000000 -0600
+++ mydev-linux-omap/arch/arm/plat-omap/gpio.c	2006-11-13 18:56:48.000000000 -0600
@@ -86,10 +86,19 @@
 /*
  * omap24xx specific GPIO registers
  */
+#if defined(CONFIG_ARCH_OMAP2420)
 #define OMAP24XX_GPIO1_BASE		(void __iomem *)0x48018000
 #define OMAP24XX_GPIO2_BASE		(void __iomem *)0x4801a000
 #define OMAP24XX_GPIO3_BASE		(void __iomem *)0x4801c000
 #define OMAP24XX_GPIO4_BASE		(void __iomem *)0x4801e000
+#elif defined(CONFIG_ARCH_OMAP2430)
+#define OMAP24XX_GPIO1_BASE		(void __iomem *)0x4900C000
+#define OMAP24XX_GPIO2_BASE		(void __iomem *)0x4900E000
+#define OMAP24XX_GPIO3_BASE		(void __iomem *)0x49010000
+#define OMAP24XX_GPIO4_BASE		(void __iomem *)0x49012000
+#define OMAP24XX_GPIO5_BASE		(void __iomem *)0x480B6000
+#endif
+	
 #define OMAP24XX_GPIO_REVISION		0x0000
 #define OMAP24XX_GPIO_SYSCONFIG		0x0010
 #define OMAP24XX_GPIO_SYSSTATUS		0x0014
@@ -169,12 +178,23 @@ static struct gpio_bank gpio_bank_730[7]
 #endif
 
 #ifdef CONFIG_ARCH_OMAP24XX
-static struct gpio_bank gpio_bank_24xx[4] = {
-	{ OMAP24XX_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,	METHOD_GPIO_24XX },
-	{ OMAP24XX_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,	METHOD_GPIO_24XX },
-	{ OMAP24XX_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,	METHOD_GPIO_24XX },
-	{ OMAP24XX_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,	METHOD_GPIO_24XX },
+
+#if defined(CONFIG_ARCH_OMAP2420)
+#define OMAP2_GPIO_MAX_BANK		4
+#elif defined(CONFIG_ARCH_OMAP2430)
+#define OMAP2_GPIO_MAX_BANK		5
+#endif
+
+static struct gpio_bank gpio_bank_24xx[OMAP2_GPIO_MAX_BANK] = {
+	{ OMAP24XX_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,       METHOD_GPIO_24XX },
+	{ OMAP24XX_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  METHOD_GPIO_24XX },
+	{ OMAP24XX_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  METHOD_GPIO_24XX },
+	{ OMAP24XX_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  METHOD_GPIO_24XX },
+#ifdef CONFIG_ARCH_OMAP2430
+	{ OMAP24XX_GPIO5_BASE, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_24XX },
+#endif
 };
+
 #endif
 
 static struct gpio_bank *gpio_bank;
@@ -1114,6 +1134,11 @@ static int initialized;
 static struct clk * gpio_ick;
 static struct clk * gpio_fck;
 
+#ifdef CONFIG_ARCH_OMAP2430
+static struct clk * gpio5_ick;
+static struct clk * gpio5_fck;
+#endif
+
 static int __init _omap_gpio_init(void)
 {
 	int i;
@@ -1139,7 +1164,25 @@ static int __init _omap_gpio_init(void)
 			printk("Could not get gpios_fck\n");
 		else
 			clk_enable(gpio_fck);
-	}
+
+		/*
+		 * On 2430 GPIO 5 uses CORE L4 ICLK
+		 */
+#ifdef CONFIG_ARCH_OMAP2430
+		if (cpu_is_omap2430()) {
+			gpio5_ick = clk_get(NULL, "gpio5_ick");
+			if (IS_ERR(gpio5_ick))
+				printk("Could not get gpio5_ick\n");
+			else
+				clk_enable(gpio5_ick);			
+			gpio5_fck = clk_get(NULL, "gpio5_fck");
+			if (IS_ERR(gpio5_fck))
+				printk("Could not get gpio5_fck\n");
+			else
+				clk_enable(gpio5_fck);
+		}
+#endif
+}
 
 #ifdef CONFIG_ARCH_OMAP15XX
 	if (cpu_is_omap15xx()) {
@@ -1170,7 +1213,7 @@ static int __init _omap_gpio_init(void)
 	if (cpu_is_omap24xx()) {
 		int rev;
 
-		gpio_bank_count = 4;
+		gpio_bank_count = OMAP2_GPIO_MAX_BANK;
 		gpio_bank = gpio_bank_24xx;
 		rev = omap_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
 		printk(KERN_INFO "OMAP24xx GPIO hardware version %d.%d\n",
diff -purN linux-omap/arch/arm/plat-omap/mcbsp.c mydev-linux-omap/arch/arm/plat-omap/mcbsp.c
--- linux-omap/arch/arm/plat-omap/mcbsp.c	2006-11-11 21:48:06.000000000 -0600
+++ mydev-linux-omap/arch/arm/plat-omap/mcbsp.c	2006-11-13 18:21:31.000000000 -0600
@@ -227,11 +227,16 @@ static void omap_mcbsp_dsp_free(void)
 #ifdef CONFIG_ARCH_OMAP2
 static void omap2_mcbsp2_mux_setup(void)
 {
-	omap_cfg_reg(Y15_24XX_MCBSP2_CLKX);
-	omap_cfg_reg(R14_24XX_MCBSP2_FSX);
-	omap_cfg_reg(W15_24XX_MCBSP2_DR);
-	omap_cfg_reg(V15_24XX_MCBSP2_DX);
-	omap_cfg_reg(V14_24XX_GPIO117);
+	if (cpu_is_omap2420()){
+		omap_cfg_reg(Y15_24XX_MCBSP2_CLKX);
+		omap_cfg_reg(R14_24XX_MCBSP2_FSX);
+		omap_cfg_reg(W15_24XX_MCBSP2_DR);
+		omap_cfg_reg(V15_24XX_MCBSP2_DX);
+		omap_cfg_reg(V14_24XX_GPIO117);
+	}
+	/*
+	 * Need to add MUX settings for OMAP 2430 SDP
+	 */
 }
 #endif
 

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: [PATCH] plat-omap changes for 2430 SDP
@ 2006-11-14 12:02 Woodruff, Richard
  0 siblings, 0 replies; 9+ messages in thread
From: Woodruff, Richard @ 2006-11-14 12:02 UTC (permalink / raw)
  To: Trilok Soni, Syed Mohammed, Khasim; +Cc: linux-omap-open-source

> As clk_get gpio5_ick can really fail, we should also put proper error
> return path if there is an error in getting gpio5_fck. Actually this
> is required in general for other OMAP1/2 clocks in gpio.c, also printk
> with KERN_INFO will be good :)

That is the convention and it should be followed...  But practically for
an internal clock wrapped in an is_cpu_xyz macro the only way for it to
fail today is for the name parameter to be wrong (or system corruption).
Given the API there are many possibilities which could do the get in a
more creative way, requiring a check, but that isn't usage today.  A lot
of verbosity inside of a is_cpu_xyz doesn't feel like it adds much for
its size.

Regards,
Richard W.

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

end of thread, other threads:[~2006-11-16  0:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14  1:19 [PATCH] plat-omap changes for 2430 SDP Syed Mohammed, Khasim
2006-11-14  2:47 ` David Brownell
2006-11-14  5:26   ` Syed Mohammed, Khasim
2006-11-14  6:44     ` David Brownell
2006-11-14 12:49       ` Syed Mohammed, Khasim
2006-11-14  9:20 ` Trilok Soni
2006-11-14 12:59   ` Syed Mohammed, Khasim
2006-11-16  0:53 ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2006-11-14 12:02 Woodruff, Richard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox