Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: dreamlayers on December 14, 2008, 07:09:03 PM

Title: pp502x: Does IDE0 have to be reset at startup?
Post by: dreamlayers on December 14, 2008, 07:09:03 PM
When Rockbox starts on my 5th generation 30 gig Video iPod, there are two clicks while the logo is displayed.  It sounds like the heads are locked and unlocked, and it seems unnecessary.  The initial lock is triggered when IDE0 is reset in system_init, and the unlock is when Rockbox tries to access the drive.  If IDE0 isn't reset, there are no clicks and startup is a bit faster.  I see no problems.  Since the bootloader was just using IDE0, it should be in a reasonable state.  A reset might be necessary if starting Rockbox from flash, but iPods can't do that now.

The same change may be possible for other pp502x based devices with hard drives.

What is the proper procedure to follow here?  Should I have submitted a patch instead?  Should I make it for other pp502x targets also, and say it needs testing on those?  I can't say I know the hardware very well, and there might be a good reason why IDE0 should be reset.  (Change is simple, DEV_RS = 0x3dfffef8 instead of 0x3ffffef8 in firmware/target/arm/system-pp502x.c (http://svn.rockbox.org/viewvc.cgi/trunk/firmware/target/arm/system-pp502x.c?view=markup) (edited: I meant pp502x not pp5002))
Title: Re: pp502x: Does IDE0 have to be reset at startup?
Post by: saratoga on December 14, 2008, 07:48:21 PM
The best thing to do would be to look at the SVN logs, figure out who wrote that code, and then ask them what they think via email or IRC.
Title: Re: pp502x: Does IDE0 have to be reset at startup?
Post by: karashata on December 15, 2008, 01:45:49 PM
My H10 20GB doesn't click on boot, and boot-up is already pretty breezy so I would suspect any potential improvement would be next-to unnoticed. However, it may not hurt to see if it makes any difference, I may give it a quick test and see what happens.

EDIT: I can't make out any difference in boot time, but making that change doesn't break anything, so it probably wouldn't hurt to make it if it fixes something elsewhere. I suppose we'll have to wait and see what whoever wrote the code says.
Title: Re: pp502x: Does IDE0 have to be reset at startup?
Post by: dreamlayers on December 15, 2008, 06:02:25 PM
The reset code was added via FS#8379 - power consumption issues PP502x/5G (http://www.rockbox.org/tracker/task/8379).  I've e-mailed Andree Buschmann about it.

The code was already separated into sections for different targets, so it would be easy to only make this change for those targets which benefit from it.

The altered code even works if Rockbox is loaded directly from the firmware partition.

Edit:  A while ago Andree told me to submit a patch.  I just did:  http://www.rockbox.org/tracker/task/9749