FS#11137 - This is initial patch that adds MPIO HD200 as a new target.

Attached to Project: Rockbox
Opened by Marcin Bukat (MarcinBukat) - Monday, 22 March 2010, 14:59 GMT
Last edited by Marcin Bukat (MarcinBukat) - Tuesday, 27 April 2010, 09:43 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Coldfire-based
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Included are:
- basic bootloader (but install instruction is not described yet)
- port specyfic files
- UI simulator

currently it is possible to load bootloader int iram with BDM and than boot rockbox. Many things does not work yet.
This task depends upon

Closed by  Marcin Bukat (MarcinBukat)
Tuesday, 27 April 2010, 09:43 GMT
Reason for closing:  Accepted
Additional comments about closing:  Commited as r25724, r25725 and r25726
Comment by Marcin Bukat (MarcinBukat) - Monday, 22 March 2010, 15:00 GMT
somehow patch got lost in action :-)
Comment by Marcin Bukat (MarcinBukat) - Monday, 22 March 2010, 18:20 GMT
A bit refined version of the patch. Removed whitespace changes in bootloader/common.c and changed model name in tools/scramble.c (I saw now model name h10_5gb which breaks '4 char rule', that is why I named my target hd200)
Comment by Rafaël Carré (funman) - Monday, 22 March 2010, 19:06 GMT
Great job!

About the "4 char rule" it's not a problem because we only use it to determine the model number, it can be arbitrarily long as long as it is given as argument to scramble (just saw that, I would have used longer names if i knew..)

Here some remarks:

- I see there are a lot of places where DRAM start is defined to 0x31000000 : could you put that in an header? like firmware/target/coldfire/mpio/hd200/system-target.h
- did Dave Chapman really write wm8750.h 5 years ago ?
- config.h has a FIXME for tuner, can the FIXME be removed, or tuner be commented out ?
- same for pcm-coldfire.c, wmcodec-coldfire.c
- there is an added chunk in coldfire/crt0.S : can you add a comment for this one ?

If you are not sure about how to implement lcd_blit_*() you could ask amiconn on irc
Comment by Marcin Bukat (MarcinBukat) - Tuesday, 23 March 2010, 22:21 GMT
about remarks:
- DRAM start define - I took existing CF ports (iriver,iaudio) as a template and there were no such define.
- wm8750.h is for now copy of wm8751.h (wm8751 is little brother of wm8750). Basic register addresses and fields are the same for both DACs. When I make playback working I am going to extend it to support additional capabilities.
- I think lcd_blit_*() are not critical for now. There are much more important features to develop.

changes in patch:
- commented out unused (for now) options in config/mpiohd200.h. This forces some ifdefs in pcm-coldfire.c
- added more comments in code and remove FIXMEs
Comment by Rafaël Carré (funman) - Wednesday, 24 March 2010, 00:48 GMT
If the files are identical for now shouldn't you use 8751.h / 8751.c, and in the future add some #ifdef for code specific to 8750:

in wm8751.c:

#ifdef HAVE_WM8750
/* specific code */

Unless they differ too much (and you run into a #ifdef nightmare), code should be shared as much as possible i think
Comment by Marcin Bukat (MarcinBukat) - Sunday, 28 March 2010, 22:33 GMT
More bootloader work. This bootloader along with mkmpioboot utility was successfully tested on my device. If the menu introduced in bootloader is a nodo I will change this later but personally I found it convenient.
Graphic for UI simulator was changed a bit also.
Comment by Marcin Bukat (MarcinBukat) - Tuesday, 30 March 2010, 13:47 GMT
Fixes few bugs and most important adds basic sound output support. There is some very high pitch noise audible though. Volume control works, did not try bass/treble settings. I also separated change to apps/plugins/ as a separate task  FS#11153 .
Comment by Marcin Bukat (MarcinBukat) - Thursday, 08 April 2010, 14:15 GMT
1. Found workaround for high pitch noise.
2. Extended delay between setting adc channel and reading. This make battery reading more stable. I don't know why buttons are not affected...
3. ata_enable() is empty now. It makes USB bridge mode work in rockbox. Idealy it should contain handling of GL811E reset line but I am not sure which one it is.
4. Hacked ata-as-coldfire.S to include byteswaps. Now it is moved to ata-as-mpio.S but maby it would be better to integrate the two with #ifdef BYTESWAP magic. Only optimized reading routine is used. I did not measured what is the impact of the change.
5. Changed behaviour of bootloader to reset instead of poweroff in case AC wall adapter is connected.
6. Included lcd_shutdown() as a part of power_off()

I found out that playing mp3 needs ~108MHz and playing ogg needs ~121MHz. This is much much more than raported in for other Coldfire based DAPs. The delta between mp3 and ogg is comparable though.
Comment by Marcin Bukat (MarcinBukat) - Wednesday, 21 April 2010, 13:52 GMT
1) squashed stupid bug in lcd_update_rect (THANKS b0hoon). Now UI is *MUCH* more responsive
2) moved ADC reading to ISR
3) enabled plugins (keymaps and graphics may need fine tunning)
4) begin work on radio support (not finished yet)
Comment by Marcin Bukat (MarcinBukat) - Monday, 26 April 2010, 12:58 GMT
Split patch into 3 separate. Small fixes as disscussed on IRC
Comment by Marcin Bukat (MarcinBukat) - Monday, 26 April 2010, 20:46 GMT
small fixes and cleanups