(Bug report) the kernel crash when I run cyclictest on AM3715/DM3730

2011-05-30 Thread stanley.miao

The test command :

# cyclictest -l1 -m -a0 -t1 -n -p99 -i200 -h200 -q
I run the following command to increase cpu's burden at the same time.
# while true; do hackbench; sleep 1;done

cyclictest and hackbench can be get in 
git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git


The linux kernel version :

the kernel I used is windriver linux kernel. but this bug can also be reproduced 
on the branch OMAPPSP_03.00.01.06 in 
git://arago-project.org/git/projects/linux-omap3.git.
The kernel in linux-omap-2.6 git tree hung and didn't give any useful Oops 
messages when I ran this cyclictest.


The Oops messages (it crashed in many different places):

1,

root@localhost:/root cyclictest -l1 -m -a0 -t1 -n -p99 -i200 -h200 -q
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa3069e4
Internal error: : 1028 [#1] PREEMPT
last sysfs file: /sys/kernel/uevent_seqnum
Modules linked in: x_tables ip_tables ipv6 sctp binfmt_misc [last unloaded: 
scsi_wait_scan]

CPU: 0Not tainted  (2.6.34.9-WR4.2.0.0_standard #3)
PC is at prm_read_mod_reg+0x34/0x44
LR is at pwrdm_wait_transition+0x40/0x90
pc : [c004bf7c]lr : [c004c76c]psr: a0d3
sp : c072bec0  ip : c004bf5c  fp : c072becc
r10:   r9 : 413fc082  r8 : 
r7 :   r6 :   r5 : c072efe0  r4 : 
r3 : fa306800  r2 : fa004948  r1 : 00e4  r0 : 01e4
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 86858019  DAC: 0017
Process swapper (pid: 0, stack limit = 0xc072a2e8)
Stack: (0xc072bec0 to 0xc072c000)
bec0: c072bee4 c072bed0 c004c76c c004bf54 c072f940 0003 c072befc c072bee8
bee0: c004ce8c c004c738 0003 c072f940 c072bf14 c072bf00 c0054b4c c004ce6c
bf00: c072efe0 0001 c072bf3c c072bf18 c004fa90 c0054b0c c077e6bc c077e6a0
bf20: 0003 0003 8002f56c 001f c072bf74 c072bf40 c0051a38 c004f58c
bf40: 492b  c6bcee00 c0731340 386d4532 2ac85836 c0731340 c07313b0
bf60: c082a350 c072e420 c072bf9c c072bf78 c046dd58 c005198c c046dca0 c072a000
bf80: c0032018 c0032014 8002f56c 413fc082 c072bfb4 c072bfa0 c003e99c c046dcac
bfa0: c07f2630 0002 c072bfcc c072bfb8 c0557d6c c003e944  c07f4368
bfc0: c072bff4 c072bfd0 c0008a74 c0557cc0 c0008584   c0032018
bfe0: 10c53c7d c077dd70  c072bff8 80008034 c00087dc  
[c004bf7c] (prm_read_mod_reg+0x34/0x44) from [c004c76c] 
(pwrdm_wait_transition+0x40/0x90)
[c004c76c] (pwrdm_wait_transition+0x40/0x90) from [c004ce8c] 
(pwrdm_clkdm_state_switch+0x2c/0x40)
[c004ce8c] (pwrdm_clkdm_state_switch+0x2c/0x40) from [c0054b4c] 
(omap2_clkdm_allow_idle+0x4c/0x50)
[c0054b4c] (omap2_clkdm_allow_idle+0x4c/0x50) from [c004fa90] 
(omap_sram_idle+0x510/0x534)
[c004fa90] (omap_sram_idle+0x510/0x534) from [c0051a38] 
(omap3_enter_idle+0xb8/0x150)
[c0051a38] (omap3_enter_idle+0xb8/0x150) from [c046dd58] 
(cpuidle_idle_call+0xb8/0x198)

[c046dd58] (cpuidle_idle_call+0xb8/0x198) from [c003e99c] 
(cpu_idle+0x64/0xbc)
[c003e99c] (cpu_idle+0x64/0xbc) from [c0557d6c] (rest_init+0xb8/0xd4)
[c0557d6c] (rest_init+0xb8/0xd4) from [c0008a74] (start_kernel+0x2a4/0x30c)
[c0008a74] (start_kernel+0x2a4/0x30c) from [80008034] (0x80008034)
Code: e59f0014 e3a010aa ebffd57e e081 (e793)

2,

root@localhost:/root cyclictest -l1 -m -a0 -t1 -n -p99 -i200 -h200 -q
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa318034
Internal error: : 1028 [#1] PREEMPT
last sysfs file: /sys/kernel/uevent_seqnum
Modules linked in: x_tables ip_tables ipv6 sctp binfmt_misc [last unloaded: 
scsi_wait_scan]

CPU: 0Not tainted  (2.6.34.9-WR4.2.0.0_standard #5)
PC is at omap_dm_timer_set_load_start+0x30/0x94
LR is at omap2_gp_timer_set_next_event+0x28/0x34
pc : [c005a0a0]lr : [c0047fb0]psr: 2093
sp : c0709e58  ip : c005a084  fp : c0709e74
r10: c0709f10  r9 : 0466  r8 : 3824a2bc
r7 :   r6 : ff91  r5 :   r4 : c0717564
r3 : fa318000  r2 : ff91  r1 :   r0 : c0717564
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 864cc019  DAC: 0017
Process swapper (pid: 0, stack limit = 0xc07082e8)
Stack: (0xc0709e58 to 0xc070a000)
9e40:   c075a4a0 c070ea38
snip the stack data
[c005a0a0] (omap_dm_timer_set_load_start+0x30/0x94) from [c0047fb0] 
(omap2_gp_timer_set_next_event+0x28/0x34)
[c0047fb0] (omap2_gp_timer_set_next_event+0x28/0x34) from [c0098fd0] 
(clockevents_program_event+0xec/0x104)
[c0098fd0] (clockevents_program_event+0xec/0x104) from [c00999e8] 
(tick_dev_program_event+0x4c/0x160)
[c00999e8] (tick_dev_program_event+0x4c/0x160) from [c0099b84] 
(tick_program_event+0x38/0x44)
[c0099b84] (tick_program_event+0x38/0x44) from [c0090a70] 
(__hrtimer_start_range_ns+0x248/0x31c)
[c0090a70] (__hrtimer_start_range_ns+0x248/0x31c) from [c0090bb4] 
(hrtimer_start_range_ns+0x34/0x3c)
[c0090bb4] (hrtimer_start_range_ns+0x34/0x3c) from 

Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2

2011-05-09 Thread stanley.miao

Acked-by: Stanley Miao stanley.m...@windriver.com

Stanley.

Tomi Valkeinen wrote:

Port the old omapfb panel driver to DSS2i. This patch changes the board
file only, the driver is ported in separate patch.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
Cc: Stanley Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-ldp.c |   73 +-
 1 files changed, 63 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..2fdfd7f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -43,6 +43,8 @@
 
 #include asm/delay.h

 #include plat/usb.h
+#include plat/display.h
+#include plat/panel-generic-dpi.h
 
 #include board-flash.h

 #include mux.h
@@ -275,19 +277,71 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
 }
 
-static struct platform_device ldp_lcd_device = {

-   .name   = ldp_lcd,
-   .id = -1,
+/* LCD */
+
+#define LCD_PANEL_BACKLIGHT_GPIO   (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO  (7 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_RESET_GPIO   55
+#define LCD_PANEL_QVGA_GPIO56
+
+static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+   gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+   gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+   return 0;
+}
+
+static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+   gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+   gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+}
+
+static struct panel_generic_dpi_data ldp_panel_data = {
+   .name   = 2430sdp,
+   .platform_enable= ldp_panel_enable_lcd,
+   .platform_disable   = ldp_panel_disable_lcd,
 };
 
-static struct omap_lcd_config ldp_lcd_config __initdata = {

-   .ctrl_name  = internal,
+static struct omap_dss_device ldp_lcd_device = {
+   .name   = lcd,
+   .driver_name= generic_dpi_panel,
+   .type   = OMAP_DISPLAY_TYPE_DPI,
+   .phy.dpi.data_lines = 16,
+   .data   = ldp_panel_data,
 };
 
-static struct omap_board_config_kernel ldp_config[] __initdata = {

-   { OMAP_TAG_LCD, ldp_lcd_config },
+static struct omap_dss_device *ldp_dss_devices[] = {
+   ldp_lcd_device,
+};
+
+static struct omap_dss_board_info ldp_dss_data = {
+   .num_devices= ARRAY_SIZE(ldp_dss_devices),
+   .devices= ldp_dss_devices,
+   .default_device = ldp_lcd_device,
 };
 
+static void __init ldp_display_init(void)

+{
+   int r;
+
+   struct gpio gpios[] = {
+   {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, LCD RESET},
+   {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, LCD QVGA},
+   {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, LCD ENABLE},
+   {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, LCD BACKLIGHT},
+   };
+
+   r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+   if (r) {
+   pr_err(Cannot request LCD GPIOs, error %d\n, r);
+   return;
+   }
+
+   omap_display_init(ldp_dss_data);
+}
+
 static void __init omap_ldp_init_early(void)
 {
omap2_init_common_infrastructure();
@@ -390,7 +444,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
 
 static struct platform_device *ldp_devices[] __initdata = {

ldp_smsc911x_device,
-   ldp_lcd_device,
ldp_gpio_keys_device,
 };
 
@@ -441,8 +494,6 @@ static struct mtd_partition ldp_nand_partitions[] = {

 static void __init omap_ldp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
-   omap_board_config = ldp_config;
-   omap_board_config_size = ARRAY_SIZE(ldp_config);
ldp_init_smsc911x();
omap_i2c_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -459,6 +510,8 @@ static void __init omap_ldp_init(void)
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
ldp_vmmc1_supply.dev = mmc[0].dev;
+
+   ldp_display_init();
 }
 
 MACHINE_START(OMAP_LDP, OMAP LDP board)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2] OMAP: DSS2: don't power off a panel twice

2010-09-02 Thread stanley.miao

Hi, Tomi,

Tomi Valkeinen wrote:

snip

Otherwise this looks fine, except that panel-taal.c does not need
modifications, as it already handles this case.
  


I will send a V3 to remove the panel-taal.c part.


Also, at some point I (or somebody else =) should think how to do proper
locking for the panel drivers. Currently it's rather broken, and, for
example, enabling and disabling a panel at the same time will cause
problems. Except for panel-taal, which uses its own lock.
  


First, I don't think there is any occasion where you need to enable and 
disable a panel at the same time.

If so, what kind of result do you want ? enabled or disabled ?

Second, now the dssdev-state can do the lock job properly. It can 
ensure only one function can run if both disable()

and enable are called at the same time.

Stanley.


 Tomi



  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V3] OMAP: DSS2: don't power off a panel twice

2010-09-02 Thread Stanley.Miao
If we blank the panel by
echo 1  /sys/devices/platform/omapfb/graphics/fb0/blank

Then, we reboot the sytem, the kernel will crash at
drivers/video/omap2/dss/core.c:323

This is because the panel is closed twice. Now check the state of a dssdev
to forbid a panel is power on or power off twice.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 drivers/video/omap2/displays/panel-acx565akm.c |6 ++
 drivers/video/omap2/displays/panel-generic.c   |6 ++
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |6 ++
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |6 ++
 .../video/omap2/displays/panel-toppoly-tdo35s.c|6 ++
 .../video/omap2/displays/panel-tpo-td043mtea1.c|6 ++
 6 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-acx565akm.c 
b/drivers/video/omap2/displays/panel-acx565akm.c
index 07fbb8a..e773106 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device 
*dssdev)
 
dev_dbg(dssdev-dev, %s\n, __func__);
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
mutex_lock(md-mutex);
 
r = omapdss_sdi_display_enable(dssdev);
@@ -644,6 +647,9 @@ static void acx_panel_power_off(struct omap_dss_device 
*dssdev)
 
dev_dbg(dssdev-dev, %s\n, __func__);
 
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
mutex_lock(md-mutex);
 
if (!md-enabled) {
diff --git a/drivers/video/omap2/displays/panel-generic.c 
b/drivers/video/omap2/displays/panel-generic.c
index 300eff5..395a68d 100644
--- a/drivers/video/omap2/displays/panel-generic.c
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -58,6 +61,9 @@ err0:
 
 static void generic_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c 
b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
index 1026746..0c6896c 100644
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c 
b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index 7d9eb2b..9a138f6 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
 {
int r = 0;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -157,6 +160,9 @@ err0:
 
 static void sharp_ls_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c 
b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
index e320e67..526e906 100644
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
@@ -46,6 +46,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c 
b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index e866e76..dbe9d43 100644

Re: [PATCH V2] OMAP: DSS2: don't power off a panel twice

2010-08-17 Thread stanley.miao

It should be Tomi to maintain DSS2. I didn't get any response from Tomi.

Stanley.

Bryan Wu wrote:

Is there any feedback about this patch,

Tested-by: Bryan Wu bryan...@canonical.com

-Bryan

On 08/11/2010 02:50 PM, Bryan Wu wrote:
  

Tested on my Beagle board. It fixed the issue.

Thanks,
-Bryan

On 08/11/2010 11:19 AM, Stanley.Miao wrote:


If we blank the panel by
echo 1  /sys/devices/platform/omapfb/graphics/fb0/blank

Then, we reboot the sytem, the kernel will crash at
drivers/video/omap2/dss/core.c:323

This is because the panel is closed twice. Now check the state of a dssdev
to forbid a panel is power on or power off twice.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 drivers/video/omap2/displays/panel-acx565akm.c |6 ++
 drivers/video/omap2/displays/panel-generic.c   |6 ++
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |6 ++
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |6 ++
 drivers/video/omap2/displays/panel-taal.c  |6 ++
 .../video/omap2/displays/panel-toppoly-tdo35s.c|6 ++
 .../video/omap2/displays/panel-tpo-td043mtea1.c|6 ++
 7 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-acx565akm.c 
b/drivers/video/omap2/displays/panel-acx565akm.c
index 1f8eb70..374cbeb 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device 
*dssdev)
 
 	dev_dbg(dssdev-dev, %s\n, __func__);
 
+	if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)

+   return 0;
+
mutex_lock(md-mutex);
 
 	r = omapdss_sdi_display_enable(dssdev);

@@ -642,6 +645,9 @@ static void acx_panel_power_off(struct omap_dss_device 
*dssdev)
 
 	dev_dbg(dssdev-dev, %s\n, __func__);
 
+	if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)

+   return;
+
mutex_lock(md-mutex);
 
 	if (!md-enabled) {

diff --git a/drivers/video/omap2/displays/panel-generic.c 
b/drivers/video/omap2/displays/panel-generic.c
index 300eff5..395a68d 100644
--- a/drivers/video/omap2/displays/panel-generic.c
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+	if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)

+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -58,6 +61,9 @@ err0:
 
 static void generic_panel_power_off(struct omap_dss_device *dssdev)

 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c

index 1026746..0c6896c 100644
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+	if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)

+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)

 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c

index 7d9eb2b..9a138f6 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
 {
int r = 0;
 
+	if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)

+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -157,6 +160,9 @@ err0:
 
 static void sharp_ls_power_off(struct omap_dss_device *dssdev)

 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c

index aaf5d30..c649f06 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -635,6 +635,9 @@ static int taal_power_on(struct omap_dss_device *dssdev)
u8 id1, id2, id3;
int r;
 
+	if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)

+   return 0;
+
if (dssdev-platform_enable) {
r = dssdev-platform_enable(dssdev);
if (r)
@@ -715,6 +718,9 @@ static void taal_power_off(struct

[PATCH] OMAP: DSS2: don't power off a panel twice

2010-08-10 Thread Stanley.Miao
If we blank the panel by
echo 1  /sys/devices/platform/omapfb/graphics/fb0/blank

Then, we reboot the sytem, the kernel will crash at
drivers/video/omap2/dss/core.c:323

This is because the panel is closed twice. Now add a variable panel_enabled
to forbid a panel is power on or power off twice.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 drivers/video/omap2/displays/panel-generic.c   |   11 +++
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |   11 +++
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |   11 +++
 drivers/video/omap2/displays/panel-taal.c  |6 ++
 .../video/omap2/displays/panel-toppoly-tdo35s.c|   11 +++
 .../video/omap2/displays/panel-tpo-td043mtea1.c|9 +
 6 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-generic.c 
b/drivers/video/omap2/displays/panel-generic.c
index 300eff5..607f11a 100644
--- a/drivers/video/omap2/displays/panel-generic.c
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -22,6 +22,8 @@
 
 #include plat/display.h
 
+static int panel_enabled;
+
 static struct omap_video_timings generic_panel_timings = {
/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
.x_res  = 640,
@@ -39,6 +41,9 @@ static int generic_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (panel_enabled)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -48,6 +53,7 @@ static int generic_panel_power_on(struct omap_dss_device 
*dssdev)
if (r)
goto err1;
}
+   panel_enabled = 1;
 
return 0;
 err1:
@@ -58,10 +64,14 @@ err0:
 
 static void generic_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (panel_enabled == 0)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
omapdss_dpi_display_disable(dssdev);
+   panel_enabled = 0;
 }
 
 static int generic_panel_probe(struct omap_dss_device *dssdev)
@@ -155,6 +165,7 @@ static struct omap_dss_driver generic_driver = {
 
 static int __init generic_panel_drv_init(void)
 {
+   panel_enabled = 0;
return omap_dss_register_driver(generic_driver);
 }
 
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c 
b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
index 1026746..b5205d4 100644
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
@@ -24,6 +24,8 @@
 
 #include plat/display.h
 
+static int panel_enabled;
+
 static struct omap_video_timings sharp_lq_timings = {
.x_res = 480,
.y_res = 272,
@@ -43,6 +45,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (panel_enabled)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -55,6 +60,7 @@ static int sharp_lq_panel_power_on(struct omap_dss_device 
*dssdev)
if (r)
goto err1;
}
+   panel_enabled = 1;
 
return 0;
 err1:
@@ -65,6 +71,9 @@ err0:
 
 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (panel_enabled == 0)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
@@ -72,6 +81,7 @@ static void sharp_lq_panel_power_off(struct omap_dss_device 
*dssdev)
msleep(100);
 
omapdss_dpi_display_disable(dssdev);
+   panel_enabled = 0;
 }
 
 static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
@@ -146,6 +156,7 @@ static struct omap_dss_driver sharp_lq_driver = {
 
 static int __init sharp_lq_panel_drv_init(void)
 {
+   panel_enabled = 0;
return omap_dss_register_driver(sharp_lq_driver);
 }
 
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c 
b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index 7d9eb2b..3750fdc 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -31,6 +31,8 @@ struct sharp_data {
struct backlight_device *bl;
 };
 
+static int panel_enabled;
+
 static struct omap_video_timings sharp_ls_timings = {
.x_res = 480,
.y_res = 640,
@@ -135,6 +137,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
 {
int r = 0;
 
+   if (panel_enabled)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -147,6 +152,7 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
if (r)
goto err1;
}
+   panel_enabled = 1;
 
return 0;
 err1:
@@ -157,6 +163,9 @@ err0:
 
 static void sharp_ls_power_off(struct

[PATCH] OMAP2: Fix a cpu type check problem.

2010-08-10 Thread Stanley.Miao
cpu_is_omap3517() and cpu_is_omap3505() are the subgroups of cpu_is_omap34xx(),
so we should check cpu_is_omap3517() and cpu_is_omap3505() first, then check
cpu_is_omap34xx().

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 138646d..dfdce2d 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3417,7 +3417,13 @@ int __init omap3xxx_clk_init(void)
struct omap_clk *c;
u32 cpu_clkflg = CK_3XXX;
 
-   if (cpu_is_omap34xx()) {
+   if (cpu_is_omap3517()) {
+   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+   cpu_clkflg |= CK_3517;
+   } else if (cpu_is_omap3505()) {
+   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+   cpu_clkflg |= CK_3505;
+   } else if (cpu_is_omap34xx()) {
cpu_mask = RATE_IN_3XXX;
cpu_clkflg |= CK_343X;
 
@@ -3432,12 +3438,6 @@ int __init omap3xxx_clk_init(void)
cpu_mask |= RATE_IN_3430ES2PLUS;
cpu_clkflg |= CK_3430ES2;
}
-   } else if (cpu_is_omap3517()) {
-   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-   cpu_clkflg |= CK_3517;
-   } else if (cpu_is_omap3505()) {
-   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-   cpu_clkflg |= CK_3505;
}
 
if (omap3_has_192mhz_clk())
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP: DSS2: don't power off a panel twice

2010-08-10 Thread stanley.miao

Laine Walker-Avina wrote:

On Tue, Aug 10, 2010 at 5:16 AM, Stanley.Miao
stanley.m...@windriver.com wrote:
  

snip

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




Instead of adding a new variable and a bunch of extra code, I solved
this problem on my local tree by just not doing anything if we're
already not active. See the follwoing for the generic panel driver.

diff --git a/drivers/video/omap2/displays/panel-generic.c
b/drivers/video/omap2/displays/panel-generic.c
index 300eff5..abc03f4 100644
--- a/drivers/video/omap2/displays/panel-generic.c
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -91,9 +91,12 @@ static int generic_panel_enable(struct
omap_dss_device *dssdev)

 static void generic_panel_disable(struct omap_dss_device *dssdev)
 {
-   generic_panel_power_off(dssdev);
+   if(dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   {
+   generic_panel_power_off(dssdev);

-   dssdev-state = OMAP_DSS_DISPLAY_DISABLED;
+   dssdev-state = OMAP_DSS_DISPLAY_DISABLED;
+   }
 }

  


Yes, This is a good idea. If we add this check into power_off(), will it 
be better ? How do you think ?


Stanley.


 static int generic_panel_suspend(struct omap_dss_device *dssdev)
  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2] OMAP: DSS2: don't power off a panel twice

2010-08-10 Thread Stanley.Miao
If we blank the panel by
echo 1  /sys/devices/platform/omapfb/graphics/fb0/blank

Then, we reboot the sytem, the kernel will crash at
drivers/video/omap2/dss/core.c:323

This is because the panel is closed twice. Now check the state of a dssdev
to forbid a panel is power on or power off twice.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 drivers/video/omap2/displays/panel-acx565akm.c |6 ++
 drivers/video/omap2/displays/panel-generic.c   |6 ++
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |6 ++
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |6 ++
 drivers/video/omap2/displays/panel-taal.c  |6 ++
 .../video/omap2/displays/panel-toppoly-tdo35s.c|6 ++
 .../video/omap2/displays/panel-tpo-td043mtea1.c|6 ++
 7 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-acx565akm.c 
b/drivers/video/omap2/displays/panel-acx565akm.c
index 1f8eb70..374cbeb 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device 
*dssdev)
 
dev_dbg(dssdev-dev, %s\n, __func__);
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
mutex_lock(md-mutex);
 
r = omapdss_sdi_display_enable(dssdev);
@@ -642,6 +645,9 @@ static void acx_panel_power_off(struct omap_dss_device 
*dssdev)
 
dev_dbg(dssdev-dev, %s\n, __func__);
 
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
mutex_lock(md-mutex);
 
if (!md-enabled) {
diff --git a/drivers/video/omap2/displays/panel-generic.c 
b/drivers/video/omap2/displays/panel-generic.c
index 300eff5..395a68d 100644
--- a/drivers/video/omap2/displays/panel-generic.c
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -58,6 +61,9 @@ err0:
 
 static void generic_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c 
b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
index 1026746..0c6896c 100644
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device 
*dssdev)
 {
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c 
b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index 7d9eb2b..9a138f6 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
 {
int r = 0;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
r = omapdss_dpi_display_enable(dssdev);
if (r)
goto err0;
@@ -157,6 +160,9 @@ err0:
 
 static void sharp_ls_power_off(struct omap_dss_device *dssdev)
 {
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
if (dssdev-platform_disable)
dssdev-platform_disable(dssdev);
 
diff --git a/drivers/video/omap2/displays/panel-taal.c 
b/drivers/video/omap2/displays/panel-taal.c
index aaf5d30..c649f06 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -635,6 +635,9 @@ static int taal_power_on(struct omap_dss_device *dssdev)
u8 id1, id2, id3;
int r;
 
+   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
+   return 0;
+
if (dssdev-platform_enable) {
r = dssdev-platform_enable(dssdev);
if (r)
@@ -715,6 +718,9 @@ static void taal_power_off(struct omap_dss_device *dssdev)
 {
struct taal_data *td = dev_get_drvdata(dssdev-dev);
 
+   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
+   return;
+
dsi_bus_lock();
 
cancel_delayed_work(td-esd_work);
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c 
b

Re: [PATCH] OMAP3 PM: fix the error messages printed when the system suspend

2010-08-09 Thread stanley.miao

Cliff Brake wrote:

On Tue, Jun 22, 2010 at 11:11 AM, Kevin Hilman
khil...@deeprootsystems.com wrote:
  

Stanley.Miao stanley.m...@windriver.com writes:

First, the subject needs to be more descriptive:

OMAP3: AM3505/3517 do not have IO wakeup capability



Functionally, what does this statement mean?  The 3503 seems to have
the EN_IO [8] bit, but I've yet to figure out what the EN_IO_CHAIN
[16] means.
  


Please reference to Chapter 4.11 PRCM Off-Mode Management in OMAP35x TRM.

Stanley.

Thanks,
Cliff

  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv4 0/1]OMAP3: AM3505/3517 do not have IO wakeup capability

2010-06-29 Thread Stanley.Miao
Changes from V3:
1, Tested on AM3517EVM and OMAP3530EVM.

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv4 1/1] OMAP3: AM3505/3517 do not have IO wakeup capability

2010-06-29 Thread Stanley.Miao
AM3505/3517 doesn't have IO wakeup capability, so we do not need to set
the bit OMAP3430_EN_IO and the bit OMAP3430_EN_IO_CHAIN in the register
PM_WKEN_WKUP when the system enters suspend state.

Tested on AM3517EVM and OMAP3530EVM.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/id.c  |2 ++
 arch/arm/mach-omap2/pm34xx.c  |7 ---
 arch/arm/plat-omap/include/plat/cpu.h |2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a..67bd971 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -179,6 +179,8 @@ void __init omap3_check_features(void)
OMAP3_CHECK_FEATURE(status, ISP);
if (cpu_is_omap3630())
omap3_features |= OMAP3_HAS_192MHZ_CLK;
+   if (!cpu_is_omap3505()  !cpu_is_omap3517())
+   omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
/*
 * TODO: Get additional info (where applicable)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b88737f..fb4994a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -385,8 +385,9 @@ void omap_sram_idle(void)
/* Enable IO-PAD and IO-CHAIN wakeups */
per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
-   if (per_next_state  PWRDM_POWER_ON ||
-   core_next_state  PWRDM_POWER_ON) {
+   if (omap3_has_io_wakeup()  \
+   (per_next_state  PWRDM_POWER_ON ||
+   core_next_state  PWRDM_POWER_ON)) {
prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_enable_io_chain();
}
@@ -479,7 +480,7 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if (omap3_has_io_wakeup()  core_next_state  PWRDM_POWER_ON) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 7514174..aa2f4f0 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -444,6 +444,7 @@ extern u32 omap3_features;
 #define OMAP3_HAS_NEON BIT(3)
 #define OMAP3_HAS_ISP  BIT(4)
 #define OMAP3_HAS_192MHZ_CLK   BIT(5)
+#define OMAP3_HAS_IO_WAKEUPBIT(6)
 
 #define OMAP3_HAS_FEATURE(feat,flag)   \
 static inline unsigned int omap3_has_ ##feat(void) \
@@ -457,5 +458,6 @@ OMAP3_HAS_FEATURE(iva, IVA)
 OMAP3_HAS_FEATURE(neon, NEON)
 OMAP3_HAS_FEATURE(isp, ISP)
 OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
+OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
 
 #endif
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 1/1] OMAP3: AM3505/3517 do not have IO wakeup capability

2010-06-25 Thread Stanley.Miao
AM3505/3517 don't have IO wakeup capability, so we don not need to set
the bit OMAP3430_EN_IO and the bit OMAP3430_EN_IO_CHAIN in the register
PM_WKEN_WKUP when the system enters retention.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/id.c  |2 ++
 arch/arm/mach-omap2/pm34xx.c  |7 ---
 arch/arm/plat-omap/include/plat/cpu.h |2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a..67bd971 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -179,6 +179,8 @@ void __init omap3_check_features(void)
OMAP3_CHECK_FEATURE(status, ISP);
if (cpu_is_omap3630())
omap3_features |= OMAP3_HAS_192MHZ_CLK;
+   if (!cpu_is_omap3505()  !cpu_is_omap3517())
+   omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
/*
 * TODO: Get additional info (where applicable)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b88737f..fb4994a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -385,8 +385,9 @@ void omap_sram_idle(void)
/* Enable IO-PAD and IO-CHAIN wakeups */
per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
-   if (per_next_state  PWRDM_POWER_ON ||
-   core_next_state  PWRDM_POWER_ON) {
+   if (omap3_has_io_wakeup()  \
+   (per_next_state  PWRDM_POWER_ON ||
+   core_next_state  PWRDM_POWER_ON)) {
prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_enable_io_chain();
}
@@ -479,7 +480,7 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if (omap3_has_io_wakeup()  core_next_state  PWRDM_POWER_ON) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 7514174..aa2f4f0 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -444,6 +444,7 @@ extern u32 omap3_features;
 #define OMAP3_HAS_NEON BIT(3)
 #define OMAP3_HAS_ISP  BIT(4)
 #define OMAP3_HAS_192MHZ_CLK   BIT(5)
+#define OMAP3_HAS_IO_WAKEUPBIT(6)
 
 #define OMAP3_HAS_FEATURE(feat,flag)   \
 static inline unsigned int omap3_has_ ##feat(void) \
@@ -457,5 +458,6 @@ OMAP3_HAS_FEATURE(iva, IVA)
 OMAP3_HAS_FEATURE(neon, NEON)
 OMAP3_HAS_FEATURE(isp, ISP)
 OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
+OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
 
 #endif
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2] OMAP3: AM3505/3517 do not have IO wakeup capability

2010-06-24 Thread Stanley.Miao
AM3505/3517 don't have IO wakeup capability, so we don not need to set
the bit OMAP3430_EN_IO and the bit OMAP3430_EN_IO_CHAIN in the register
PM_WKEN_WKUP when the system enters retention.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/id.c  |2 ++
 arch/arm/mach-omap2/pm34xx.c  |   10 ++
 arch/arm/plat-omap/include/plat/cpu.h |2 ++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a..67bd971 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -179,6 +179,8 @@ void __init omap3_check_features(void)
OMAP3_CHECK_FEATURE(status, ISP);
if (cpu_is_omap3630())
omap3_features |= OMAP3_HAS_192MHZ_CLK;
+   if (!cpu_is_omap3505()  !cpu_is_omap3517())
+   omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
/*
 * TODO: Get additional info (where applicable)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 86a2240..7cc8fce 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -416,9 +416,11 @@ void omap_sram_idle(void)
omap3_core_save_context();
omap3_prcm_save_context();
}
-   /* Enable IO-PAD and IO-CHAIN wakeups */
-   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
-   omap3_enable_io_chain();
+   if (omap3_has_io_wakeup()) {
+   /* Enable IO-PAD and IO-CHAIN wakeups */
+   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
+   omap3_enable_io_chain();
+   }
}
omap3_intc_prepare_idle();
 
@@ -494,7 +496,7 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if (core_next_state  PWRDM_POWER_ON  omap3_has_io_wakeup()) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 7514174..aa2f4f0 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -444,6 +444,7 @@ extern u32 omap3_features;
 #define OMAP3_HAS_NEON BIT(3)
 #define OMAP3_HAS_ISP  BIT(4)
 #define OMAP3_HAS_192MHZ_CLK   BIT(5)
+#define OMAP3_HAS_IO_WAKEUPBIT(6)
 
 #define OMAP3_HAS_FEATURE(feat,flag)   \
 static inline unsigned int omap3_has_ ##feat(void) \
@@ -457,5 +458,6 @@ OMAP3_HAS_FEATURE(iva, IVA)
 OMAP3_HAS_FEATURE(neon, NEON)
 OMAP3_HAS_FEATURE(isp, ISP)
 OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
+OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
 
 #endif
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] omap: fix the cpu type check in clock3xxx_data.c

2010-06-22 Thread Stanley.Miao
omap3517 and omap3505 belong to OMAP3 architecture, so the cpu_is_omap34xx
will be true. Therefore, if the cpu omap3517 is a exception, we should check
whether it is omap3517 before check whether it is omap34xx.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 41b155a..6766612 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3412,7 +3412,13 @@ int __init omap3xxx_clk_init(void)
struct omap_clk *c;
u32 cpu_clkflg = CK_3XXX;
 
-   if (cpu_is_omap34xx()) {
+   if (cpu_is_omap3517()) {
+   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+   cpu_clkflg |= CK_3517;
+   } else if (cpu_is_omap3505()) {
+   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+   cpu_clkflg |= CK_3505;
+   } else if (cpu_is_omap34xx()) {
cpu_mask = RATE_IN_3XXX;
cpu_clkflg |= CK_343X;
 
@@ -3427,12 +3433,6 @@ int __init omap3xxx_clk_init(void)
cpu_mask |= RATE_IN_3430ES2PLUS;
cpu_clkflg |= CK_3430ES2;
}
-   } else if (cpu_is_omap3517()) {
-   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-   cpu_clkflg |= CK_3517;
-   } else if (cpu_is_omap3505()) {
-   cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-   cpu_clkflg |= CK_3505;
}
 
if (omap3_has_192mhz_clk())
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP3 PM: fix the error messages printed when the system suspend

2010-06-22 Thread Stanley.Miao
omap3505/omap3517 don't have the bit OMAP3430_EN_IO and the bit
OMAP3430_EN_IO_CHAIN in the register PM_WKEN_WKUP. When the system
suspend, the following messages will be printed:

Wake up daisy chain activation failed.

Now fix it by adding if (!cpu_is_omap3505()  !cpu_is_omap3517()).

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/pm34xx.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 62529ff..d16648a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -385,8 +385,9 @@ void omap_sram_idle(void)
/* Enable IO-PAD and IO-CHAIN wakeups */
per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
-   if (per_next_state  PWRDM_POWER_ON ||
-   core_next_state  PWRDM_POWER_ON) {
+   if (!cpu_is_omap3505()  !cpu_is_omap3517()  \
+   (per_next_state  PWRDM_POWER_ON || \
+ core_next_state  PWRDM_POWER_ON)) {
prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_enable_io_chain();
}
@@ -479,7 +480,8 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if ((core_next_state  PWRDM_POWER_ON)  \
+   !cpu_is_omap3505()  !cpu_is_omap3517()) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/7] omap hsmmc: fix the hsmmc driver for am3517.

2010-05-13 Thread stanley.miao

Tony Lindgren wrote:

Hi,

Some requests to make this more future proof.

* Stanley.Miao stanley.m...@windriver.com [100419 23:20]:
  

AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like vmmc, so we set a noop set_power function for it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/hsmmc.c |   32 
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..5f46797 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int 
slot,
}
 }
 
+static int am3517_mmc_set_power(struct device *dev, int slot, int power_on,

+   int vdd)
+{
+   return 0;
+}
+



Please rename this to nop_mmc_set_power or similar. Other omaps may
need it too.
  


Accepted.

  

 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)

@@ -150,7 +156,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-   } else {
+   } else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}



Let's get rid of multiple cpu_is_omap tests please. Could you please
update this along the lines of something like this:

#define HSMMC_HAS_PBIAS (1  0)
#define HSMMC_HAS_WHATEVER  (1  1)
...

if (!(cpu_is_omap3517() || cpu_is_omap3505())
mmc-slots[i].features |= HSMMC_HAS_PBIAS;
  


Accepted.

We can move other features into the variable features, such as 
nonremovable, power_saving.


Stanley.

  

@@ -216,12 +222,25 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
 */
mmc-slots[0].ocr_mask = c-ocr_mask;
 
+		if (!cpu_is_omap3517()  !cpu_is_omap3505()) {

+   switch (c-mmc) {
+   case 1:
+   /* on-chip level shifting via PBIAS0/PBIAS1 */
+   mmc-slots[0].before_set_reg = 
hsmmc1_before_set_reg;
+   mmc-slots[0].after_set_reg = 
hsmmc1_after_set_reg;
+   break;
+   case 2:
+   case 3:
+   /* off-chip level shifting, or none */
+   mmc-slots[0].before_set_reg = 
hsmmc23_before_set_reg;
+   mmc-slots[0].after_set_reg = NULL;
+   break;
+   }
+   } else /* cpu_is_omap3517() || cpu_is_omap3505() */
+   mmc-slots[0].set_power = am3517_mmc_set_power;
+



Then you can test for that flag here too. When new omaps get added, it
just a question of setting the features flags right.

Regards,

Tony

  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable

2010-05-13 Thread Stanley.Miao
There are three i2c buses on am3517, and each i2c bus has several devices
on it, so we can't name the i2c boardinfo structures with one of these
devices. In order to make it more readable, now rename these three boardinfo
structures based on i2c indexes.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
Acked-By: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 19b9e41..af383a8 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -136,7 +136,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data 
*pdata)
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30),
.type   = s35390a,
@@ -166,7 +166,7 @@ static void __init am3517_evm_rtc_init(void)
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
-   am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -177,7 +177,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_gpio_expander_info_0,
@@ -191,7 +191,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x20),
.platform_data = am3517evm_ui_gpio_expander_info_1,
@@ -205,10 +205,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-   ARRAY_SIZE(am3517evm_tca6416_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-   ARRAY_SIZE(am3517evm_ui_tca6416_info));
+   omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+   omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
return 0;
 }
@@ -455,8 +455,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();
 
-   i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-   ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
/*Ethernet*/
am3517_evm_ethernet_init(am3517_evm_emac_pdata);
 }
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] omap: init the gpio pinmux for mmc

2010-05-13 Thread Stanley.Miao
There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/devices.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 10f3a3c..3d30f22 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,15 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr)
 {
+   if ((mmc_controller-slots[0].switch_pin  0)  \
+   (mmc_controller-slots[0].switch_pin  OMAP_MAX_GPIO_LINES))
+   omap_mux_init_gpio(mmc_controller-slots[0].switch_pin,
+   OMAP_PIN_INPUT_PULLUP);
+   if ((mmc_controller-slots[0].gpio_wp  0)  \
+   (mmc_controller-slots[0].gpio_wp  OMAP_MAX_GPIO_LINES))
+   omap_mux_init_gpio(mmc_controller-slots[0].gpio_wp,
+   OMAP_PIN_INPUT_PULLUP);
+
if (cpu_is_omap2420()  controller_nr == 0) {
omap_cfg_reg(H18_24XX_MMC_CMD);
omap_cfg_reg(H15_24XX_MMC_CLKI);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Some am3517 related patches [V4]

2010-05-13 Thread Stanley.Miao
Changes from V3:
1, refresh the the patches against the current omap-for-linus branch
2, Added features in mmc-slot[i].

Stanley.Miao (3):
  AM3517: rename the i2c boardinfo to make it more readable
  omap: init the gpio pinmux for mmc
  omap hsmmc: fix the hsmmc driver for am3517

 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 arch/arm/mach-omap2/devices.c |9 +
 arch/arm/mach-omap2/hsmmc.c   |   27 +--
 arch/arm/plat-omap/include/plat/mmc.h |4 
 4 files changed, 44 insertions(+), 16 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] omap: init the gpio pinmux for mmc

2010-05-12 Thread stanley.miao

Tony Lindgren wrote:

* Stanley.Miao stanley.m...@windriver.com [100419 23:20]:
  

There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/devices.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..df9c62a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,13 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr)
 {
+   if (mmc_controller-slots[0].switch_pin  0)
+   omap_mux_init_gpio(mmc_controller-slots[0].switch_pin,
+   OMAP_PIN_INPUT_PULLUP);
+   if (mmc_controller-slots[0].gpio_wp  0)
+   omap_mux_init_gpio(mmc_controller-slots[0].gpio_wp,
+   OMAP_PIN_INPUT_PULLUP);
+
if (cpu_is_omap2420()  controller_nr == 0) {
omap_cfg_reg(H18_24XX_MMC_CMD);
omap_cfg_reg(H15_24XX_MMC_CLKI);



The problem I see with this patch is that it attempts to mux
even for the GPIO pins on the companion chips, such as twl4030.

Got any ideas on how to prevent that?
  


Hi, Tony,

The gpios on companion chips are greater than OMAP_MAX_GPIO_LINES, they 
are not defined

in mux34xx.c, so omap_mux_init_gpio will do nothing.

However, I will add if(gpio_wp  OMAP_MAX_GPIO_LINES) to prevent from 
invoking omap_mux_init_gpio().


Stanley.


Tony

  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/7] AM3517: rename the i2c boardinfo to make it more readable

2010-05-12 Thread stanley.miao

Tony Lindgren wrote:

* Hiremath, Vaibhav hvaib...@ti.com [100420 00:03]:
  

snip


There are three i2c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

  

[Hiremath, Vaibhav] Since we haven't had any objection/suggestion to follow 
naming convention based on i2C indexes, I think we can merge this patch.

Acked-By: Vaibhav Hiremath hvaib...@ti.com



Looks like this needs to be refreshed against the current
omap-for-linus branch to apply.
  


OK, I will re-send it soon.

Stanley.


Regards,

Tony

  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] AM3517: rename the i2c boardinfo to make it more readable

2010-04-20 Thread Stanley.Miao
There are three i2c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..3acfcae 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -39,7 +39,7 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30),
.type   = s35390a,
@@ -69,7 +69,7 @@ static void __init am3517_evm_rtc_init(void)
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
-   am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -80,7 +80,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_gpio_expander_info_0,
@@ -94,7 +94,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x20),
.platform_data = am3517evm_ui_gpio_expander_info_1,
@@ -108,10 +108,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-   ARRAY_SIZE(am3517evm_tca6416_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-   ARRAY_SIZE(am3517evm_ui_tca6416_info));
+   omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+   omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
return 0;
 }
@@ -311,8 +311,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();
 
-   i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-   ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] omap: init the gpio pinmux for mmc

2010-04-20 Thread Stanley.Miao
There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/devices.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..df9c62a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,13 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr)
 {
+   if (mmc_controller-slots[0].switch_pin  0)
+   omap_mux_init_gpio(mmc_controller-slots[0].switch_pin,
+   OMAP_PIN_INPUT_PULLUP);
+   if (mmc_controller-slots[0].gpio_wp  0)
+   omap_mux_init_gpio(mmc_controller-slots[0].gpio_wp,
+   OMAP_PIN_INPUT_PULLUP);
+
if (cpu_is_omap2420()  controller_nr == 0) {
omap_cfg_reg(H18_24XX_MMC_CMD);
omap_cfg_reg(H15_24XX_MMC_CLKI);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] omap hsmmc: fix the hsmmc driver for am3517.

2010-04-20 Thread Stanley.Miao
AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like vmmc, so we set a noop set_power function for it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/hsmmc.c |   32 
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..5f46797 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int 
slot,
}
 }
 
+static int am3517_mmc_set_power(struct device *dev, int slot, int power_on,
+   int vdd)
+{
+   return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
@@ -150,7 +156,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-   } else {
+   } else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}
@@ -216,12 +222,25 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
 */
mmc-slots[0].ocr_mask = c-ocr_mask;
 
+   if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
+   switch (c-mmc) {
+   case 1:
+   /* on-chip level shifting via PBIAS0/PBIAS1 */
+   mmc-slots[0].before_set_reg = 
hsmmc1_before_set_reg;
+   mmc-slots[0].after_set_reg = 
hsmmc1_after_set_reg;
+   break;
+   case 2:
+   case 3:
+   /* off-chip level shifting, or none */
+   mmc-slots[0].before_set_reg = 
hsmmc23_before_set_reg;
+   mmc-slots[0].after_set_reg = NULL;
+   break;
+   }
+   } else /* cpu_is_omap3517() || cpu_is_omap3505() */
+   mmc-slots[0].set_power = am3517_mmc_set_power;
+
switch (c-mmc) {
case 1:
-   /* on-chip level shifting via PBIAS0/PBIAS1 */
-   mmc-slots[0].before_set_reg = hsmmc1_before_set_reg;
-   mmc-slots[0].after_set_reg = hsmmc1_after_set_reg;
-
/* Omap3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630()  c-wires  4) {
c-wires = 4;
@@ -235,9 +254,6 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
c-wires = 4;
/* FALLTHROUGH */
case 3:
-   /* off-chip level shifting, or none */
-   mmc-slots[0].before_set_reg = hsmmc23_before_set_reg;
-   mmc-slots[0].after_set_reg = NULL;
break;
default:
pr_err(MMC%d configuration not supported!\n, c-mmc);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/7] AM3517: rename the i2c boardinfo to make it more readable

2010-04-20 Thread stanley.miao

Felipe Balbi wrote:

Hi,

On Tue, Apr 20, 2010 at 08:33:28AM +0200, ext Stanley.Miao wrote:

@@ -311,8 +311,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();

- i2c_register_board_info(1, am3517evm_i2c_boardinfo,
- ARRAY_SIZE(am3517evm_i2c_boardinfo));
+ i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+ ARRAY_SIZE(am3517evm_i2c1_boardinfo));


I'm curious why isn't this together with the other busses ??

rtc s35390a is on i2c1 bus. am3517_evm_rtc_init() will initialize the 
IRQ(a gpio pin).

So i2c_register_board_info have to be put after am3517_evm_rtc_init.

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/9] Some am3517 related patches [V2]

2010-04-19 Thread Stanley.Miao
Changes from V2:
1, Removed the controversial patches. I will submit them later.

Some am3517 related patches. The detaild changelog is below:

Stanley.Miao (9):
  omap: fix the compile error if CONFIG_MTD_NAND_OMAP2 is not enabled
  omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL
  AM3517: rename the i2c boardinfo to make it more readable
  AM3517: Add platform init code for regulator driver
  AM3517: Add audio codec platform data
  AM3517: initialize i2c subsystem after mux subsystem
  OMAP: fix a gpmc nand problem
  omap: init the gpio pinmux for mmc
  omap hsmmc: fix the hsmmc driver for am3517.

 arch/arm/mach-omap2/board-am3517evm.c  |  149 +---
 arch/arm/mach-omap2/devices.c  |7 ++
 arch/arm/mach-omap2/gpmc-nand.c|3 +
 arch/arm/mach-omap2/hsmmc.c|   32 +--
 arch/arm/plat-omap/include/plat/irqs.h |2 -
 arch/arm/plat-omap/include/plat/nand.h |7 ++
 6 files changed, 178 insertions(+), 22 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL

2010-04-19 Thread Stanley.Miao
INT_34XX_BENCH_MPU_EMUL was defined twice, another is at Line 312.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/plat-omap/include/plat/irqs.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index b65088a..4017019 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -345,8 +345,6 @@
 #define INT_34XX_MMC3_IRQ  94
 #define INT_34XX_GPT12_IRQ 95
 
-#defineINT_34XX_BENCH_MPU_EMUL 3
-
 #define INT_35XX_HECC0_IRQ 24
 #define INT_35XX_HECC1_IRQ 28
 #define INT_35XX_EMAC_C0_RXTHRESH_IRQ  67
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/9] AM3517: initialize i2c subsystem after mux subsystem

2010-04-19 Thread Stanley.Miao
The initialize of i2c subsystem will set pinmux, so it should be done
after the initialize of mux subsystem initialization.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index f24e367..f8f99b8 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -419,9 +419,9 @@ static struct omap_board_mux board_mux[] __initdata = {
 
 static void __init am3517_evm_init(void)
 {
-   am3517_evm_i2c_init();
-
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+   am3517_evm_i2c_init();
platform_add_devices(am3517_evm_devices,
ARRAY_SIZE(am3517_evm_devices));
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/9] omap hsmmc: fix the hsmmc driver for am3517.

2010-04-19 Thread Stanley.Miao
AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like vmmc, so we set a noop set_power function for it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/hsmmc.c |   32 
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..5f46797 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int 
slot,
}
 }
 
+static int am3517_mmc_set_power(struct device *dev, int slot, int power_on,
+   int vdd)
+{
+   return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
@@ -150,7 +156,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-   } else {
+   } else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}
@@ -216,12 +222,25 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
 */
mmc-slots[0].ocr_mask = c-ocr_mask;
 
+   if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
+   switch (c-mmc) {
+   case 1:
+   /* on-chip level shifting via PBIAS0/PBIAS1 */
+   mmc-slots[0].before_set_reg = 
hsmmc1_before_set_reg;
+   mmc-slots[0].after_set_reg = 
hsmmc1_after_set_reg;
+   break;
+   case 2:
+   case 3:
+   /* off-chip level shifting, or none */
+   mmc-slots[0].before_set_reg = 
hsmmc23_before_set_reg;
+   mmc-slots[0].after_set_reg = NULL;
+   break;
+   }
+   } else /* cpu_is_omap3517() || cpu_is_omap3505() */
+   mmc-slots[0].set_power = am3517_mmc_set_power;
+
switch (c-mmc) {
case 1:
-   /* on-chip level shifting via PBIAS0/PBIAS1 */
-   mmc-slots[0].before_set_reg = hsmmc1_before_set_reg;
-   mmc-slots[0].after_set_reg = hsmmc1_after_set_reg;
-
/* Omap3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630()  c-wires  4) {
c-wires = 4;
@@ -235,9 +254,6 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
c-wires = 4;
/* FALLTHROUGH */
case 3:
-   /* off-chip level shifting, or none */
-   mmc-slots[0].before_set_reg = hsmmc23_before_set_reg;
-   mmc-slots[0].after_set_reg = NULL;
break;
default:
pr_err(MMC%d configuration not supported!\n, c-mmc);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/11] Some am3517 related patches [V2]

2010-04-14 Thread Stanley.Miao
Changes from V1:
1, modify the mmc set_power part according to Adrian.Hunter.
2, Updated the config file.

Some am3517 related patches. The detaild changelog is below:


The following changes since commit eba014745cc806d625b6a553d1af6efd14e16321:
  Tony Lindgren (1):
Linux-omap rebuilt: Updated to -rc3

are available in the git repository at:

  . devel

Stanley.Miao (12):
  omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL
  AM3517: Add platform init code for EMAC driver
  AM3517: rename the i2c boardinfo to make it more readable
  AM3517: Add platform init code for regulator driver
  AM3517: Add audio codec platform data
  AM3517: Add nand platform data for am3517evm
  AM3517: initialize i2c subsystem after mux subsystem
  OMAP: fix a gpmc nand problem
  AM3517: Update the config file of am3517evm
  omap: init the gpio pinmux for mmc
  omap hsmmc: fix the hsmmc driver for am3517.
  AM3517: Add mmc platform data for am3517evm

 arch/arm/configs/am3517_evm_defconfig |  599 
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/board-am3517evm.c |  392 ++-
 arch/arm/mach-omap2/devices.c |7 +
 arch/arm/mach-omap2/gpmc-nand.c   |3 +
 arch/arm/mach-omap2/hsmmc.c   |   32 ++-
 arch/arm/mach-omap2/include/mach/am35xx.h |9 +
 arch/arm/plat-omap/include/plat/irqs.h|2 -
 8 files changed, 938 insertions(+), 109 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/12] AM3517: Add platform init code for EMAC driver

2010-04-14 Thread Stanley.Miao
Add platform init code for EMAC driver.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  114 +
 arch/arm/mach-omap2/include/mach/am35xx.h |9 ++
 2 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..db542b2 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,7 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/gpio.h
+#include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
 
 #include mach/hardware.h
@@ -30,6 +31,7 @@
 
 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h
 
@@ -39,6 +41,117 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define AM35XX_EVM_PHY_MASK  (0xF)
+#define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
+
+static struct emac_platform_data am3517_evm_emac_pdata = {
+   .phy_mask   = AM35XX_EVM_PHY_MASK,
+   .mdio_max_freq  = AM35XX_EVM_MDIO_FREQUENCY,
+   .rmii_en= 1,
+};
+
+static int __init eth_addr_setup(char *str)
+{
+   int i;
+   long res;
+
+   if (str == NULL)
+   return 0;
+   for (i = 0; i   ETH_ALEN; i++) {
+   if (!strict_strtol(str[i * 3], 16, res))
+   am3517_evm_emac_pdata.mac_addr[i] = res;
+   else
+   return -EINVAL;
+   }
+   return 1;
+}
+
+/* Get MAC address from kernel boot parameter eth=AA:BB:CC:DD:EE:FF */
+__setup(eth=, eth_addr_setup);
+
+static struct resource am3517_emac_resources[] = {
+   {
+   .start  = AM35XX_IPSS_EMAC_BASE,
+   .end= AM35XX_IPSS_EMAC_BASE + 0x3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .end= INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_emac_device = {
+   .name   = davinci_emac,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_emac_resources),
+   .resource   = am3517_emac_resources,
+};
+
+static void am3517_enable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
+   AM35XX_CPGMAC_C0_RX_THRESH_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am3517_disable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
+{
+   u32 regval;
+
+   pdata-ctrl_reg_offset  = AM35XX_EMAC_CNTRL_OFFSET;
+   pdata-ctrl_mod_reg_offset  = AM35XX_EMAC_CNTRL_MOD_OFFSET;
+   pdata-ctrl_ram_offset  = AM35XX_EMAC_CNTRL_RAM_OFFSET;
+   pdata-mdio_reg_offset  = AM35XX_EMAC_MDIO_OFFSET;
+   pdata-ctrl_ram_size= AM35XX_EMAC_CNTRL_RAM_SIZE;
+   pdata-version  = EMAC_VERSION_2;
+   pdata-hw_ram_addr  = AM35XX_EMAC_HW_RAM_ADDR;
+   pdata-interrupt_enable = am3517_enable_ethernet_int;
+   pdata-interrupt_disable= am3517_disable_ethernet_int;
+   am3517_emac_device.dev.platform_data = pdata;
+   platform_device_register(am3517_emac_device);
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+   regval = regval  (~(AM35XX_CPGMACSS_SW_RST));
+   omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+   return ;
+ }
+
 static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30

[PATCH 03/12] AM3517: rename the i2c boardinfo to make it more readable

2010-04-14 Thread Stanley.Miao
There are three i2c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index db542b2..5abf333 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -152,7 +152,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data 
*pdata)
return ;
  }
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30),
.type   = s35390a,
@@ -182,7 +182,7 @@ static void __init am3517_evm_rtc_init(void)
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
-   am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -193,7 +193,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_gpio_expander_info_0,
@@ -207,7 +207,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x20),
.platform_data = am3517evm_ui_gpio_expander_info_1,
@@ -221,10 +221,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-   ARRAY_SIZE(am3517evm_tca6416_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-   ARRAY_SIZE(am3517evm_ui_tca6416_info));
+   omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+   omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
return 0;
 }
@@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();
 
-   i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-   ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/12] AM3517: Add platform init code for regulator driver

2010-04-14 Thread Stanley.Miao
Add platform init code for regulator driver.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  122 +
 1 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 5abf333..2d7fd08 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -22,6 +22,7 @@
 #include linux/gpio.h
 #include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
+#include linux/regulator/machine.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -159,6 +160,122 @@ static struct i2c_board_info __initdata 
am3517evm_i2c1_boardinfo[] = {
},
 };
 
+/* TPS65023 specific initialization */
+/* VDCDC1 - VDD_CORE */
+static struct regulator_consumer_supply am3517_evm_vdcdc1_supplies[] = {
+   {
+   .supply = vdd_core,
+   },
+};
+
+/* VDCDC2 - VDDSHV */
+static struct regulator_consumer_supply am3517_evm_vdcdc2_supplies[] = {
+   {
+   .supply = vddshv,
+   },
+};
+
+/* VDCDC2 |- VDDS
+  |- VDDS_SRAM_CORE_BG
+  |- VDDS_SRAM_MPU */
+static struct regulator_consumer_supply am3517_evm_vdcdc3_supplies[] = {
+   {
+   .supply = vdds,
+   },
+   {
+   .supply = vdds_sram_core_bg,
+   },
+   {
+   .supply = vdds_sram_mpu,
+   },
+};
+
+/* LDO1 |- VDDA1P8V_USBPHY
+|- VDDA_DAC */
+static struct regulator_consumer_supply am3517_evm_ldo1_supplies[] = {
+   {
+   .supply = vdda1p8v_usbphy,
+   },
+   {
+   .supply = vdda_dac,
+   },
+};
+
+/* LDO2 - VDDA3P3V_USBPHY */
+static struct regulator_consumer_supply am3517_evm_ldo2_supplies[] = {
+   {
+   .supply = vdda3p3v_usbphy,
+   },
+};
+
+static struct regulator_init_data am3517_evm_regulator_data[] = {
+   /* DCDC1 */
+   {
+   .constraints = {
+   .min_uV = 120,
+   .max_uV = 120,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc1_supplies),
+   .consumer_supplies = am3517_evm_vdcdc1_supplies,
+   },
+   /* DCDC2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc2_supplies),
+   .consumer_supplies = am3517_evm_vdcdc2_supplies,
+   },
+   /* DCDC3 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc3_supplies),
+   .consumer_supplies = am3517_evm_vdcdc3_supplies,
+   },
+   /* LDO1 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo1_supplies),
+   .consumer_supplies = am3517_evm_ldo1_supplies,
+   },
+   /* LDO2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo2_supplies),
+   .consumer_supplies = am3517_evm_ldo2_supplies,
+   },
+};
+
 /*
  * RTC - S35390A
  */
@@ -216,6 +333,11 @@ static struct i2c_board_info __initdata 
am3517evm_i2c3_boardinfo[] = {
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_ui_gpio_expander_info_2,
},
+   {
+   I2C_BOARD_INFO(tps65023, 0x48),
+   .flags

[PATCH 05/12] AM3517: Add audio codec platform data

2010-04-14 Thread Stanley.Miao
Codec tlv320aic23 is on the second i2c bus. Add the tlv320aic23 info in
i2c2 board_info.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 2d7fd08..879c13f 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -312,6 +312,9 @@ static struct pca953x_platform_data 
am3517evm_gpio_expander_info_0 = {
 };
 static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
+   I2C_BOARD_INFO(tlv320aic23, 0x1A),
+   },
+   {
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_gpio_expander_info_0,
},
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/12] AM3517: Add nand platform data for am3517evm

2010-04-14 Thread Stanley.Miao
Add nand flash init code for am3517evm.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   84 +
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 879c13f..a76ff11 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -23,6 +23,9 @@
 #include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
 #include linux/regulator/machine.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -35,6 +38,8 @@
 #include plat/control.h
 #include plat/usb.h
 #include plat/display.h
+#include plat/nand.h
+#include plat/gpmc.h
 
 #include mux.h
 
@@ -42,6 +47,84 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition am3517evm_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = xloader,
+   .offset = 0,
+   .size   = 4 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = uboot,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 14 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = uboot-params,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 2 * (SZ_128K)
+   },
+   {
+   .name   = linux-kernel,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 40 * (SZ_128K)
+   },
+   {
+   .name   = rootfs,
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,
+   },
+};
+
+static struct omap_nand_platform_data am3517evm_nand_data = {
+   .parts  = am3517evm_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(am3517evm_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .devsize= 1,
+   .dev_ready  = NULL,
+};
+
+void __init am3517evm_flash_init(void)
+{
+   u8 cs = 0;
+   u8 nandcs = GPMC_CS_NUM + 1;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   while (cs  GPMC_CS_NUM) {
+   u32 ret = 0;
+   ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+   if ((ret  0xC00) == 0x800) {
+   /* Found it!! */
+   if (nandcs  GPMC_CS_NUM)
+   nandcs = cs;
+   }
+   cs++;
+   }
+   if (nandcs  GPMC_CS_NUM) {
+   printk(KERN_INFO NAND: Unable to find configuration 
+in GPMC\n );
+   return;
+   }
+
+   if (nandcs  GPMC_CS_NUM) {
+   am3517evm_nand_data.cs   = nandcs;
+   am3517evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+   am3517evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+   gpmc_nand_init(am3517evm_nand_data);
+   }
+}
+
+
 #define AM35XX_EVM_PHY_MASK  (0xF)
 #define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
 
@@ -539,6 +622,7 @@ static void __init am3517_evm_init(void)
ARRAY_SIZE(am3517_evm_devices));
 
omap_serial_init();
+   am3517evm_flash_init();
 
/* Configure GPIO for EHCI port */
omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/12] AM3517: initialize i2c subsystem after mux subsystem

2010-04-14 Thread Stanley.Miao
The initialize of i2c subsystem will set pinmux, so it should be done
after the initialize of mux subsystem initialization.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index a76ff11..6a82ac3 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -615,9 +615,9 @@ static struct omap_board_mux board_mux[] __initdata = {
 
 static void __init am3517_evm_init(void)
 {
-   am3517_evm_i2c_init();
-
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+   am3517_evm_i2c_init();
platform_add_devices(am3517_evm_devices,
ARRAY_SIZE(am3517_evm_devices));
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/12] OMAP: fix a gpmc nand problem

2010-04-14 Thread Stanley.Miao
If gpmc_t isn't given, we don't need to set timing for gpmc, or it will cause
a Oops.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/gpmc-nand.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 64d74f0..e57fb29 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -39,6 +39,9 @@ static int omap2_nand_gpmc_retime(void)
struct gpmc_timings t;
int err;
 
+   if (!gpmc_nand_data-gpmc_t)
+   return 0;
+
memset(t, 0, sizeof(t));
t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-sync_clk);
t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-cs_on);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/12] AM3517: Update the config file of am3517evm

2010-04-14 Thread Stanley.Miao
Added MTD, NETDEVICES, WATCHDOG, GPIO_PCA953X, REGULATOR, FB, SOUND, MMC, RTC.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/configs/am3517_evm_defconfig |  599 -
 1 files changed, 513 insertions(+), 86 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..a995767 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -1,13 +1,14 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.32-rc5
-# Wed Oct 28 15:47:47 2009
+# Linux kernel version: 2.6.34-rc3
+# Wed Apr 14 16:07:52 2010
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_HAVE_PROC_CPU=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -19,7 +20,9 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
 CONFIG_CONSTRUCTORS=y
@@ -32,6 +35,12 @@ CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_LZO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
@@ -46,17 +55,13 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 CONFIG_TREE_RCU=y
 # CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_TINY_RCU is not set
 # CONFIG_RCU_TRACE is not set
 CONFIG_RCU_FANOUT=32
 # CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_GROUP_SCHED=y
-CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_RT_GROUP_SCHED is not set
-CONFIG_USER_SCHED=y
-# CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
@@ -67,6 +72,7 @@ CONFIG_INITRAMFS_SOURCE=
 CONFIG_RD_GZIP=y
 # CONFIG_RD_BZIP2 is not set
 # CONFIG_RD_LZMA is not set
+# CONFIG_RD_LZO is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_ANON_INODES=y
@@ -88,10 +94,14 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
 
 #
 # Kernel Performance Events And Counters
 #
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
@@ -127,14 +137,41 @@ CONFIG_LBDAF=y
 # IO Schedulers
 #
 CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED=anticipatory
+CONFIG_DEFAULT_IOSCHED=cfq
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
 # CONFIG_FREEZER is not set
 
 #
@@ -146,6 +183,7 @@ CONFIG_MMU=y
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCMRING is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
@@ -155,7 +193,6 @@ CONFIG_MMU=y
 # CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -163,6 +200,7 @@ CONFIG_MMU=y
 # CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_DOVE is not set

[PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL

2010-04-13 Thread Stanley.Miao
INT_34XX_BENCH_MPU_EMUL was defined twice, another is at Line 312.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/plat-omap/include/plat/irqs.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index b65088a..4017019 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -345,8 +345,6 @@
 #define INT_34XX_MMC3_IRQ  94
 #define INT_34XX_GPT12_IRQ 95
 
-#defineINT_34XX_BENCH_MPU_EMUL 3
-
 #define INT_35XX_HECC0_IRQ 24
 #define INT_35XX_HECC1_IRQ 28
 #define INT_35XX_EMAC_C0_RXTHRESH_IRQ  67
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/11] AM3517: Add platform init code for EMAC driver

2010-04-13 Thread Stanley.Miao
Add platform init code for EMAC driver.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  114 +
 arch/arm/mach-omap2/include/mach/am35xx.h |9 ++
 2 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..db542b2 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,7 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/gpio.h
+#include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
 
 #include mach/hardware.h
@@ -30,6 +31,7 @@
 
 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h
 
@@ -39,6 +41,117 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define AM35XX_EVM_PHY_MASK  (0xF)
+#define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
+
+static struct emac_platform_data am3517_evm_emac_pdata = {
+   .phy_mask   = AM35XX_EVM_PHY_MASK,
+   .mdio_max_freq  = AM35XX_EVM_MDIO_FREQUENCY,
+   .rmii_en= 1,
+};
+
+static int __init eth_addr_setup(char *str)
+{
+   int i;
+   long res;
+
+   if (str == NULL)
+   return 0;
+   for (i = 0; i   ETH_ALEN; i++) {
+   if (!strict_strtol(str[i * 3], 16, res))
+   am3517_evm_emac_pdata.mac_addr[i] = res;
+   else
+   return -EINVAL;
+   }
+   return 1;
+}
+
+/* Get MAC address from kernel boot parameter eth=AA:BB:CC:DD:EE:FF */
+__setup(eth=, eth_addr_setup);
+
+static struct resource am3517_emac_resources[] = {
+   {
+   .start  = AM35XX_IPSS_EMAC_BASE,
+   .end= AM35XX_IPSS_EMAC_BASE + 0x3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .end= INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_emac_device = {
+   .name   = davinci_emac,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_emac_resources),
+   .resource   = am3517_emac_resources,
+};
+
+static void am3517_enable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
+   AM35XX_CPGMAC_C0_RX_THRESH_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am3517_disable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
+{
+   u32 regval;
+
+   pdata-ctrl_reg_offset  = AM35XX_EMAC_CNTRL_OFFSET;
+   pdata-ctrl_mod_reg_offset  = AM35XX_EMAC_CNTRL_MOD_OFFSET;
+   pdata-ctrl_ram_offset  = AM35XX_EMAC_CNTRL_RAM_OFFSET;
+   pdata-mdio_reg_offset  = AM35XX_EMAC_MDIO_OFFSET;
+   pdata-ctrl_ram_size= AM35XX_EMAC_CNTRL_RAM_SIZE;
+   pdata-version  = EMAC_VERSION_2;
+   pdata-hw_ram_addr  = AM35XX_EMAC_HW_RAM_ADDR;
+   pdata-interrupt_enable = am3517_enable_ethernet_int;
+   pdata-interrupt_disable= am3517_disable_ethernet_int;
+   am3517_emac_device.dev.platform_data = pdata;
+   platform_device_register(am3517_emac_device);
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+   regval = regval  (~(AM35XX_CPGMACSS_SW_RST));
+   omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+   return ;
+ }
+
 static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30

[PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable

2010-04-13 Thread Stanley.Miao
There are three i3c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index db542b2..5abf333 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -152,7 +152,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data 
*pdata)
return ;
  }
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO(s35390a, 0x30),
.type   = s35390a,
@@ -182,7 +182,7 @@ static void __init am3517_evm_rtc_init(void)
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
-   am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -193,7 +193,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_gpio_expander_info_0,
@@ -207,7 +207,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO(tca6416, 0x20),
.platform_data = am3517evm_ui_gpio_expander_info_1,
@@ -221,10 +221,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-   ARRAY_SIZE(am3517evm_tca6416_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-   ARRAY_SIZE(am3517evm_ui_tca6416_info));
+   omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+   omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
return 0;
 }
@@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
/* RTC - S35390A */
am3517_evm_rtc_init();
 
-   i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-   ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+   ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/11] AM3517: Add platform init code for regulator driver

2010-04-13 Thread Stanley.Miao
Add platform init code for regulator driver.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  122 +
 1 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 5abf333..2d7fd08 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -22,6 +22,7 @@
 #include linux/gpio.h
 #include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
+#include linux/regulator/machine.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -159,6 +160,122 @@ static struct i2c_board_info __initdata 
am3517evm_i2c1_boardinfo[] = {
},
 };
 
+/* TPS65023 specific initialization */
+/* VDCDC1 - VDD_CORE */
+static struct regulator_consumer_supply am3517_evm_vdcdc1_supplies[] = {
+   {
+   .supply = vdd_core,
+   },
+};
+
+/* VDCDC2 - VDDSHV */
+static struct regulator_consumer_supply am3517_evm_vdcdc2_supplies[] = {
+   {
+   .supply = vddshv,
+   },
+};
+
+/* VDCDC2 |- VDDS
+  |- VDDS_SRAM_CORE_BG
+  |- VDDS_SRAM_MPU */
+static struct regulator_consumer_supply am3517_evm_vdcdc3_supplies[] = {
+   {
+   .supply = vdds,
+   },
+   {
+   .supply = vdds_sram_core_bg,
+   },
+   {
+   .supply = vdds_sram_mpu,
+   },
+};
+
+/* LDO1 |- VDDA1P8V_USBPHY
+|- VDDA_DAC */
+static struct regulator_consumer_supply am3517_evm_ldo1_supplies[] = {
+   {
+   .supply = vdda1p8v_usbphy,
+   },
+   {
+   .supply = vdda_dac,
+   },
+};
+
+/* LDO2 - VDDA3P3V_USBPHY */
+static struct regulator_consumer_supply am3517_evm_ldo2_supplies[] = {
+   {
+   .supply = vdda3p3v_usbphy,
+   },
+};
+
+static struct regulator_init_data am3517_evm_regulator_data[] = {
+   /* DCDC1 */
+   {
+   .constraints = {
+   .min_uV = 120,
+   .max_uV = 120,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc1_supplies),
+   .consumer_supplies = am3517_evm_vdcdc1_supplies,
+   },
+   /* DCDC2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc2_supplies),
+   .consumer_supplies = am3517_evm_vdcdc2_supplies,
+   },
+   /* DCDC3 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = true,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc3_supplies),
+   .consumer_supplies = am3517_evm_vdcdc3_supplies,
+   },
+   /* LDO1 */
+   {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo1_supplies),
+   .consumer_supplies = am3517_evm_ldo1_supplies,
+   },
+   /* LDO2 */
+   {
+   .constraints = {
+   .min_uV = 330,
+   .max_uV = 330,
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .always_on = false,
+   .apply_uV = false,
+   },
+   .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo2_supplies),
+   .consumer_supplies = am3517_evm_ldo2_supplies,
+   },
+};
+
 /*
  * RTC - S35390A
  */
@@ -216,6 +333,11 @@ static struct i2c_board_info __initdata 
am3517evm_i2c3_boardinfo[] = {
I2C_BOARD_INFO(tca6416, 0x21),
.platform_data = am3517evm_ui_gpio_expander_info_2,
},
+   {
+   I2C_BOARD_INFO(tps65023, 0x48),
+   .flags

[PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem

2010-04-13 Thread Stanley.Miao
The initialize of i2c subsystem will set pinmux, so it should be done
after the initialize of mux subsystem initialization.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index a76ff11..6a82ac3 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -615,9 +615,9 @@ static struct omap_board_mux board_mux[] __initdata = {
 
 static void __init am3517_evm_init(void)
 {
-   am3517_evm_i2c_init();
-
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+   am3517_evm_i2c_init();
platform_add_devices(am3517_evm_devices,
ARRAY_SIZE(am3517_evm_devices));
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/11] OMAP: fix a gpmc nand problem

2010-04-13 Thread Stanley.Miao
If gpmc_t isn't given, we don't need to set timing for gpmc, or it will cause
a Oops.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/gpmc-nand.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 64d74f0..e57fb29 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -39,6 +39,9 @@ static int omap2_nand_gpmc_retime(void)
struct gpmc_timings t;
int err;
 
+   if (!gpmc_nand_data-gpmc_t)
+   return 0;
+
memset(t, 0, sizeof(t));
t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-sync_clk);
t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-cs_on);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/11] AM3517: Add nand platform data for am3517evm

2010-04-13 Thread Stanley.Miao
Add nand flash init code for am3517evm.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   84 +
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 879c13f..a76ff11 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -23,6 +23,9 @@
 #include linux/davinci_emac.h
 #include linux/i2c/pca953x.h
 #include linux/regulator/machine.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -35,6 +38,8 @@
 #include plat/control.h
 #include plat/usb.h
 #include plat/display.h
+#include plat/nand.h
+#include plat/gpmc.h
 
 #include mux.h
 
@@ -42,6 +47,84 @@
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition am3517evm_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = xloader,
+   .offset = 0,
+   .size   = 4 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = uboot,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 14 * (SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = uboot-params,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 2 * (SZ_128K)
+   },
+   {
+   .name   = linux-kernel,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 40 * (SZ_128K)
+   },
+   {
+   .name   = rootfs,
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,
+   },
+};
+
+static struct omap_nand_platform_data am3517evm_nand_data = {
+   .parts  = am3517evm_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(am3517evm_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .devsize= 1,
+   .dev_ready  = NULL,
+};
+
+void __init am3517evm_flash_init(void)
+{
+   u8 cs = 0;
+   u8 nandcs = GPMC_CS_NUM + 1;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   while (cs  GPMC_CS_NUM) {
+   u32 ret = 0;
+   ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+   if ((ret  0xC00) == 0x800) {
+   /* Found it!! */
+   if (nandcs  GPMC_CS_NUM)
+   nandcs = cs;
+   }
+   cs++;
+   }
+   if (nandcs  GPMC_CS_NUM) {
+   printk(KERN_INFO NAND: Unable to find configuration 
+in GPMC\n );
+   return;
+   }
+
+   if (nandcs  GPMC_CS_NUM) {
+   am3517evm_nand_data.cs   = nandcs;
+   am3517evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+   am3517evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+   gpmc_nand_init(am3517evm_nand_data);
+   }
+}
+
+
 #define AM35XX_EVM_PHY_MASK  (0xF)
 #define AM35XX_EVM_MDIO_FREQUENCY(100) /*PHY bus frequency */
 
@@ -539,6 +622,7 @@ static void __init am3517_evm_init(void)
ARRAY_SIZE(am3517_evm_devices));
 
omap_serial_init();
+   am3517evm_flash_init();
 
/* Configure GPIO for EHCI port */
omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.

2010-04-13 Thread Stanley.Miao
am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like vmmc, so we don't need set set_power function for it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/hsmmc.c   |4 +++-
 drivers/mmc/host/omap_hsmmc.c |   28 +---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..a6e6c86 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-   } else {
+   } else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}
@@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
 */
mmc-slots[0].ocr_mask = c-ocr_mask;
 
+#ifndef CONFIG_MACH_OMAP3517EVM
switch (c-mmc) {
case 1:
/* on-chip level shifting via PBIAS0/PBIAS1 */
@@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info 
*controllers)
kfree(mmc);
continue;
}
+#endif
hsmmc_data[c-mmc - 1] = mmc;
}
 
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 83f0aff..f3c64a2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int 
slot)
 
 #endif
 
-#ifdef CONFIG_REGULATOR
+#if defined(CONFIG_REGULATOR)  !defined(CONFIG_MACH_OMAP3517EVM)
 
 static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
  int vdd)
@@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct 
omap_hsmmc_host *host, int vdd)
clk_disable(host-dbclk);
 
/* Turn the power off */
-   ret = mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
+   if (mmc_slot(host).set_power) {
+   ret = mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
+
+   /* Turn the power ON with given VDD 1.8 or 3.0v */
+   if (!ret)
+   ret = mmc_slot(host).set_power(host-dev,
+   host-slot_id, 1, vdd);
+   }
 
-   /* Turn the power ON with given VDD 1.8 or 3.0v */
-   if (!ret)
-   ret = mmc_slot(host).set_power(host-dev, host-slot_id, 1,
-  vdd);
clk_enable(host-iclk);
clk_enable(host-fclk);
if (host-got_dbclk)
@@ -1478,13 +1481,15 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, 
struct mmc_ios *ios)
if (ios-power_mode != host-power_mode) {
switch (ios-power_mode) {
case MMC_POWER_OFF:
-   mmc_slot(host).set_power(host-dev, host-slot_id,
-0, 0);
+   if (mmc_slot(host).set_power)
+   mmc_slot(host).set_power(host-dev,
+   host-slot_id, 0, 0);
host-vdd = 0;
break;
case MMC_POWER_UP:
-   mmc_slot(host).set_power(host-dev, host-slot_id,
-1, ios-vdd);
+   if (mmc_slot(host).set_power)
+   mmc_slot(host).set_power(host-dev,
+   host-slot_id, 1, ios-vdd);
host-vdd = ios-vdd;
break;
case MMC_POWER_ON:
@@ -1714,7 +1719,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host 
*host)
return 0;
}
 
-   mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
+   if (mmc_slot(host).set_power)
+   mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
host-vdd = 0;
host-power_mode = MMC_POWER_OFF;
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/11] AM3517: Add mmc platform data for am3517evm

2010-04-13 Thread Stanley.Miao
Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
with LCD, so add macros to resolve it.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/board-am3517evm.c |   45 +
 2 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4b9fc57..e94afdd 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)  += 
board-omap3touchbook.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_4430SDP)+= board-4430sdp.o
 
-obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
+obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
+  hsmmc.o
 
 # Platform specific device init code
 obj-y  += usb-musb.o
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6a82ac3..8054994 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -26,6 +26,7 @@
 #include linux/mtd/mtd.h
 #include linux/mtd/partitions.h
 #include linux/mtd/nand.h
+#include linux/mmc/host.h
 
 #include mach/hardware.h
 #include mach/am35xx.h
@@ -40,7 +41,9 @@
 #include plat/display.h
 #include plat/nand.h
 #include plat/gpmc.h
+#include plat/mmc.h
 
+#include hsmmc.h
 #include mux.h
 
 #define LCD_PANEL_PWR  176
@@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
 static int lcd_enabled;
 static int dvi_enabled;
 
+#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
+   defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
 static void __init am3517_evm_display_init(void)
 {
int r;
@@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct 
omap_dss_device *dssdev)
gpio_set_value(LCD_PANEL_PWR, 0);
lcd_enabled = 0;
 }
+#else
+static inline void __init am3517_evm_display_init(void)
+{
+}
+
+static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+   return 0;
+}
+
+static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+}
+#endif
 
 static struct omap_dss_device am3517_evm_lcd_device = {
.type   = OMAP_DISPLAY_TYPE_DPI,
@@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+static struct omap2_hsmmc_info mmc[] = {
+   {
+   .mmc= 1,
+   .wires  = 4,
+   .gpio_cd= 127,
+   .gpio_wp= 126,
+   .ocr_mask   = MMC_VDD_165_195 |
+   MMC_VDD_26_27 | MMC_VDD_27_28 |
+   MMC_VDD_29_30 |
+   MMC_VDD_30_31 | MMC_VDD_31_32,
+   },
+#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01)  \
+   !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
+   {
+   .mmc= 2,
+   .wires  = 4,
+   .gpio_cd= 175,
+   .gpio_wp= 176,
+   .ocr_mask   = MMC_VDD_165_195,
+   },
+#endif
+   {}  /* Terminator */
+};
+
 static void __init am3517_evm_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
 
i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
ARRAY_SIZE(am3517evm_i2c1_boardinfo));
+   /* MMC init function */
+   omap2_hsmmc_init(mmc);
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.

2010-04-13 Thread stanley.miao

Adrian Hunter wrote:

Stanley.Miao wrote:
am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the 
regulators

like vmmc, so we don't need set set_power function for it.


It would be better to leave omap_hsmmc alone and either:
- define fixed voltage regulators
- or make a noop set_power function


There are no voltage regulator for mmc, I will make a noop set_power 
function.


How is the power supplied?


I didn't found it in TRM.  The pin vmmc was removed, no pin was added.



With regard to pbias the change should be:


I will accept the below change.

Thanks for the review.

Stanley.




diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..595b24a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

if (cpu_is_omap2430()) {
control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-} else {
+} else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
}
@@ -216,12 +216,24 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

 */
mmc-slots[0].ocr_mask = c-ocr_mask;

+if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
+switch (c-mmc) {
+case 1:
+/* on-chip level shifting via PBIAS0/PBIAS1 */
+mmc-slots[0].before_set_reg = hsmmc1_before_set_reg;
+mmc-slots[0].after_set_reg = hsmmc1_after_set_reg;
+break;
+case 2:
+case 3:
+/* off-chip level shifting, or none */
+mmc-slots[0].before_set_reg = hsmmc23_before_set_reg;
+mmc-slots[0].after_set_reg = NULL;
+break;
+}
+}
+
switch (c-mmc) {
case 1:
-/* on-chip level shifting via PBIAS0/PBIAS1 */
-mmc-slots[0].before_set_reg = hsmmc1_before_set_reg;
-mmc-slots[0].after_set_reg = hsmmc1_after_set_reg;
-
/* Omap3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630()  c-wires  4) {
c-wires = 4;
@@ -235,9 +247,6 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

c-wires = 4;
/* FALLTHROUGH */
case 3:
-/* off-chip level shifting, or none */
-mmc-slots[0].before_set_reg = hsmmc23_before_set_reg;
-mmc-slots[0].after_set_reg = NULL;
break;
default:
pr_err(MMC%d configuration not supported!\n, c-mmc);





Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap2/hsmmc.c   |4 +++-
 drivers/mmc/host/omap_hsmmc.c |   28 +---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..a6e6c86 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

 if (cpu_is_omap2430()) {
 control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
 control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-} else {
+} else if (!cpu_is_omap3517()  !cpu_is_omap3505()) {
 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
 control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
 }
@@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

  */
 mmc-slots[0].ocr_mask = c-ocr_mask;
 
+#ifndef CONFIG_MACH_OMAP3517EVM


ifdef CONFIG_MACH_OMAP3517EVM





 switch (c-mmc) {
 case 1:
 /* on-chip level shifting via PBIAS0/PBIAS1 */
@@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct 
omap2_hsmmc_info *controllers)

 kfree(mmc);
 continue;
 }
+#endif
 hsmmc_data[c-mmc - 1] = mmc;
 }
 
diff --git a/drivers/mmc/host/omap_hsmmc.c 
b/drivers/mmc/host/omap_hsmmc.c

index 83f0aff..f3c64a2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device 
*dev, int slot)
 
 #endif
 
-#ifdef CONFIG_REGULATOR

+#if defined(CONFIG_REGULATOR)  !defined(CONFIG_MACH_OMAP3517EVM)
 
 static int omap_hsmmc_1_set_power(struct device *dev, int slot, int 
power_on,

   int vdd)
@@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct 
omap_hsmmc_host *host, int vdd)

 clk_disable(host-dbclk);
 
 /* Turn the power off */

-ret = mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
+if (mmc_slot(host).set_power) {
+ret = mmc_slot(host).set_power(host-dev, host-slot_id, 0, 0);
+
+/* Turn the power

vdds_dsi doesn't exist on all omap3430 arch chip

2010-03-04 Thread stanley.miao

Hi, Tomi,

The commit below:
http://www.gitorious.org/linux-omap-dss2/linux/commit/ec70668fa99b2dd0d305fbdb451a728f2e2a4c58
doesn't apply to ti_omap_am3517. There is no vdds_dsi on am3517.

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Which directory should OMAP-L137/L138's code in ?

2009-06-12 Thread stanley.miao
I am developing on the board OMAP-L137/L138, which is similar with 
Davinci series board.  Should I put its platform file in the directory 
arch/arm/mach-davinci ? or create a new direcory arch/arch/mach-L1xx for 
it ?


Any suggestions ?

Thanks
Stanley.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Which directory should OMAP-L137/L138's code in ?

2009-06-12 Thread stanley.miao

Thanks a lot.

Stanley.

Syed Mohammed, Khasim wrote:

Hi,

  

-Original Message-
From: linux-omap-ow...@vger.kernel.org 
[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Tony
Lindgren
Sent: Friday, June 12, 2009 4:02 PM
To: stanley.miao; Kevin Hilman
Cc: linux-omap@vger.kernel.org
Subject: Re: Which directory should OMAP-L137/L138's code in ?

* stanley.miao stanley.m...@windriver.com [090612 02:53]:


I am developing on the board OMAP-L137/L138, which is similar with
Davinci series board.  Should I put its platform file in the directory
arch/arm/mach-davinci ? or create a new direcory arch/arch/mach-L1xx for
it ?

Any suggestions ?
  

If it uses DaVinci core code to me it sounds like it should be under
mach-davinci. Kevin?




The TI code for OMAP L 13x is part of mach-davinci. And the platform specific 
patches to be submitted to Davinci mailing list for upstream submissions.

Regards,
Khasim

  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP_LDP: Support LCD display as a FB device on ZOOM MDK (Re: LDP support)

2009-05-08 Thread stanley.miao

Gadiyar, Anand wrote:

Stanley.miao wrote:
  

Russell King - ARM Linux wrote:


On Thu, May 07, 2009 at 11:01:35PM +0800, stanley.miao wrote:
  
  

Hi, Tony,

Now the kernel can't boot on LDP. The attached file is the boot log.



No boot log found.


  
  

Sorry, forgot to attach the boot log.

It is linux-omap master branch.

Stanley.



Looks like you used the CodeSourcery 2007q3 toolchain. This had been
reported earlier. Switching to 2008q3 works.

- Anand



  

Yeah, Now the kernel booted. it's compiler's problem.

Linux version 2.6.30-rc4-omap1-05873-g2489dcb (stan...@stanley-desktop) 
(gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #2 Fri May 8 17:06:34 
CST 2009

CPU: ARMv7 Processor [411fc082] revision 2 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP LDP board


Hi, Tony,

LCD still works.
The code I tested is the master branch of linux-omap. Is it right ?

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP_LDP: Support LCD display as a FB device on ZOOM MDK (Re: LDP support)

2009-05-07 Thread stanley.miao

Tony Lindgren wrote:

* Tony Lindgren t...@atomide.com [090505 21:00]:
  

* Russell King - ARM Linux li...@arm.linux.org.uk [090505 12:52]:


On Tue, Apr 28, 2009 at 03:42:37PM -0700, Tony Lindgren wrote:
  

* Russell King - ARM Linux li...@arm.linux.org.uk [090428 15:07]:


Tony, et.al.,

Any ideas when more LDP support will be pushed into mainline (such as
the framebuffer support)?
  

I'll be looking at the board-*.c patches for the next merge window
hopefully this week or next week.

Looks like LDP keyboard, touchscreen  RTC are pretty much ready
to go. Then the MMC has some regulator updates, but AFAIK the MMC
should work OK already.

For the framebuffer, Imre and Tomi know the status the best, so
I've added them to Cc.

Imre has been meaning to send a bunch of drivers/video/omap changes
to the fbdev list for a while now and LDP framebuffer may depend on
those. Imre, any news on the status of sending the fb patches
upstream?

Then there are the upcoming DSS patches from Tomi, but those still
need some work before they're ready to go.


Is there any news on this?  Will we see more functional OMAP3 / LDP
support queued for the next merge window?
  

Yes fro the stuff listed above, but still no news on the framebuffer
patches. Imre?



Added Stanley Miao to Cc. Here's an updated version of Stanley's patch to
add fb support for LDP.

I don't have an LDP, maybe you guys can give it a try against the mainline
kernel and see if it works! There might be some changes needed to 
drivers/video/omap/dispc.c too.. And those should be handled by Imre.


But if this works, at least we can then add support for few more boards
easily while waiting for Imre to send his updates.
  

Hi, Tony,

Now the kernel can't boot on LDP. The attached file is the boot log.

I will check it when I have  time.

Stanley.


Cheers,

Tony 
  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] LDP: Add support for built-in camera

2009-03-26 Thread stanley.miao

Aguirre Rodriguez, Sergio Alberto wrote:
  

-Original Message-
From: stanley.miao [mailto:stanley.m...@windriver.com]
Sent: Tuesday, March 10, 2009 3:04 AM
To: Aguirre Rodriguez, Sergio Alberto
Cc: linux-me...@vger.kernel.org; linux-omap@vger.kernel.org; Sakari Ailus;
Tuukka.O Toivonen; Hiroshi DOYU; DongSoo(Nathaniel) Kim; MiaoStanley;
Nagalla, Hari; Hiremath, Vaibhav; Lakhani, Amish; Menon, Nishanth
Subject: RE: [PATCH 5/5] LDP: Add support for built-in camera

On Mon, 2009-03-09 at 15:24 -0500, Aguirre Rodriguez, Sergio Alberto
wrote:

snip

out


when I run my test program.

3CSI2: ComplexIO Error IRQ 80
CSI2: ComplexIO Error IRQ 80
3CSI2: ComplexIO Error IRQ c2
CSI2: ComplexIO Error IRQ c2
3CSI2: ComplexIO Error IRQ c2
CSI2: ComplexIO Error IRQ c2
3CSI2: ComplexIO Error IRQ c6
CSI2: ComplexIO Error IRQ c6
3CSI2: ECC correction failed
CSI2: ECC correction failed
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6



Oops, my mistake. Missed to add that struct there... Fixed now.

About the CSI2 errors you're receiving... Which version of LDP are you
  

using? Which Silicon revision has (ES2.1 or ES3.0)?

ZOOM1 board(LDP3430-VG1.0.0-1), omap3430 ES2.1.

When I use your old version patch, sometimes the test succeed, sometimes
failed(no data was generated and no error). This version, always failed.



Stanley,

I'm working on some CSI2 fixes that could help you with this..

I'll keep you updated on this.

Also, about your board version, it is possible that you'll need a HW modfix 
because of a redundant resistor in CSI2 datalanes. I'm in talks with some 
people at TI to prepare a ready to publish document about this rework.

Zoom1 with ES3 silicon doesn't need this HW fix.
  

Hi, Sergio,

When I used your version in omapzoom tree, the camera worked sometimes. 
So I think it's not HW's problem.


My test program is capture.c that I got from v4l2 spec and did some 
modifications.

This is my test log:

r...@localhost:/root ./capture -d /dev/video4
select timeout
read_frame: Resource temporarily unavailable
select timeout
read_frame: Resource temporarily unavailable
^C

r...@localhost:/root ./capture -d /dev/video4
Got 20 frames data, success.

r...@localhost:/root ./capture -d /dev/video4
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
CSI2: Short packet receive error
CSI2: ECC correction failed
select timeout
read_frame: Resource temporarily unavailable
select timeout
read_frame: Resource temporarily unavailable
select timeout
read_frame: Resource temporarily unavailable
select timeout
read_frame: Resource temporarily unavailable
^C

select timeout means that no data was generated.

Stanley.


I'll hope to get back to you about this next week.

Regards,
Sergio

  

Thanks.
Stanley.



Regards,
Sergio
  

Stanley.




  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 5/5] LDP: Add support for built-in camera

2009-03-10 Thread stanley.miao
On Mon, 2009-03-09 at 15:24 -0500, Aguirre Rodriguez, Sergio Alberto
wrote:
 Hi,
 
  -Original Message-
  From: stanley.miao [mailto:stanley.m...@windriver.com]
 
 snip
 
   +static struct i2c_board_info __initdata ldp_i2c_boardinfo_2[] = {
   +#if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
   + {
   + I2C_BOARD_INFO(ov3640, OV3640_I2C_ADDR),
   + .platform_data = ldp_ov3640_platform_data,
   + },
   +#endif
   +};
  
  This new added i2c_board_info was not registered.
  After I added this line,
  
  omap_register_i2c_bus(2, 400, ldp_i2c_boardinfo_2,
  ARRAY_SIZE(ldp_i2c_boardinfo_2));
  
  the sensor was found. but the test still failed. A lot of error came out
  when I run my test program.
  
  3CSI2: ComplexIO Error IRQ 80
  CSI2: ComplexIO Error IRQ 80
  3CSI2: ComplexIO Error IRQ c2
  CSI2: ComplexIO Error IRQ c2
  3CSI2: ComplexIO Error IRQ c2
  CSI2: ComplexIO Error IRQ c2
  3CSI2: ComplexIO Error IRQ c6
  CSI2: ComplexIO Error IRQ c6
  3CSI2: ECC correction failed
  CSI2: ECC correction failed
  3CSI2: ComplexIO Error IRQ 6
  CSI2: ComplexIO Error IRQ 6
  3CSI2: ComplexIO Error IRQ 6
  CSI2: ComplexIO Error IRQ 6
  3CSI2: ComplexIO Error IRQ 6
  CSI2: ComplexIO Error IRQ 6
  3CSI2: ComplexIO Error IRQ 6
  CSI2: ComplexIO Error IRQ 6
  
 
 Oops, my mistake. Missed to add that struct there... Fixed now.
 
 About the CSI2 errors you're receiving... Which version of LDP are you using? 
 Which Silicon revision has (ES2.1 or ES3.0)?

ZOOM1 board(LDP3430-VG1.0.0-1), omap3430 ES2.1.

When I use your old version patch, sometimes the test succeed, sometimes
failed(no data was generated and no error). This version, always failed.

Thanks.
Stanley.

 
 Regards,
 Sergio
  
  Stanley.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] LDP: Add support for built-in camera

2009-03-04 Thread stanley.miao

Aguirre Rodriguez, Sergio Alberto wrote:

This patch adds support for the LDP builtin camera sensor:
 - Primary sensor (/dev/video4): OV3640 (CSI2).

It introduces also a new file for storing all camera sensors board
specific related functions, like other platforms do (N800 for example).

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
 arch/arm/mach-omap2/Makefile|3 +-
 arch/arm/mach-omap2/board-ldp-camera.c  |  203 +++
 arch/arm/mach-omap2/board-ldp.c |   17 +++
 arch/arm/plat-omap/include/mach/board-ldp.h |1 +
 4 files changed, 223 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ldp-camera.c

snip
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 1e1fd84..513aa8f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -47,6 +47,13 @@
 #define SDP3430_SMC91X_CS  3
 #define CONFIG_DISABLE_HFCLK 1
 
+#include media/v4l2-int-device.h

+
+#if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
+#include media/ov3640.h
+extern struct ov3640_platform_data ldp_ov3640_platform_data;
+#endif
+
 #define ENABLE_VAUX1_DEDICATED 0x03
 #define ENABLE_VAUX1_DEV_GRP   0x20
 
@@ -496,6 +503,15 @@ static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {

},
 };
 
+static struct i2c_board_info __initdata ldp_i2c_boardinfo_2[] = {

+#if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
+   {
+   I2C_BOARD_INFO(ov3640, OV3640_I2C_ADDR),
+   .platform_data = ldp_ov3640_platform_data,
+   },
+#endif
+};
  

This new added i2c_board_info was not registered.
After I added this line,

omap_register_i2c_bus(2, 400, ldp_i2c_boardinfo_2,
   ARRAY_SIZE(ldp_i2c_boardinfo_2));

the sensor was found. but the test still failed. A lot of error came out 
when I run my test program.


3CSI2: ComplexIO Error IRQ 80
CSI2: ComplexIO Error IRQ 80
3CSI2: ComplexIO Error IRQ c2
CSI2: ComplexIO Error IRQ c2
3CSI2: ComplexIO Error IRQ c2
CSI2: ComplexIO Error IRQ c2
3CSI2: ComplexIO Error IRQ c6
CSI2: ComplexIO Error IRQ c6
3CSI2: ECC correction failed
CSI2: ECC correction failed
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6
3CSI2: ComplexIO Error IRQ 6
CSI2: ComplexIO Error IRQ 6


Stanley.

+
 static int __init omap_i2c_init(void)
 {
omap_register_i2c_bus(1, 2600, ldp_i2c_boardinfo,
@@ -530,6 +546,7 @@ static void __init omap_ldp_init(void)
omap_serial_init();
usb_musb_init();
twl4030_mmc_init(mmc);
+   ldp_cam_init();
 }
 
 static void __init omap_ldp_map_io(void)

diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h 
b/arch/arm/plat-omap/include/mach/board-ldp.h
index f233996..8e5d90b 100644
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ b/arch/arm/plat-omap/include/mach/board-ldp.h
@@ -30,6 +30,7 @@
 #define __ASM_ARCH_OMAP_LDP_H
 
 extern void twl4030_bci_battery_init(void);

+extern void ldp_cam_init(void);
 
 #define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ

 #define LDP_SMC911X_CS 1
  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 0/5] Sensor drivers for OMAP3430SDP and LDP camera

2009-03-03 Thread stanley.miao

Aguirre Rodriguez, Sergio Alberto wrote:

This patch series depends on the following patches:

 - Add TWL4030 registers, posted by Tuukka Toivonen on March 2nd.
 - OMAP3 ISP and camera drivers patch series, posted by Sakari Ailus on
   March 3rd. (Please follow his instructions to pull from gitorious.org server)

This has been tested with:
 - SDP3430-VG5.0.1 with OMAP3430-ES3.1 daughter board upgrade.
 - Camkit V3.0.1 with MT9P012 and OV3640 sensors
 - LDP with OV3640 sensor

Sergio Aguirre (5):
  MT9P012: Add driver
  DW9710: Add driver
  OV3640: Add driver
  

Hi, Sergio,

You forgot to send the 3rd patch, OV3640: Add driver.

Stanley.


  OMAP3430SDP: Add support for Camera Kit v3
  LDP: Add support for built-in camera
  


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: BUG: LDP - smc911x region too small

2009-02-03 Thread stanley.miao

Woodruff, Richard wrote:

Here should be 0x100. Fixing this won't cause problems with smsc911x
patches.
  

Yes it will - if it gets fixed in the -rc series for the smc911x driver
your patches will conflict.

There's more which needs fixing though - no platform data is being passed
so the smc911x driver still fails to initialise.



Data sheet shows addressable range as 0x50 from base -- 0xFC.  So 0xFF should 
be good.

I tried to send Russell data sheet but his emails is rejecting it.

Regards,
Richard W.

  

It has been fixed.

http://marc.info/?l=linux-arm-kernelm=123307584619895w=2


Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: BUG: LDP - smc911x region too small

2009-01-19 Thread stanley.miao
On Mon, 2009-01-19 at 22:37 +, Russell King - ARM Linux wrote:
 At the moment:
 
 ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
 ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
 
 However, the SMC911x driver wants to claim 256 bytes from this region.
 Indeed, its register set definitions appears to indicate that its needs
 more than 16 bytes of address space.
 
 So, the question is what is the right fix?
 
 Unfortunately, fixing this will cause problems with the SMSC911x patches,
 so I'd like to get an answer on this sooner rather than later please.

Here should be 0x100. Fixing this won't cause problems with smsc911x
patches.

Stanley.

 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH repost] OMAP: convert omap ldp platform to use smsc911x

2009-01-19 Thread Stanley.Miao
From 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x,
will replace it. so convert omap_ldp to use smsc911x driver.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/configs/omap_ldp_defconfig |   24 -
 arch/arm/mach-omap2/board-ldp.c |   49 ---
 arch/arm/plat-omap/include/mach/board-ldp.h |6 +--
 3 files changed, 53 insertions(+), 26 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig 
b/arch/arm/configs/omap_ldp_defconfig
index d88e6d7..64db3b1 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -489,14 +489,34 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_PHYLIB is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
 # CONFIG_ENC28J60 is not set
-CONFIG_SMC911X=y
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6592d58..ea00f1b 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -23,6 +23,7 @@
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h
 #include linux/i2c/twl4030.h
+#include linux/smsc911x.h
 
 #include mach/hardware.h
 #include asm/mach-types.h
@@ -44,8 +45,6 @@
 
 #include mmc-twl4030.h
 
-
-#define SDP3430_SMC91X_CS  3
 #define CONFIG_DISABLE_HFCLK 1
 
 #define ENABLE_VAUX1_DEDICATED 0x03
@@ -53,10 +52,10 @@
 
 #define TWL4030_MSECURE_GPIO   22
 
-static struct resource ldp_smc911x_resources[] = {
+static struct resource ldp_smsc911x_resources[] = {
[0] = {
-   .start  = OMAP34XX_ETHR_START,
-   .end= OMAP34XX_ETHR_START + SZ_4K,
+   .start  = 0,
+   .end= 0,
.flags  = IORESOURCE_MEM,
},
[1] = {
@@ -66,11 +65,21 @@ static struct resource ldp_smc911x_resources[] = {
},
 };
 
-static struct platform_device ldp_smc911x_device = {
-   .name   = smc911x,
+static struct smsc911x_platform_config ldp_smsc911x_config = {
+   .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+   .irq_type   = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+   .flags  = SMSC911X_USE_32BIT,
+   .phy_interface  = PHY_INTERFACE_MODE_MII,
+};
+
+static struct platform_device ldp_smsc911x_device = {
+   .name   = smsc911x,
.id = -1,
-   .num_resources  = ARRAY_SIZE(ldp_smc911x_resources),
-   .resource   = ldp_smc911x_resources,
+   .num_resources  = ARRAY_SIZE(ldp_smsc911x_resources),
+   .resource   = ldp_smsc911x_resources,
+   .dev= {
+   .platform_data = ldp_smsc911x_config,
+   },
 };
 
 static int ldp_twl4030_keymap[] = {
@@ -308,34 +317,34 @@ static struct platform_device ldp_lcd_device = {
 };
 
 static struct platform_device *ldp_devices[] __initdata = {
-   ldp_smc911x_device,
+   ldp_smsc911x_device,
ldp_lcd_device,
ldp_gpio_keys_device,
 };
 
-static inline void __init ldp_init_smc911x(void)
+static inline void __init ldp_init_smsc911x(void)
 {
int eth_cs;
unsigned long cs_mem_base;
int eth_gpio = 0;
 
-   eth_cs = LDP_SMC911X_CS;
+   eth_cs = LDP_SMSC911X_CS;
 
if (gpmc_cs_request(eth_cs, SZ_16M, cs_mem_base)  0) {
-   printk(KERN_ERR Failed to request GPMC mem for smc911x\n);
+   printk(KERN_ERR Failed to request GPMC mem for smsc911x\n);
return;
}
 
-   ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
-   ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
+   ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
+   ldp_smsc911x_resources[0].end   = cs_mem_base + 0x100;
udelay(100);
 
-   eth_gpio = LDP_SMC911X_GPIO;
+   eth_gpio = LDP_SMSC911X_GPIO;
 
-   ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+   ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
 
-   if (gpio_request(eth_gpio, smc911x irq)  0) {
-   printk(KERN_ERR Failed to request GPIO%d for smc911x IRQ\n,
+   if (gpio_request(eth_gpio, smsc911x irq)  0) {
+   printk(KERN_ERR Failed

Re: [PATCHv3] OMAP: Fix McBSP spin_lock deadlock

2009-01-15 Thread stanley.miao
I didn't test it on omap1, so that make a silly mistake.

I will send the V4 shortly.

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] OMAP: Fix McBSP spin_lock deadlock.

2009-01-13 Thread stanley.miao
On Mon, 2009-01-12 at 12:46 +0200, Tony Lindgren wrote:
 * stanley.miao stanley.m...@windriver.com [090112 12:34]:
  On Thu, 2009-01-08 at 15:33 +0200, Tony Lindgren wrote:
   * stanley.miao stanley.m...@windriver.com [081107 15:47]:
This solution keeps the virtual clock in place and enable the child
clocks before enable the virtual clock. So, any comments ?
   
   What if we just removed the custom clock and had a struct **clk
   in struct omap_mcbsp that contains the clocks for each instance?
  
  It works. This is what I did in my first patch. 
 
 OK, sorry for all this going back and forth..

It's OK. In order to make the code better, it is worth a little more
job.

  We still don't
 have a good long term solution on how to handle different clocks..
 
snip
 
 Sounds like we should just apply your original patch, then figure
 out a good long term approacth.
 
 Can you please repost your first version of the patch?

I will post the patch V3.

Stanley.

 
 Regards,
 
 Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3] OMAP: Fix McBSP spin_lock deadlock

2009-01-13 Thread Stanley.Miao
A spin_lock deadlock will occur when omap_mcbsp_request() is invoked.

omap_mcbsp_request() --
clk_enable(mcbsp-clk)   -- clk_enable get clockfw_lock, then call -
omap2_clk_enable()   --
_omap2_clk_enable()  --
omap_mcbsp_clk_enable()  --
clk_enable(mcbsp_ick)-- now clk_enable acquire clockfw_lock again.

mcbsp_clk is not the true clock, so delete it and ask omap_mcbsp_request
enable mcbsp_ick and mcbsp_fck directly.

Signed-off-by: Stanley.Miao stanley.m...@windriver.com
---
 arch/arm/mach-omap1/mcbsp.c |  103 +++-
 arch/arm/mach-omap2/mcbsp.c |  162 +++
 arch/arm/plat-omap/include/mach/mcbsp.h |6 +-
 arch/arm/plat-omap/mcbsp.c  |   47 ++---
 4 files changed, 85 insertions(+), 233 deletions(-)

diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 7de7c69..5291e64 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -26,83 +26,6 @@
 #define DPS_RSTCT2_PER_EN  (1  0)
 #define DSP_RSTCT2_WD_PER_EN   (1  1)
 
-struct mcbsp_internal_clk {
-   struct clk clk;
-   struct clk **childs;
-   int n_childs;
-};
-
-#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
-static void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
-{
-   const char *clk_names[] = { dsp_ck, api_ck, dspxor_ck };
-   int i;
-
-   mclk-n_childs = ARRAY_SIZE(clk_names);
-   mclk-childs = kzalloc(mclk-n_childs * sizeof(struct clk *),
-   GFP_KERNEL);
-
-   for (i = 0; i  mclk-n_childs; i++) {
-   /* We fake a platform device to get correct device id */
-   struct platform_device pdev;
-
-   pdev.dev.bus = platform_bus_type;
-   pdev.id = mclk-clk.id;
-   mclk-childs[i] = clk_get(pdev.dev, clk_names[i]);
-   if (IS_ERR(mclk-childs[i]))
-   printk(KERN_ERR Could not get clock %s (%d).\n,
-   clk_names[i], mclk-clk.id);
-   }
-}
-
-static int omap_mcbsp_clk_enable(struct clk *clk)
-{
-   struct mcbsp_internal_clk *mclk = container_of(clk,
-   struct mcbsp_internal_clk, clk);
-   int i;
-
-   for (i = 0; i  mclk-n_childs; i++)
-   clk_enable(mclk-childs[i]);
-   return 0;
-}
-
-static void omap_mcbsp_clk_disable(struct clk *clk)
-{
-   struct mcbsp_internal_clk *mclk = container_of(clk,
-   struct mcbsp_internal_clk, clk);
-   int i;
-
-   for (i = 0; i  mclk-n_childs; i++)
-   clk_disable(mclk-childs[i]);
-}
-
-static struct mcbsp_internal_clk omap_mcbsp_clks[] = {
-   {
-   .clk = {
-   .name   = mcbsp_clk,
-   .id = 1,
-   .enable = omap_mcbsp_clk_enable,
-   .disable= omap_mcbsp_clk_disable,
-   },
-   },
-   {
-   .clk = {
-   .name   = mcbsp_clk,
-   .id = 3,
-   .enable = omap_mcbsp_clk_enable,
-   .disable= omap_mcbsp_clk_disable,
-   },
-   },
-};
-
-#define omap_mcbsp_clks_size   ARRAY_SIZE(omap_mcbsp_clks)
-#else
-#define omap_mcbsp_clks_size   0
-static struct mcbsp_internal_clk __initdata *omap_mcbsp_clks;
-static inline void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
-{ }
-#endif
-
 static void omap1_mcbsp_request(unsigned int id)
 {
/*
@@ -165,8 +88,9 @@ static struct omap_mcbsp_platform_data 
omap15xx_mcbsp_pdata[] = {
.rx_irq = INT_McBSP1RX,
.tx_irq = INT_McBSP1TX,
.ops= omap1_mcbsp_ops,
-   .clk_name   = mcbsp_clk,
-   },
+   .ick_name   = mcbsp_ick,
+   .fck_name   = mcbsp_fck,
+   },
{
.phys_base  = OMAP1510_MCBSP2_BASE,
.dma_rx_sync= OMAP_DMA_MCBSP2_RX,
@@ -182,7 +106,9 @@ static struct omap_mcbsp_platform_data 
omap15xx_mcbsp_pdata[] = {
.rx_irq = INT_McBSP3RX,
.tx_irq = INT_McBSP3TX,
.ops= omap1_mcbsp_ops,
-   .clk_name   = mcbsp_clk,
+   .ick_name   = mcbsp_ick,
+   .fck_name   = mcbsp_fck,
+
},
 };
 #define OMAP15XX_MCBSP_PDATA_SZARRAY_SIZE(omap15xx_mcbsp_pdata)
@@ -200,7 +126,9 @@ static struct omap_mcbsp_platform_data 
omap16xx_mcbsp_pdata[] = {
.rx_irq = INT_McBSP1RX,
.tx_irq = INT_McBSP1TX,
.ops= omap1_mcbsp_ops,
-   .clk_name   = mcbsp_clk,
+   .ick_name   = mcbsp_ick

Re: [PATCH v2] OMAP: Fix McBSP spin_lock deadlock.

2009-01-12 Thread stanley.miao
On Thu, 2009-01-08 at 15:33 +0200, Tony Lindgren wrote:
 * stanley.miao stanley.m...@windriver.com [081107 15:47]:
  This solution keeps the virtual clock in place and enable the child
  clocks before enable the virtual clock. So, any comments ?
 
 What if we just removed the custom clock and had a struct **clk
 in struct omap_mcbsp that contains the clocks for each instance?

It works. This is what I did in my first patch. 

The difference is I add two struct *clk in struct omap_mcbsp.

struct omap_mcbsp {
@@ -365,7 +366,8 @@ struct omap_mcbsp {
/* Protect the field .free, while checking if the mcbsp is in
use */
spinlock_t lock;
struct omap_mcbsp_platform_data *pdata;
-   struct clk *clk;
+   struct clk *ick;
+   struct clk *fck;


If one struct **clk is better, I will resend the patch later.

Stanley
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [REVIEW PATCH 00/14] OMAP3 camera + ISP + MT9P012 sensor driver v2

2009-01-12 Thread stanley.miao
Hi,Sergio,

I saw you had a ov3640 patch in omapzoom tree. Why don't you submit it
together ?

Stanley.

On Mon, 2009-01-12 at 20:03 -0600, Aguirre Rodriguez, Sergio Alberto
wrote:
 Hi,
 
 I'm sending the following patchset for review to the relevant lists 
 (linux-omap, v4l, linux-media).
 
 Includes:
  - Omap3 camera core + ISP drivers.
  - MT9P012 sensor driver (adapted to 3430SDP)
  - DW9710 lens driver (adapted to work with MT9P012 for SDP)
  - Necessary v4l2-int-device changes to make above drivers work
  - Redefine OMAP3 ISP platform device.
  - Review comments fixed from: (Thanks a lot for their time and help)
- Hans Verkuil
- Tony Lindgreen
- Felipe Balbi
- Vaibhav Hiremath
- David Brownell
 
 Some notes:
  - Uses v4l2-int-device solution.
  - Tested with 3430SDP ES3.0 VG5.0.1 with Camkit v3.0.1
  - Applies cleanly on top of commit 0ec95b96fd77036a13398c66901e11cd301190d0 
 by Jouni Hogander (OMAP3: PM: Emu_pwrdm is switched off by hardware even when 
 sdti is in use)
  - ISP wrappers dropped from the patchset, as a rework is going on currently.
 
 
 I appreciate in advance your time.
 
 Regards,
 Sergio
 
 --
 video4linux-list mailing list
 Unsubscribe mailto:video4linux-list-requ...@redhat.com?subject=unsubscribe
 https://www.redhat.com/mailman/listinfo/video4linux-list
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 0/3] OMAP_LDP support in linux-git tree

