From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/7] ehci-omap: Clean up added ehci-omap.c
Date: Mon, 06 Feb 2012 13:26:44 +0200 [thread overview]
Message-ID: <4F2FB8F4.2080407@compulab.co.il> (raw)
In-Reply-To: <1328276312-30153-3-git-send-email-govindraj.raja@ti.com>
On 02/03/12 15:38, Govindraj.R wrote:
> From: "Govindraj.R" <govindraj.raja@ti.com>
>
> Clean up added ehci-omap.c and make it generic for re-use across
> omap-soc having same ehci ip block. Also pass the modes to be configured
> from board file and configure the ports accordingly. All usb layers
> are not cache aligned, till then keep cache off for usb ops as ehci will use
> internally dma for all usb ops.
>
> * Add a generic common header ehci-omap.h having common ip block
> data and reg shifts.
> * Rename and modify ehci-omap3 to ehci.h retain only conflicting
> sysc reg shifts remove others and move to common header file.
>
> Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Some final neats below, otherwise:
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> arch/arm/include/asm/arch-omap3/ehci.h | 55 +++++++
> arch/arm/include/asm/arch-omap3/ehci_omap3.h | 58 -------
> arch/arm/include/asm/arch-omap4/ehci.h | 49 ++++++
> arch/arm/include/asm/ehci-omap.h | 148 ++++++++++++++++++
> drivers/usb/host/ehci-omap.c | 212 +++++++++++++++++++-------
> 5 files changed, 408 insertions(+), 114 deletions(-)
> create mode 100644 arch/arm/include/asm/arch-omap3/ehci.h
> delete mode 100644 arch/arm/include/asm/arch-omap3/ehci_omap3.h
> create mode 100644 arch/arm/include/asm/arch-omap4/ehci.h
> create mode 100644 arch/arm/include/asm/ehci-omap.h
[...]
> diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h
> new file mode 100644
> index 0000000..c99ac20
> --- /dev/null
> +++ b/arch/arm/include/asm/ehci-omap.h
[...]
> +
> +/* ULPI */
> +#define ULPI_SET(a) (a + 1)
> +#define ULPI_CLR(a) (a + 2)
> +#define ULPI_FUNC_CTRL 0x04
> +#define ULPI_FUNC_CTRL_RESET (1 << 5)
The above should be removed as it is not used anymore.
> +
> +struct omap_usbhs_board_data {
> + enum usbhs_omap_port_mode port_mode[OMAP_HS_USB_PORTS];
> +};
> +
> +struct omap_usbtll {
> + u32 rev; /* 0x00 */
> + u32 hwinfo; /* 0x04 */
> + u8 reserved1[0x8];
Are you sure you want this to be an array of bytes instead of
register (u32) wide fields?
IMO,
u32 reserved1[2];
looks much better than:
u8 reserved1[0x8];
and does not have alignment issues, but if you think u8 is better,
I will not object.
> + u32 sysc; /* 0x10 */
> + u32 syss; /* 0x14 */
> + u32 irqst; /* 0x18 */
> + u32 irqen; /* 0x1c */
> + u8 reserved2[0x10];
> + u32 shared_conf; /* 0x30 */
> + u8 reserved3[0xc];
> + u32 channel_conf; /* 0x40 */
> +};
> +
> +struct omap_uhh {
> + u32 rev; /* 0x00 */
> + u32 hwinfo; /* 0x04 */
> + u8 reserved1[0x8];
> + u32 sysc; /* 0x10 */
> + u32 syss; /* 0x14 */
> + u8 reserved2[0x28];
> + u32 hostconfig; /* 0x40 */
> + u32 debugcsr; /* 0x44 */
> +};
> +
> +struct omap_ehci {
> + u32 hccapbase; /* 0x00 */
> + u32 hcsparams; /* 0x04 */
> + u32 hccparams; /* 0x08 */
> + u8 reserved1[0x04];
> + u32 usbcmd; /* 0x10 */
> + u32 usbsts; /* 0x14 */
> + u32 usbintr; /* 0x18 */
> + u32 frindex; /* 0x1c */
> + u32 ctrldssegment; /* 0x20 */
> + u32 periodiclistbase; /* 0x24 */
> + u32 asysnclistaddr; /* 0x28 */
> + u8 reserved2[0x24];
> + u32 configflag; /* 0x50 */
> + u32 portsc_i; /* 0x54 */
> + u8 reserved3[0x38];
> + u32 insreg00; /* 0x90 */
> + u32 insreg01; /* 0x94 */
> + u32 insreg02; /* 0x98 */
> + u32 insreg03; /* 0x9c */
> + u32 insreg04; /* 0xa0 */
> + u32 insreg05_utmi_ulpi; /* 0xa4 */
> + u32 insreg06; /* 0xa8 */
> + u32 insreg07; /* 0xac */
> + u32 insreg08; /* 0xb0 */
> +};
> +
> +int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata);
> +int omap_ehci_hcd_stop(void);
> +
> +#endif /* _OMAP_COMMON_EHCI_H_ */
[...]
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 93d3bb7..89c3c3a 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
[...]
> +static void omap_ehci_soft_phy_reset(int port)
> +{
> + struct ulpi_viewport ulpi_vp;
> +
> + ulpi_vp.viewport_addr = (u32)&ehci->insreg05_utmi_ulpi;
> + ulpi_vp.port_num = port;
> +
> + ulpi_reset(&ulpi_vp);
> +
no need for the empty line here
> +}
> +
[...]
> /*
> - * Initialize the OMAP3 EHCI controller and PHY.
> - * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37.
> + * Initialize the OMAP EHCI controller and PHY.
> + * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1
> * See there for additional Copyrights.
> */
> -int ehci_hcd_init(void)
> +int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata)
> {
> - int ret;
> + int ret = 0;
> + unsigned int i, reg = 0, rev = 0;
no need to initialize ret here, it is done below.
>
> - debug("Initializing OMAP3 EHCI\n");
> + debug("Initializing OMAP EHCI\n");
>
> ret = board_usb_init();
> if (ret < 0)
[...]
--
Regards,
Igor.
next prev parent reply other threads:[~2012-02-06 11:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 13:38 [U-Boot] [PATCH v3 0/7] Clean up ehci-omap and extend support for omap3/4 socs Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 1/7] ehci-omap: driver for EHCI host on OMAP3 Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 2/7] ehci-omap: Clean up added ehci-omap.c Govindraj.R
2012-02-06 11:26 ` Igor Grinberg [this message]
2012-02-03 13:38 ` [U-Boot] [PATCH v3 3/7] OMAP3+: Clock: Adding ehci clock enabling Govindraj.R
2012-02-06 11:42 ` Igor Grinberg
2012-02-06 11:57 ` Govindraj
2012-02-06 12:17 ` Igor Grinberg
2012-02-03 13:38 ` [U-Boot] [PATCH v3 4/7] OMAP4: clock-common: Move the usb dppl configuration to new func Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 5/7] OMAP3+: ehci-omap: enable usb host ports for beagle/panda Govindraj.R
2012-02-06 12:03 ` Igor Grinberg
2012-02-03 13:38 ` [U-Boot] [PATCH v3 6/7] usb: ulpi: Extend the existing ulpi framework Govindraj.R
2012-02-06 8:55 ` Igor Grinberg
2012-02-06 9:38 ` Govindraj
2012-02-06 10:03 ` Igor Grinberg
2012-02-08 17:42 ` SUBHASHINI MANNE
2012-02-09 6:32 ` Govindraj
2012-02-03 13:38 ` [U-Boot] [PATCH v3 7/7] usb: ulpi: Add omap-ulpi-view port support Govindraj.R
2012-02-06 9:10 ` Igor Grinberg
2012-02-03 15:25 ` [U-Boot] [PATCH v3 0/7] Clean up ehci-omap and extend support for omap3/4 socs Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F2FB8F4.2080407@compulab.co.il \
--to=grinberg@compulab.co.il \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.