All of lore.kernel.org
 help / color / mirror / Atom feed
  • * [U-Boot] unassigned-patches/25: [PATCH] USB EHCI: reset root hub
           [not found]   ` <1218807733-26929-3-git-send-email-dzu@denx.de>
           [not found]     ` <1218807733-26929-4-git-send-email-dzu@denx.de>
    @ 2008-08-15 13:45     ` u-boot at bugs.denx.de
      2008-09-01 15:41       ` Detlev Zundel
      2008-09-04  8:44       ` Markus Klotzbücher
      1 sibling, 2 replies; 18+ messages in thread
    From: u-boot at bugs.denx.de @ 2008-08-15 13:45 UTC (permalink / raw)
      To: u-boot
    
     Some of multi-function USB controllers (e.g. ISP1562) allow root hub
    resetting only via EHCI registers. So, this patch adds the corresponding
    kind of reset to OHCI's hc_reset() if the newly introduced CONFIG_PCI_EHCI_DEVNO
    option is set (e.g. for Socrates board).
    
    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
    
    ---
    Added to GNATS database as unassigned-patches/25
    >Responsible:    patch-coord
    >Message-Id:     <1218807733-26929-3-git-send-email-dzu@denx.de>
    >In-Reply-To:    <1218807733-26929-2-git-send-email-dzu@denx.de>
    >References:     <1218807733-26929-1-git-send-email-dzu@denx.de> <1218807733-26929-2-git-send-email-dzu@denx.de>
    >Patch-Date:     Fri Aug 15 15:42:10 +0200 2008
    ---
     drivers/usb/usb_ohci.c     |   31 +++++++++++++++++++++++++++++++
     drivers/usb/usb_ohci.h     |    3 +++
     include/configs/socrates.h |    1 +
     3 files changed, 35 insertions(+), 0 deletions(-)
    
    diff --git a/drivers/usb/usb_ohci.c b/drivers/usb/usb_ohci.c
    index fd60edb..0f5bd06 100644
    --- a/drivers/usb/usb_ohci.c
    +++ b/drivers/usb/usb_ohci.c
    @@ -1571,11 +1571,42 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
     
     static int hc_reset (ohci_t *ohci)
     {
    +#ifdef CONFIG_PCI_EHCI_DEVNO
    +	pci_dev_t pdev;
    +	struct pci_device_id ehci_pci_ids[] = {
    +		{0x1131, 0x1562},	/* Philips 1562 PCI EHCI module ids */
    +		{0, 0}
    +	};
    +#endif
     	int timeout = 30;
     	int smm_timeout = 50; /* 0,5 sec */
     
     	dbg("%s\n", __FUNCTION__);
     
    +#ifdef CONFIG_PCI_EHCI_DEVNO
    +	/*
    +	 *  Some multi-function controllers (e.g. ISP1562) allow root hub
    +	 * resetting via EHCI registers only.
    +	 */
    +	pdev = pci_find_devices(ehci_pci_ids, CONFIG_PCI_EHCI_DEVNO);
    +	if (pdev != -1) {
    +		u32 base;
    +		int timeout = 1000;
    +
    +		pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &base);
    +		writel (readl(base + EHCI_USBCMD_OFF) | EHCI_USBCMD_HCRESET,
    +			base + EHCI_USBCMD_OFF);
    +
    +		while (readl(base + EHCI_USBCMD_OFF) & EHCI_USBCMD_HCRESET) {
    +			if (timeout-- <= 0) {
    +				printf("USB RootHub reset timed out!");
    +				break;
    +			}
    +			udelay(1);
    +		}
    +	} else
    +		printf("No EHCI func@%d index!\n", CONFIG_PCI_EHCI_DEVNO);
    +#endif
     	if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */
     		writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
     		info("USB HC TakeOver from SMM");
    diff --git a/drivers/usb/usb_ohci.h b/drivers/usb/usb_ohci.h
    index 380cb4c..7a04bf5 100644
    --- a/drivers/usb/usb_ohci.h
    +++ b/drivers/usb/usb_ohci.h
    @@ -195,6 +195,9 @@ struct ohci_regs {
     	} roothub;
     } __attribute((aligned(32)));
     
    +/* Some EHCI controls */
    +#define EHCI_USBCMD_OFF		0x20
    +#define EHCI_USBCMD_HCRESET	(1 << 1)
     
     /* OHCI CONTROL AND STATUS REGISTER MASKS */
     
    diff --git a/include/configs/socrates.h b/include/configs/socrates.h
    index 8a64942..fdc1557 100644
    --- a/include/configs/socrates.h
    +++ b/include/configs/socrates.h
    @@ -403,6 +403,7 @@
     #define CONFIG_USB_OHCI_NEW		1
     #define CONFIG_PCI_OHCI			1
     #define CONFIG_PCI_OHCI_DEVNO		3 /* Number in PCI list */
    +#define CONFIG_PCI_EHCI_DEVNO		(CONFIG_PCI_OHCI_DEVNO / 2)
     #define CFG_USB_OHCI_MAX_ROOT_PORTS	15
     #define CFG_USB_OHCI_SLOT_NAME		"ohci_pci"
     #define CFG_OHCI_SWAP_REG_ACCESS	1
    -- 
    1.5.6.1
    
    ^ permalink raw reply related	[flat|nested] 18+ messages in thread
  • * [U-Boot] unassigned-patches/23: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get().
           [not found] ` <1218807733-26929-2-git-send-email-dzu@denx.de>
           [not found]   ` <1218807733-26929-3-git-send-email-dzu@denx.de>
    @ 2008-08-15 13:45   ` u-boot at bugs.denx.de
      2008-09-01 15:41     ` Detlev Zundel
      1 sibling, 1 reply; 18+ messages in thread
    From: u-boot at bugs.denx.de @ 2008-08-15 13:45 UTC (permalink / raw)
      To: u-boot
    
    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
    
    ---
    Added to GNATS database as unassigned-patches/23
    >Responsible:    patch-coord
    >Message-Id:     <1218807733-26929-2-git-send-email-dzu@denx.de>
    >In-Reply-To:    <1218807733-26929-1-git-send-email-dzu@denx.de>
    >References:     <1218807733-26929-1-git-send-email-dzu@denx.de>
    >Patch-Date:     Fri Aug 15 15:42:09 +0200 2008
    ---
     drivers/rtc/rx8025.c |    6 +++++-
     1 files changed, 5 insertions(+), 1 deletions(-)
    
    diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c
    index 64eafe5..6ba9df2 100644
    --- a/drivers/rtc/rx8025.c
    +++ b/drivers/rtc/rx8025.c
    @@ -136,7 +136,11 @@ int rtc_get (struct rtc_time *tmp)
     
     	tmp->tm_sec  = bcd2bin (sec & 0x7F);
     	tmp->tm_min  = bcd2bin (min & 0x7F);
    -	tmp->tm_hour = bcd2bin (hour & 0x3F);
    +	if (rtc_read(RTC_CTL1_REG_ADDR) & RTC_CTL1_BIT_2412)
    +		tmp->tm_hour = bcd2bin (hour & 0x3F);
    +	else
    +		tmp->tm_hour = bcd2bin (hour & 0x1F) % 12 +
    +			       ((hour & 0x20) ? 12 : 0);
     	tmp->tm_mday = bcd2bin (mday & 0x3F);
     	tmp->tm_mon  = bcd2bin (mon & 0x1F);
     	tmp->tm_year = bcd2bin (year) + ( bcd2bin (year) >= 70 ? 1900 : 2000);
    -- 
    1.5.6.1
    
    ^ permalink raw reply related	[flat|nested] 18+ messages in thread
  • * [U-Boot] unassigned-patches/24: [PATCH] PHY: Add support for the M88E1121R Marvell chip.
           [not found] <1218807733-26929-1-git-send-email-dzu@denx.de>
           [not found] ` <1218807733-26929-2-git-send-email-dzu@denx.de>
    @ 2008-08-15 13:45 ` u-boot at bugs.denx.de
      2008-09-01 15:39   ` Detlev Zundel
      1 sibling, 1 reply; 18+ messages in thread
    From: u-boot at bugs.denx.de @ 2008-08-15 13:45 UTC (permalink / raw)
      To: u-boot
    
    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
    Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
    
    ---
    Added to GNATS database as unassigned-patches/24
    >Responsible:    patch-coord
    >Message-Id:     <1218807733-26929-1-git-send-email-dzu@denx.de>
    >In-Reply-To:    
    >References:     
    >Patch-Date:     Fri Aug 15 15:42:08 +0200 2008
    ---
     drivers/net/tsec.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
     drivers/net/tsec.h |    7 +++++++
     2 files changed, 57 insertions(+), 0 deletions(-)
    
    diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
    index 6e0f2c6..fb5002d 100644
    --- a/drivers/net/tsec.c
    +++ b/drivers/net/tsec.c
    @@ -1157,6 +1157,55 @@ struct phy_info phy_info_M88E1118 = {
     		},
     };
     
    +/*
    + *  Since to access LED register we need do switch the page, we
    + * do LED configuring in the miim_read-like function as follows
    + */
    +uint mii_88E1121_set_led (uint mii_reg, struct tsec_private *priv)
    +{
    +	uint pg;
    +
    +	/* Switch the page to access the led register */
    +	pg = read_phy_reg(priv, MIIM_88E1121_PHY_PAGE);
    +	write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, MIIM_88E1121_PHY_LED_PAGE);
    +
    +	/* Configure leds */
    +	write_phy_reg(priv, MIIM_88E1121_PHY_LED_CTRL,
    +		      MIIM_88E1121_PHY_LED_DEF);
    +
    +	/* Restore the page pointer */
    +	write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, pg);
    +	return 0;
    +}
    +
    +struct phy_info phy_info_M88E1121R = {
    +	0x01410cb,
    +	"Marvell 88E1121R",
    +	4,
    +	(struct phy_cmd[]){	/* config */
    +		/* Reset and configure the PHY */
    +		{MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
    +		{MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
    +		{MIIM_ANAR, MIIM_ANAR_INIT, NULL},
    +		/* Configure leds */
    +		{MIIM_88E1121_PHY_LED_CTRL, miim_read,
    +		 &mii_88E1121_set_led},
    +		{MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
    +		{miim_end,}
    +		},
    +	(struct phy_cmd[]){	/* startup */
    +		/* Status is read once to clear old link state */
    +		{MIIM_STATUS, miim_read, NULL},
    +		{MIIM_STATUS, miim_read, &mii_parse_sr},
    +		{MIIM_STATUS, miim_read, &mii_parse_link},
    +		{miim_end,}
    +		},
    +	(struct phy_cmd[]){	/* shutdown */
    +		{miim_end,}
    +		},
    +};
    +
    +
     static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv)
     {
     	uint mii_data = read_phy_reg(priv, mii_reg);
    @@ -1522,6 +1571,7 @@ struct phy_info *phy_info[] = {
     	&phy_info_M88E1011S,
     	&phy_info_M88E1111S,
     	&phy_info_M88E1118,
    +	&phy_info_M88E1121R,
     	&phy_info_M88E1145,
     	&phy_info_M88E1149S,
     	&phy_info_dm9161,
    diff --git a/drivers/net/tsec.h b/drivers/net/tsec.h
    index 6a2338b..fee5934 100644
    --- a/drivers/net/tsec.h
    +++ b/drivers/net/tsec.h
    @@ -184,6 +184,13 @@
     #define MIIM_88E1111_PHY_LED_DIRECT	0x4100
     #define MIIM_88E1111_PHY_LED_COMBINE	0x411C
     
    +/* 88E1121 PHY LED Control Register */
    +#define MIIM_88E1121_PHY_LED_CTRL	16
    +#define MIIM_88E1121_PHY_LED_PAGE	3
    +#define MIIM_88E1121_PHY_LED_DEF	0x0030
    +
    +#define MIIM_88E1121_PHY_PAGE		22
    +
     /* 88E1145 Extended PHY Specific Control Register */
     #define MIIM_88E1145_PHY_EXT_CR 20
     #define MIIM_M88E1145_RGMII_RX_DELAY	0x0080
    -- 
    1.5.6.1
    
    ^ permalink raw reply related	[flat|nested] 18+ messages in thread

  • end of thread, other threads:[~2008-09-05 23:25 UTC | newest]
    
    Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1218807733-26929-1-git-send-email-dzu@denx.de>
         [not found] ` <1218807733-26929-2-git-send-email-dzu@denx.de>
         [not found]   ` <1218807733-26929-3-git-send-email-dzu@denx.de>
         [not found]     ` <1218807733-26929-4-git-send-email-dzu@denx.de>
    2008-08-15 13:45       ` [U-Boot] unassigned-patches/22: [PATCH] Removed hardcoded MxMR loop value from upmconfig() for MPC85xx u-boot at bugs.denx.de
         [not found]       ` <1218807733-26929-5-git-send-email-dzu@denx.de>
         [not found]         ` <1218807733-26929-6-git-send-email-dzu@denx.de>
    2008-08-15 13:45           ` [U-Boot] unassigned-patches/26: [PATCH] 85xx: socrates: Enable Lime support u-boot at bugs.denx.de
    2008-08-15 13:45         ` [U-Boot] unassigned-patches/27: [PATCH] 85xx: Socrates: Major code update u-boot at bugs.denx.de
    2008-08-15 13:45     ` [U-Boot] unassigned-patches/25: [PATCH] USB EHCI: reset root hub u-boot at bugs.denx.de
    2008-09-01 15:41       ` Detlev Zundel
    2008-09-01 17:33         ` Markus Klotzbücher
    2008-09-04  8:44       ` Markus Klotzbücher
    2008-09-04  9:19         ` [U-Boot] [PATCH v2] " Detlev Zundel
    2008-09-04  9:44           ` Markus Klotzbücher
    2008-09-05 23:25           ` Wolfgang Denk
    2008-08-15 13:45   ` [U-Boot] unassigned-patches/23: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get() u-boot at bugs.denx.de
    2008-09-01 15:41     ` Detlev Zundel
    2008-08-15 13:45 ` [U-Boot] unassigned-patches/24: [PATCH] PHY: Add support for the M88E1121R Marvell chip u-boot at bugs.denx.de
    2008-09-01 15:39   ` Detlev Zundel
    2008-09-01 22:00     ` Ben Warren
    2008-09-01 22:48       ` Detlev Zundel
    2008-09-02  0:34         ` Ben Warren
    2008-09-02  8:11           ` Detlev Zundel
    

    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.