2008-12-08 Thread stanley.miao

 Sorry for the delay. If you want to use the same patch for the mainline
 kernel and linux-omap kernel, you may need to edit the Makefile and Kconfig
 manually.
 
 But since you have the ldp board already in the mainline kernel, all you
 need to do is to send me patches against the mainline kernel to add
 various support bits still missing from the mainline board file. Exactly
 what you did with for smc support (Well I had to cut out the smc driver
 bits):
 
 ARM: OMAP3: LDP: Add Ethernet device support to make ldp boot succeess
 
 in the current omap3-upstream series:
 
 http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=shortlog;h=omap3-upstream
 
 So just send patches to add the rest of the devices, OK? Make sure it
 compiles with the mainline kernel, so exclude the drivers that are not
 there yet.
 

LCD_LDP driver patch has been integrated into l-o tree. Do I need to
re-send it against mainline kernel ?

Stanley.

 Cheers,
 
 Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] OMAP: Add OMAP_LDP platform support.

2008-12-04 Thread stanley.miao
The first patch(PATCHv2 1/3) in this thread have fixed this problem. It
has not been pushed in. 

Stanley.

On Thu, 2008-12-04 at 17:44 +0800, Sam Duan wrote:
 Hi Stanley,
 
 I git clone the
 tree(http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.gi
 t)
 and configured the kernel with omap_ldp_defconfig but met some compile
 errors.
 It seems like the line gpio_direction_input(eth_gpio)  was not patched in.
 It's omap_set_gpio_direction(eth_gpio, 1) at Line343 in
 arch/arm/mach-omap2/board-ldp.c which caused an error implicit
 declaration;
 I replaced omap_set_gpio_direction(eth_gpio, 1) with
 gpio_direction_input(eth_gpio) but the same error appeared with
 drivers/video/omap/lcd_ldp.c for omap_set_gpio_direction and
 omap_set_gpio_dataout.
  
 Did I miss some other patches? Are there any patchs can make the kernel
 compiled with omap_ldp_defconfig?
 Thanks
 Sam
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[alsa-devel][PATCHv2 0/1] OMAP_TWL4030 SoC Audio driver.

2008-11-27 Thread Stanley.Miao
Changes from v1:

1, change the name from omap-general to omap_twl4030.

2, proune off board related defines.

3, add a extended interface omap_twl4030_specific_init() to support some board
specific features.


If some board specific features are added into a board, for example, omap3evm
board. we can create a new file omap3evm.c and define a funciton
omap_twl4030_specific_init() in it, and select SND_OMAP_TWL4030_SPECIFIC in
config SND_OMAP_SOC_OMAP3EVM.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[alsa-devel][PATCHv2 1/1] OMAP_TWL4030 SoC Audio driver.

2008-11-27 Thread Stanley.Miao
Add a shared omap_twl4030 driver to avoid reduplicate code among omap drivers.
This drive also provides a extended interface for some board specific features.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 sound/soc/omap/Kconfig|   33 -
 sound/soc/omap/Makefile   |   16 +++--
 sound/soc/omap/omap_twl4030.c |  155 +
 sound/soc/omap/omap_twl4030.h |   48 +
 4 files changed, 244 insertions(+), 8 deletions(-)
 create mode 100644 sound/soc/omap/omap_twl4030.c
 create mode 100644 sound/soc/omap/omap_twl4030.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 1cd0176..35a17f4 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -6,6 +6,10 @@ config SND_OMAP_SOC_MCBSP
tristate
select OMAP_MCBSP
 
+config SND_OMAP_TWL4030_SPECIFIC
+   bool
+   default n
+
 config SND_OMAP_SOC_N810
tristate SoC Audio support for Nokia N810
depends on SND_OMAP_SOC  MACH_NOKIA_N810
@@ -14,6 +18,14 @@ config SND_OMAP_SOC_N810
help
  Say Y if you want to add support for SoC audio on Nokia N810.
 
+config SND_OMAP_SOC_OMAP3_BEAGLE
+   tristate SoC Audio support for OMAP3 Beagle
+   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP3_BEAGLE
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the Beagleboard.
+
 config SND_OMAP_SOC_OSK5912
tristate SoC Audio support for omap osk5912
depends on SND_OMAP_SOC  MACH_OMAP_OSK
@@ -38,12 +50,27 @@ config SND_OMAP_SOC_OMAP2EVM
help
  Say Y if you want to add support for SoC audio on the omap2evm board.
 
-config SND_OMAP_SOC_SDP3430
-   tristate SoC Audio support for Texas Instruments SDP3430
+config SND_OMAP_SOC_OMAP3EVM
+   tristate SoC Audio support for OMAP3EVM
+   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP3EVM
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the omap3evm board.
+config SND_OMAP_SOC_3430SDP
+   tristate SoC Audio support for OMAP 3430SDP
depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_3430SDP
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
- Say Y if you want to add support for SoC audio on Texas Instruments 
SDP3430.
+ Say Y if you want to add support for SoC audio on TI OMAP 3430SDP.
+
+config SND_OMAP_SOC_LDP
+   tristate SoC Audio support for OMAP ZOOM SDK
+   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_LDP
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP ZOOM MDK.
 
 
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 29cf3a8..66785cb 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -7,13 +7,19 @@ obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
+snd-soc-omap3beagle-objs := omap_twl4030.o
 snd-soc-osk5912-objs := osk5912.o
-snd-soc-overo-objs := overo.o
-snd-soc-omap2evm-objs := omap2evm.o
-snd-soc-sdp3430-objs := sdp3430.o
+snd-soc-overo-objs := omap_twl4030.o
+snd-soc-3430sdp-objs := omap_twl4030.o
+snd-soc-ldp-objs := omap_twl4030.o
+snd-soc-omap2evm-objs := omap_twl4030.o
+snd-soc-omap3evm-objs := omap_twl4030.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
 obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
 obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
-obj-$(CONFIG_MACH_OMAP2EVM) += snd-soc-omap2evm.o
-obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
+obj-$(CONFIG_SND_OMAP_SOC_3430SDP) += snd-soc-3430sdp.o
+obj-$(CONFIG_SND_OMAP_SOC_LDP) += snd-soc-ldp.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o
diff --git a/sound/soc/omap/omap_twl4030.c b/sound/soc/omap/omap_twl4030.c
new file mode 100644
index 000..4d60217
--- /dev/null
+++ b/sound/soc/omap/omap_twl4030.c
@@ -0,0 +1,155 @@
+/*
+ * omap_twl4030.c  --  OMAP_TWL4030 SoC Audio board driver.
+ *
+ * Author: Stanley Miao [EMAIL PROTECTED]
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA

Re: [PATCH] OMAP general SOC driver.

2008-11-27 Thread stanley.miao
On Wed, 2008-11-26 at 21:16 +, Mark Brown wrote:
 On Wed, Nov 26, 2008 at 12:33:12PM -0800, David Brownell wrote:
 
  And maybe more; that's just me summarizing unconnected pins,
  not the datasheet.  There are also cost-reduced parts with
  less audio capability.
 
 ...
 
  I make no claim about audio expertise -- the nearest I come
  to it is observing a few years back that there was a huge
  framework hole, which ASoC seems to fill -- but I wonder if
  it shouldn't suffice just to provide a mask of capabilities
  that are wired up on a given board.
 
 It's possible - if the differences can be handled by marking some pins
 as connected or disconnected and possible specifying a different system
 clock rate to the chip then that approach was what I was expecting.
 If there is more substantial differences such as having the clocking
 arranged differently then separate drivers start to make more sense.

I had considered the differences among every boards. If you want add
some board specific dapm widgets or other features, you can use the
extended interface to add them. If a board has too much differences, you
can separate it from this driver and implement it independently.

Now there are four same driver files in alsa-devel tree and there are
another three same drives waiting to be pushed. So I think this shared
diver is needed. 

After reading all of the suggestions, I reworked the driver and will
send it again. This new version has a better difference-tolerance
ability.

Stanley.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] OMAP: Add OMAP_LDP platform support.

2008-11-27 Thread Stanley.Miao
Add OMAP_LDP platform support.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-ldp.c |  477 ++-
 arch/arm/plat-omap/include/mach/board-ldp.h |4 +
 2 files changed, 479 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 1ea5998..7513bcd 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -16,11 +16,13 @@
 #include linux/platform_device.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/gpio_keys.h
 #include linux/workqueue.h
 #include linux/err.h
 #include linux/clk.h
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h
+#include linux/i2c/twl4030.h
 
 #include mach/hardware.h
 #include asm/mach-types.h
@@ -32,41 +34,512 @@
 #include mach/gpio.h
 #include mach/board.h
 #include mach/common.h
+#include mach/keypad.h
 #include mach/gpmc.h
+#include mach/mmc.h
+#include mach/usb-musb.h
 
 #include asm/io.h
 #include asm/delay.h
 #include mach/control.h
 
+#include mmc-twl4030.h
+
+
+#define CONFIG_DISABLE_HFCLK 1
+
+#define ENABLE_VAUX1_DEDICATED 0x03
+#define ENABLE_VAUX1_DEV_GRP   0x20
+
+#define TWL4030_MSECURE_GPIO   22
+
+static struct resource ldp_smc911x_resources[] = {
+   [0] = {
+   .start  = OMAP34XX_ETHR_START,
+   .end= OMAP34XX_ETHR_START + SZ_4K,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = 0,
+   .end= 0,
+   .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+   },
+};
+
+static struct platform_device ldp_smc911x_device = {
+   .name   = smc911x,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(ldp_smc911x_resources),
+   .resource   = ldp_smc911x_resources,
+};
+
+static int ldp_twl4030_keymap[] = {
+   KEY(0, 0, KEY_1),
+   KEY(1, 0, KEY_2),
+   KEY(2, 0, KEY_3),
+   KEY(0, 1, KEY_4),
+   KEY(1, 1, KEY_5),
+   KEY(2, 1, KEY_6),
+   KEY(3, 1, KEY_F5),
+   KEY(0, 2, KEY_7),
+   KEY(1, 2, KEY_8),
+   KEY(2, 2, KEY_9),
+   KEY(3, 2, KEY_F6),
+   KEY(0, 3, KEY_F7),
+   KEY(1, 3, KEY_0),
+   KEY(2, 3, KEY_F8),
+   PERSISTENT_KEY(4, 5),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   0
+};
+
+static struct twl4030_keypad_data ldp_kp_twl4030_data = {
+   .rows   = 6,
+   .cols   = 6,
+   .keymap = ldp_twl4030_keymap,
+   .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap),
+   .rep= 1,
+   .irq= TWL4030_MODIRQ_KEYPAD,
+};
+
+static struct gpio_keys_button ldp_gpio_keys_buttons[] = {
+   [0] = {
+   .code   = KEY_ENTER,
+   .gpio   = 101,
+   .desc   = enter sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [1] = {
+   .code   = KEY_F1,
+   .gpio   = 102,
+   .desc   = func 1,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [2] = {
+   .code   = KEY_F2,
+   .gpio   = 103,
+   .desc   = func 2,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [3] = {
+   .code   = KEY_F3,
+   .gpio   = 104,
+   .desc   = func 3,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [4] = {
+   .code   = KEY_F4,
+   .gpio   = 105,
+   .desc   = func 4,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [5] = {
+   .code   = KEY_LEFT,
+   .gpio   = 106,
+   .desc   = left sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [6] = {
+   .code   = KEY_RIGHT,
+   .gpio   = 107,
+   .desc   = right sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [7] = {
+   .code   = KEY_UP,
+   .gpio   = 108,
+   .desc   = up sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [8] = {
+   .code   = KEY_DOWN,
+   .gpio   = 109,
+   .desc

[PATCH 2/2] OMAP: Support LCD display as a FB device on ZOOM MDK

2008-11-27 Thread Stanley.Miao
Add glue to control the OMAP_LDP LCD as a frame buffer device
using the existing dispc.c driver under omapfb.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 drivers/video/omap/lcd_ldp.c |  198 ++
 1 files changed, 198 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap/lcd_ldp.c

diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c
new file mode 100644
index 000..66a6b91
--- /dev/null
+++ b/drivers/video/omap/lcd_ldp.c
@@ -0,0 +1,198 @@
+/*
+ * LCD panel support for the TI LDP board
+ *
+ * Copyright (C) 2007 WindRiver
+ * Author: Stanley Miao [EMAIL PROTECTED]
+ *
+ * Derived from drivers/video/omap/lcd-2430sdp.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/delay.h
+#include linux/i2c/twl4030.h
+
+#include mach/gpio.h
+#include mach/mux.h
+#include mach/omapfb.h
+#include asm/mach-types.h
+
+#define LCD_PANEL_BACKLIGHT_GPIO   (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO  (7 + OMAP_MAX_GPIO_LINES)
+
+#define LCD_PANEL_RESET_GPIO   55
+#define LCD_PANEL_QVGA_GPIO56
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+#define LCD_XRES   480
+#define LCD_YRES   640
+#define LCD_PIXCLOCK_MAX   41700
+#else
+#define LCD_XRES   240
+#define LCD_YRES   320
+#define LCD_PIXCLOCK_MAX   185186
+#endif
+
+#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
+#define ENABLE_VAUX2_DEDICATED  0x09
+#define ENABLE_VAUX2_DEV_GRP0x20
+#define ENABLE_VAUX3_DEDICATED 0x03
+#define ENABLE_VAUX3_DEV_GRP   0x20
+
+#define ENABLE_VPLL2_DEDICATED  0x05
+#define ENABLE_VPLL2_DEV_GRP0xE0
+#define TWL4030_VPLL2_DEV_GRP   0x33
+#define TWL4030_VPLL2_DEDICATED 0x36
+
+#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v)
+
+
+static int ldp_panel_init(struct lcd_panel *panel,
+   struct omapfb_device *fbdev)
+{
+   gpio_request(LCD_PANEL_RESET_GPIO, lcd reset);
+   gpio_request(LCD_PANEL_QVGA_GPIO, VGA/QVGA switch);
+   gpio_request(LCD_PANEL_ENABLE_GPIO, lcd panel);
+   gpio_request(LCD_PANEL_BACKLIGHT_GPIO, lcd backlight);
+
+   gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+   gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+   gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
+#else
+   gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
+#endif
+   gpio_direction_output(LCD_PANEL_RESET_GPIO, 1);
+
+   return 0;
+}
+
+static void ldp_panel_cleanup(struct lcd_panel *panel)
+{
+   gpio_free(LCD_PANEL_RESET_GPIO);
+   gpio_free(LCD_PANEL_QVGA_GPIO);
+   gpio_free(LCD_PANEL_ENABLE_GPIO);
+   gpio_free(LCD_PANEL_BACKLIGHT_GPIO);
+}
+
+static int ldp_panel_enable(struct lcd_panel *panel)
+{
+   if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED,
+   TWL4030_VPLL2_DEDICATED))
+   return -EIO;
+   if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP,
+   TWL4030_VPLL2_DEV_GRP))
+   return -EIO;
+
+   gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+   gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+   if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEDICATED,
+   TWL4030_VAUX3_DEDICATED))
+   return -EIO;
+   if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEV_GRP,
+   TWL4030_VAUX3_DEV_GRP))
+   return -EIO;
+
+   return 0;
+}
+
+static void ldp_panel_disable(struct lcd_panel *panel)
+{
+   gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+   gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+   t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED);
+   t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP);
+   mdelay(4);
+}
+
+static unsigned long ldp_panel_get_caps(struct lcd_panel *panel)
+{
+   return 0;
+}
+
+struct lcd_panel ldp_panel = {
+   .name   = ldp,
+   .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
+ OMAP_LCDC_INV_HSYNC,
+
+   .bpp= 16,
+   .data_lines = 18,
+   .x_res

Re: [PATCHv2 0/3] OMAP_LDP support in linux-git tree

2008-11-27 Thread stanley.miao
On Wed, 2008-11-26 at 15:12 -0800, Tony Lindgren wrote:
 * Stanley.Miao [EMAIL PROTECTED] [081120 23:45]:
  Changes from v1:
  
  1, change omap_request_gpio() to gpio_request() in gpio.patch.
 
 One request: Since the LDP is in the mainline kernel, can you please
 provide whatever applies as patches against the mainline board-ldp.c?
 
 Then if some driver is not yet in mainline, provide that in an extra
 patch.
 
 That way I don't have to rewrite your patches for mainline ;)

Did I understand you right ? 

The nand patch modified arch/arm/mach-omap2/Makefile. This Makefile
changed a lot against mainline. I don't know how to provide the patch
against mainline.

Stanley.


 Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCHv2 1/1] OMAP_TWL4030 SoC Audio driver.

2008-11-27 Thread stanley.miao
On Thu, 2008-11-27 at 13:19 +, Mark Brown wrote:
 On Thu, Nov 27, 2008 at 08:50:57PM +0800, Stanley.Miao wrote:
 
  Add a shared omap_twl4030 driver to avoid reduplicate code among omap 
  drivers.
  This drive also provides a extended interface for some board specific 
  features.
 
 As discussed in the thread following your initial submission it'd be
 better to do something like having flags specifying which outputs are
 connected up rather than just leaving all that stuff to per-board code.
 At the minute all that's being shared is a bit of boiler plate (which
 will get smaller) and the hw_params function at the source code level.
 
 As I said in response to your original posting I'd strongly urge you to
 look at the s3c24xx_uda134x driver for an example of how something like
 this can be implemented.

I tried to make it work whether there is platform_data or not. If I
write it according to s3c24xx_uda134x style, every board should register
a platform_device. 

 
 Some more specific comments below...
 
  +config SND_OMAP_TWL4030_SPECIFIC
  +   bool
  +   default n
  +
 
 This really needs some documentation.  I think a better name should be
 possible too but see my comments below for the header...
 
snip
 
  +#ifdef CONFIG_SND_OMAP_TWL4030_SPECIFIC
  +extern void omap_twl4030_specific_init(struct snd_soc_device *);
  +#else
  +static inline void omap_twl4030_specific_init(struct snd_soc_device 
  *snd_dev)
  +{
  +   if(snd_dev == NULL)
  +   return;
  +   /* McBSP2 */
  +   *(unsigned int *)snd_dev-machine-dai_link-cpu_dai-private_data = 1;
  +   omap_twl4030_data = NULL;
  +}
  +#endif
 
 This still has the previous problem with your use of ifdefs: it means
 that it's not possible to build the driver for configurations that both
 do and don't need this.

This is why there is a SND_OMAP_TWL4030_SPECIFIC in Kconfig. If there
are some board specific features, SND_OMAP_TWL4030_SPECIFIC should be
selected under a board config, and omap_twl4030_specific_init() will be
difined in the board specific file.

Stanley.

 ___
 Alsa-devel mailing list
 [EMAIL PROTECTED]
 http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP general SOC driver.

2008-11-26 Thread Stanley.Miao
Add a shared omap SoC driver to avoid reduplicate code among omap soc drivers.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 sound/soc/omap/Kconfig|   49 +
 sound/soc/omap/Makefile   |   13 
 sound/soc/omap/omap-general.c |  155 +
 sound/soc/omap/omap-general.h |   70 ++
 4 files changed, 287 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/omap/omap-general.c
 create mode 100644 sound/soc/omap/omap-general.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 8b7766b..92a557f 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -14,6 +14,14 @@ config SND_OMAP_SOC_N810
help
  Say Y if you want to add support for SoC audio on Nokia N810.
 
+config SND_OMAP_SOC_OMAP3_BEAGLE
+   tristate SoC Audio support for OMAP3 Beagle
+   depends on SND_OMAP_SOC  MACH_OMAP3_BEAGLE
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the Beagleboard.
+
 config SND_OMAP_SOC_OSK5912
