DM6467_DVSDK_2_00_00_22 : Fail To Generate Server Executable Using Files Generate By RTSC Server Package Wizard

2009-10-07 Thread Cheng Teh Kian

Hi All,

Currently I am using DM6467 with software package :
1. DVSDK_2_00_00_22
2. Codec Engine 2_23_01
3. dm6467_dvsdk_combos_2_05
4. bios 5_33_03
5. biosutils 1_01_00
6. cg6x 6_0_21
7. fc 2_23_01
8. xdais 6_23
9. xdctools_3_10_03

I tried to use Unit Server Wizard to generate files for my codec 
server(called up using command 'dvsdk_2_00_00_22/xdctools*/xs 
ti.sdo.codecutils.genserver).  I have selected H264ENC and H264DEC 
(refer to package codec inside 'dm6467_dvsdk_combos_2_05')  in Unit 
Server Wizard and manage to generate file as below:


1. package.xdc

2. codec.cfg

3. link.cmd

4. main.c

5. package.bld

6. package.xs

7. server.cfg

8. server.tcf



Then I modified 'server.cfg' as below:

H264DEC.alg.codeSection = DDR2;

H264DEC.alg.udataSection = DDR2;

H264DEC.alg.dataSection = DDR2;



H264ENC.alg.codeSection = DDR2;

H264ENC.alg.udataSection = DDR2;

H264ENC.alg.dataSection = DDR2;

This codec server has been place in 'dm6467_dvsdk_combos_2_05'. When I 
build the whole 'dm6467_dvsdk_combos_2_05', I got the following error:


 .executables [packages/ti/sdo/servers/loopback_diy] 
#
# configuring loopback_diy.x64P from package/cfg/loopback_diy_x64P.cfg ...
/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03/xs 
-Dxdc.path=/home/ctkian/dvsdk_2_00_00_22/dm6467_dvsdk_combos_2_05;/home/ctkian/dvsdk_2_00_00_22/dm6467_dvsdk_combos_2_05/packages;/home/ctkian/dvsdk_2_00_00_22/codec_engine_2_23_01/cetools/packages;/home/ctkian/dvsdk_2_00_00_22/xdais_6_23/packages;/home/ctkian/dvsdk_2_00_00_22/framework_components_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/framework_components_2_23_01/fctools/packages;/home/ctkian/dvsdk_2_00_00_22/bios_5_33_03/packages;/home/ctkian/dvsdk_2_00_00_22/linuxutils_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/dsplink-1_61_03-prebuilt/packages;/home/ctkian/dvsdk_2_00_00_22/codec_engine_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/biosutils_1_01_00/packages;/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03/packages;../../../.. 
-Dxdc.root=/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03 
-Dxdc.hostOS=Linux 
-Dconfig.importPath=.;/home/ctkian/dvsdk_2_00_00_22/dm6467_dvsdk_combos_2_05;/home/ctkian/dvsdk_2_00_00_22/dm6467_dvsdk_combos_2_05/packages;/home/ctkian/dvsdk_2_00_00_22/codec_engine_2_23_01/cetools/packages;/home/ctkian/dvsdk_2_00_00_22/xdais_6_23/packages;/home/ctkian/dvsdk_2_00_00_22/framework_components_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/framework_components_2_23_01/fctools/packages;/home/ctkian/dvsdk_2_00_00_22/bios_5_33_03/packages;/home/ctkian/dvsdk_2_00_00_22/linuxutils_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/dsplink-1_61_03-prebuilt/packages;/home/ctkian/dvsdk_2_00_00_22/codec_engine_2_23_01/packages;/home/ctkian/dvsdk_2_00_00_22/biosutils_1_01_00/packages;/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03/packages;../../../..;/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03;/home/ctkian/dvsdk_2_00_00_22/xdctools_3_10_03/etc 
;/home/ctkian/dvsdk_2_00_00_22/bios_5_33_03/packages/ti/bios/include 
-Dxdc.bld.targets= -DTOOLS=  -Dxdc.cfg.check.fatal=false xdc.cfg 
loopback_diy.x64P package/cfg/loopback_diy_x64P.cfg 
package/cfg/loopback_diy_x64P

platform   = ti.platforms.evmDM6467
Warning: Undefined HDINTC::biosInterruptEventNo_1. An unused interrupt 
Event Number must be assigned in HDINTC config to be used as the BIOS 
ISR interrupt line. Using event number 31. If this event Id is already 
in use, please re-configure with a suitable Event number.
Warning: Undefined HDINTC::biosInterruptEventNo_0. An unused interrupt 
Event Number must be assigned in HDINTC config to be used as the BIOS 
ISR interrupt line. Using event number 30. If this event Id is already 
in use, please re-configure with a suitable Event number.
Warning: Undefined HDINTC::biosInterruptVectorId_0. An unused interrupt 
Event Number must be assigned in HDINTC config to be used as the BIOS 
ISR interrupt line. Using interrupt line 7. If this line is already in 
use, please re-configure with a suitable Event number.
Warning: Undefined HDINTC::biosInterruptVectorId_1. An unused interrupt 
Event Number must be assigned in HDINTC config to be used as the BIOS 
ISR interrupt line. Using interrupt line 8. If this line is already in 
use, please re-configure with a suitable Event number.
Warning:  Alg h264dec DARAM scratch size exceeds engine configuration 
for groupId 1
Warning:  Alg h264dec SARAM scratch size exceeds engine configuration 
for groupId 1
Warning:  Alg h264enc DARAM scratch size exceeds engine configuration 
for groupId 1
Warning:  Alg h264enc SARAM scratch size exceeds engine configuration 
for groupId 1

ti.sdo.ce.ipc.bios.close(): loading dsplink.dsp

NOTE: You can find the complete server data sheet in 
./package/info/loopback_diy.x64P.DataSheet.html



Auto register ti.sdo.fc.ires.edma3chan.EDMA3CHAN
Auto register ti.sdo.fc.ires.hdvicp.HDVICP
   will link with 

Uncompressed kernel - reducing start times

2009-10-07 Thread ExpatEgghead
Hi all;

I am trying to reduce our startup time for our DM355 custom board.
Currently it works fine, we just need it to be faster. I wanted to try
an uncompressed kernel,. Built it but when downloaded into flash,
u-boot won;t load it and complains:

U-Boot 1.2.0 (Feb  2 2008 - 23:52:10)

DRAM:  128 MB
NAND:  NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND
1GiB 3,3V 8-bit)
Bad block table found at page 524224, version 0x01
Bad block table found at page 524160, version 0x01
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
Bad block table found at page 524224, version 0x01
Bad block table found at page 524160, version 0x01
2048 MiB
In:serial
Out:   serial
Err:   serial
ARM Clock :- 216MHz
DDR Clock :- 171MHz
Hit any key to stop autoboot:  3

