All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] socrates: add USB support
@ 2008-05-21 23:15 Wolfgang Denk
  2008-05-22  9:59 ` Markus Klotzbücher
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2008-05-21 23:15 UTC (permalink / raw)
  To: u-boot

From: Sergei Poselenov <sposelenov@emcraft.com>

Add new configuration variable CONFIG_PCI_OHCI_DEVNO.
In case of several PCI USB controllers on a board this variable
specifys which controller to use.
See doc/README.generic_usb_ohci for details.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
---
Markus, please note that we added a new configuration variable,
CONFIG_PCI_OHCI_DEVNO in drivers/usb_ohci.c. It addresses the the
case when there are several USB controllers installed on a board
(like on socrates, where 4 PCI OHCI USB controllers are available),
and we need to support a controller instance other than the first
found.

For socrates, currently it is the 2nd OHCI controller of the 2nd
ISP1562 PCI USB chip (i.e. instance number 3 in the PCI list of OHCI
controllers (0x1131/0x1561)).
---
 doc/README.generic_usb_ohci |    6 ++++++
 drivers/usb/usb_ohci.c      |    5 ++++-
 include/configs/socrates.h  |   14 ++++++++++++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/doc/README.generic_usb_ohci b/doc/README.generic_usb_ohci
index c44c501..147ea51 100644
--- a/doc/README.generic_usb_ohci
+++ b/doc/README.generic_usb_ohci
@@ -51,6 +51,12 @@ You'll need to define
 
 	CONFIG_PCI_OHCI
 
+If you have several USB PCI controllers, define
+
+	CONFIG_PCI_OHCI_DEVNO: number of the OHCI device in PCI list
+
+If undefined, the first instance found in PCI space will be used.
+
 PCI Controllers need to do byte swapping on register accesses, so they
 should to define:
 
diff --git a/drivers/usb/usb_ohci.c b/drivers/usb/usb_ohci.c
index ee0f2e4..318478a 100644
--- a/drivers/usb/usb_ohci.c
+++ b/drivers/usb/usb_ohci.c
@@ -53,6 +53,9 @@
 
 #if defined(CONFIG_PCI_OHCI)
 # include <pci.h>
+#if !defined(CONFIG_PCI_OHCI_DEVNO)
+#define CONFIG_PCI_OHCI_DEVNO	0
+#endif
 #endif
 
 #include <malloc.h>
@@ -1818,7 +1821,7 @@ int usb_lowlevel_init(void)
 	gohci.sleeping = 0;
 	gohci.irq = -1;
 #ifdef CONFIG_PCI_OHCI
-	pdev = pci_find_devices(ohci_pci_ids, 0);
+	pdev = pci_find_devices(ohci_pci_ids, CONFIG_PCI_OHCI_DEVNO);
 
 	if (pdev != -1) {
 		u16 vid, did;
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 5d37383..c3ecd6f 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -232,7 +232,7 @@
 #define CONFIG_EEPRO100
 #undef CONFIG_TULIP
 
-#undef CONFIG_PCI_SCAN_SHOW		/* show pci devices on startup	*/
+#define CONFIG_PCI_SCAN_SHOW		/* show pci devices on startup	*/
 #define CFG_PCI_SUBSYS_VENDORID 0x1057	/* Motorola			*/
 
 #endif	/* CONFIG_PCI */
@@ -299,8 +299,8 @@
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_NFS
 #define CONFIG_CMD_PING
-#undef CONFIG_CMD_RTC
 #define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
 
 
 #if defined(CONFIG_PCI)
@@ -399,4 +399,14 @@
 #define CONFIG_OF_LIBFDT	1
 #define CONFIG_OF_BOARD_SETUP	1
 
+/* USB support */
+#define CONFIG_USB_OHCI_NEW		1
+#define CONFIG_PCI_OHCI			1
+#define CONFIG_PCI_OHCI_DEVNO		3 /* Number in PCI list */
+#define CFG_USB_OHCI_MAX_ROOT_PORTS	15
+#define CFG_USB_OHCI_SLOT_NAME		"ohci_pci"
+#define CFG_OHCI_SWAP_REG_ACCESS	1
+#define CONFIG_DOS_PARTITION		1
+#define CONFIG_USB_STORAGE		1
+
 #endif	/* __CONFIG_H */
-- 
1.5.4.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot-Users] [PATCH] socrates: add USB support
  2008-05-21 23:15 [U-Boot-Users] [PATCH] socrates: add USB support Wolfgang Denk
@ 2008-05-22  9:59 ` Markus Klotzbücher
  2008-05-22 13:14   ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Klotzbücher @ 2008-05-22  9:59 UTC (permalink / raw)
  To: u-boot

Sergei, Wolfgang,

Wolfgang Denk <wd@denx.de> writes:

> From: Sergei Poselenov <sposelenov@emcraft.com>
>
> Add new configuration variable CONFIG_PCI_OHCI_DEVNO.
> In case of several PCI USB controllers on a board this variable
> specifys which controller to use.
> See doc/README.generic_usb_ohci for details.
>
> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
> ---
> Markus, please note that we added a new configuration variable,
> CONFIG_PCI_OHCI_DEVNO in drivers/usb_ohci.c. It addresses the the
> case when there are several USB controllers installed on a board
> (like on socrates, where 4 PCI OHCI USB controllers are available),
> and we need to support a controller instance other than the first
> found.
>
> For socrates, currently it is the 2nd OHCI controller of the 2nd
> ISP1562 PCI USB chip (i.e. instance number 3 in the PCI list of OHCI
> controllers (0x1131/0x1561)).

Patch looks ok (and passed the sequoia test) so:

Acked-by: Markus Klotzbuecher <mk@denx.de>

But for the future:

- The subject is less than meaningful. 

- I would have really preferred two patches, one for the generic change
  and one for updating the board config.

Wolfgang, do you want to pick this one up directly (preferably with a
more meaningful subject) or shall I push it through the usb tree. Either
is fine for me.

Best regards

Markus Klotzb?cher

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] [PATCH] socrates: add USB support
  2008-05-22  9:59 ` Markus Klotzbücher
@ 2008-05-22 13:14   ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2008-05-22 13:14 UTC (permalink / raw)
  To: u-boot

Dear Markus,

in message <87prrevev5.fsf@denx.de> you wrote:
> 
> Wolfgang, do you want to pick this one up directly (preferably with a
> more meaningful subject) or shall I push it through the usb tree. Either
> is fine for me.

It would be nice if you could take this through the USB repo (and send
a pull request soon :-) And please also fix the subject.

Thanks.

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: wd at denx.de
365 Days of drinking Lo-Cal beer.                       = 1 Lite-year

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-22 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 23:15 [U-Boot-Users] [PATCH] socrates: add USB support Wolfgang Denk
2008-05-22  9:59 ` Markus Klotzbücher
2008-05-22 13:14   ` Wolfgang Denk

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.