tristate SoC Audio support for omap osk5912
depends on SND_OMAP_SOC  MACH_OMAP_OSK
@@ -21,3 +29,44 @@ config SND_OMAP_SOC_OSK5912
select SND_SOC_TLV320AIC23
help
  Say Y if you want to add support for SoC audio on osk5912.
+
+config SND_OMAP_SOC_OVERO
+   tristate SoC Audio support for Gumstix Overo
+   depends on SND_OMAP_SOC  MACH_OVERO
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the Gumstix Overo.
+
+config SND_OMAP_SOC_3430SDP
+   tristate SoC Audio support for OMAP 3430SDP
+   depends on SND_OMAP_SOC  MACH_OMAP_3430SDP
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP 3430SDP.
+
+config SND_OMAP_SOC_LDP
+   tristate SoC Audio support for OMAP ZOOM SDK
+   depends on SND_OMAP_SOC  MACH_OMAP_LDP
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP ZOOM MDK.
+
+config SND_OMAP_SOC_OMAP2EVM
+   tristate SoC Audio support for OMAP2EVM
+   depends on SND_OMAP_SOC  MACH_OMAP2EVM
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP2EVM.
+
+config SND_OMAP_SOC_OMAP3EVM
+   tristate SoC Audio support for OMAP3EVM
+   depends on SND_OMAP_SOC  MACH_OMAP3EVM
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP3EVM.
+
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index e09d1f2..de9163b 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -7,7 +7,20 @@ obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
+snd-soc-omap3beagle-objs := omap-general.o
 snd-soc-osk5912-objs := osk5912.o
+snd-soc-overo-objs := omap-general.o
+snd-soc-3430sdp-objs := omap-general.o
+snd-soc-ldp-objs := omap-general.o
+snd-soc-omap2evm-objs := omap-general.o
+snd-soc-omap3evm-objs := omap-general.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
 obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
+obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
+obj-$(CONFIG_SND_OMAP_SOC_3430SDP) += snd-soc-3430sdp.o
+obj-$(CONFIG_SND_OMAP_SOC_LDP) += snd-soc-ldp.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o
+
diff --git a/sound/soc/omap/omap-general.c b/sound/soc/omap/omap-general.c
new file mode 100644
index 000..a3fa647
--- /dev/null
+++ b/sound/soc/omap/omap-general.c
@@ -0,0 +1,155 @@
+/*
+ * omap-general.c  --  OMAP SoC general machine file.
+ *
+ * Author: Stanley Miao [EMAIL PROTECTED]
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include linux/clk.h
+#include linux/platform_device.h
+#include sound/core.h
+#include sound/pcm.h
+#include sound/soc.h
+#include sound/soc-dapm.h
+
+#include asm/mach-types.h
+#include mach/hardware.h
+#include

Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.

2008-11-21 Thread stanley.miao
On Thu, 2008-11-20 at 23:52 -0800, David Brownell wrote:
 On Thursday 20 November 2008, stanley.miao wrote:
  
   Use gpio_set_value() to replace omap_set_gpio_dataout(), except
   when initializing.  The reset pin *was* being toggled...
  
  These actions are in init function. so keep omap_set_gpio_dataout() in
  place.

Sorry, it should be keep gpio_direction_out() in place. I made a
mistake, but the code is right.

Stanley.

 
 No, omap_set_gpio_dataout() is gone.  You can't call it any more.
 
   gpio_direction_output(gpio, initial_value)
 
 is what you'd want after gpio_request().


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP: set appropriate platform data for touchscreen.

2008-11-20 Thread Stanley.Miao
Set appropriate platform data for touchscreen and make it work correctly.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-3430sdp.c |8 
 arch/arm/mach-omap2/board-ldp.c |8 
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index b7d2e92..42f92be 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -213,9 +213,17 @@ static int ads7846_vaux_control(int vaux_cntrl)
 }
 
 static struct ads7846_platform_data tsc2046_config __initdata = {
+   .x_max  = 0x0fff,
+   .y_max  = 0x0fff,
+   .x_plate_ohms   = 180,
+   .pressure_max   = 255,
+   .debounce_max   = 10,
+   .debounce_tol   = 10,
+   .debounce_rep   = 1,
.get_pendown_state  = ads7846_get_pendown_state,
.keep_vref_on   = 1,
.vaux_control   = ads7846_vaux_control,
+   .settle_delay_usecs = 150,
 };
 
 
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index a59e4eb..f17d507 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -277,9 +277,17 @@ static int ads7846_vaux_control(int vaux_cntrl)
 }
 
 static struct ads7846_platform_data tsc2046_config __initdata = {
+   .x_max  = 0x0fff,
+   .y_max  = 0x0fff,
+   .x_plate_ohms   = 180,
+   .pressure_max   = 255,
+   .debounce_max   = 10,
+   .debounce_tol   = 10,
+   .debounce_rep   = 1,
.get_pendown_state  = ads7846_get_pendown_state,
.keep_vref_on   = 1,
.vaux_control   = ads7846_vaux_control,
+   .settle_delay_usecs = 150,
 };
 
 
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP3 NAND: Add NAND support on OMAP_LDP

2008-11-20 Thread Stanley.Miao
Add NAND support on OMAP_LDP.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Makefile|3 +-
 arch/arm/mach-omap2/board-ldp-flash.c   |  103 +++
 arch/arm/mach-omap2/board-ldp.c |1 +
 arch/arm/plat-omap/include/mach/board-ldp.h |2 +
 4 files changed, 108 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ldp-flash.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3897347..bfc9bcf 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -66,7 +66,8 @@ obj-$(CONFIG_MACH_OMAP3_BEAGLE)   += 
board-omap3beagle.o \
   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
   mmc-twl4030.o \
-  usb-musb.o
+  usb-musb.o \
+  board-ldp-flash.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o \
   board-apollon-mmc.o  \
   board-apollon-keys.o
diff --git a/arch/arm/mach-omap2/board-ldp-flash.c 
b/arch/arm/mach-omap2/board-ldp-flash.c
new file mode 100644
index 000..4c20f5f
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ldp-flash.c
@@ -0,0 +1,103 @@
+/*
+ * linux/arch/arm/mach-omap2/board-ldp-flash.c
+ *
+ * Copyright (C) 2008 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author: Rohit Choraria [EMAIL PROTECTED]
+ *
+ * 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.
+ */
+
+#include linux/kernel.h
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+#include linux/types.h
+#include linux/io.h
+
+#include asm/mach/flash.h
+#include mach/board.h
+#include mach/gpmc.h
+#include mach/nand.h
+
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition ldp_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader-NAND,
+   .offset = 0,
+   .size   = 4 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 4 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = Boot Env-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x10 */
+   .size   = 2 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = Kernel-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x14 */
+   .size   = 32 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = File System - NAND,
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x54 */
+   },
+};
+
+/* NAND chip access: 16 bit */
+static struct omap_nand_platform_data ldp_nand_data = {
+   .parts  = ldp_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(ldp_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .dev_ready  = NULL,
+};
+
+static struct resource ldp_nand_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device ldp_nand_device = {
+   .name   = omap2-nand,
+   .id = 0,
+   .dev= {
+   .platform_data  = ldp_nand_data,
+   },
+   .num_resources  = 1,
+   .resource   = ldp_nand_resource,
+};
+
+/**
+ * ldp430_flash_init - Identify devices connected to GPMC and register.
+ *
+ * @return - void.
+ */
+void __init ldp_flash_init(void)
+{
+   int nandcs = LDP_NAND_CS;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   ldp_nand_data.cs = nandcs;
+   ldp_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
+   ldp_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
+
+   if (platform_device_register(ldp_nand_device)  0)
+   printk(KERN_ERR Unable to register NAND device\n);
+}
+
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index f17d507..d6f25ae 100644

Re: [PATCH] OMAP: set appropriate platform data for touchscreen.

2008-11-20 Thread stanley.miao
Please ignore it, I will resend it with other patches together.

Stanley.


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3 NAND: Add NAND support on OMAP_LDP

2008-11-20 Thread stanley.miao
Please ignore it, I will resend it with other patches together.

Stanley.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.

2008-11-20 Thread stanley.miao
On Thu, 2008-11-20 at 11:11 -0800, David Brownell wrote:
 On Thursday 20 November 2008, Stanley.Miao wrote:
  -   omap_set_gpio_direction(LCD_PANEL_QVGA_GPIO, 0);
  -   omap_set_gpio_direction(LCD_PANEL_RESET_GPIO, 0);
  gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
  gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
 
 Nothing does
 
   gpio_request(LCD_PANEL_QVGA_GPIO, qvga something);
   gpio_request(LCD_PANEL_RESET_GPIO, lcd reset);
 

Accepted, change omap_request_gpio() to gpio_request().

 And by removing the initial direction setting call (above),
 behavior of at least the reset line changes:  it's no longer
 pullsed low.
 
 It'd be better to change the direction setting calls above
 (setting an initial low value), and then make the calls
 below use gpio_set_value().
 
   
   #ifdef CONFIG_FB_OMAP_LCD_VGA
  -   omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 0);
  +   gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
   #else
  -   omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 1);
  +   gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
   #endif
  -   omap_set_gpio_dataout(LCD_PANEL_RESET_GPIO, 1);
  +   gpio_direction_output(LCD_PANEL_RESET_GPIO, 1);
 
 Use gpio_set_value() to replace omap_set_gpio_dataout(), except
 when initializing.  The reset pin *was* being toggled...

These actions are in init function. so keep omap_set_gpio_dataout() in
place.

Thanks for your review, I will resend it.

Stanley.

 
 - Dave
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 0/3] OMAP_LDP support in linux-git tree

2008-11-20 Thread Stanley.Miao
Changes from v1:

1, change omap_request_gpio() to gpio_request() in gpio.patch.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 3/3] OMAP3 NAND: Add NAND support on OMAP_LDP

2008-11-20 Thread Stanley.Miao
Add NAND support on OMAP_LDP.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Makefile|3 +-
 arch/arm/mach-omap2/board-ldp-flash.c   |  103 +++
 arch/arm/mach-omap2/board-ldp.c |1 +
 arch/arm/plat-omap/include/mach/board-ldp.h |2 +
 4 files changed, 108 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ldp-flash.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3897347..bfc9bcf 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -66,7 +66,8 @@ obj-$(CONFIG_MACH_OMAP3_BEAGLE)   += 
board-omap3beagle.o \
   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
   mmc-twl4030.o \
-  usb-musb.o
+  usb-musb.o \
+  board-ldp-flash.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o \
   board-apollon-mmc.o  \
   board-apollon-keys.o
diff --git a/arch/arm/mach-omap2/board-ldp-flash.c 
b/arch/arm/mach-omap2/board-ldp-flash.c
new file mode 100644
index 000..06e0f2d
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ldp-flash.c
@@ -0,0 +1,103 @@
+/*
+ * linux/arch/arm/mach-omap2/board-ldp-flash.c
+ *
+ * Copyright (C) 2008 Wind River Systems, Inc.
+ *
+ * Author: Stanley Miao [EMAIL PROTECTED]
+ * Based on mach-omap2/board-3430sdp-flash.c by Rohit Choraria
+ *
+ * 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.
+ */
+
+#include linux/kernel.h
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+#include linux/types.h
+#include linux/io.h
+
+#include asm/mach/flash.h
+#include mach/board.h
+#include mach/gpmc.h
+#include mach/nand.h
+
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition ldp_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader-NAND,
+   .offset = 0,
+   .size   = 4 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 4 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = Boot Env-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x10 */
+   .size   = 2 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = Kernel-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x14 */
+   .size   = 32 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = File System - NAND,
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x54 */
+   },
+};
+
+/* NAND chip access: 16 bit */
+static struct omap_nand_platform_data ldp_nand_data = {
+   .parts  = ldp_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(ldp_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .dev_ready  = NULL,
+};
+
+static struct resource ldp_nand_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device ldp_nand_device = {
+   .name   = omap2-nand,
+   .id = 0,
+   .dev= {
+   .platform_data  = ldp_nand_data,
+   },
+   .num_resources  = 1,
+   .resource   = ldp_nand_resource,
+};
+
+/**
+ * ldp430_flash_init - Identify devices connected to GPMC and register.
+ *
+ * @return - void.
+ */
+void __init ldp_flash_init(void)
+{
+   int nandcs = LDP_NAND_CS;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   ldp_nand_data.cs = nandcs;
+   ldp_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
+   ldp_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
+
+   if (platform_device_register(ldp_nand_device)  0)
+   printk(KERN_ERR Unable to register NAND device\n);
+}
+
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 79f49d3..103ce6d

Re: OOPS in OMAP 1-wire driver

2008-11-19 Thread stanley.miao
It has been fixed and the patch was added to -mm tree.

Stanley.


From: Stanley.Miao [EMAIL PROTECTED]

OMAP LDP boot crash.  This is because w1 subsystem changed the search
interface, so update omap_hdq's search interface to follow the change.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/w1/masters/omap_hdq.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff -puN drivers/w1/masters/omap_hdq.c~w1-omap-fix-omap-ldp-boot-crash
drivers/w1/masters/omap_hdq.c
--- a/drivers/w1/masters/omap_hdq.c~w1-omap-fix-omap-ldp-boot-crash
+++ a/drivers/w1/masters/omap_hdq.c
@@ -86,8 +86,8 @@ static struct platform_driver omap_hdq_d
 static u8 omap_w1_read_byte(void *_hdq);
 static void omap_w1_write_byte(void *_hdq, u8 byte);
 static u8 omap_w1_reset_bus(void *_hdq);
-static void omap_w1_search_bus(void *_hdq, u8 search_type,
-   w1_slave_found_callback slave_found);
+static void omap_w1_search_bus(void *_hdq, struct w1_master
*master_dev,
+   u8 search_type, w1_slave_found_callback slave_found);
 
 
 static struct w1_bus_master omap_w1_master = {
@@ -231,8 +231,8 @@ static u8 omap_w1_reset_bus(void *_hdq)
 }
 
 /* W1 search callback function */
-static void omap_w1_search_bus(void *_hdq, u8 search_type,
-   w1_slave_found_callback slave_found)
+static void omap_w1_search_bus(void *_hdq, struct w1_master
*master_dev,
+   u8 search_type, w1_slave_found_callback slave_found)
 {
u64 module_id, rn_le, cs, id;
 
@@ -249,7 +249,7 @@ static void omap_w1_search_bus(void *_hd
cs = w1_calc_crc8((u8 *)rn_le, 7);
id = (cs  56) | module_id;
 
-   slave_found(_hdq, id);
+   slave_found(master_dev, id);
 }
 
 static int _omap_hdq_reset(struct hdq_data *hdq_data)
_
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Add SMC_MEM_RESERVED for OMAP platform.

2008-11-17 Thread stanley.miao
On Mon, 2008-11-17 at 10:31 +, [EMAIL PROTECTED] wrote:
 Hi Stanley,
 
 Jeff has merged the smsc911x driver into -next, this is intended to 
 replace smc911x moving forward.  I'll forward the patchset to you 
 off-list, it includes platform_data support for several platforms so 
 adding support for omap should be simple.

OK, Thanks.

Stanley.

 
  diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
  index cc7d85b..d1b3b9b 100644
  --- a/drivers/net/smc911x.h
  +++ b/drivers/net/smc911x.h
  @@ -42,6 +42,16 @@
 #define SMC_USE_16BIT  0
 #define SMC_USE_32BIT  1
 #define SMC_IRQ_SENSE  IRQF_TRIGGER_LOW
  +#elif defined(CONFIG_ARCH_OMAP34XX)
  +  #define SMC_USE_16BIT  0
  +  #define SMC_USE_32BIT  1
  +  #define SMC_IRQ_SENSE  IRQF_TRIGGER_LOW
  +  #define SMC_MEM_RESERVED   1
  +#elif defined(CONFIG_ARCH_OMAP24XX)
  +  #define SMC_USE_16BIT  0
  +  #define SMC_USE_32BIT  1
  +  #define SMC_IRQ_SENSE  IRQF_TRIGGER_LOW
  +  #define SMC_MEM_RESERVED   1
   #else
   /*
* Default configuration
 
 nack - this platform-specific configuration shouldn't be in the driver, 
 SMC_DYNAMIC_BUS_CONFIG was added so this can be specified in 
 platform_data.
 
 Regards,
 --
 Steve Glendinning
 SMSC GmbH
 m: +44 777 933 9124
 e: [EMAIL PROTECTED]
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] smc911x: Add support for LAN9211 chips from SMSC

2008-11-17 Thread Stanley.Miao
Add the define of LAN9211 in chip_ids.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 drivers/net/smc911x.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index d1b3b9b..f688b55 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -682,6 +682,7 @@ smc_pxa_dma_outsl(struct smc911x_local *lp, u_long physaddr,
 #define CHIP_9116  0x0116
 #define CHIP_9117  0x0117
 #define CHIP_9118  0x0118
+#define CHIP_9211  0x9211
 #define CHIP_9215  0x115A
 #define CHIP_9217  0x117A
 #define CHIP_9218  0x118A
@@ -696,6 +697,7 @@ static const struct chip_id chip_ids[] =  {
{ CHIP_9116, LAN9116 },
{ CHIP_9117, LAN9117 },
{ CHIP_9118, LAN9118 },
+   { CHIP_9211, LAN9211 },
{ CHIP_9215, LAN9215 },
{ CHIP_9217, LAN9217 },
{ CHIP_9218, LAN9218 },
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] Add SMC_MEM_RESERVED for OMAP platform.

2008-11-17 Thread Stanley.Miao
The iomem resource for Ethernet device  has been reserved on omap24xx and
omap34xx. So, define SMC_MEM_RESERVED for them.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 drivers/net/smc911x.c |6 --
 drivers/net/smc911x.h |   10 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 1f26ab0..291ee46 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -2065,7 +2065,7 @@ static int smc911x_drv_probe(struct platform_device *pdev)
ret = -ENODEV;
goto out;
}
-
+#ifndef SMC_MEM_RESERVED
/*
 * Request the regions.
 */
@@ -2073,7 +2073,7 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 ret = -EBUSY;
 goto out;
}
-
+#endif
ndev = alloc_etherdev(sizeof(struct smc911x_local));
if (!ndev) {
printk(%s: could not allocate device.\n, CARDNAME);
@@ -2110,7 +2110,9 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 release_both:
free_netdev(ndev);
 release_1:
+#ifndef SMC_MEM_RESERVED
release_mem_region(res-start, SMC911X_IO_EXTENT);
+#endif
 out:
printk(%s: not found (%d).\n, CARDNAME, ret);
}
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index cc7d85b..d1b3b9b 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -42,6 +42,16 @@
   #define SMC_USE_16BIT0
   #define SMC_USE_32BIT1
   #define SMC_IRQ_SENSEIRQF_TRIGGER_LOW
+#elif defined(CONFIG_ARCH_OMAP34XX)
+  #define SMC_USE_16BIT0
+  #define SMC_USE_32BIT1
+  #define SMC_IRQ_SENSEIRQF_TRIGGER_LOW
+  #define SMC_MEM_RESERVED 1
+#elif defined(CONFIG_ARCH_OMAP24XX)
+  #define SMC_USE_16BIT0
+  #define SMC_USE_32BIT1
+  #define SMC_IRQ_SENSEIRQF_TRIGGER_LOW
+  #define SMC_MEM_RESERVED 1
 #else
 /*
  * Default configuration
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/6] OMAP: Make OMAP LDP boot succussfuly

2008-11-12 Thread stanley.miao
Any other comments ?

Stanley.

On Tue, 2008-11-11 at 19:50 +0800, Stanley.Miao wrote:
 Changes since v1:
 
 1, fix all the patch format problem.
 
 2, split the defconfig patch from code patches.
 
 3, put a twl4030keypad bug fix into a single patch.
 
 4, Add a persistent bit in the keypad map, and prune off #ifdef(OMAP_LDP)
 from the keypad driver.
 
 
 Now there is only basic support for OMAP LDP in linux-omap-2.6, LDP can't boot
 up, even crash at boot time(because of omap_hdq problem).
 
 Add the following patches to fix the boot crash and let LDP boot succussfuly.
 
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [rft/rfc/patch-2.6.28-rc3+ 00/59] namespace cleanup patches

2008-11-12 Thread stanley.miao
If you are using git-send-email, please provide the --no-chain-reply-to
option to avoid creating exceptionally deep nesting.

Stanley.

On Wed, 2008-11-12 at 00:56 +0200, Felipe Balbi wrote:
 From: Felipe Balbi [EMAIL PROTECTED]
 
 Get rid of omap_{read,write}[bsl] defines.
 Virtual and physical addresses usage was fixed by Russel King and
 there's no need anymore for keeping a define to a standard kernel
 function. Get rid of those to keep the namespace cleaner.
 
 Build tested with all omap defconfigs.
 Depends on my previous make clk fwk build again on omap1 patch.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 6/6] OMAP_LDP: Add keypad related configs into defconfig.

2008-11-11 Thread Stanley.Miao
Add keypad related configs into omap_ldp_defconfig.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/configs/omap_ldp_defconfig |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig 
b/arch/arm/configs/omap_ldp_defconfig
index add0b71..d88e6d7 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -549,7 +549,16 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_TWL4030=y
+# CONFIG_KEYBOARD_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/6] OMAP_LDP: Add Ethernet device support to make ldp boot succeess.

2008-11-11 Thread Stanley.Miao
Add Ethernet device support in board-ldp.c to make ldp can boot and mount nfs
successfully.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-ldp.c |   53 +++
 arch/arm/plat-omap/include/mach/board-ldp.h |5 ++-
 drivers/net/smc911x.c   |6 ++-
 drivers/net/smc911x.h   |2 +
 4 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c2bb726..e89f271 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -44,6 +44,7 @@
 #include mmc-twl4030.h
 
 
+#define SDP3430_SMC91X_CS  3
 #define CONFIG_DISABLE_HFCLK 1
 
 #define ENABLE_VAUX1_DEDICATED 0x03
@@ -51,6 +52,26 @@
 
 #define TWL4030_MSECURE_GPIO   22
 
+static struct resource ldp_smc911x_resources[] = {
+   [0] = {
+   .start  = OMAP34XX_ETHR_START,
+   .end= OMAP34XX_ETHR_START + SZ_4K,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = 0,
+   .end= 0,
+   .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+   },
+};
+
+static struct platform_device ldp_smc911x_device = {
+   .name   = smc911x,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(ldp_smc911x_resources),
+   .resource   = ldp_smc911x_resources,
+};
+
 static int ts_gpio;
 
 static int __init msecure_init(void)
@@ -177,14 +198,46 @@ static struct platform_device ldp_lcd_device = {
 };
 
 static struct platform_device *ldp_devices[] __initdata = {
+   ldp_smc911x_device,
ldp_lcd_device,
 };
 
+static inline void __init ldp_init_smc911x(void)
+{
+   int eth_cs;
+   unsigned long cs_mem_base;
+   int eth_gpio = 0;
+
+   eth_cs = LDP_SMC911X_CS;
+
+   if (gpmc_cs_request(eth_cs, SZ_16M, cs_mem_base)  0) {
+   printk(KERN_ERR Failed to request GPMC mem for smc911x\n);
+   return;
+   }
+
+   ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
+   ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
+   udelay(100);
+
+   eth_gpio = LDP_SMC911X_GPIO;
+
+   ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+
+   if (omap_request_gpio(eth_gpio)  0) {
+   printk(KERN_ERR Failed to request GPIO%d for smc911x IRQ\n,
+   eth_gpio);
+   return;
+   }
+   omap_set_gpio_direction(eth_gpio, 1);
+}
+
+
 static void __init omap_ldp_init_irq(void)
 {
omap2_init_common_hw(NULL);
omap_init_irq();
omap_gpio_init();
+   ldp_init_smc911x();
 }
 
 static struct omap_uart_config ldp_uart_config __initdata = {
diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h 
b/arch/arm/plat-omap/include/mach/board-ldp.h
index 66e2746..f233996 100644
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ b/arch/arm/plat-omap/include/mach/board-ldp.h
@@ -32,5 +32,8 @@
 extern void twl4030_bci_battery_init(void);
 
 #define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
-
+#define LDP_SMC911X_CS 1
+#define LDP_SMC911X_GPIO   152
+#define DEBUG_BASE 0x0800
+#define OMAP34XX_ETHR_STARTDEBUG_BASE
 #endif /* __ASM_ARCH_OMAP_LDP_H */
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index f59c777..05e7512 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -2063,7 +2063,7 @@ static int smc911x_drv_probe(struct platform_device *pdev)
ret = -ENODEV;
goto out;
}
-
+#ifndef SMC_MEM_RESERVED
/*
 * Request the regions.
 */
