public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 3/4] EHCI: adjust for mx5
Date: Sun, 25 Sep 2011 19:38:31 +0200	[thread overview]
Message-ID: <201109251938.32119.marek.vasut@gmail.com> (raw)
In-Reply-To: <1316971511-5667-3-git-send-email-fermata7@gmail.com>

On Sunday, September 25, 2011 07:25:09 PM Jana Rapava wrote:

Dear Jana Rapava,

> Add into ./include/usb/ehci-fsl.h macros and structures
> needed by following patch; change prefix of common MX31 USB_CTRL bits
> to MXC.

The commit message doesn't make too much sense. The intention is to move 
definitions shared across multiple drivers into common header file? If so, 
please express this properly.

> 
> Signed-off-by: Jana Rapava <fermata7@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Remy Bohmer <linux@bohmer.net>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> Changes for v2:
>       - changed to proper patch
> Changes for v3:
>       - merged other USB patches from u-boot-pxa/efikasb
>       - offset-based access changed to struct-based access
>       - use {clrset,clr,set}bits_le32() calls
>       - CodingStyle and naming cleanup
> Changes for v4:
>        - split into patchset
> 
>  drivers/usb/host/ehci-mxc.c |    9 +--
>  include/usb/ehci-fsl.h      |  119
> ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 121
> insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
> index a0cfbb7..973bb4f 100644
> --- a/drivers/usb/host/ehci-mxc.c
> +++ b/drivers/usb/host/ehci-mxc.c
> @@ -37,9 +37,6 @@
>  #endif
> 
>  #ifdef CONFIG_MX31
> -#define MX31_OTG_SIC_SHIFT	29
> -#define MX31_OTG_SIC_MASK	(0x3 << MX31_OTG_SIC_SHIFT)
> -#define MX31_OTG_PM_BIT		(1 << 24)
> 
>  #define MX31_H2_SIC_SHIFT	21
>  #define MX31_H2_SIC_MASK	(0x3 << MX31_H2_SIC_SHIFT)

You should move this all into ehci-fsl.h then.