Loading from NAND 1GiB 3,3V 8-bit, offset 0x40

** Bad Magic Number 0xe321f0d3 **
## Booting image at 8070 ...
Bad Magic Number
DM355 EVM #

Any ideas why this might be so?

-- 
--Adrian Edmonds

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] MUSB: fix DM644xEVM DRVVBUS GPIO number

2009-10-07 Thread Sergei Shtylyov

Hello, I wrote:

Commit 30899ca7f20571c4bd64544dec261171f6ec255b (USB: musb: davinci 
dm6446evm
GPIO renumbering) has updated GPIO_nVBUS_DRV to a wrong value which 
causes a

kernel oops.


The DaVinci chips have 104 GPIOs max, not 128, hence the correct 
value is 120

(that is 104 + 8 + 8), not 144.



Signed-off-by: Sergei Shtylyov sshtyl...@ru.mvista.com



---
Please, apply it before 2.6.31 is out as it fixes a kernel oops...



   Ping.


  David, Greg is waiting for your ACKs (or NAKs) on my several 
outstanding MUSB patches... we've already missed 2.6.31. :-/


   David, PING again...
   Greg, can the patch that hasn't been merged to Linus' tree (this one 
hasn't been merged in its due time) be merged into -stable. If not, then 
this patch can now be dropped from the cosideration and superseded by 
Saminathan's patch -- this patch is only valid in the context of 2.6.31.
Or perhaps Swaminathan's patch could be applied to -stable in the form 
different from 2.6.32, i.e. with 120, not 160 for the GPIO #...


WBR, Sergei

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH 1/2] davinci: DA850/OMAP-L138 EVM expander setup and UI card detection

2009-10-07 Thread Chaithrika U S
All,

Any comments/suggestions on this patch set?

Regards, 
Chaithrika

On Thu, Oct 01, 2009 at 02:30:28, Chaithrika U S wrote:
 DA850/OMAP-L138 EVM can be connected to an UI card which has various
 peripherals on it.The UI card has TCA6416 expander which can be probed
 to check whether the UI card is connected or not. If the UI card is
 connected, setup NOR and NAND devices. This is done via the expander
 setup callback.
 
 Signed-off-by: Chaithrika U S chaithr...@ti.com
 ---
  arch/arm/mach-davinci/board-da850-evm.c |  127 
 ---
  1 files changed, 99 insertions(+), 28 deletions(-)
 
 diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
 b/arch/arm/mach-davinci/board-da850-evm.c
 index 25ae007..dd43644 100644
 --- a/arch/arm/mach-davinci/board-da850-evm.c
 +++ b/arch/arm/mach-davinci/board-da850-evm.c
 @@ -17,6 +17,7 @@
  #include linux/console.h
  #include linux/i2c.h
  #include linux/i2c/at24.h
 +#include linux/i2c/pca953x.h
  #include linux/gpio.h
  #include linux/platform_device.h
  #include linux/mtd/mtd.h
 @@ -144,10 +145,85 @@ static struct platform_device 
 da850_evm_nandflash_device = {
   .resource   = da850_evm_nandflash_resource,
  };
  
 +static u32 ui_card_detected;
 +static void da850_evm_setup_nor_nand(void);
 +
 +static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned 
 gpio,
 + unsigned ngpio, void *c)
 +{
 + int sel_a, sel_b, sel_c, ret;
 +
 + sel_a = gpio + 7;
 + sel_b = gpio + 6;
 + sel_c = gpio + 5;
 +
 + ret = gpio_request(sel_a, sel_a);
 + if (ret) {
 + pr_warning(Cannot open UI expander pin %d\n, sel_a);
 + goto exp_setup_sela_fail;
 + }
 +
 + ret = gpio_request(sel_b, sel_b);
 + if (ret) {
 + pr_warning(Cannot open UI expander pin %d\n, sel_b);
 + goto exp_setup_selb_fail;
 + }
 +
 + ret = gpio_request(sel_c, sel_c);
 + if (ret) {
 + pr_warning(Cannot open UI expander pin %d\n, sel_c);
 + goto exp_setup_selc_fail;
 + }
 +
 + /* deselect all functionalities */
 + gpio_direction_output(sel_a, 1);
 + gpio_direction_output(sel_b, 1);
 + gpio_direction_output(sel_c, 1);
 +
 + ui_card_detected = 1;
 + pr_info(DA850/OMAP-L138 EVM UI card detected\n);
 +
 + da850_evm_setup_nor_nand();
 +
 + return 0;
 +
 +exp_setup_selc_fail:
 + gpio_free(sel_b);
 +exp_setup_selb_fail:
 + gpio_free(sel_a);
 +exp_setup_sela_fail:
 + return ret;
 +}
 +
 +static int da850_evm_ui_expander_teardown(struct i2c_client *client,
 + unsigned gpio, unsigned ngpio, void *c)
 +{
 + /* deselect all functionalities */
 + gpio_set_value(gpio + 5, 1);
 + gpio_set_value(gpio + 6, 1);
 + gpio_set_value(gpio + 7, 1);
 +
 + gpio_free(gpio + 5);
 + gpio_free(gpio + 6);
 + gpio_free(gpio + 7);
 +
 + return 0;
 +}
 +
 +static struct pca953x_platform_data da850_evm_ui_expander_info = {
 + .gpio_base  = DAVINCI_N_GPIO,
 + .setup  = da850_evm_ui_expander_setup,
 + .teardown   = da850_evm_ui_expander_teardown,
 +};
 +
  static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
   {
   I2C_BOARD_INFO(tlv320aic3x, 0x18),
 - }
 + },
 + {
 + I2C_BOARD_INFO(tca6416, 0x20),
 + .platform_data = da850_evm_ui_expander_info,
 + },
  };
  
  static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
 @@ -251,13 +327,6 @@ static void __init da850_evm_init_nor(void)
   iounmap(aemif_addr);
  }
  
 -#if defined(CONFIG_MTD_PHYSMAP) || \
 -defined(CONFIG_MTD_PHYSMAP_MODULE)
 -#define HAS_NOR 1
 -#else
 -#define HAS_NOR 0
 -#endif
 -
  #if defined(CONFIG_MMC_DAVINCI) || \
  defined(CONFIG_MMC_DAVINCI_MODULE)
  #define HAS_MMC 1
 @@ -265,6 +334,28 @@ static void __init da850_evm_init_nor(void)
  #define HAS_MMC 0
  #endif
  
 +static void da850_evm_setup_nor_nand(void)
 +{
 + int ret = 0;
 +
 + if (ui_card_detected  !HAS_MMC) {
 + ret = da8xx_pinmux_setup(da850_nand_pins);
 + if (ret)
 + pr_warning(da850_evm_init: nand mux setup failed: 
 + %d\n, ret);
 +
 + ret = da8xx_pinmux_setup(da850_nor_pins);
 + if (ret)
 + pr_warning(da850_evm_init: nor mux setup failed: %d\n,
 + ret);
 +
 + da850_evm_init_nor();
 +
 + platform_add_devices(da850_evm_devices,
 + ARRAY_SIZE(da850_evm_devices));
 + }
 +}
 +
  static const short da850_evm_lcdc_pins[] = {
   DA850_GPIO2_8, DA850_GPIO2_15,
   -1
 @@ -275,21 +366,6 @@ static __init void da850_evm_init(void)
   struct davinci_soc_info *soc_info = davinci_soc_info;
   int ret;
  
 - ret = da8xx_pinmux_setup(da850_nand_pins);
 - if 

Re: [PATCH 1/2] davinci: DA850/OMAP-L138 EVM expander setup and UI card detection

2009-10-07 Thread Sergei Shtylyov

Hello.

Chaithrika U S wrote:


DA850/OMAP-L138 EVM can be connected to an UI card which has various
peripherals on it.The UI card has TCA6416 expander which can be probed
to check whether the UI card is connected or not. If the UI card is
connected, setup NOR and NAND devices. This is done via the expander
setup callback.



Signed-off-by: Chaithrika U S chaithr...@ti.com


[...]


diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
b/arch/arm/mach-davinci/board-da850-evm.c
index 25ae007..dd43644 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -17,6 +17,7 @@
 #include linux/console.h
 #include linux/i2c.h
 #include linux/i2c/at24.h
+#include linux/i2c/pca953x.h
 #include linux/gpio.h
 #include linux/platform_device.h
 #include linux/mtd/mtd.h
@@ -144,10 +145,85 @@ static struct platform_device da850_evm_nandflash_device 
= {
.resource   = da850_evm_nandflash_resource,
 };
 
+static u32 ui_card_detected;

+static void da850_evm_setup_nor_nand(void);
+
+static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned 
gpio,
+   unsigned ngpio, void *c)
+{
+   int sel_a, sel_b, sel_c, ret;
+
+   sel_a = gpio + 7;
+   sel_b = gpio + 6;
+   sel_c = gpio + 5;
+
+   ret = gpio_request(sel_a, sel_a);
+   if (ret) {
+   pr_warning(Cannot open UI expander pin %d\n, sel_a);
+   goto exp_setup_sela_fail;
+   }
+
+   ret = gpio_request(sel_b, sel_b);
+   if (ret) {
+   pr_warning(Cannot open UI expander pin %d\n, sel_b);
+   goto exp_setup_selb_fail;
+   }
+
+   ret = gpio_request(sel_c, sel_c);
+   if (ret) {
+   pr_warning(Cannot open UI expander pin %d\n, sel_c);
+   goto exp_setup_selc_fail;
+   }
+
+   /* deselect all functionalities */
+   gpio_direction_output(sel_a, 1);
+   gpio_direction_output(sel_b, 1);
+   gpio_direction_output(sel_c, 1);
+
+   ui_card_detected = 1;
+   pr_info(DA850/OMAP-L138 EVM UI card detected\n);
+
+   da850_evm_setup_nor_nand();
+
+   return 0;
+
+exp_setup_selc_fail:
+   gpio_free(sel_b);
+exp_setup_selb_fail:
+   gpio_free(sel_a);
+exp_setup_sela_fail:
+   return ret;
+}


[...]


@@ -265,6 +334,28 @@ static void __init da850_evm_init_nor(void)
 #define HAS_MMC 0
 #endif
 
+static void da850_evm_setup_nor_nand(void)

+{
+   int ret = 0;
+
+   if (ui_card_detected  !HAS_MMC) {


  Why check it of you're always calling this function with ui_card_detected 
set?



+   ret = da8xx_pinmux_setup(da850_nand_pins);
+   if (ret)
+   pr_warning(da850_evm_init: nand mux setup failed: 
+   %d\n,   ret);
+
+   ret = da8xx_pinmux_setup(da850_nor_pins);


   I'm afraid these pin lists are:

1) intersecting;
2) actually board specific (especially it their chip select part).

   Why not simply have the single unified AEMIF pin list like it's done for 
DA830 and not have it in the board code instead? Since the use of the chip 
selects and data/adress bus width actually depend on hos the board is wired.
It's the same kind of mistake as with adding board-specific GPIO pins to the 
 pin lists in da850.c.
   All this doesn't directly concern this patch however, as it's just 
moving the existing code around...


WBR, Sergei

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH/RFC] davinci: da830: add support for new silicon rev

2009-10-07 Thread Steve Chen
On Wed, 2009-10-07 at 09:12 +0100, Thompson, Nick (GE EntSol,
Intelligent Platforms) wrote:
 
 I have been given PDFs of the errata information including 2.0 fixes by
 TI. I haven't been given any instructions or indications that it is
 proprietary information - I'm told it is on the TI web site. Do you want
 me to share it on the list?
 
 The cache issue has been fixed BTW.
 
 There are also four new (to me) errata against 1.0, 1.1 and 2.0
 revisions - one of which is fixed in 2.0.

As much as I like to know, I can not ask you to post anything that may
be confidential.  Since Mark Grosen from TI already indicated that he
will provide the official version of 2.0 errata, lets give him (and
TI) a chance to put everything together.

Regards,

Steve


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: Uncompressed kernel - reducing start times

2009-10-07 Thread Caglar Akyuz
On Wednesday 07 October 2009 13:59:50 ExpatEgghead wrote:
 Hi all;

 I am trying to reduce our startup time for our DM355 custom board.
 Currently it works fine, we just need it to be faster. I wanted to try
 an uncompressed kernel,. Built it but when downloaded into flash,
 u-boot won;t load it and complains:

 U-Boot 1.2.0 (Feb  2 2008 - 23:52:10)

 DRAM:  128 MB
 NAND:  NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND
 1GiB 3,3V 8-bit)
 Bad block table found at page 524224, version 0x01
 Bad block table found at page 524160, version 0x01
 NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V
 8-bit) Bad block table found at page 524224, version 0x01
 Bad block table found at page 524160, version 0x01
 2048 MiB
 In:serial
 Out:   serial
 Err:   serial
 ARM Clock :- 216MHz
 DDR Clock :- 171MHz
 Hit any key to stop autoboot:  3

 Loading from NAND 1GiB 3,3V 8-bit, offset 0x40

 ** Bad Magic Number 0xe321f0d3 **
 ## Booting image at 8070 ...
 Bad Magic Number
 DM355 EVM #

 Any ideas why this might be so?