@@ -2071,7 +2071,7 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 ret = -EBUSY;
 goto out;
}
-
+#endif
ndev = alloc_etherdev(sizeof(struct smc911x_local));
if (!ndev) {
printk(%s: could not allocate device.\n, CARDNAME);
@@ -2108,7 +2108,9 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 release_both:
free_netdev(ndev);
 release_1:
+#ifndef SMC_MEM_RESERVED
release_mem_region(res-start, SMC911X_IO_EXTENT);
+#endif
 out:
printk(%s: not found (%d).\n, CARDNAME, ret);
}
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index d1b3b9b..f688b55 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -682,6 +682,7 @@ smc_pxa_dma_outsl(struct smc911x_local *lp, u_long physaddr,
 #define CHIP_9116  0x0116
 #define CHIP_9117  0x0117
 #define CHIP_9118  0x0118
+#define CHIP_9211  0x9211
 #define CHIP_9215  0x115A
 #define CHIP_9217  0x117A
 #define CHIP_9218  0x118A
@@ -696,6 +697,7 @@ static const struct chip_id chip_ids[] =  {
{ CHIP_9116, LAN9116 },
{ CHIP_9117, LAN9117 },
{ CHIP_9118, LAN9118 },
+   { CHIP_9211, LAN9211 },
{ CHIP_9215, LAN9215

[PATCH v2 5/6] OMAP_LDP: Add keypad support on ZOOM SDK

2008-11-11 Thread Stanley.Miao
Support twl4030 keypad and gpio keys on ZOOM SDK.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-ldp.c |  114 +++
 arch/arm/plat-omap/include/mach/keypad.h|5 +
 drivers/input/keyboard/Kconfig  |2 +-
 drivers/input/keyboard/gpio_keys.c  |4 +
 drivers/input/keyboard/omap-twl4030keypad.c |9 +-
 include/linux/gpio_keys.h   |1 +
 6 files changed, 130 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e89f271..a8e63d7 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -16,6 +16,7 @@
 #include linux/platform_device.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/gpio_keys.h
 #include linux/workqueue.h
 #include linux/err.h
 #include linux/clk.h
@@ -33,6 +34,7 @@
 #include mach/gpio.h
 #include mach/board.h
 #include mach/common.h
+#include mach/keypad.h
 #include mach/gpmc.h
 #include mach/mmc.h
 #include mach/usb-musb.h
@@ -72,6 +74,116 @@ static struct platform_device ldp_smc911x_device = {
.resource   = ldp_smc911x_resources,
 };
 
+static int ldp_twl4030_keymap[] = {
+   KEY(0, 0, KEY_1),
+   KEY(1, 0, KEY_2),
+   KEY(2, 0, KEY_3),
+   KEY(0, 1, KEY_4),
+   KEY(1, 1, KEY_5),
+   KEY(2, 1, KEY_6),
+   KEY(3, 1, KEY_F5),
+   KEY(0, 2, KEY_7),
+   KEY(1, 2, KEY_8),
+   KEY(2, 2, KEY_9),
+   KEY(3, 2, KEY_F6),
+   KEY(0, 3, KEY_F7),
+   KEY(1, 3, KEY_0),
+   KEY(2, 3, KEY_F8),
+   PERSISTENT_KEY(4, 5),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   0
+};
+
+static struct twl4030_keypad_data ldp_kp_twl4030_data = {
+   .rows   = 6,
+   .cols   = 6,
+   .keymap = ldp_twl4030_keymap,
+   .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap),
+   .rep= 1,
+   .irq= TWL4030_MODIRQ_KEYPAD,
+};
+
+static struct gpio_keys_button ldp_gpio_keys_buttons[] = {
+   [0] = {
+   .code   = KEY_ENTER,
+   .gpio   = 101,
+   .desc   = enter sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [1] = {
+   .code   = KEY_F1,
+   .gpio   = 102,
+   .desc   = func 1,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [2] = {
+   .code   = KEY_F2,
+   .gpio   = 103,
+   .desc   = func 2,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [3] = {
+   .code   = KEY_F3,
+   .gpio   = 104,
+   .desc   = func 3,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [4] = {
+   .code   = KEY_F4,
+   .gpio   = 105,
+   .desc   = func 4,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [5] = {
+   .code   = KEY_LEFT,
+   .gpio   = 106,
+   .desc   = left sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [6] = {
+   .code   = KEY_RIGHT,
+   .gpio   = 107,
+   .desc   = right sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [7] = {
+   .code   = KEY_UP,
+   .gpio   = 108,
+   .desc   = up sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+   [8] = {
+   .code   = KEY_DOWN,
+   .gpio   = 109,
+   .desc   = down sw,
+   .active_low = 1,
+   .debounce_interval  = 30,
+   },
+};
+
+static struct gpio_keys_platform_data ldp_gpio_keys = {
+   .buttons= ldp_gpio_keys_buttons,
+   .nbuttons   = ARRAY_SIZE(ldp_gpio_keys_buttons),
+   .rep= 1,
+};
+
+static struct platform_device ldp_gpio_keys_device = {
+   .name   = gpio-keys,
+   .id = -1,
+   .dev= {
+   .platform_data  = ldp_gpio_keys,
+   },
+};
+
 static int ts_gpio;
 
 static int __init msecure_init(void

[PATCH v2 4/6] OMAP: Fix twl4030 keypad bug.

2008-11-11 Thread Stanley.Miao
The n_cols number has beed set to the right value in the board specific file,
so in the twl4030 driver, the n_cols doesn't need to plus 1.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 drivers/input/keyboard/omap-twl4030keypad.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/omap-twl4030keypad.c 
b/drivers/input/keyboard/omap-twl4030keypad.c
index 13c9c0a..21f922d 100644
--- a/drivers/input/keyboard/omap-twl4030keypad.c
+++ b/drivers/input/keyboard/omap-twl4030keypad.c
@@ -173,7 +173,7 @@ static void twl4030_kp_scan(struct omap_keypad *kp, int 
release_all)
if (!changed)
continue;
 
-   for (col = 0; col  kp-n_cols + 1; col++) {
+   for (col = 0; col  kp-n_cols; col++) {
int key;
 
if (!(changed  (1  col)))
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/6] OMAP: Update the search() interface of omap_hdq.

2008-11-11 Thread Stanley.Miao
OMAP LDP boot crash. This is because w1 subsystem changed the search interface,
so update omap_hdq's search interface to follow the change.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 drivers/w1/masters/omap_hdq.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index e7fa6ab..b8d0f8b 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -89,8 +89,8 @@ static struct platform_driver omap_hdq_driver = {
 static u8 omap_w1_read_byte(void *_hdq);
 static void omap_w1_write_byte(void *_hdq, u8 byte);
 static u8 omap_w1_reset_bus(void *_hdq);
-static void omap_w1_search_bus(void *_hdq, u8 search_type,
-   w1_slave_found_callback slave_found);
+static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev,
+   u8 search_type, w1_slave_found_callback slave_found);
 
 
 static struct w1_bus_master omap_w1_master = {
@@ -237,8 +237,8 @@ static u8 omap_w1_reset_bus(void *_hdq)
 }
 
 /* W1 search callback function */
-static void omap_w1_search_bus(void *_hdq, u8 search_type,
-   w1_slave_found_callback slave_found)
+static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev,
+   u8 search_type, w1_slave_found_callback slave_found)
 {
u64 module_id, rn_le, cs, id;
 
@@ -255,7 +255,7 @@ static void omap_w1_search_bus(void *_hdq, u8 search_type,
cs = w1_calc_crc8((u8 *)rn_le, 7);
id = (cs  56) | module_id;
 
-   slave_found(_hdq, id);
+   slave_found(master_dev, id);
 }
 
 static int _omap_hdq_reset(struct hdq_data *hdq_data)
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/6] OMAP_LDP: Add network related configs in defconfig.

2008-11-11 Thread Stanley.Miao
Add network related configs in omap_ldp_defconfig, to make LDP can boot from
NFS successfully.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/configs/omap_ldp_defconfig |  148 ++-
 1 files changed, 147 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig 
b/arch/arm/configs/omap_ldp_defconfig
index b8135d2..add0b71 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -329,7 +329,82 @@ CONFIG_PM=y
 # CONFIG_SUSPEND is not set
 # CONFIG_APM_EMULATION is not set
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-# CONFIG_NET is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG=cubic
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -345,6 +420,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
@@ -405,6 +482,54 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_1=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
 
 #
 # Input device support
@@ -1053,6 +1178,27 @@ CONFIG_TMPFS=y
 # CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
-- 
1.5.6.3

--
To unsubscribe from this list

Re: [PATCH 0/3] OMAP: Make OMAP LDP boot succussfuly

2008-11-10 Thread stanley.miao
On Fri, 2008-11-07 at 17:53 +0200, Felipe Balbi wrote:
 On Fri, Nov 07, 2008 at 09:41:24PM +0800, Stanley.Miao wrote:
  Now there is only basic support for OMAP LDP in linux-omap-2.6, LDP can't 
  boot
  up, even crash at boot time(because of omap_hdq problem).
  
  Add the following patches to fix the boot crash and let LDP boot 
  succussfuly.
 
 I recall seeing patches sending this driver to mainline, could you check
 with Evgeniy Polyakov what's status ?? Or resend this series after
 fixing my comments and Cc him.

Thanks for your comments, I will re-send the patches later.

Stanley.

 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] OMAP: Fix McBSP spin_lock deadlock.

2008-11-07 Thread stanley.miao
This solution keeps the virtual clock in place and enable the child
clocks before enable the virtual clock. So, any comments ?

Stanley.

On Thu, 2008-11-06 at 20:44 +0800, Stanley.Miao wrote:
 A spin_lock deadlock will occur when omap_mcbsp_request() is invoked.
 
 omap_mcbsp_request() --
 clk_enable(mcbsp-clk)   -- clk_enable get clockfw_lock, then call -
 omap2_clk_enable()   --
 _omap2_clk_enable()  --
 omap_mcbsp_clk_enable()  --
 clk_enable(mcbsp_ick)-- now clk_enable acquire clockfw_lock again.
 
 The solution:
 
 If a alias clock has some relative clocks, enable relative clocks before 
 enable
 the alias clock.
 
 Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
 ---
  arch/arm/mach-omap1/mcbsp.c |   67 ++--
  arch/arm/mach-omap2/mcbsp.c |   88 +++---
  arch/arm/plat-omap/clock.c  |9 +++-
  arch/arm/plat-omap/include/mach/clock.h |2 +
  4 files changed, 47 insertions(+), 119 deletions(-)
 
 diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
 index 7de7c69..cf220be 100644
 --- a/arch/arm/mach-omap1/mcbsp.c
 +++ b/arch/arm/mach-omap1/mcbsp.c
 @@ -26,80 +26,45 @@
  #define DPS_RSTCT2_PER_EN(1  0)
  #define DSP_RSTCT2_WD_PER_EN (1  1)
  
 -struct mcbsp_internal_clk {
 - struct clk clk;
 - struct clk **childs;
 - int n_childs;
 -};
 -
  #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
 -static void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
 +static void omap_mcbsp_clk_init(struct clk *mclk)
  {
   const char *clk_names[] = { dsp_ck, api_ck, dspxor_ck };
   int i;
  
 - mclk-n_childs = ARRAY_SIZE(clk_names);
 - mclk-childs = kzalloc(mclk-n_childs * sizeof(struct clk *),
 + mclk-n_relatives = ARRAY_SIZE(clk_names);
 + mclk-relatives = kzalloc(mclk-n_relatives * sizeof(struct clk *),
   GFP_KERNEL);
  
 - for (i = 0; i  mclk-n_childs; i++) {
 + for (i = 0; i  mclk-n_relatives; i++) {
   /* We fake a platform device to get correct device id */
   struct platform_device pdev;
  
   pdev.dev.bus = platform_bus_type;
 - pdev.id = mclk-clk.id;
 - mclk-childs[i] = clk_get(pdev.dev, clk_names[i]);
 - if (IS_ERR(mclk-childs[i]))
 + pdev.id = mclk-id;
 + mclk-relatives[i] = clk_get(pdev.dev, clk_names[i]);
 + if (IS_ERR(mclk-relatives[i]))
   printk(KERN_ERR Could not get clock %s (%d).\n,
 - clk_names[i], mclk-clk.id);
 + clk_names[i], mclk-id);
   }
  }
  
 -static int omap_mcbsp_clk_enable(struct clk *clk)
 -{
 - struct mcbsp_internal_clk *mclk = container_of(clk,
 - struct mcbsp_internal_clk, clk);
 - int i;
 -
 - for (i = 0; i  mclk-n_childs; i++)
 - clk_enable(mclk-childs[i]);
 - return 0;
 -}
 -
 -static void omap_mcbsp_clk_disable(struct clk *clk)
 -{
 - struct mcbsp_internal_clk *mclk = container_of(clk,
 - struct mcbsp_internal_clk, clk);
 - int i;
 -
 - for (i = 0; i  mclk-n_childs; i++)
 - clk_disable(mclk-childs[i]);
 -}
 -
 -static struct mcbsp_internal_clk omap_mcbsp_clks[] = {
 +static struct clk omap_mcbsp_clks[] = {
   {
 - .clk = {
 - .name   = mcbsp_clk,
 - .id = 1,
 - .enable = omap_mcbsp_clk_enable,
 - .disable= omap_mcbsp_clk_disable,
 - },
 + .name   = mcbsp_clk,
 + .id = 1,
   },
   {
 - .clk = {
 - .name   = mcbsp_clk,
 - .id = 3,
 - .enable = omap_mcbsp_clk_enable,
 - .disable= omap_mcbsp_clk_disable,
 - },
 + .name   = mcbsp_clk,
 + .id = 3,
   },
  };
  
  #define omap_mcbsp_clks_size ARRAY_SIZE(omap_mcbsp_clks)
  #else
  #define omap_mcbsp_clks_size 0
 -static struct mcbsp_internal_clk __initdata *omap_mcbsp_clks;
 -static inline void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
 +static struct clk __initdata *omap_mcbsp_clks;
 +static inline void omap_mcbsp_clk_init(struct clk *mclk)
  { }
  #endif
  
 @@ -233,7 +198,7 @@ int __init omap1_mcbsp_init(void)
   for (i = 0; i  omap_mcbsp_clks_size; i++) {
   if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
   omap_mcbsp_clk_init(omap_mcbsp_clks[i]);
 - clk_register(omap_mcbsp_clks[i].clk);
 + clk_register(omap_mcbsp_clks[i]);
   }
   }
  
 diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c

[PATCH 2/3] OMAP_LDP: Add Ethernet device support to make ldp boot succeess.

2008-11-07 Thread Stanley.Miao
Add Ethernet device support in board-ldp.c to make ldp can boot and mount nfs
successfully.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/configs/omap_ldp_defconfig |  148 ++-
 arch/arm/mach-omap2/board-ldp.c |   53 ++
 arch/arm/plat-omap/include/mach/board-ldp.h |5 +-
 drivers/net/smc911x.c   |6 +-
 drivers/net/smc911x.h   |2 +
 5 files changed, 210 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig 
b/arch/arm/configs/omap_ldp_defconfig
index b8135d2..add0b71 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -329,7 +329,82 @@ CONFIG_PM=y
 # CONFIG_SUSPEND is not set
 # CONFIG_APM_EMULATION is not set
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-# CONFIG_NET is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG=cubic
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -345,6 +420,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
@@ -405,6 +482,54 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_1=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
 
 #
 # Input device support
@@ -1053,6 +1178,27 @@ CONFIG_TMPFS=y
 # CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3

[PATCH 3/3] OMAP_LDP: Add keypad support on ZOOM SDK

2008-11-07 Thread Stanley.Miao
Support twl4030 keypad and gpio keys on ZOOM SDK.

Signed-off-by: Stanley.Miao [EMAIL PROTECTED]
---
 arch/arm/configs/omap_ldp_defconfig |   11 +++-
 arch/arm/mach-omap2/board-ldp.c |  115 +++
 drivers/input/keyboard/Kconfig  |2 +-
 drivers/input/keyboard/gpio_keys.c  |4 +
 drivers/input/keyboard/omap-twl4030keypad.c |   15 +++-
 include/linux/gpio_keys.h   |1 +
 6 files changed, 143 insertions(+), 5 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig 
b/arch/arm/configs/omap_ldp_defconfig
index add0b71..33541d0 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -549,7 +549,16 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_TWL4030=y
+# CONFIG_KEYBOARD_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index f319e97..c01baec 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -16,6 +16,7 @@
 #include linux/platform_device.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/gpio_keys.h
 #include linux/workqueue.h
 #include linux/err.h
 #include linux/clk.h
@@ -33,6 +34,7 @@
 #include mach/gpio.h
 #include mach/board.h
 #include mach/common.h
+#include mach/keypad.h
 #include mach/gpmc.h
 #include mach/mmc.h
 #include mach/usb-musb.h
@@ -72,6 +74,117 @@ static struct platform_device ldp_smc911x_device = {
.resource   = ldp_smc911x_resources,
 };
 
+static int ldp_twl4030_keymap[] = {
+   KEY(0, 0, KEY_1),
+   KEY(1, 0, KEY_2),
+   KEY(2, 0, KEY_3),
+   KEY(0, 1, KEY_4),
+   KEY(1, 1, KEY_5),
+   KEY(2, 1, KEY_6),
+   KEY(3, 1, KEY_F5),
+   KEY(0, 2, KEY_7),
+   KEY(1, 2, KEY_8),
+   KEY(2, 2, KEY_9),
+   KEY(3, 2, KEY_F6),
+   KEY(0, 3, KEY_F7),
+   KEY(1, 3, KEY_0),
+   KEY(2, 3, KEY_F8),
+   KEY(5, 4, KEY_MUTE),
+   KEY(4, 4, KEY_VOLUMEUP),
+   KEY(5, 5, KEY_VOLUMEDOWN),
+   0
+};
+
+static struct twl4030_keypad_data ldp_kp_twl4030_data = {
+   .rows   = 6,
+   .cols   = 6,
+   .keymap = ldp_twl4030_keymap,
+   .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap),
+   .rep= 1,
+   .irq= TWL4030_MODIRQ_KEYPAD,
+};
+
+
+static struct gpio_keys_button ldp_gpio_keys_buttons[] = {
+   [0] = {
+   .code   = KEY_ENTER,
+   .gpio   = 101,
+   .desc   = enter sw,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [1] = {
+   .code   = KEY_F1,
+   .gpio   = 102,
+   .desc   = func 1,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [2] = {
+   .code   = KEY_F2,
+   .gpio   = 103,
+   .desc   = func 2,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [3] = {
+   .code   = KEY_F3,
+   .gpio   = 104,
+   .desc   = func 3,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [4] = {
+   .code   = KEY_F4,
+   .gpio   = 105,
+   .desc   = func 4,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [5] = {
+   .code   = KEY_LEFT,
+   .gpio   = 106,
+   .desc   = left sw,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [6] = {
+   .code   = KEY_RIGHT,
+   .gpio   = 107,
+   .desc   = right sw,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [7] = {
+   .code   = KEY_UP,
+   .gpio   = 108,
+   .desc   = up sw,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+   [8] = {
+   .code   = KEY_DOWN,
+   .gpio   = 109,
+   .desc   = down sw,
+   .active_low = 1,
+   .debounce_interval = 30,
+   },
+};
+
+static struct gpio_keys_platform_data ldp_gpio_keys = {
+   .buttons= ldp_gpio_keys_buttons,
+   .nbuttons

  1   2   >