Skip to contentSkip to conversation

Patch generalizing USB driver for MPC5200

U-Boot-Users Reinhard Meyer 6 participants 8 messages Mar 1, 2004 – Mar 14, 2004

lore
Share & tools
lore
#0 lore raw

1. This spatch removes the compiler warnings (integer made from pointer without cast)

2. it generalizes the Clock Divider Values and the Port Config for USB

if CONFIG_USB_CDMFDC5xxx and CONFIG_USB_GPSCFG5xxx are NOT defined, nothing changes.

Defining them allows for other system clocks than 528 MHz and/or other types of USB Port Configurations, for example single ended (#define CONFIG_USB_GPSCFG5xxx 0x00005000)

Thanks, Pierre, for the good work, the driver works fine on our board! -------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot.usb5200.patch
Type: application/octet-stream
Size: 2695 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20040301/77b5afc6/attachment.obj

#1 lore raw
Quoted 8 lines · In message <[email protected]> you wrote:

1. This spatch removes the compiler warnings (integer made from pointer without cast)

2. it generalizes the Clock Divider Values and the Port Config for USB

if CONFIG_USB_CDMFDC5xxx and CONFIG_USB_GPSCFG5xxx are NOT defined, nothing changes.

Please provide a CHANGELOG entry and a description of these #define's for the README.

Quoted 8 lines
(quoted diff) +3 -0
@@ -1532,10 +1532,19 @@ int usb_lowlevel_init(void)
 {
 
 	/* Set the USB Clock						     */
+#if defined (CONFIG_USB_CDMFDC5xxx)
+	*(vu_long *)MPC5XXX_CDM_48_FDC = CONFIG_USB_CDMFDC5xxx;
+#else
 	*(vu_long *)MPC5XXX_CDM_48_FDC = 0x0001bbbb;

Review int usb_lowlevel_init(void) · line 1547

Quoted 10 lines
(quoted diff) +7 -1
-	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00800000;
+#endif
+	/* remove all USB bits first before ORing in ours */
+	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00807000;
 	/* Activate USB port						     */
+#if defined (CONFIG_USB_GPSCFG5xxx)
+	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= CONFIG_USB_GPSCFG5xxx;
+#else
 	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= 0x00001000;
+#endif

If you think it is likely that these nubers may need adjustment for other boards, then we should #defined them for ALL boards in the config file and get rid of the "#if defined()" mess here.

Your patch adds no code tat actually uses these constants, so basicly all we do is create dead code.

That's why I reject the patch as is. Please feel free to address the 3 issues listed above and resubmit.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Q:  How many DEC repairman does it take to fix a flat ?
A:  Five; four to hold the car up and one to swap tires.
#2 lore raw

[U-Boot-Users] Patch generalizing USB and IDE drivers for MPC5200

Hi everybody,

Here's my suggestions :
- for the USB drivers, the constants CONFIG_USB_CDMFDC5xxx and CONFIG_USB_GPSCFG5xxx
must be defined in the board configuration file
- for the IDE driver, the reset routine is board specific, then the good place for it is the board directory.

The attached patch fixes this points for the Lite5200 board. (Reinhard:
it includes your fixes for compiler warnings
in usb_ohci.c).

CHANGELOG:
* Patch by Pierre AUBERT, 02 Mar 2004
cleanups on IDE and USB drivers for MPC5200

Quoted 46 lines · Wolfgang Denk
Quoted 9 lines · In message <[email protected]> you wrote:

1. This spatch removes the compiler warnings (integer made from pointer without cast)

2. it generalizes the Clock Divider Values and the Port Config for USB

if CONFIG_USB_CDMFDC5xxx and CONFIG_USB_GPSCFG5xxx are NOT defined, nothing changes.

Please provide a CHANGELOG entry and a description of these #define's for the README.

Quoted 10 lines
(quoted diff) +4 -1
@@ -1532,10 +1532,19 @@ int usb_lowlevel_init(void)
 {
 
 	/* Set the USB Clock						     */
+#if defined (CONFIG_USB_CDMFDC5xxx)
+	*(vu_long *)MPC5XXX_CDM_48_FDC = CONFIG_USB_CDMFDC5xxx;
+#else
 	*(vu_long *)MPC5XXX_CDM_48_FDC = 0x0001bbbb;
-	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00800000;
+#endif

Review int usb_lowlevel_init(void) · line 1549

Quoted 10 lines
(quoted diff) +6 -0
+	/* remove all USB bits first before ORing in ours */
+	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00807000;
 	/* Activate USB port						     */
+#if defined (CONFIG_USB_GPSCFG5xxx)
+	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= CONFIG_USB_GPSCFG5xxx;
+#else
 	*(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= 0x00001000;
+#endif
 
 

If you think it is likely that these nubers may need adjustment for other boards, then we should #defined them for ALL boards in the config file and get rid of the "#if defined()" mess here.

Your patch adds no code tat actually uses these constants, so basicly all we do is create dead code.

Quoted 9 lines

That's why I reject the patch as is. Please feel free to address the 3 issues listed above and resubmit.

Best regards,

Wolfgang Denk

Best regards

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot-ide-usb-mpc5200.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20040302/8f7536a1/attachment.txt

#3 lore raw

[U-Boot-Users] Patch generalizing USB and IDE drivers for MPC5200

Quoted 3 lines · In message <[email protected]> you wrote:

* Patch by Pierre AUBERT, 02 Mar 2004
cleanups on IDE and USB drivers for MPC5200

Thanks, checked in (slightly modified)

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Fascinating is a word I use for the unexpected.
	-- Spock, "The Squire of Gothos", stardate 2124.5
#4 lore raw

[U-Boot-Users] linker script howto.

In reply to Reinhard Meyer

Greeting.

Can someone point me at some helpful howto's on writing LDS files for the gnu linker? I have been so far benefiting from copying chunks of existing ones, but am looking for more detail about how that rules & assumptions really work.

Thanx.

-dbu
<[email protected]>

#5 lore raw

[U-Boot-Users] linker script howto.

Dave,
Take a look at the Using ld GNU document. It explains all about scripting in the linker. The "info ld" command also has a great deal of information about scripts with examples.

Cal Erickson

Quoted 24 lines · David Updegraff

Greeting.

Can someone point me at some helpful howto's on writing LDS files for the gnu
linker? I have been so far benefiting from copying chunks of existing ones, but
am looking for more detail about how that rules & assumptions really work.

Thanx.

-dbu
<[email protected]>

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Signature · 6 lines
===========================================================================
Cal Erickson                 MontaVista Software Inc.
Linux Consultant             1237 E. Arques Ave.
Phone (408) 328-0304         Sunnyvale CA 94085
Fax   (408) 328-9204         web http://www.mvista.com
===========================================================================
#6 lore raw

[U-Boot-Users] linker script howto.

In reply to David Updegraff
Quoted 4 lines · In message <[email protected]> you wrote:

Can someone point me at some helpful howto's on writing LDS files for the gnu linker? I have been so far benefiting from copying chunks of existing ones, but am looking for more detail about how that rules & assumptions really work.

See the GNU ld documentation (info pages).
File: ld.info, Node: Scripts, Section: Linker Scripts

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The Gates in my computer are AND, OR and NOT; they are not Bill.
#7 lore raw

[U-Boot-Users] linker script howto.

In reply to David Updegraff

Hi,
you can get more help and samples. use the "info ld" and select the
Scripts link

Regards
Ganapathi C

----- Original Message -----
From: "David Updegraff" <[email protected]>
To: "U-Boot Mailing List" <[email protected]>
Sent: Monday, March 01, 2004 11:46 PM
Subject: [U-Boot-Users] linker script howto.

Quoted 3 lines

Greeting.

Can someone point me at some helpful howto's on writing LDS files for the

gnu

Quoted 1 line

linker? I have been so far benefiting from copying chunks of existing

ones, but

Quoted 18 lines

am looking for more detail about how that rules & assumptions really work.

Thanx.

-dbu
<[email protected]>

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users