Are you appending u-boot header to the uncompressed image as well? Something 
like:

 mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n  
 Linux-2.6.30-davinci1-06077-gc55c499-dirty -d arch/arm/boot/Image 
 arch/arm/boot/uImage_uncomp

Regards,
Caglar



___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 0/7] Re-structure of Davinci USB configuration infrastructure.

2009-10-07 Thread Swaminathan S
This patch series re-structures DaVinci USB initialization and configuration
infrastructure.  In DaVinci devices both VBUS control and PHY modules
reside external to MUSB module and their implementation is device dependant.

VBUS and PHY control implementation has been moved to board, 
platform specific files residing in mach-davinci (from drivers/usb/musb/
davinci.c).

davinci.c configures/controls VBUS, PHY through above platform/board specific
routines.  In this way the MUSB module has been made transparent to variation
in underlying DaVinci Devices and their USB implementation.

The re-structure is based on below criteria of control

Board specific file  - USB role, USB VBUS, configured instances.
Platform specific file - USB PHY, memory maps, IRQ's etc
Generic (usb.c) file - platform registration, generic musb config.



Ravi B (1):
  Subscribes for USB resources for TI-DM646x EVM

Swaminathan S (6):
  Re-structure of Davinci USB platform implementation.
  Subscribes for USB resources for TI DM644x EVM platform.
  Updating the SFFSDR board USB config for DM644x platform.
  DM355 USB updates for new DaVinci platform USB infrastructure.
  Re-structure of davinci platform support.
  Updating the Leopard board USB config for DM355 Platform.

 arch/arm/mach-davinci/board-dm355-evm.c  |   28 -
 arch/arm/mach-davinci/board-dm355-leopard.c  |   18 +++-
 arch/arm/mach-davinci/board-dm644x-evm.c |   46 ++-
 arch/arm/mach-davinci/board-dm646x-evm.c |   72 ++
 arch/arm/mach-davinci/board-sffsdr.c |   14 ++-
 arch/arm/mach-davinci/dm355.c|   75 ++
 arch/arm/mach-davinci/dm644x.c   |   70 ++
 arch/arm/mach-davinci/dm646x.c   |   91 
 arch/arm/mach-davinci/include/mach/common.h  |7 +-
 arch/arm/mach-davinci/include/mach/dm355.h   |3 +
 arch/arm/mach-davinci/include/mach/dm644x.h  |3 +
 arch/arm/mach-davinci/include/mach/dm646x.h  |3 +
 arch/arm/mach-davinci/include/mach/usb_davinci.h |   49 +++
 arch/arm/mach-davinci/include/mach/usb_musb.h|   41 ++
 arch/arm/mach-davinci/usb.c  |  144 +--
 drivers/usb/musb/davinci.c   |  162 +++---
 drivers/usb/musb/davinci.h   |   17 ---
 drivers/usb/musb/musb_core.h |3 +-
 include/linux/usb/musb.h |7 +
 19 files changed, 577 insertions(+), 276 deletions(-)
 mode change 100644 = 100755 arch/arm/mach-davinci/board-sffsdr.c
 create mode 100644 arch/arm/mach-davinci/include/mach/usb_davinci.h
 create mode 100644 arch/arm/mach-davinci/include/mach/usb_musb.h

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 3/7] Subscribes for USB resources for TI-DM646x EVM

2009-10-07 Thread Swaminathan S
From: Ravi B a0393...@psplinux051.india.ti.com

This patch implments the support for USB VBUS, PHY control, DM646x
USB memory map, IRQ, USB Mode. It initializes for a single instance
of MUSB controller.

Signed-off-by: Ravi B ravib...@ti.com
---
 arch/arm/mach-davinci/board-dm646x-evm.c |   72 +
 arch/arm/mach-davinci/dm646x.c   |   91 ++
 arch/arm/mach-davinci/include/mach/dm646x.h  |3 +
 arch/arm/mach-davinci/include/mach/usb_davinci.h |4 +-
 4 files changed, 169 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c 
b/arch/arm/mach-davinci/board-dm646x-evm.c
index 24e0e13..49103a6 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -33,6 +33,7 @@
 #include linux/i2c/at24.h
 #include linux/i2c/pcf857x.h
 #include linux/etherdevice.h
+#include linux/usb/musb.h
 
 #include media/tvp514x.h
 
@@ -60,6 +61,7 @@
 /* CPLD Register 0 bits to control ATA */
 #define DM646X_EVM_ATA_RST BIT(0)
 #define DM646X_EVM_ATA_PWD BIT(1)
+#define DM646X_EVM_USB_VBUSBIT(7)
 
 #define DM646X_EVM_PHY_MASK(0x2)
 #define DM646X_EVM_MDIO_FREQUENCY  (220) /* PHY bus frequency */
@@ -88,14 +90,33 @@ static void __iomem *vpif_vsclkdis_reg;
 /* spin lock for updating above registers */
 static spinlock_t vpif_reg_lock;
 
+static int dm646x_evm_set_vbus(struct device *dev, int is_on);
+static struct musb_hdrc_platform_data usb_evm_data[] = {
+   {
+#if defined(CONFIG_USB_MUSB_OTG)
+   .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
+   .mode =  MUSB_PERIPHERAL,
+#elif defined(CONFIG_USB_MUSB_HOST)
+   .mode = MUSB_HOST,
+#endif
+   .power = 255,
+   .potpgt = 8,
+   .set_vbus = dm646x_evm_set_vbus,
+   }
+};
+
 static struct davinci_uart_config uart_config __initdata = {
.enabled_uarts = (1  0),
 };
 
+struct i2c_client *cpld_reg0_client;
 /* CPLD Register 0 Client: used for I/O Control */
 static int cpld_reg0_probe(struct i2c_client *client,
   const struct i2c_device_id *id)
 {
+   cpld_reg0_client = client;
+
if (HAS_ATA) {
u8 data;
struct i2c_msg msg[2] = {
@@ -652,6 +673,8 @@ static __init void evm_init(void)
 
soc_info-emac_pdata-phy_mask = DM646X_EVM_PHY_MASK;
soc_info-emac_pdata-mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
+
+   dm646x_usb_configure(usb_evm_data, ARRAY_SIZE(usb_evm_data));
 }
 
 static __init void davinci_dm646x_evm_irq_init(void)
@@ -659,6 +682,55 @@ static __init void davinci_dm646x_evm_irq_init(void)
davinci_irq_init();
 }
 
+/* Initiate the I2C command to the expander to turn on/off the VBUS line */
+static int vbus_state = -1;
+static void evm_deferred_drvvbus(struct work_struct *ignored)
+{
+   u8 data;
+
+   struct i2c_msg msg[2] = {
+   {
+   .addr = cpld_reg0_client-addr,
+   .flags = I2C_M_RD,
+   .len = 1,
+   .buf = data,
+   },
+   {
+   .addr = cpld_reg0_client-addr,
+   .flags = 0,
+   .len = 1,
+   .buf = data,
+   },
+   };
+
+   i2c_transfer(cpld_reg0_client-adapter, msg, 1);
+   if (vbus_state)
+   data |= DM646X_EVM_USB_VBUS;
+   else
+   data = ~DM646X_EVM_USB_VBUS;
+
+   i2c_transfer(cpld_reg0_client-adapter, msg + 1, 1);
+   vbus_state = !vbus_state;
+}
+
+/*
+ * DM644x EVM USB VBUS handler.  On TI DM644x EVM USB VBUS is controller
+ * through I2C expander (0x3A) lines.  Tthis function schedules a
+ * work thread to handle the actual VBUS on/off operations.
+ */
+static int dm646x_evm_set_vbus(struct device *dev, int is_on)
+{
+   static DECLARE_WORK(evm_vbus_work, evm_deferred_drvvbus);
+
+   is_on = is_on ? 1 : 0;
+   if (vbus_state == is_on)
+   return 0;
+
+   vbus_state = !is_on;
+   schedule_work(evm_vbus_work);
+   return 0;
+}
+
 MACHINE_START(DAVINCI_DM6467_EVM, DaVinci DM646x EVM)
.phys_io  = IO_PHYS,
.io_pg_offst  = (__IO_ADDRESS(IO_PHYS)  18)  0xfffc,
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 36e4fb4..2276c6a 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -28,6 +28,8 @@
 #include mach/serial.h
 #include mach/common.h
 #include mach/asp.h
+#include mach/usb_davinci.h
+#include mach/usb_musb.h
 
 #include clock.h
 #include mux.h
@@ -315,6 +317,12 @@ static struct clk vpif1_clk = {
.flags = ALWAYS_ENABLED,
 };
 
+static struct clk usb_clk = {
+   .name = usb,
+   .parent = pll1_sysclk3,
+   .lpsc = DAVINCI_LPSC_USB,
+};
+
 struct davinci_clk dm646x_clks[] = {

[PATCH 2/7] Subscribes for USB resources for TI DM644x EVM platform.

2009-10-07 Thread Swaminathan S
This patch implements the support for USB VBUS, PHY control, DM644x USB memory
mapsi, IRQ, USB Mode.  It initializes for a single instance of MUSB controller.

Signed-off-by: Swaminathan S swami.i...@ti.com
---
 arch/arm/mach-davinci/board-dm644x-evm.c |   46 ++-
 arch/arm/mach-davinci/dm644x.c   |   70 ++
 arch/arm/mach-davinci/include/mach/dm644x.h  |3 +
 arch/arm/mach-davinci/include/mach/usb_davinci.h |   41 +
 4 files changed, 159 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-davinci/include/mach/usb_davinci.h

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index 1213a00..bafae44 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -29,6 +29,7 @@
 #include linux/phy.h
 #include linux/clk.h
 #include linux/videodev2.h
+#include linux/usb/musb.h
 
 #include media/tvp514x.h
 
@@ -63,6 +64,8 @@
 #define LXT971_PHY_ID  (0x001378e2)
 #define LXT971_PHY_MASK(0xfff0)
 
+static int dm644x_evm_set_vbus(struct device *dev, int is_on);
+
 static struct mtd_partition davinci_evm_norflash_partitions[] = {
/* bootloader (UBL, U-Boot, etc) in first 5 sectors */
{
@@ -477,7 +480,6 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned 
ngpio, void *c)
/* irlml6401 switches over 1A, in under 8 msec;
 * now it can be managed by nDRV_VBUS ...
 */
-   setup_usb(500, 8);
 
return 0;
 }
@@ -699,6 +701,21 @@ static int davinci_phy_fixup(struct phy_device *phydev)
 #define HAS_NAND 0
 #endif
 
+static struct musb_hdrc_platform_data usb_evm_data[] = {
+   {
+#if defined(CONFIG_USB_MUSB_OTG)
+   .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
+   .mode =  MUSB_PERIPHERAL,
+#elif defined(CONFIG_USB_MUSB_HOST)
+   .mode = MUSB_HOST,
+#endif
+   .power = 255,
+   .potpgt = 8,
+   .set_vbus = dm644x_evm_set_vbus,
+   }
+};
+
 static __init void davinci_evm_init(void)
 {
struct clk *aemif_clk;
@@ -747,6 +764,7 @@ static __init void davinci_evm_init(void)
phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
davinci_phy_fixup);
 
+   dm644x_usb_configure(usb_evm_data, ARRAY_SIZE(usb_evm_data));
 }
 
 static __init void davinci_evm_irq_init(void)
@@ -754,6 +772,32 @@ static __init void davinci_evm_irq_init(void)
davinci_irq_init();
 }
 
+#define GPIO_nVBUS_DRV (DAVINCI_N_GPIO + 16) /* USB VBUS line */
+static int vbus_state = -1;
+static void evm_deferred_drvvbus(struct work_struct *ignored)
+{
+   gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
+   vbus_state = !vbus_state;
+}
+
+/*
+ * DM644x EVM USB VBUS handler.  On TI DM644x EVM USB VBUS is controller
+ * through I2C expander (0x3A) lines.  Tthis function schedules a
+ * work thread to handle the actual VBUS on/off operations.
+ */
+static int dm644x_evm_set_vbus(struct device *dev, int is_on)
+{
+   static DECLARE_WORK(evm_vbus_work, evm_deferred_drvvbus);
+
+   is_on = is_on ? 1 : 0;
+   if (vbus_state == is_on)
+   return 0;
+
+   vbus_state = !is_on;
+   schedule_work(evm_vbus_work);
+   return 0;
+}
+
 MACHINE_START(DAVINCI_EVM, DaVinci DM644x EVM)
/* Maintainer: MontaVista Software sou...@mvista.com */
.phys_io  = IO_PHYS,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index d6e0fa5..8e1559b 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -28,6 +28,8 @@
 #include mach/serial.h
 #include mach/common.h
 #include mach/asp.h
+#include mach/usb_musb.h
+#include mach/usb_davinci.h
 
 #include clock.h
 #include mux.h
@@ -761,6 +763,74 @@ void __init dm644x_init(void)
davinci_common_init(davinci_soc_info_dm644x);
 }
 
