Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus
Hello, MUSB PHY on OMAP3EVM Rev= E uses external Vbus supply to support 500mA of power.We need to program MUSB PHY to use external Vbus for this purpose. Adding 'extvbus' member in musb_config structure which should be set by all the boards where MUSB interface is using external Vbus supply. Ajay, How does the DRVVBUS bit behave on the OMAP3 EVM board on issuing the 'usb reset' command (with musb_cfg.extvbus being set)? OMAP3EVM doesn't use TPS PHY but it has ISP1507 PHY and uses external Vbus And so it needs extvbus programming (musb_cfg.extvbus =1)in OTG_CTRL register. As for as I know it is not needed for boards using usb PHY on TPS device. This post has a few more details, but in short it seems that DRVVBUS is automatically set by the TPS chip when doing the bus reset: Looks like TPS sets the extvbus and so musb_cfg.extvbus doesn't have Any effect. Ajay http://lists.denx.de/pipermail/u-boot/2011-June/095221.html (And indeed, on a board with *no* external vbus, setting musb_cfg.extvbus and reading from a memory stick works just fine.) I checked the u-boot in the current DVSDK (4.02.00.06) and the git repo for u-boot-ti and they all have the same construct. Thanks, Orjan -- Orjan Friberg FlatFrog Laboratories AB ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus
Hi, On 2011-07-05 13:15, Gupta, Ajay Kumar wrote: OMAP3EVM doesn't use TPS PHY but it has ISP1507 PHY and uses external Vbus And so it needs extvbus programming (musb_cfg.extvbus =1)in OTG_CTRL register. As for as I know it is not needed for boards using usb PHY on TPS device. Can you clarify what you mean by not needed for boards using usb PHY on TPS device? This comment was more for boards such as Beagle which uses TPS device and Uses internal charge pump of PHY. How does that differ from the ISP1507? From what I'm reading, the ISP1507 does have an integrated 5V charge pump. Or is it simply a matter of how the board is designed? Correct. OMAP3EVM (Rev-G) doesn't use internal charge pump but external Vbus and thus we need to tell the PHY about this using BUS_CTRL.EXTVBUS Register (Sorry I wrote OTG_CTRL wrongly in previous post) (On our custom board, we have added an external vbus supply to be able to draw 100 mA.) So it seems you are using PHY inside TPS659x but external Vbus for which I think you need to, 1. Explicitly set OTG_CTRL.D5 = 0 so that PHY doesn't drive 5V. 2. Do not set musb_cfg.extvbus I have not seen anyone with this option on TPS PHY so not sure of above Steps would work. Thanks, Ajay Thanks, Orjan -- Orjan Friberg FlatFrog Laboratories AB ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] USB cardreader issue
Hi All, I am trying to read images from SD cards attached to a USB card reader. usb start command shows errors as per logs copied below. Is there any known issue in supporting usb card readers In general or it's compatibility issue with few card readers? Regards, Ajay 1) Card reader - [A] == U-Boot usb start (Re)start USB... USB: scanning bus for devices... 1 USB Device(s) found scanning bus for storage devices... READ_CAP ERROR 1 Storage Device(s) found U-Boot usb tree Device Tree: 1 Mass Storage (12 Mb/s, 500mA) Generic USB2.0-CRW 2006041309210 U-Boot fatinfo usb 0:1 ** Can't read from device 0 ** ** Unable to use usb 0:1 for fatinfo ** U-Boot usb info 1: Mass Storage, USB Revision 2.0 - Generic USB2.0-CRW 2006041309210 - Class: (from Interface) Mass Storage - PacketSize: 64 Configurations: 1 - Vendor: 0x0bda Product 0x0158 Version 81.149 Configuration: 1 - Interfaces: 1 Bus Powered 500mA - String: CARD READER Interface: 0 - Alternate Setting 0, Endpoints: 2 - Class Mass Storage, Transp. SCSI, Bulk only - String: Bulk-In, Bulk-Out, Interface - Endpoint 1 Out Bulk MaxPacket 512 - Endpoint 2 In Bulk MaxPacket 512 2) Card reader - [B] == U-Boot # usb start (Re)start USB... USB: scanning bus for devices... 1 USB Device(s) found scanning bus for storage devices... Device NOT ready Request Sense returned 02 3A 00 1 Storage Device(s) found U-Boot # usb tree Device Tree: 1 Mass Storage (12 Mb/s, 100mA) Generic Mass Storage Device 058F312D81B U-Boot # usb info 1: Mass Storage, USB Revision 2.0 - Generic Mass Storage Device 058F312D81B - Class: (from Interface) Mass Storage - PacketSize: 64 Configurations: 1 - Vendor: 0x058f Product 0x6362 Version 1.38 Configuration: 1 - Interfaces: 1 Bus Powered 100mA Interface: 0 - Alternate Setting 0, Endpoints: 2 - Class Mass Storage, Transp. SCSI, Bulk only - Endpoint 1 Out Bulk MaxPacket 512 - Endpoint 2 In Bulk MaxPacket 512 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] USB cardreader issue
Hi, I am trying to read images from SD cards attached to a USB card reader. usb start command shows errors as per logs copied below. I tested with uboot version 2009.11 and will try with latest Uboot and update the results. Ajay Is there any known issue in supporting usb card readers In general or it's compatibility issue with few card readers? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4 v2] musb: MSC host support for AM35x
Hi, 2010/7/9 Ajay Kumar Gupta ajay.gu...@ti.com: Tested MSC Host on AM3517EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com --- drivers/usb/musb/Makefile | 1 + drivers/usb/musb/am35x.c | 118 +++ drivers/usb/musb/am35x.h | 94 ++ drivers/usb/musb/musb_udc.c | 2 + include/usb.h | 2 +- 5 files changed, 216 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/am35x.c create mode 100644 drivers/usb/musb/am35x.h Acked-by: Remy Bohmer li...@bohmer.net Remy, Please merge the patch set supporting AM3517 musb in your uboot-usb tree. Regards, Ajay ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4 v2] AM35X: Add musb support
Remy, Any comment on this patch set ? Regards, Ajay He sent me an e-mail offline. He is on vacation without Wifi and laptop. Thanks for updating on this. Regards, Ajay Sandeep ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4 v2] AM35X: Add musb support
These patches add support for musb in AM35x. Changes from v1: - Moved SCM definitions to am35x specific file am35x_def.h Patches have been created against uboot-ti/master tree (as on 9th July) but they also apply cleanly to both denx/master and uboot-usb/master as there is no interdependent changes. Remy, Any comment on this patch set ? Regards, Ajay Regards, Ajay Ajay Kumar Gupta (4): AM35x: Adding SCM general register definitions musb: MSC host support for AM35x musb: am35x: Workaround for fifo read issue AM3517EVM: musb: add usb config arch/arm/include/asm/arch-omap3/am35x_def.h | 52 + drivers/usb/musb/Makefile |1 + drivers/usb/musb/am35x.c| 150 +++ drivers/usb/musb/am35x.h| 94 + drivers/usb/musb/musb_core.c|6 + drivers/usb/musb/musb_udc.c |2 + include/configs/am3517_evm.h| 38 +++ include/usb.h |2 +- 8 files changed, 344 insertions(+), 1 deletions(-) create mode 100644 arch/arm/include/asm/arch-omap3/am35x_def.h create mode 100644 drivers/usb/musb/am35x.c create mode 100644 drivers/usb/musb/am35x.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
Hi, Adding general register structure of system control module (SCM) of AM35x. This would be required to access devconf2 and ip_sw_reset register in musb module. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com --- arch/arm/include/asm/arch-omap3/cpu.h | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/arch-omap3/cpu.h b/arch/arm/include/asm/arch-omap3/cpu.h index c072c27..773ea0c 100644 --- a/arch/arm/include/asm/arch-omap3/cpu.h +++ b/arch/arm/include/asm/arch-omap3/cpu.h @@ -483,4 +483,24 @@ struct pm { #define I2C_BASE2 (OMAP34XX_CORE_L4_IO_BASE + 0x72000) #define I2C_BASE3 (OMAP34XX_CORE_L4_IO_BASE + 0x6) +/* AM35x specific */ +#ifndef __KERNEL_STRICT_NAMES +#ifndef __ASSEMBLY__ +#define AM35X_SCM_GEN_BASE 0x48002270 +/* General register mappings of system control module */ +struct am35x_scm_general { + u32 res1[0xC4]; /* 0x000 - 0x30C */ + u32 devconf2; /* 0x310 */ + u32 devconf3; /* 0x314 */ + u32 res2[0x2]; /* 0x318 - 0x31C */ + u32 cba_priority; /* 0x320 */ + u32 lvl_intr_clr; /* 0x324 */ + u32 ip_sw_reset;/* 0x328 */ + u32 ipss_clk_ctrl; /* 0x32C */ +}; Shouldn't this structure be in a am35 specific header? AM35x is based on OMAP3x and moreover there is no AM35x specific File so I added them here. Do you want me to add a header for AM35x as arch/arm/include/asm/arch-omap3/am35x.h ? Thanks, Ajay +#define am35x_scm_general_regs ((struct am35x_scm_general *)AM35X_SCM_GEN_BASE) + +#endif /*__ASSEMBLY__ */ +#endif /* __KERNEL_STRICT_NAMES */ + #endif /* _CPU_H */ -- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
Hi Adding general register structure of system control module (SCM) of AM35x. This would be required to access devconf2 and ip_sw_reset register in musb module. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com --- arch/arm/include/asm/arch-omap3/cpu.h | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/arch-omap3/cpu.h b/arch/arm/include/asm/arch-omap3/cpu.h index c072c27..773ea0c 100644 --- a/arch/arm/include/asm/arch-omap3/cpu.h +++ b/arch/arm/include/asm/arch-omap3/cpu.h @@ -483,4 +483,24 @@ struct pm { #define I2C_BASE2 (OMAP34XX_CORE_L4_IO_BASE + 0x72000) #define I2C_BASE3 (OMAP34XX_CORE_L4_IO_BASE + 0x6) +/* AM35x specific */ +#ifndef __KERNEL_STRICT_NAMES +#ifndef __ASSEMBLY__ +#define AM35X_SCM_GEN_BASE 0x48002270 +/* General register mappings of system control module */ +struct am35x_scm_general { + u32 res1[0xC4]; /* 0x000 - 0x30C */ + u32 devconf2; /* 0x310 */ + u32 devconf3; /* 0x314 */ + u32 res2[0x2]; /* 0x318 - 0x31C */ + u32 cba_priority; /* 0x320 */ + u32 lvl_intr_clr; /* 0x324 */ + u32 ip_sw_reset;/* 0x328 */ + u32 ipss_clk_ctrl; /* 0x32C */ +}; Shouldn't this structure be in a am35 specific header? AM35x is based on OMAP3x and moreover there is no AM35x specific understood File so I added them here. Do you want me to add a header for AM35x as arch/arm/include/asm/arch-omap3/am35x.h ? Thanks, Ajay -- What about drivers/usb/musb/am35x.h which you just created in your patch set am35x_scm_general is a system register sets and can be used by non usb modules as well so I think drivers/usb/musb/am35x.h would not be a right place. Are you concerned of same name file instead? If so then we can have Different names for these files. Thanks, Ajay Thanks, Sandeep ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-boot: Beagle board as a USB Mass Storage Device Class
Hi, Thanks for your response. I want to tell few more things about our implementation. Actually we are planning to simulate (but not implement) the file system and implement the SCSI transparent command set decoder. When ever a file You can also use USB DFU for this where you can transfer files to RAM or NAND partitions. DFU is not yet supported in Denx's uboot tree but is Available in openmoko's tree [http://git.openmoko.org/?p=u-boot.git;a=summary]. You will have to port back DFU feature from openmoko to Denx's tree. Thanks for the hint Ajay. Let me add that DFU is also a standard protocol: http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf So many people will be able to enjoy this in addition to solving this very specific problem of Yogesh. Detlev, Actually I have ported DFU from openmoko to Denx tree and used it on OMAP3EVM. I hope it should work just fine on Beagle as well. Will it be ok if I submit those patches to Denx's tree? Is there anyone Already working on this? I have seen below page with the same proposal from Mike. http://elinux.org/CELF_Project_Proposal/Add_DFU_support_to_U-Boot Mike, Are you working on this? Regards, Ajay Cheers Detlev -- It's very important that you sleep because that's when your brain is garbage collecting. And a dream is if you are interrupted in the middle and have junk left in the registers. -- Gerald Sussman -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4 v2] musb: Add Phy programming for using external Vbus
+static inline u8 musb_read_ulpi_buscontrol(struct musb_regs *musbr) +{} probably want this to return 0 to avoid warnings, otherwise this looks good to me. thanks ! Sure, I will update and repost the patches. Thanks, Ajay -mike ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-boot: Beagle board as a USB Mass Storage Device Class
I want to make the Beagle board (with u-boot) to look like a USB Mass Storage Device when it is connected to the host PC. Can anyone suggest regarding the files that I need to update in u-boot code, to make the Beagle board look like a USB Mass Storage Device. This would require to add support for MSC gadget at drivers/usb/gadget/. You can refer kernel MSC gadget implementation at driver/usb/gadget/g_file_storage.c for this. -Ajay Regards, Yogesh ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] TI Davinci and MUSB
-Original Message- From: Neal Tew [mailto:lo...@mm.st] Sent: Friday, February 05, 2010 11:20 AM To: u-boot@lists.denx.de Cc: Gupta, Ajay Kumar Subject: Re: [U-Boot] TI Davinci and MUSB [5]? I don't think that's right. Look at the offsets. -Neal I've been trying to get usbtty working on a DM355 (still isn't working...) and ran into a bug(?). In drivers/usb/musb/davinci.h: struct davinci_usb_regs { u32 version; u32 ctrlr; u32 reserved[0x20]; u32 intclrr; u32 intmskr; u32 intmsksetr; }; Shouldn't this be reserved[0x20/4] ? Yes, this is a bug. Though the correct fix is, - u32 reserved[0x20]; + u32 reserved[5]; Opps, there are actually 32 intermediate register each of 32 bits. So the correct one is as Neal suggested. - u32 reserved[0x20]; + u32 reserved[020/4]; -Ajay Please refer musb Davinci (DM6446) document (page-74) at, http://focus.ti.com/lit/ug/sprue35f/sprue35f.pdf --4h CTRLR Control Register Section 4.1 8h STATR Status Register Section 4.2 10h RNDISR RNDIS Register Section 4.3 14h AUTOREQ Autorequest Register Section 4.4 20h INTSRCR USB Interrupt Source Register Section 4.5 24h INTSETR USB Interrupt Source Set Register Section 4.6 --28h INTCLRR USB Interrupt Source Clear Register -Ajay -- Neal Tew ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] TI Davinci and MUSB
-Original Message- From: Wolfgang Denk [mailto:w...@denx.de] Sent: Friday, February 05, 2010 12:12 PM To: Gupta, Ajay Kumar Cc: Neal Tew; u-boot@lists.denx.de Subject: Re: [U-Boot] TI Davinci and MUSB Dear Gupta, Ajay Kumar, In message 19f8576c6e063c45be387c64729e7394044a776...@dbde02.ent.ti.com you wrote: Opps, there are actually 32 intermediate register each of 32 bits. So the correct one is as Neal suggested. - u32 reserved[0x20]; + u32 reserved[020/4]; 0x20 / 4 = 8 020 / 4 = 4 It was typing mistake... Thanks, Ajay Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de One difference between a man and a machine is that a machine is quiet when well oiled. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4 v6] DA8xx: USB support
-Original Message- From: Gupta, Ajay Kumar Sent: Tuesday, December 22, 2009 10:41 AM To: u-boot@lists.denx.de Cc: li...@bohmer.net; Gupta, Ajay Kumar Subject: [PATCH 0/4 v6] DA8xx: USB support Hi, These patch set have been refreshed and created against mainline master branch. Remy, Please ignore this patch set as I forgot git add for main files Drivers/usb/musb/da8xx.c. Will correct it and submit it in few minutes. -Ajay Regards, Ajay Ajay Kumar Gupta (4): DA830: Add pinmux for USB0_DRVVBUS DA8xx: Add GPIO register definitions DA8xx: Add MUSB host support DA830: Add usb config board/davinci/da830evm/da830evm.c|8 ++ drivers/usb/musb/Makefile|1 + include/asm-arm/arch-davinci/gpio_defs.h | 14 +++ include/configs/da830evm.h | 38 ++ include/usb.h|2 +- 5 files changed, 57 insertions(+), 6 deletions(-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] omap3evm: Add board revision function
Hi, -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Gupta, Ajay Kumar Sent: Friday, November 13, 2009 3:31 PM To: u-boot@lists.denx.de Cc: Hiremath, Vaibhav Subject: Re: [U-Boot] [PATCH] omap3evm: Add board revision function snip... /* * Routine: board_init * Description: Early hardware init. @@ -45,6 +72,8 @@ int board_init(void) { DECLARE_GLOBAL_DATA_PTR; + omap3_evm_get_revision(); + This must be called after setup_net_chip() else ethernet id Read statement wouldn't work. I will resubmit this patch. Regards, ajay gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ /* board id for Linux */ gd-bd-bi_arch_number = MACH_TYPE_OMAP3EVM; diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h index 37da29d..e2581f6 100644 --- a/board/ti/evm/evm.h +++ b/board/ti/evm/evm.h @@ -33,6 +33,20 @@ const omap3_sysinfo sysinfo = { #endif }; +/* + * OMAP35x EVM revision + * Run time detection of EVM revision is done by reading Ethernet + * PHY ID - + * GEN_1 = 0x0115 + * GEN_2 = 0x9220 + */ +enum { + OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */ + OMAP3EVM_BOARD_GEN_2, /* EVM Rev = Rev E */ +}; + +u8 get_omap3_evm_rev(void); + static void setup_net_chip(void); /* -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support
Remy, -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Gupta, Ajay Kumar Sent: Tuesday, November 17, 2009 7:35 PM To: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support Remy, Any comment on DA8xx USB support patches? These patch set depends on DA8xx base support patches which are available only on uboot-ti tree. Any comment ? Regards, Ajay Regards, Ajay -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Gupta, Ajay Kumar Sent: Sunday, November 15, 2009 11:19 AM To: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support Hi, Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile snip.. + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); '' is missing, will resubmit the patch set. Regards, Ajay + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization +for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_clr); + writel(0, da8xx_usb_regs-eoi); +} diff --git a/drivers/usb/musb/da8xx.h b/drivers/usb/musb/da8xx.h new file mode 100644 index 000..93234f0 --- /dev/null +++ b/drivers/usb/musb/da8xx.h @@ -0,0 +1,103 @@ +/* + * da8xx.h -- TI's DA8xx platform specific usb wrapper definitions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.h + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __DA8XX_MUSB_H__ +#define __DA8XX_MUSB_H__ + +#include asm/arch/hardware.h +#include asm/arch/gpio_defs.h +#include musb_core.h + +/* Base address of da8xx usb0 wrapper */ #define DA8XX_USB_OTG_BASE +0x01E0 + +/* Base address of da8xx musb core */ #define +DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400) + +/* Timeout for DA8xx usb module */ +#define DA8XX_USB_OTG_TIMEOUT 0x3FF + +/* + * DA8xx platform USB wrapper register overlay. + */ +struct da8xx_usb_regs { + dv_reg revision; + dv_reg control; + dv_reg status; + dv_reg emulation; + dv_reg mode; + dv_reg autoreq; + dv_reg srpfixtime; + dv_reg teardown; + dv_reg intsrc; + dv_reg intsrc_set; + dv_reg intsrc_clr; + dv_reg intmsk; + dv_reg intmsk_set; + dv_reg intmsk_clr; + dv_reg intsrcmsk; + dv_reg eoi; + dv_reg intvector; + dv_reg grndis_size[4]; +}; + +#define da8xx_usb_regs ((struct da8xx_usb_regs +*)DA8XX_USB_OTG_BASE) + +/* DA8XX interrupt bits definitions */ +#define DA8XX_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */ +#define DA8XX_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */ +#define DA8XX_USB_TXINT_SHIFT
Re: [U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support
Remy, Any comment on DA8xx USB support patches? These patch set depends on DA8xx base support patches which are available only on uboot-ti tree. Regards, Ajay -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Gupta, Ajay Kumar Sent: Sunday, November 15, 2009 11:19 AM To: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support Hi, Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile snip.. + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); '' is missing, will resubmit the patch set. Regards, Ajay + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_clr); + writel(0, da8xx_usb_regs-eoi); +} diff --git a/drivers/usb/musb/da8xx.h b/drivers/usb/musb/da8xx.h new file mode 100644 index 000..93234f0 --- /dev/null +++ b/drivers/usb/musb/da8xx.h @@ -0,0 +1,103 @@ +/* + * da8xx.h -- TI's DA8xx platform specific usb wrapper definitions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.h + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __DA8XX_MUSB_H__ +#define __DA8XX_MUSB_H__ + +#include asm/arch/hardware.h +#include asm/arch/gpio_defs.h +#include musb_core.h + +/* Base address of da8xx usb0 wrapper */ +#define DA8XX_USB_OTG_BASE 0x01E0 + +/* Base address of da8xx musb core */ +#define DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400) + +/* Timeout for DA8xx usb module */ +#define DA8XX_USB_OTG_TIMEOUT 0x3FF + +/* + * DA8xx platform USB wrapper register overlay. + */ +struct da8xx_usb_regs { + dv_reg revision; + dv_reg control; + dv_reg status; + dv_reg emulation; + dv_reg mode; + dv_reg autoreq; + dv_reg srpfixtime; + dv_reg teardown; + dv_reg intsrc; + dv_reg intsrc_set; + dv_reg intsrc_clr; + dv_reg intmsk; + dv_reg intmsk_set; + dv_reg intmsk_clr; + dv_reg intsrcmsk; + dv_reg eoi; + dv_reg intvector; + dv_reg grndis_size[4]; +}; + +#define da8xx_usb_regs ((struct da8xx_usb_regs *)DA8XX_USB_OTG_BASE) + +/* DA8XX interrupt bits definitions */ +#define DA8XX_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */ +#define DA8XX_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */ +#define DA8XX_USB_TXINT_SHIFT0 +#define DA8XX_USB_RXINT_SHIFT8 + +#define DA8XX_USB_USBINT_MASK0x01ff/* 8 Mentor, DRVVBUS */ +#define DA8XX_USB_TXINT_MASK \ + (DA8XX_USB_TX_ENDPTS_MASK DA8XX_USB_TXINT_SHIFT) +#define DA8XX_USB_RXINT_MASK \ + (DA8XX_USB_RX_ENDPTS_MASK DA8XX_USB_RXINT_SHIFT) + +/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ +#define CFGCHIP2_PHYCLKGD (1 17
Re: [U-Boot] [PATCH 3/4 v4] DA8xx: Add MUSB host support
Hi, -Original Message- From: Gupta, Ajay Kumar Sent: Sunday, November 15, 2009 11:04 AM To: u-boot@lists.denx.de Cc: li...@bohmer.net; tom@windriver.com; Gupta, Ajay Kumar; Subbrathnam, Swaminathan Subject: [PATCH 3/4 v4] DA8xx: Add MUSB host support Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile snip.. + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); '' is missing, will resubmit the patch set. Regards, Ajay + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_clr); + writel(0, da8xx_usb_regs-eoi); +} diff --git a/drivers/usb/musb/da8xx.h b/drivers/usb/musb/da8xx.h new file mode 100644 index 000..93234f0 --- /dev/null +++ b/drivers/usb/musb/da8xx.h @@ -0,0 +1,103 @@ +/* + * da8xx.h -- TI's DA8xx platform specific usb wrapper definitions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.h + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __DA8XX_MUSB_H__ +#define __DA8XX_MUSB_H__ + +#include asm/arch/hardware.h +#include asm/arch/gpio_defs.h +#include musb_core.h + +/* Base address of da8xx usb0 wrapper */ +#define DA8XX_USB_OTG_BASE 0x01E0 + +/* Base address of da8xx musb core */ +#define DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400) + +/* Timeout for DA8xx usb module */ +#define DA8XX_USB_OTG_TIMEOUT 0x3FF + +/* + * DA8xx platform USB wrapper register overlay. + */ +struct da8xx_usb_regs { + dv_reg revision; + dv_reg control; + dv_reg status; + dv_reg emulation; + dv_reg mode; + dv_reg autoreq; + dv_reg srpfixtime; + dv_reg teardown; + dv_reg intsrc; + dv_reg intsrc_set; + dv_reg intsrc_clr; + dv_reg intmsk; + dv_reg intmsk_set; + dv_reg intmsk_clr; + dv_reg intsrcmsk; + dv_reg eoi; + dv_reg intvector; + dv_reg grndis_size[4]; +}; + +#define da8xx_usb_regs ((struct da8xx_usb_regs *)DA8XX_USB_OTG_BASE) + +/* DA8XX interrupt bits definitions */ +#define DA8XX_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */ +#define DA8XX_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */ +#define DA8XX_USB_TXINT_SHIFT 0 +#define DA8XX_USB_RXINT_SHIFT 8 + +#define DA8XX_USB_USBINT_MASK 0x01ff/* 8 Mentor, DRVVBUS */ +#define DA8XX_USB_TXINT_MASK \ + (DA8XX_USB_TX_ENDPTS_MASK DA8XX_USB_TXINT_SHIFT) +#define DA8XX_USB_RXINT_MASK \ + (DA8XX_USB_RX_ENDPTS_MASK DA8XX_USB_RXINT_SHIFT) + +/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ +#define CFGCHIP2_PHYCLKGD(1 17) +#define CFGCHIP2_VBUSSENSE (1 16) +#define CFGCHIP2_RESET (1 15) +#define CFGCHIP2_OTGMODE (3 13) +#define CFGCHIP2_NO_OVERRIDE (0 13) +#define CFGCHIP2_FORCE_HOST (1 13) +#define
Re: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support
Hi, -Original Message- From: Paulraj, Sandeep Sent: Friday, November 13, 2009 5:36 PM To: Gupta, Ajay Kumar; u-boot@lists.denx.de; Tom Cc: Subbrathnam, Swaminathan; Wolfgang Denk Subject: RE: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support Ajay, We have a problem with your licensing Subject: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 138 + drivers/usb/musb/da8xx.h | 79 ++ include/usb.h |3 +- 4 files changed, 220 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile @@ -27,6 +27,7 @@ LIB := $(obj)libusb_musb.a COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o COBJS-$(CONFIG_USB_DAVINCI) += davinci.o +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c new file mode 100644 index 000..5b02e33 --- /dev/null +++ b/drivers/usb/musb/da8xx.c @@ -0,0 +1,138 @@ +/* + * da8xx.c - TI's DA8xx platform specific usb wrapper functions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.c + * + * Copyright (c) 2009 Texas Instruments Incorporated + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the license found in the file + * named COPYING that should have accompanied this file. + * + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. This is not going to work. I have discussed offline with Wolfgang and Tom. This is going to probably get a NAK from both of them unless they have had a change of heart in the last month. I know what you have done is in response to a possible U-Boot moving to GPL v3. Hi Sandeep, I will discuss it internally and would post updated version. Regards, Ajay + * + */ +#include common.h +#include asm/arch/hardware.h +#include asm/arch/gpio_defs.h + +#include da8xx.h + +/* MUSB platform configuration */ +struct musb_config musb_cfg = { + (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE, + DA8XX_USB_OTG_TIMEOUT, + 0 +}; + +/* + * This function enables VBUS by driving the GPIO Bank4 Pin 15 high. + */ +static void enable_vbus(void) +{ + u32 value; + + /* configure GPIO bank4 pin 15 in output direction */ + value = readl(davinci_gpio_bank45-dir); + writel((value (~DA8XX_USB_VBUS_GPIO)), davinci_gpio_bank45-dir); + + /* set GPIO bank4 pin 15 high to drive VBUS */ + value = readl(davinci_gpio_bank45-set_data); + writel((value | DA8XX_USB_VBUS_GPIO), davinci_gpio_bank45- set_data); +} + +/* + * Enable the usb0 phy. This initialization procedure is explained in + * the DA8xx USB user guide document. + */ +static u8 phy_on(void) +{ + u32 timeout; + u32 cfgchip2; + + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + + cfgchip2 = ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN | + CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ); + cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON | + CFGCHIP2_REFFREQ_24MHZ; + + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); + + /* wait until the usb phy pll locks */ + timeout = musb_cfg.timeout; + while (timeout--) + if (readl(davinci_syscfg_regs-cfgchip2) CFGCHIP2_PHYCLKGD) + return 1; + + /* USB phy was not turned on */ + return 0; +} + +/* + * Disable the usb phy + */ +static void phy_off(void) +{ + u32 cfgchip2; + + /* +* Power down the on-chip PHY. +*/ + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + cfgchip2 = ~CFGCHIP2_PHY_PLLON; + cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN; + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); +} + +/* + * This function performs DA8xx platform specific initialization for usb0. + */ +int musb_platform_init(void) +{ + u32 revision; + + /* enable psc for usb2.0 */ + lpsc_on(33); + + /* enable usb vbus */ + enable_vbus(); + + /* reset the controller */ + writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG)); + udelay(5000); + + /* start the on-chip usb phy
Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support
Hi, Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- snip.. --- a/include/usb.h +++ b/include/usb.h @@ -183,7 +183,8 @@ struct usb_device { #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \ defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \ defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \ + defined(CONFIG_USB_DA8XX) These are aligned incorrectly (should be 4 spaces rather than a tab) It was originally with tabs only. Are you suggesting to change all 5 lines to match the alignment ? Tom, What do you think on this one? -Ajay ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support
Hi, Hi, Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- snip.. --- a/include/usb.h +++ b/include/usb.h @@ -183,7 +183,8 @@ struct usb_device { #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \ defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \ defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \ + defined(CONFIG_USB_DA8XX) These are aligned incorrectly (should be 4 spaces rather than a tab) It was originally with tabs only. Are you suggesting to change all 5 lines to match the alignment ? Tom, What do you think on this one? In general tabs are preferred but I would like to review the entire patchset. When you make changes to a subset of the patches, you must repost the entire patchset. Please repost the entire patchset. Ok sure. Shall I post this patch with tabs or with 4-spaces as Nick suggested ? Regards, Ajay Tom -Ajay ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] DA830: Add usb config
-Original Message- From: Nick Thompson [mailto:nick.thomp...@gefanuc.com] Sent: Thursday, November 12, 2009 10:25 PM To: Gupta, Ajay Kumar Cc: u-boot@lists.denx.de; Subbrathnam, Swaminathan Subject: Re: [PATCH 3/3] DA830: Add usb config On 12/11/09 15:39, Ajay Kumar Gupta wrote: Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- include/configs/da830evm.h | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h index 38e2ce1..52e6473 100644 --- a/include/configs/da830evm.h +++ b/include/configs/da830evm.h @@ -149,6 +149,11 @@ #define CONFIG_SYS_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED #endif +/*==*/ +/* USB configuration */ +/*==*/ Block comments should be in this format: /* * USB configuration */ Thanks, I will update and post v2. Regards, Ajay Thanks, Nick. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS
-Original Message- From: Paulraj, Sandeep Sent: Thursday, November 12, 2009 10:00 PM To: Tom; Nick Thompson Cc: Gupta, Ajay Kumar; u-boot@lists.denx.de; Subbrathnam, Swaminathan Subject: RE: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS Paulraj, Sandeep wrote: Ajay Kumar Gupta wrote: USB0_DRVVBUS pinmux configuration is required for USB functinality in uboot. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- This patch set is created against Nick Thompson's latest patch set (v5) on DA8xx support and another patch from him on Davinci pinmux. [Davinci: add a pin multiplexer configuration API] It is difficult to review code that is dependent on other outstanding patches. The base DA8xx support will be in arm-ti branch shortly. Please rebase these patches when this happens and resubmit. Tom I think he might have added it locally and then made his patches. So he might not have to rebase. Without Nick's patches da830evm.c would not even exist :-) My issue is not with how development continues, it is with how patches are reviewed. To really review this patchset someone would need to apply the pin mux patch, the the 8xx patch set, then this set. Reviewing patches against outstanding patches does not scale and should be avoided. Tom Not any more :-) Take a look at http://git.denx.de/?p=u-boot/u-boot- ti.git;a=shortlog;h=refs/heads/master I have tested some other DaVincs SOCs as well after adding these patches and they seem to be working fine as of now. Lets continue the review process for the USB support. I had actually applied all dependent patches and then created the USB patches and tested. So it removes the rebase issue. Regards, Ajay Thanks, Sandeep ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/8] OMAP3 Add usb device support
Tom, From: Tom Rix Tom.Rix at windriver.com Subject: [PATCH 4/8] OMAP3 Add usb device support Newsgroups: gmane.comp.boot-loaders.u-boot Date: 2009-09-28 16:37:25 GMT (4 weeks, 12 hours and 29 minutes ago) This change adds the usb device support for musb. Omap3 platform support added at the same level as davinci. The interface for usbtty to use the musb device support was added. Verified on omap3 beagle, zoom1 and zoom2. Signed-off-by: Tom Rix Tom.Rix at windriver.com --- drivers/serial/usbtty.h | 2 + drivers/usb/musb/Makefile | 2 + drivers/usb/musb/musb_core.c | 8 +- drivers/usb/musb/musb_core.h | 40 ++ drivers/usb/musb/musb_debug.h | 205 + drivers/usb/musb/musb_udc.c | 963 + drivers/usb/musb/omap3.c | 129 ++ drivers/usb/musb/omap3.h | 48 ++ include/usb.h | 3 +- include/usb/musb_udc.h | 54 +++ 10 files changed, 1451 insertions(+), 3 deletions(-) create mode 100644 drivers/usb/musb/musb_debug.h create mode 100644 drivers/usb/musb/musb_udc.c create mode 100644 drivers/usb/musb/omap3.c create mode 100644 drivers/usb/musb/omap3.h create mode 100644 include/usb/musb_udc.h snip .. .. +int musb_platform_init(void) +{ + int ret = -1; + + if (platform_needs_initialization) { + u32 stdby; + + if (twl4030_usb_ulpi_init()) { + serial_printf(ERROR: %s Could not initialize PHY\n, + __PRETTY_FUNCTION__); + goto end; + } OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required. Can we move this within #ifdef like, #ifndef CONFIG_OMAP3_EVM + if (twl4030_usb_ulpi_init()) { ... ... #endif -Ajay + + otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE; + + /* Set OTG to always be on */ + writel(OMAP3_OTG_SYSCONFIG_NO_STANDBY_MODE | + OMAP3_OTG_SYSCONFIG_NO_IDLE_MODE, otg-sysconfig); + + /* Set the interface */ + writel(OMAP3_OTG_INTERFSEL_OMAP, otg-interfsel); + + /* Clear force standby */ + stdby = readl(otg-forcestdby); + stdby = ~OMAP3_OTG_FORCESTDBY_STANDBY; + writel(stdby, otg-forcestdby); + + platform_needs_initialization = 0; + } + + ret = platform_needs_initialization; +end: + return ret; + +} + + +/* UDC level routines */ +void udc_irq(void); +void udc_set_nak(int ep_num); +void udc_unset_nak(int ep_num); +int udc_endpoint_write(struct usb_endpoint_instance *endpoint); +void udc_setup_ep(struct usb_device_instance *device, unsigned int id, + struct usb_endpoint_instance *endpoint); +void udc_connect(void); +void udc_disconnect(void); +void udc_enable(struct usb_device_instance *device); +void udc_disable(void); +void udc_startup_events(struct usb_device_instance *device); +int udc_init(void); + +/* usbtty */ +#ifdef CONFIG_USB_TTY + +#define EP0_MAX_PACKET_SIZE 64 /* MUSB_EP0_FIFOSIZE */ +#define UDC_INT_ENDPOINT 1 +#define UDC_INT_PACKET_SIZE 64 +#define UDC_OUT_ENDPOINT 2 +#define UDC_OUT_PACKET_SIZE 64 +#define UDC_IN_ENDPOINT 3 +#define UDC_IN_PACKET_SIZE 64 +#define UDC_BULK_PACKET_SIZE 64 + +#endif /* CONFIG_USB_TTY */ + +#endif /* __MUSB_UDC_H__ */ + -- 1.6.0.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/8] OMAP3 beagle Add usbtty configuration
Tom, From: Tom Rix Tom.Rix at windriver.com Subject: [PATCH 6/8] OMAP3 beagle Add usbtty configuration Newsgroups: gmane.comp.boot-loaders.u-boot Date: 2009-09-28 16:37:27 GMT (4 weeks, 12 hours and 41 minutes ago) The primary console of beagle is the serial header. A secondary console is to use the usbtty. The user can set this manually by doing setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty saveenv usbtty will be usable by accessing the /dev/ttyACM0 on a linux host. Signed-off-by: Tom Rix Tom.Rix at windriver.com --- include/configs/omap3_beagle.h | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 55eeb94..253cdba 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -98,6 +98,21 @@ #define CONFIG_OMAP3_MMC 1 #define CONFIG_DOS_PARTITION 1 +/* USB */ +#define CONFIG_MUSB_UDC 1 +#define CONFIG_USB_OMAP3 1 +#define CONFIG_TWL4030_USB 1 + +/* USB device configuration */ +#define CONFIG_USB_DEVICE1 +#define CONFIG_USB_TTY 1 +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +/* Change these to suit your needs */ +#define CONFIG_USBD_VENDORID 0x0451 +#define CONFIG_USBD_PRODUCTID0x5678 +#define CONFIG_USBD_MANUFACTURER Texas Instruments +#define CONFIG_USBD_PRODUCT_NAME Beagle + We can either define CONFIG_MUSB_UDC or CONFIG_MUSB_HCD (host support), so I think it's better to move host and device specific definitions within CONFIG_MUSB_UDC or CONFIG_MUSB_HCD. #ifdef CONFIG_USB_OMAP3 #ifdef CONFIG_MUSB_HCD here define all host specific definitions #endif #ifdef CONFIG_MUSB_UDC here define all device specific definitions #endif #endif /* CONFIG_USB_OMAP3 */ This change would make it easier to test Host or device functionalities. -Ajay /* commands to include */ #include config_cmd_default.h @@ -164,6 +179,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ loadaddr=0x8200\0 \ + usbtty=cdc_acm\0 \ console=ttyS2,115200n8\0 \ videomode=1024x768 at 60,vxres=1024,vyres=768\0 \ videospec=omapfb:vram:2M,vram:4M\0 \ -- 1.6.0.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [UBOOT] MUSB: query
Hi, I don't see MUSB support in uboot for OMAP3 platforms though a few patches supporting MUSB are available in Sakoman's tree (omap-dev-usb branch) since Feb-09. What is the current status on this? I saw some long discussion on MUSB Patches specially for clock changes. Is someone working on this and planning to push those patches to Denx's tree? If not then I would be sending the refreshed patches for OMAP3EVM. Regards, Ajay ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot