This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12363 - Sandisk Sansa Connect port
Attached to Project:
Rockbox
Opened by Tomasz Moń (desowin) - Wednesday, 02 November 2011, 22:35 GMT+2
Last edited by Tomasz Moń (desowin) - Thursday, 17 November 2011, 13:12 GMT+2
Opened by Tomasz Moń (desowin) - Wednesday, 02 November 2011, 22:35 GMT+2
Last edited by Tomasz Moń (desowin) - Thursday, 17 November 2011, 13:12 GMT+2
|
DetailsI am attaching patch adding initial support for Sandisk Sansa Connect.
Installation currently requires little hardware modification to bypass the check. Bootloader build is assumed to be installed in place of vmlinux - it can boot both OF (by pressing PREV whilst booting; vmlinux.bin and initrd.bin are being searched on storage and then loaded) and Rockbox. Included is initial support for following: -buttons -lcd -sdhc -backlight Easiest way to test new builds of Rockbox main binary is to set device into "usbautoboot" mode (login into OF shell and issue command "ptool -s usbautoboot 1") and then use zsitool to upload the binary (adding .srr header is required) into RAM. zsitool can be found at: http://hg.atheme.org/users/desowin/zsitool/ Mentioned hardware modification: http://desowin.jogger.pl/2011/10/19/sansa-connect-hacking-cz-5-flashing-bootloader/ |
This task depends upon
Closed by Tomasz Moń (desowin)
Thursday, 17 November 2011, 13:12 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r31000.
Thursday, 17 November 2011, 13:12 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r31000.
Moreover, I fixed the model num to 81 in scramble.c and configure (a new target was commited with id 80 during my work on this port and I forgot to update those on merge).
Attached (cumulative, supersedes previous patches) patch fixes it.
Improved button experience - scrollwheel still appears slow, but is much more deterministic now.
Fixed SD write operation as well as cache commit/invalidation.
Fixed plugins - those can load now fine.
Notes:
-------------------
CONFIG_SDRAM_START missing for Creative Zen and M:Robe
"#if defined"'s added to system-dm320.c for CREATIVE_ZVx are not accurate. They should just include the M:Robe, the ZVX port is broken and unmaintained.
Should system_prepare_fw_start be placed in the crt0-board.S along with an inclusion of the branch to that function?
This is not specific to your port: but in general it looks like system-dm320 needs to be re-factored so that we can avoid some of those ifdef's and isolate the target specific stuff. Not sure on an approach for that offhand.
-------------------
The work looks great. If you get to the DSP code and have trouble let me know and I will help out on that.
Changed the "#if defined"'s.
Changed few comments in code - no functional changes.
One question on system-dm320.c:
Can this:
+#ifdef SANSA_CONNECT
+ IO_CLK_PLLA = 0xA0;
+ IO_CLK_SEL0 = 0x66;
+ IO_CLK_SEL2 = 0;
+ IO_CLK_PLLB = 0x1000; /* powerdown PLLB */
+ IO_CLK_DIV0 = 0x101; /* AHB, ARM */
+ IO_CLK_DIV1 = 0x102; /* Accelerator, SDRAM */
+ IO_CLK_DIV2 = 0x200; /* DSP, MS clock */
+ IO_CLK_BYP = 0;
+#endif
be placed in _init_board (crt0-board.S).. does it make sense?
Added crt0-board.S for this target which does initialization (Clocks, SDRAM, GIO).
One other thought:
It looks like the AVR code uses the second SPI interface. Is it possible to extend the existing SPI driver in spi-dm320.c so that it can talk through either controller?
The init function could probably setup both controllers since it disables the clock at the end anyway. The spi_targets structure could possibly include the target SPI controller as a field so that the same block_transfer function could be used for both controllers.
I am not sure if that is the best solution; I am just trying to avoid duplicate code.
The main reason behind discarding that idea was that the SPI0 interface can do DMA, whilst the SPI1 can't - hence I think the functions in spi-dm320.c should be separate, with SPI0 using DMA.
The timings need to be fixed - the udelay(100) are just rought estimates that make sure all the commands work.
Given above reasons, it's why I decided to put that code into avr-sansaconnect.c.
Fixed bug in LCD initialization which set other GIOs controlled by IO_GIO_DIR2 register.
Added I2C software implementation on GIO36 (SCL) and GIO35 (SDA) which is used in Sansa Connect (the hardware I2C cannot be used, as the pins are already occupied by SPI).
Added AIC3X audio driver.
Synced to latest SVN, added GUI boost support.
Changes to SD initialization greatly improves storage access - loading OF image from storage is now mere seconds instead of nearly two minutes.
Fixed hold switch change detection (lost hold switch changes should be gone).
Use sleep(HZ/20) in lcd_sleep() instead of udelay(50000) to improve resonsiveness.