+/*
+ * Configure the USB PHY for DM644x platforms.
+ */
+static int dm644x_usb_phy_config(struct device *dev, u8 mode, int is_on)
+{
+   u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
+
+   if (is_on) {
+   /* power everything up; start the on-chip PHY and its PLL */
+   phy_ctrl = ~(USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN);
+   phy_ctrl |= USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON;
+   } else {
+   /* powerdown the on-chip PHY, its PLL, and the OTG block */
+   phy_ctrl = ~(USBPHY_SESNDEN | USBPHY_VBDTCTEN |
+   USBPHY_PHYPLLON);
+   phy_ctrl |= USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN;
+   }
+
+   __raw_writel(phy_ctrl, USB_PHY_CTRL);
+
+   if (is_on) {
+   /* wait for PLL to lock before proceeding */
+   while ((__raw_readl(USB_PHY_CTRL)  USBPHY_PHYCLKGD) == 0)
+   cpu_relax();
+   }
+
+   return 0;

[PATCH 4/7] Updating the SFFSDR board USB config for DM644x platform.

2009-10-07 Thread Swaminathan S
Updating the SFFSDR board USB configuration to aling with the new DaVinci USB
configuration infrastructure.  Based on current implementation initialize the
MUSB config to support Peripheral mode alone configuration.

Signed-off-by: Swaminathan S swami.i...@ti.com
---
 arch/arm/mach-davinci/board-sffsdr.c |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)
 mode change 100644 = 100755 arch/arm/mach-davinci/board-sffsdr.c

diff --git a/arch/arm/mach-davinci/board-sffsdr.c 
b/arch/arm/mach-davinci/board-sffsdr.c
old mode 100644
new mode 100755
index 7acdfd8..6d65469
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -38,6 +38,7 @@
 #include linux/mtd/partitions.h
 #include linux/mtd/physmap.h
 #include linux/io.h
+#include linux/usb/musb.h
 
 #include asm/setup.h
 #include asm/mach-types.h
@@ -154,6 +155,16 @@ static void __init davinci_sffsdr_map_io(void)
dm644x_init();
 }
 
+/* Only Peripheral mode supported hene populate set_vbus to NULL */
+static struct musb_hdrc_platform_data usb_evm_data[] = {
+   {
+   .mode =  MUSB_PERIPHERAL,
+   .power = 0,
+   .potpgt = 0,
+   .set_vbus = NULL,
+   }
+};
+
 static __init void davinci_sffsdr_init(void)
 {
struct davinci_soc_info *soc_info = davinci_soc_info;
@@ -164,7 +175,8 @@ static __init void davinci_sffsdr_init(void)
davinci_serial_init(uart_config);
soc_info-emac_pdata-phy_mask = SFFSDR_PHY_MASK;
soc_info-emac_pdata-mdio_max_freq = SFFSDR_MDIO_FREQUENCY;
-   setup_usb(0, 0); /* We support only peripheral mode. */
+
+   dm644x_usb_configure(usb_evm_data, ARRAY_SIZE(usb_evm_data));
 
/* mux VLYNQ pins */
davinci_cfg_reg(DM644X_VLYNQEN);
-- 
1.6.0.rc1.64.g61192

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 1/7] Re-structure of Davinci USB platform implementation.

2009-10-07 Thread Swaminathan S
This patch implements the generic DaVinci platform USB configuration
infrastructure.  Re-structure's usb.c to subscribe for plaform resources for
the configured instances of controller.  Adds phy_config data member in musb.h
to enable generic conrol of platform specific USB PHY functionality.

Signed-off-by: Swaminathan S swami.i...@ti.com
---
 arch/arm/mach-davinci/include/mach/common.h   |7 +-
 arch/arm/mach-davinci/include/mach/usb_musb.h |   41 +++
 arch/arm/mach-davinci/usb.c   |  144 +++--
 include/linux/usb/musb.h  |7 ++
 4 files changed, 87 insertions(+), 112 deletions(-)
 create mode 100644 arch/arm/mach-davinci/include/mach/usb_musb.h

diff --git a/arch/arm/mach-davinci/include/mach/common.h 
b/arch/arm/mach-davinci/include/mach/common.h
index 1fd3917..8fbbb7b 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -20,12 +20,6 @@ extern void davinci_irq_init(void);
 extern void __iomem *davinci_intc_base;
 extern int davinci_intc_type;
 