> @@ -66,11 +63,11 @@ static int mxc_set_usbcontrol(int port, unsigned int
> flags)
> 
>  		switch (port) {
>  		case 0:	/* OTG port */
> -			v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
> +			v &= ~(MXC_OTG_SIC_MASK | MXC_OTG_PM_BIT);
>  			v |= (flags & MXC_EHCI_INTERFACE_MASK)
> -					<< MX31_OTG_SIC_SHIFT;
> +					<< MXC_OTG_SIC_SHIFT;
>  			if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
> -				v |= MX31_OTG_PM_BIT;
> +				v |= MXC_OTG_PM_BIT;
> 
>  			break;
>  		case 1: /* H1 port */
> diff --git a/include/usb/ehci-fsl.h b/include/usb/ehci-fsl.h
> index 67600ed..b107f71 100644
> --- a/include/usb/ehci-fsl.h
> +++ b/include/usb/ehci-fsl.h
> @@ -169,6 +169,79 @@
>  #define CONFIG_SYS_FSL_USB_ADDR CONFIG_SYS_MPC512x_USB_ADDR
>  #endif

[...]

> +/* ULPI OTG Control bits of interest */
> +#define ULPI_OTG_EXT_VBUS_IND	(1 << 7)
> +#define ULPI_OTG_DM_PULLDOWN	(1 << 2)
> +#define ULPI_OTG_DP_PULLDOWN	(1 << 1)
> +#define	ULPI_OTG_DRV_VBUS	(1 << 5)

Use space/tab consistently ... space is the prefered thing to use.

> +#define ULPI_OTG_DRV_VBUS_EXT	(1 << 6)
> +#define ULPI_OTG_CHRG_VBUS	(1 << 4)
> +
> +/* ULPI Function Control bits of interest */
> +#define ULPI_FC_XCVR_SELECT	(1 << 0)
> +#define ULPI_FC_OPMODE_NORMAL	(0 << 3)
> +#define ULPI_FC_SUSPENDM_PWRED	(1 << 6)
> +
>  /*
>   * USB Registers
>   */
> @@ -210,7 +283,7 @@ struct usb_ehci {
>  	u32	txfilltuning;	/* 0x164 - Host TT Transmit
>  					   pre-buffer packet tuning */
>  	u8	res7[0x8];
> -	u32	ulpi_viewpoint;	/* 0x170 - ULPI Reister Access */
> +	u32	ulpi_viewpoint;	/* 0x170 - ULPI Register Access */
>  	u8	res8[0xc];
>  	u32	config_flag;	/* 0x180 - Configured Flag Register */
>  	u32	portsc;		/* 0x184 - Port status/control */
> @@ -242,4 +315,48 @@ struct usb_ehci {
>  	u8	res13[0xafc];
>  };
> 
> +struct usb_control_regs {
> +	u32	usbctrl;	/* 0x800 - USB Control */
> +	u32	otgmirror;	/* 0x804 - OTG Port Mirror */
> +	u32	phyctrl0;	/* 0x808 - UTMI PHY Control Register 0 */
> +	u32	phyctrl1;	/* 0x80C - UTMI PHY Control Register 1 */
> +	u32	usbctrl1;	/* 0x810 - USB Control Register 1 */
> +	u32	uh2ctrl;	/* 0x814 - USB Host2 Control */
> +	u32	uh3ctrl;	/* 0x818 - USB Host3 Control */
> +};

mx5_usb_control_regs ... this is not the same on all mxc chips.

> +
> +struct ulpi_regs {
> +	u8	vendor_id_low;		/* 0x00 - Vendor ID lower byte */
> +	u8	vendor_id_high;		/* 0x01 - Vendor ID upper byte */
> +	u8	product_id_low;		/* 0x02 - Product ID lower byte */
> +	u8	product_id_high;	/* 0x03 - Product ID higher byte */
> +	/* Function Control; 0x04 - 0x06 Read, 0x04 Write */
> +	u8	function_ctrl_write;
> +	u8	function_ctrl_set;	/* 0x05 Set */
> +	u8	function_ctrl_clear;	/* 0x06 Clear */
> +	/* Interface Control; 0x07 - 0x09 Read, 0x07 Write */
> +	u8	iface_ctrl_write;
> +	u8	iface_ctrl_set;		/* 0x08 Set */
> +	u8	iface_ctrl_clear;	/* 0x09 Clear */
> +	/* OTG Control; 0x0A - 0x0C Read, 0x0A Write */
> +	u8	otg_ctrl_write;
> +	u8	otg_ctrl_set;		/* 0x0B Set */
> +	u8	otg_ctrl_clear;		/* 0x0C Clear */
> +	/* USB Interrupt Enable Rising; 0x0D - 0x0F Read, 0x0D Write */
> +	u8	usb_ie_rising_write;
> +	u8	usb_ie_rising_set;	/* 0x0E Set */
> +	u8	usb_ie_rising_clear;	/* 0x0F Clear */
> +	/* USB Interrupt Enable Falling; 0x10 - 0x12 Read, 0x10 Write */
> +	u8	usb_ie_falling_write;
> +	u8	usb_ie_falling_set;	/* 0x11 Set */
> +	u8	usb_ie_falling_clear;	/* 0x12 Clear */
> +	u8	usb_int_status;		/* 0x13 - USB Interrupt Status */
> +	u8	usb_int_latch;		/* 0x14 - USB Interrupt Latch */
> +	u8	debug;			/* 0x15 - Debug */
> +	/* Scratch Register; 0x16 - 0x18 Read, 0x16 Write */
> +	u8	scratch_write;
> +	u8	scratch_set;		/* 0x17 Set */
> +	u8	scratch_clear;		/* 0x18 Clear*/
> +};

Hm, we should keep this here only until we get a decent ULPI implementation. 
Also, rename to something like mxc_ulpi_regs at least.

> +
>  #endif /* _EHCI_FSL_H */

  reply	other threads:[~2011-09-25 17:38 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 21:06 [U-Boot] some USB cleanup on EfikaMX Jana Rapava
2011-09-08 22:32 ` Wolfgang Denk
2011-09-09 10:18 ` Stefano Babic
2011-09-12 17:20 ` [U-Boot] [PATCH 1/2 v2] USB cleanup for EfikaMX Jana Rapava
2011-09-12 19:25   ` Marek Vasut
2011-09-18  2:19   ` [U-Boot] [PATCH v3] Add USB support for Efika Jana Rapava
2011-09-18  2:33     ` Marek Vasut
2011-09-19  8:43     ` Stefano Babic
2011-09-19 10:30       ` Marek Vasut
2011-09-24 15:57       ` Remy Bohmer
2011-09-24 19:07         ` Fabio Estevam
2011-09-24 19:19           ` Marek Vasut
2011-09-24 21:22             ` Fabio Estevam
2011-09-22  5:18     ` Marek Vasut
2011-09-25 11:55     ` [U-Boot] [PATCH v4 1/5] EHCI: add callback ehci_fixup Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 2/5] Add USB support for Efika Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 3/5] /drivers/usb/host/ehci-mxc.c: naming cleanup Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 4/5] USB: Add usb_event_poll() to get keyboards working with EHCI Jana Rapava
2011-09-25 12:02         ` Marek Vasut
2011-09-25 11:55       ` [U-Boot] [PATCH v4 5/5] USB: move ehci.h and ehci-core.h into /include/usb/ Jana Rapava
2011-09-27 10:45         ` [U-Boot] [PATCH v5 1/4] usb: Move ehci.h and ehci-core.h to include/usb directory Jana Rapava
2011-09-27 10:57           ` Fabio Estevam
2011-09-27 11:01           ` [U-Boot] [PATCH v5 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-27 11:01             ` [U-Boot] [PATCH v5 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 11:01             ` [U-Boot] [PATCH v5 4/4] Add USB support for Efika Jana Rapava
2011-09-27 11:50               ` Marek Vasut
2011-09-27 14:12                 ` Jana Rapava
2011-09-27 14:55                   ` Marek Vasut
2011-09-27 18:17                 ` Jana Rapava
2011-09-27 18:20                   ` Marek Vasut
2011-09-28 10:26                   ` Stefano Babic
2011-09-28 12:12                     ` Jana Rapava
2011-09-27 11:23             ` [U-Boot] [PATCH v5 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 11:42               ` Jana Rapava
2011-09-27 19:24                 ` [U-Boot] [PATCH v6 " Jana Rapava
2011-09-27 19:24                   ` [U-Boot] [PATCH v6 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 19:41                     ` Marek Vasut
2011-09-27 20:19                       ` Jana Rapava
2011-09-27 20:47                         ` Marek Vasut
2011-09-27 19:24                   ` [U-Boot] [PATCH v6 4/4] Add USB support for Efika Jana Rapava
2011-09-27 19:47                     ` Marek Vasut
2011-09-27 20:40                       ` Jana Rapava
2011-09-27 20:50                         ` Marek Vasut
2011-09-27 19:40                   ` [U-Boot] [PATCH v6 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 22:21                   ` [U-Boot] [PATCH v7 " Jana Rapava
2011-09-27 22:21                     ` [U-Boot] [PATCH v7 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 22:21                     ` [U-Boot] [PATCH v7 4/4] Add USB support for Efika Jana Rapava
2011-09-28  0:43                       ` Marek Vasut
2011-09-28 12:25                         ` Jana Rapava
2011-09-28 12:28                           ` Marek Vasut
2011-09-28  0:46                     ` [U-Boot] [PATCH v7 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-28 10:54                     ` Marek Vasut
2011-09-28 11:52                       ` Jana Rapava
2011-09-28 12:13                         ` Marek Vasut
2011-09-28 15:02                     ` [U-Boot] [PATCH v8 " Jana Rapava
2011-09-28 15:05                       ` [U-Boot] [PATCH v8 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-28 15:07                         ` [U-Boot] [PATCH v8 4/4] Add USB support for Efika Jana Rapava
2011-09-28 15:20                           ` Marek Vasut
2011-09-28 18:12                             ` Jana Rapava
2011-09-28 18:26                               ` Marek Vasut
2011-10-06 21:18                           ` Wolfgang Denk
2011-10-07 17:16                             ` Jana Rapava
2011-09-28 15:21                       ` [U-Boot] [PATCH v8 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 11:07           ` [U-Boot] [PATCH v5 1/4] usb: Move ehci.h and ehci-core.h to include/usb directory Fabio Estevam
2011-09-27 11:09             ` Fabio Estevam
2011-09-27 11:27               ` Jana Rapava
2011-09-27 18:44           ` [U-Boot] [PATCH v6 " Jana Rapava
2011-09-27 22:06             ` [U-Boot] [PATCH v7 " Jana Rapava
2011-09-28 14:59               ` [U-Boot] [PATCH v8 " Jana Rapava
2011-09-28 19:49                 ` [U-Boot] [PATCH v9 " Jana Rapava
2011-09-28 20:36                   ` Marek Vasut
2011-09-28 21:10                     ` Jana Rapava
2011-09-28 21:43                       ` Marek Vasut
2011-09-28 23:04                         ` Jana Rapava
2011-09-28 23:05                           ` Marek Vasut
2011-09-28 23:22                             ` Jana Rapava
2011-09-28 19:51                 ` [U-Boot] [PATCH v9 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-28 19:52                   ` [U-Boot] [PATCH v9 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-28 19:54                     ` [U-Boot] [PATCH v9 4/4] Add USB support for Efika Jana Rapava
2011-09-28 20:44                       ` Marek Vasut
2011-09-28 20:36                   ` [U-Boot] [PATCH v9 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-28 21:14                     ` Jana Rapava
2011-09-28 21:26                       ` Marek Vasut
2011-09-25 12:02       ` [U-Boot] [PATCH v4 1/5] " Marek Vasut
2011-09-25 17:25     ` [U-Boot] [PATCH v4 1/4] USB: move ehci.h and ehci-core.h into /include/usb/ Jana Rapava
2011-09-25 17:25       ` [U-Boot] [PATCH v4 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-25 17:41         ` Marek Vasut
2011-09-25 17:25       ` [U-Boot] [PATCH v4 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-25 17:38         ` Marek Vasut [this message]
2011-09-25 17:25       ` [U-Boot] [PATCH v4 4/4] Add USB support for Efika Jana Rapava
2011-09-25 17:34         ` Marek Vasut
2011-09-26 20:28           ` Jana Rapava
2011-09-26 20:42             ` Marek Vasut
2011-09-26 20:51             ` Marek Vasut
2011-09-27 11:00               ` Jana Rapava
2011-09-25 19:01       ` [U-Boot] [PATCH v4 1/4] USB: move ehci.h and ehci-core.h into /include/usb/ Fabio Estevam
2011-09-26  8:32         ` Jana Rapava
2011-10-09 18:42       ` Marek Vasut
2011-10-09 20:22         ` Jana Rapava
2011-10-14 15:49           ` Fabio Estevam
2011-10-14 16:07             ` Marek Vasut
2011-10-14 15:50           ` Marek Vasut
2011-10-06 21:33   ` [U-Boot] [PATCH 1/2 v2] USB cleanup for EfikaMX Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2011-11-01 19:20 [U-Boot] [PATCH v3 3/4] EHCI: adjust for mx5 Jana Rapava
2011-11-12 17:37 ` [U-Boot] [PATCH v4 " Jana Rapava
2011-11-14  9:12   ` Wolfgang Grandegger
2011-11-14 20:50     ` Jana Rapava

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=201109251938.32119.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox