AM35X: Add musb support
Subsystems (3)
v2 cover AM35X: Add musb support
Remy,
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.
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
PATCH v2 1/4 AM35x: Adding SCM general register definitions
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.
--- arch/arm/include/asm/arch-omap3/am35x_def.h | 52 +++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-omap3/am35x_def.h
arch/arm/include/asm/arch-omap3/am35x_def.h new file +52 -0
@@ -0,0 +1,52 @@ +/* +* am35x_def.h - TI's AM35x specific definitions. +* +* Based on arch/arm/include/asm/arch-omap3/cpu.h +* +* Author: Ajay Kumar Gupta <[email protected]> +* +* Copyright (c) 2010 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 _AM35X_DEF_H_ +#define _AM35X_DEF_H_ + +#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) +#include <asm/types.h> +#endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */ + +#ifndef __KERNEL_STRICT_NAMES +#ifndef __ASSEMBLY__ + +/* General register mappings of system control module */ +#define AM35X_SCM_GEN_BASE 0x48002270 +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 */ +}; +#define am35x_scm_general_regs ((struct am35x_scm_general *)AM35X_SCM_GEN_BASE) + +#endif /*__ASSEMBLY__ */ +#endif /* __KERNEL_STRICT_NAMES */ + +#endif /* _AM35X_DEF_H_ */
Signature · 1 line
1.6.2.4
PATCH v2 2/4 musb: MSC host support for AM35x
Tested MSC Host on AM3517EVM.
--- 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
drivers/usb/musb/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_USB_BLACKFIN) += blackfin_usb.o COBJS-$(CONFIG_USB_DAVINCI) += davinci.o COBJS-$(CONFIG_USB_OMAP3) += omap3.o COBJS-$(CONFIG_USB_DA8XX) += da8xx.o +COBJS-$(CONFIG_USB_AM35X) += am35x.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/usb/musb/am35x.c new file +118 -0
118 lines not on this page · raw message
drivers/usb/musb/am35x.h new file +94 -0
94 lines not on this page · raw message
drivers/usb/musb/musb_udc.c +2 -0
@@ -57,6 +57,8 @@#include "musb_core.h" #if defined(CONFIG_USB_OMAP3 )#include "omap3.h" +#elif defined(CONFIG_USB_AM35X ) +#include "am35x.h" #elif defined(CONFIG_USB_DAVINCI )#include "davinci.h" #endif
include/usb.h +1 -1
@@ -133,7 +133,7 @@ struct usb_device {defined (CONFIG_USB_SL811HS ) ||defined (CONFIG_USB_ISP116X_HCD ) || \defined (CONFIG_USB_R8A66597_HCD ) ||defined (CONFIG_USB_DAVINCI ) || \defined (CONFIG_USB_OMAP3 ) ||defined (CONFIG_USB_DA8XX ) || \ - defined(CONFIG_USB_BLACKFIN) + defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)int usb_lowlevel_init (void );int usb_lowlevel_stop (void );
Signature · 1 line
1.6.2.4
PATCH v2 3/4 musb: am35x: Workaround for fifo read issue
AM35x supports only 32bit read operations so we need to have workaround for 8bit and 16bit read operations.
--- drivers/usb/musb/am35x.c | 32 ++++++++++++++++++++++++++++++++ drivers/usb/musb/musb_core.c | 6 ++++++ 2 files changed, 38 insertions(+), 0 deletions(-)
drivers/usb/musb/am35x.c +32 -0
@@ -116,3 +116,35 @@ void musb_platform_deinit(void)/* Turn off the phy */ phy_off (); } + +/* +* This function reads data from endpoint fifo for AM35x +* which supports only 32bit read operation. +* +* ep - endpoint number +* length - number of bytes to read from FIFO +* fifo_data - pointer to data buffer into which data is read +*/ +__attribute__((weak)) +void read_fifo (u8 ep,u32 length,void *fifo_data) +{ +u8 *data = (u8 *)fifo_data; +u32 val; +int i; + +/* select the endpoint index */ +writeb (ep, &musbr->index); + +if (length >4 ) { +for (i =0 ; i < (length >>2 ); i++) { + val =readl (&musbr->fifox[ep]); +memcpy (data, &val,4 ); + data +=4 ; + } + length %=4 ; + } +if (length >0 ) { + val =readl (&musbr->fifox[ep]); +memcpy (data, &val, length); + } +}
drivers/usb/musb/musb_core.c +6 -0
@@ -142,6 +142,11 @@ void write_fifo(u8 ep, u32 length, void *fifo_data) }/* +* AM35x supports only 32bit read operations so +* use seperate read_fifo() function for it. +*/ +#ifndef CONFIG_USB_AM35X +/* * This function reads data from endpoint fifo * * ep - endpoint number
@@ -160,3 +165,4 @@ void read_fifo(u8 ep, u32 length, void *fifo_data)while (length--) *data++ = readb(&musbr->fifox[ep]); } +#endif /* CONFIG_USB_AM35X */
Signature · 1 line
1.6.2.4
PATCH v2 4/4 AM3517EVM: musb: add usb config
Enabling USB HOST in defconfig.
--- include/configs/am3517_evm.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-)
include/configs/am3517_evm.h +38 -0
@@ -99,6 +99,44 @@#define CONFIG_OMAP3_MMC 1#define CONFIG_DOS_PARTITION 1 +/* +* USB configuration +* Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard +* Enable CONFIG_MUSB_UDC for Device functionalities. +*/ +#define CONFIG_USB_AM35X 1 +#define CONFIG_MUSB_HCD 1 + +#ifdef CONFIG_USB_AM35X + +#ifdef CONFIG_MUSB_HCD +#define CONFIG_CMD_USB + +#define CONFIG_USB_STORAGE +#define CONGIG_CMD_STORAGE +#define CONFIG_CMD_FAT + +#ifdef CONFIG_USB_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_PREBOOT "usb start" +#endif /* CONFIG_USB_KEYBOARD */ + +#endif /* CONFIG_MUSB_HCD */ + +#ifdef CONFIG_MUSB_UDC +/* USB device configuration */ +#define CONFIG_USB_DEVICE 1 +#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_PRODUCTID 0x5678 +#define CONFIG_USBD_MANUFACTURER "Texas Instruments" +#define CONFIG_USBD_PRODUCT_NAME "AM3517EVM" +#endif /* CONFIG_MUSB_UDC */ + +#endif /* CONFIG_USB_AM35X */ +/* commands to include */ #include <config_cmd_default.h>
Signature · 1 line
1.6.2.4
PATCH v2 3/4 musb: am35x: Workaround for fifo read issue
In reply to Ajay Kumar GuptaHi,
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 8 lines
AM35x supports only 32bit read operations so we need to have workaround for 8bit and 16bit read operations.
Signed-off-by Ajay Kumar Gupta <[email protected]>---
?drivers/usb/musb/am35x.c ? ? | ? 32 ++++++++++++++++++++++++++++++++ ?drivers/usb/musb/musb_core.c | ? ?6 ++++++
?2 files changed, 38 insertions(+), 0 deletions(-)
PATCH v2 2/4 musb: MSC host support for AM35x
In reply to Ajay Kumar GuptaHi,
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 4 lines
Tested MSC Host on AM3517EVM.
Signed-off-by Ajay Kumar Gupta <[email protected]>---
Quoted 8 lines
?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 100644drivers/usb/musb/am35x.h
Gupta
PATCH v2 2/4 musb: MSC host support for AM35x
Hi,
Quoted 8 lines
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 6 lines
Tested MSC Host on AM3517EVM.
Signed-off-by Ajay Kumar Gupta <[email protected]>---
?drivers/usb/musb/Makefile ? | ? ?1 +
?drivers/usb/musb/am35x.c ? ?| ?118+++++++++++++++++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 6 lines
?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 100644drivers/usb/musb/am35x.hAcked-by Remy Bohmer <[email protected]>
Remy,
Please merge the patch set supporting AM3517 musb in your
uboot-usb tree.
Regards,
Ajay
PATCH v2 2/4 musb: MSC host support for AM35x
In reply to Remy BohmerDear Remy Bohmer,
Quoted 15 lines · In message <[email protected]> you…
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 12 lines
Tested MSC Host on AM3517EVM.
Signed-off-by Ajay Kumar Gupta <[email protected]>--- 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
Quoted 1 line
Acked-by Remy Bohmer <[email protected]>
You ACK these? I would expect they go in through the USB repository. What is your expectation - who should apply these patches?
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de When all is said and done, more is said than done.
PATCH v2 2/4 musb: MSC host support for AM35x
Hi Wolfgang,
2010/8/8 Wolfgang Denk <[email protected]>:
Quoted 18 lines
Dear Remy Bohmer,
Quoted 15 lines · In message <[email protected]> you…
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 12 lines
Tested MSC Host on AM3517EVM.
Signed-off-by Ajay Kumar Gupta <[email protected]>---
?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 100644drivers/usb/musb/am35x.h
Quoted 4 lines
Quoted 1 line
Acked-by Remy Bohmer <[email protected]>You ACK these? I would expect they go in through the USB repository. What is your expectation - who should apply these patches?
I guess I was not fully awake when I sent that, I thought it was part of a bigger series that should go in the u-boot-ti tree... Anyway, I applied it to the u-boot-usb tree already a week ago...
Kind regards,
Remy
Gupta
v2 cover AM35X: Add musb support
In reply to Ajay Kumar GuptaQuoted 7 lines
These patches add support for musb in AM35x.
Changes from v1:
- Moved SCM definitions to am35x specific fileam35x_def.hPatches 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
Quoted 23 lines
Regards,
AjayAjay 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 configarch/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
Paulraj
v2 cover AM35X: Add musb support
Quoted 10 lines
Quoted 9 lines
These patches add support for musb in AM35x.
Changes from v1:
- Moved SCM definitions to am35x specific fileam35x_def.hPatches 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.
Quoted 5 lines
Remy,
Any comment on this patch set ?Regards,
Ajay
He sent me an e-mail offline.
He is on vacation without Wifi and laptop.
Sandeep
Gupta
v2 cover AM35X: Add musb support
Quoted 9 lines
Quoted 5 lines
Remy,
Any comment on this patch set ?Regards,
AjayHe sent me an e-mail offline.
He is on vacation without Wifi and laptop.
Thanks for updating on this.
Regards,
Ajay
Quoted 2 lines
Sandeep
v2 cover AM35X: Add musb support
In reply to Ajay Kumar GuptaHi,
2010/7/9 Ajay Kumar Gupta <[email protected]>:
Quoted 27 lines
Remy,
These patches add support for musb in AM35x.
Changes from v1:
? ? ? ?- Moved SCM definitions to am35x specific fileam35x_def.hPatches 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.
Regards,
AjayAjay 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 +-
Quoted 4 lines
?8 files changed, 344 insertions(+), 1 deletions(-) ?create mode 100644
arch/arm/include/asm/arch-omap3/am35x_def.h?create mode 100644drivers/usb/musb/am35x.c
?create mode 100644drivers/usb/musb/am35x.h
Applied to u-boot-usb master.
Thanks.
Remy