-/* parameters describe VBUS sourcing for host mode */
-extern void setup_usb(unsigned mA, unsigned potpgt_msec);
-
-/* parameters describe VBUS sourcing for host mode */
-extern void setup_usb(unsigned mA, unsigned potpgt_msec);
-
 struct davinci_timer_instance {
void __iomem*base;
u32 bottom_irq;
@@ -77,5 +71,6 @@ extern void davinci_common_init(struct davinci_soc_info 
*soc_info);
 /* standard place to map on-chip SRAMs; they *may* support DMA */
 #define SRAM_VIRT  0xfffe
 #define SRAM_SIZE  SZ_128K
+#define DAVINCI_USB_OTG_BASE0x01C64000
 
 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
diff --git a/arch/arm/mach-davinci/include/mach/usb_musb.h 
b/arch/arm/mach-davinci/include/mach/usb_musb.h
new file mode 100644
index 000..e9b35c9
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/usb_musb.h
@@ -0,0 +1,41 @@
+/*
+ * This file contains the architecture specific USB definitions
+ * of the TI DaVinci platforms.
+ *
+ * Copyright (C) 2009 Texas Instruments.
+ *
+ * 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
+ *
+ */
+#ifndef USB_MUSB_H_
+#define USB_MUSB_H_
+
+#include linux/platform_device.h
+#include linux/usb/musb.h
+
+struct plat_res_data {
+   struct musb_hdrc_platform_data  *plat_data;
+   struct resource *res_data;
+   u8  num_res;
+};
+
+struct usb_plat_data {
+   struct plat_res_data*prdata;
+   u8  num_inst;
+};
+
+/* VBUS control fuction */
+extern void setup_usb(struct usb_plat_data *pdata);
+#endif
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 2fff9a6..2c25c55 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -6,20 +6,12 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
+#include linux/string.h
 
 #include linux/usb/musb.h
 #include linux/usb/otg.h
+#include mach/usb_musb.h
 
-#include mach/common.h
-#include mach/hardware.h
-#include mach/irqs.h
-#include mach/cputype.h
-#include mach/usb.h
-
-#define DAVINCI_USB_OTG_BASE   0x01c64000
-#define DA8XX_USB1_BASE0x01e25000
-
-#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
 static struct musb_hdrc_eps_bits musb_eps[] = {
{ ep1_tx, 8, },
{ ep1_rx, 8, },
@@ -43,103 +35,43 @@ static struct musb_hdrc_config musb_config = {
.eps_bits   = musb_eps,
 };
 
-static struct musb_hdrc_platform_data usb_data = {
-#if defined(CONFIG_USB_MUSB_OTG)
-   /* OTG requires a Mini-AB connector */
-   .mode   = MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
-   .mode   = MUSB_PERIPHERAL,
-#elif defined(CONFIG_USB_MUSB_HOST)
-   .mode   = MUSB_HOST,
-#endif
-   .clock  = usb,
-   .config = musb_config,
-};
-
-static struct resource usb_resources[] = {
-   {
-   /* physical address */
-   .start  = DAVINCI_USB_OTG_BASE,
-   .end= DAVINCI_USB_OTG_BASE + 0x5ff,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = IRQ_USBINT,
-   .flags  = 

[PATCH 5/7] DM355 USB updates for new DaVinci platform USB infrastructure.

2009-10-07 Thread Swaminathan S
Updating the DM355 USB platform implementation to subscribe to the new
DaVinci USB infrastructure.

Signed-off-by: Swaminathan S swami.i...@ti.com
---
 arch/arm/mach-davinci/board-dm355-evm.c  |   28 -
 arch/arm/mach-davinci/dm355.c|   75 ++
 arch/arm/mach-davinci/include/mach/dm355.h   |3 +
 arch/arm/mach-davinci/include/mach/usb_davinci.h |6 ++
 4 files changed, 110 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c 
b/arch/arm/mach-davinci/board-dm355-evm.c
index f87ef58..e61d82e 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -39,6 +39,7 @@
 #include mach/serial.h
 #include mach/nand.h
 #include mach/mmc.h
+#include mach/usb_davinci.h
 
 #define DAVINCI_ASYNC_EMIF_CONTROL_BASE0x01e1
 #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE   0x0200
@@ -318,9 +319,25 @@ static struct spi_board_info dm355_evm_spi_info[] 
__initconst = {
},
 };
 
+static struct musb_hdrc_platform_data usb_evm_data[] = {
+   {
+#if defined(CONFIG_USB_MUSB_OTG)
+   .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
+   .mode =  MUSB_PERIPHERAL,
+#elif defined(CONFIG_USB_MUSB_HOST)
+   .mode = MUSB_HOST,
+#endif
+   .power = 255,
+   .potpgt = 8,
+   .set_vbus = NULL, /* VBUS is controller by USB IP */
+   }
+};
+
 static __init void dm355_evm_init(void)
 {
struct clk *aemif;
+   u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
 
gpio_request(1, dm9000);
gpio_direction_input(1);
@@ -341,11 +358,18 @@ static __init void dm355_evm_init(void)
 * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
 * but could be 0x048c for about 25% faster page reads.
 */
-
gpio_request(2, usb_id_toggle);
gpio_direction_output(2, USB_ID_VALUE);
+
+   /* dm355 EVM swaps usb D+/D- for signal integrity, and
+* is clocked from the main 24 MHz crystal.
+*/
+   phy_ctrl = ~(3  9);
+   phy_ctrl |= USBPHY_DATAPOL;
+   __raw_writel(phy_ctrl, USB_PHY_CTRL);
+
/* irlml6401 switches over 1A in under 8 msec */
-   setup_usb(500, 8);
+   dm355_usb_configure(usb_evm_data, ARRAY_SIZE(usb_evm_data));
 
davinci_setup_mmc(0, dm355evm_mmc_config);
davinci_setup_mmc(1, dm355evm_mmc_config);
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 0596700..9f3b0ab 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -31,6 +31,9 @@
 #include mach/serial.h
 #include mach/common.h
 #include mach/asp.h
+#include mach/usb_musb.h
+#include mach/usb_davinci.h
+
 
 #include clock.h
 #include mux.h
@@ -849,6 +852,78 @@ void __init dm355_init_asp1(u32 evt_enable, struct 
snd_platform_data *pdata)
platform_device_register(dm355_asp1_device);
 }
 
+/*
+ * Configure the USB PHY for DM355 platforms.
+ */
+static int dm355_usb_phy_config(struct device *dev, u8 mode, int is_on)
+{
+   u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
+   u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
+
+   if (is_on) {
+
+   /* power everything up; start the on-chip PHY and its PLL */
+   phy_ctrl = ~(USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN);
+   phy_ctrl |= USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON;
+   deepsleep = ~DRVVBUS_OVERRIDE;
+   __raw_writel(deepsleep, DM355_DEEPSLEEP);
+   } else {
+   /* powerdown the on-chip PHY, its PLL, and the OTG block */
+   phy_ctrl = ~(USBPHY_SESNDEN | USBPHY_VBDTCTEN |
+   USBPHY_PHYPLLON);
+   phy_ctrl |= USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN;
+   }
+
+   __raw_writel(phy_ctrl, USB_PHY_CTRL);
+
+   if (is_on) {
+   /* wait for PLL to lock before proceeding */
+   while ((__raw_readl(USB_PHY_CTRL)  USBPHY_PHYCLKGD) == 0)
+   cpu_relax();
+   }
+
+   return 0;
+}
+
+static struct resource usb_resources[] = {
+   {
+   .start  = DAVINCI_USB_OTG_BASE,
+   .end= DAVINCI_USB_OTG_BASE + 0x5ff,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = IRQ_USBINT,
+   .flags  = IORESOURCE_IRQ,
+   }
+};
+
+static struct plat_res_data dm355_usb_res;
+static struct usb_plat_data dm355_usb_plat_data;
+
+/*
+ * Initialize DM355 related USB information such as Memory maps, IRQ etc.
+ * Since DM355 supprots a single MUSB controller initialize the instance
+ * value to 1.
+ */
+void dm355_usb_configure(struct musb_hdrc_platform_data *pdata, u8 num_inst)
+{
+   pdata-phy_config = dm355_usb_phy_config;
+
+   dm355_usb_res.plat_data = pdata;
+   dm355_usb_res.res_data = usb_resources;
+   

[PATCH 7/7] Updating the Leopard board USB config for DM355 Platform.

2009-10-07 Thread Swaminathan S
Updating the Leopard board USB configuration to align with new DaVinci USB
platform infrastructure.

Signed-off-by: Swaminathan S swami.i...@ti.com
---
 arch/arm/mach-davinci/board-dm355-leopard.c |   18 +-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c 
b/arch/arm/mach-davinci/board-dm355-leopard.c
index 84ad5d1..08b3fc6 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -36,6 +36,7 @@
 #include mach/serial.h
 #include mach/nand.h
 #include mach/mmc.h
+#include mach/usb_davinci.h
 
 #define DAVINCI_ASYNC_EMIF_CONTROL_BASE0x01e1
 #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE   0x0200
@@ -243,6 +244,21 @@ static struct spi_board_info dm355_leopard_spi_info[] 
__initconst = {
},
 };
 
+static struct musb_hdrc_platform_data usb_evm_data[] = {
+   {
+#if defined(CONFIG_USB_MUSB_OTG)
+   .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
+   .mode =  MUSB_PERIPHERAL,
+#elif defined(CONFIG_USB_MUSB_HOST)
+   .mode = MUSB_HOST,
+#endif
+   .power = 255,
+   .potpgt = 8,
+   .set_vbus = NULL, /* VBUS is controller by USB IP */
+   }
+};
+
 static __init void dm355_leopard_init(void)
 {
struct clk *aemif;
@@ -270,7 +286,7 @@ static __init void dm355_leopard_init(void)
gpio_request(2, usb_id_toggle);
gpio_direction_output(2, USB_ID_VALUE);
/* irlml6401 switches over 1A in under 8 msec */
-   setup_usb(500, 8);
+   dm355_usb_configure(usb_evm_data, ARRAY_SIZE(usb_evm_data));
 
davinci_setup_mmc(0, dm355leopard_mmc_config);
davinci_setup_mmc(1, dm355leopard_mmc_config);
-- 
1.6.0.rc1.64.g61192

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] davinci: DA830/OMAP-L137 EVM: simplify selection of UI card peripherals

2009-10-07 Thread Mark A. Greer
On Mon, Oct 05, 2009 at 11:12:17AM +0530, Nori, Sekhar wrote:
 On Fri, Oct 02, 2009 at 02:24:17, Mark A. Greer wrote:

  I don't know Sekhar...  This looks like a step backwards to me with all
  the #ifdef-ery.  Why not keep the code as it is and change the #ifdefs
  that are already there (e.g., change the CONFIG_UI ones to CONFIG_FB,
  etc)?
 
 Mark,
 
 The only new #ifdef the patch introduces is for MMC/SD. That is
 to make sure plugging in UI card does not get MMC to stop working.

You have taken #ifdef's that included/excluded code and replaced them with
#ifdef's that are a part of the runtime logic.  That's typically frowned
upon.  That's my issue.

 I think the patch actually improves readability by removing the
 existing #ifdefs present inside function body.

I disagree plus the existing ifdef's do what #ifdef's are supposed to do,
include or exclude chunks of code.  Now, in addition to indirectly
making them a part of the runtime logic, you added another level of
indirection so people have to figure out exactly how 'HAS_LCD', etc.
get defined (not difficult but another level just the same).

 The HAS_XXX constructs are not new and have been used in other
 DaVinci code. Have a look at support for DM644x EVM  here:
 
 http://lxr.linux.no/linux+v2.6.31/arch/arm/mach-davinci/board-dm644x-evm.c#L609

Past mistakes are not valid justifications for future ones.  :)

Mark
--

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 2/7] Subscribes for USB resources for TI DM644x EVM platform.

2009-10-07 Thread Sergei Shtylyov

Hello.

Swaminathan S wrote:


This patch implements the support for USB VBUS, PHY control, DM644x USB memory
mapsi,


  Maps?


IRQ, USB Mode.  It initializes for a single instance of MUSB controller.

Signed-off-by: Swaminathan S swami.i...@ti.com
  

[...]

diff --git a/arch/arm/mach-davinci/include/mach/usb_davinci.h 
b/arch/arm/mach-davinci/include/mach/usb_davinci.h
new file mode 100644
index 000..02f8af7
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/usb_davinci.h
  


  Please don't create yet another header where mach/usb.h was 
intended to be used...



@@ -0,0 +1,41 @@
+/*
+ * This file contains the processor specific USB definitions
+ * of the TI DaVinci platforms.
+ *
+ * Copyright (C) 2009 Texas Instruments.


WBR, Sergei


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Initializing ramdisk

2009-10-07 Thread Tivy, Robert
Hi Folks,

A colleague is trying to increase the size of his ramdisk from 16MB to 24MB, 
and one of the steps he's taken is to increase the size for 'initrd' in 
bootargs:
bootargs=console=ttyS0,115200n8 root=/dev/ram initrd=0x8090,24M 
init=/bin/ash lpj=5000 mem=80M
bootcmd=bootm 0x8070
When doing so he gets the following error output:
RAMDISK: ext2 filesystem found at block 0
RAMDISK: image too big! (24576KiB/16384KiB)
RAMDISK: image too big! (24576KiB/16384KiB)
List of all partitions:
List of all partitions:
No filesystem could mount root, tried:
No filesystem could mount root, tried:  ext3 ext3 ext2 ext2 vfat vfat msdos 
msdos
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

It seems the kernel still thinks the ramdisk is 16MB and doesn't like being 
asked to initialize more than that (24MB).

Is there some other u-boot setting that needs to be done?

Thanks  Regards,

- Rob

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: Initializing ramdisk

2009-10-07 Thread Pedanekar, Hemant
Rob,

Make sure you have CONFIG_BLK_DEV_RAM_SIZE set to support 24MB+ ramdisk size in 
your kernel configuration.

-
Hemant


From: davinci-linux-open-source-bounces+hemantp=ti@linux.davincidsp.com 
[mailto:davinci-linux-open-source-bounces+hemantp=ti@linux.davincidsp.com] 
On Behalf Of Tivy, Robert
Sent: Thursday, October 08, 2009 6:45 AM
To: davinci-linux-open-source@linux.davincidsp.com
Subject: Initializing ramdisk

Hi Folks,

A colleague is trying to increase the size of his ramdisk from 16MB to 24MB, 
and one of the steps he's taken is to increase the size for 'initrd' in 
bootargs:
bootargs=console=ttyS0,115200n8 root=/dev/ram initrd=0x8090,24M 
init=/bin/ash lpj=5000 mem=80M
bootcmd=bootm 0x8070
When doing so he gets the following error output:
RAMDISK: ext2 filesystem found at block 0
RAMDISK: image too big! (24576KiB/16384KiB)
RAMDISK: image too big! (24576KiB/16384KiB)
List of all partitions:
List of all partitions:
No filesystem could mount root, tried:
No filesystem could mount root, tried:  ext3 ext3 ext2 ext2 vfat vfat msdos 
msdos
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

It seems the kernel still thinks the ramdisk is 16MB and doesn't like being 
asked to initialize more than that (24MB).

Is there some other u-boot setting that needs to be done?

Thanks  Regards,

- Rob

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: Initializing ramdisk

2009-10-07 Thread Brian G Rhodes

Brian G Rhodes wrote:

Pedanekar, Hemant wrote:


Rob,

 

Make sure you have CONFIG_BLK_DEV_RAM_SIZE set to support 24MB+ 
ramdisk size in your kernel configuration.


 



You can also specify ramdisk_blocksize=24000 in your bootargs.  The 
units are KiB.





My apologies. I meant ramdisk_size.


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source