summaryrefslogtreecommitdiffstats
path: root/bootloader/sansa_as3525.c
AgeCommit message (Collapse)AuthorFilesLines
2016-04-22Fix AMSv2 variant 1 detection if rockbox loaded from SD cardMihail Zenkov1-0/+7
Change-Id: Ie7c9c06170601e109f8d3de9686773c38a6e224a
2015-06-02AMS: fix usb initialization in bootloaderMihail Zenkov1-0/+2
Regression after 8b8b85433f6e9ac673adb Change-Id: I86389be0b85c5c2ad8a32d7089a6a79a6b7c8708
2015-01-08usb: finally get rid of USE_ROCKBOX_USB in Sansa bootloader, use bootloader usbAmaury Pouly1-8/+8
For some reason, the bootloader and config files didn't define HAVE_BOOTLOADER_USB_MODE, also remove the special cases in usb.c which they implied. Change-Id: I68c29be7d03627e64cac4ff7678e0c211e087a8c
2014-10-04Fix USB speed detectionMihail Zenkov1-3/+5
Change-Id: I615d2d5366ffa1e2e9c6b0837bf5a62a7e471fca Reviewed-on: http://gerrit.rockbox.org/994 Reviewed-by: Frank Gevaerts <frank@gevaerts.be> Tested: Mihail Zenkov <mihail.zenkov@gmail.com> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis1-7/+3
This patch redoes the filesystem code from the FAT driver up to the clipboard code in onplay.c. Not every aspect of this is finished therefore it is still "WIP". I don't wish to do too much at once (haha!). What is left to do is get dircache back in the sim and find an implementation for the dircache indicies in the tagcache and playlist code or do something else that has the same benefit. Leaving these out for now does not make anything unusable. All the basics are done. Phone app code should probably get vetted (and app path handling just plain rewritten as environment expansions); the SDL app and Android run well. Main things addressed: 1) Thread safety: There is none right now in the trunk code. Most of what currently works is luck when multiple threads are involved or multiple descriptors to the same file are open. 2) POSIX compliance: Many of the functions behave nothing like their counterparts on a host system. This leads to inconsistent code or very different behavior from native to hosted. One huge offender was rename(). Going point by point would fill a book. 3) Actual running RAM usage: Many targets will use less RAM and less stack space (some more RAM because I upped the number of cache buffers for large memory). There's very little memory lying fallow in rarely-used areas (see 'Key core changes' below). Also, all targets may open the same number of directory streams whereas before those with less than 8MB RAM were limited to 8, not 12 implying those targets will save slightly less. 4) Performance: The test_disk plugin shows markedly improved performance, particularly in the area of (uncached) directory scanning, due partly to more optimal directory reading and to a better sector cache algorithm. Uncached times tend to be better while there is a bit of a slowdown in dircache due to it being a bit heavier of an implementation. It's not noticeable by a human as far as I can say. Key core changes: 1) Files and directories share core code and data structures. 2) The filesystem code knows which descriptors refer to same file. This ensures that changes from one stream are appropriately reflected in every open descriptor for that file (fileobj_mgr.c). 3) File and directory cache buffers are borrowed from the main sector cache. This means that when they are not in use by a file, they are not wasted, but used for the cache. Most of the time, only a few of them are needed. It also means that adding more file and directory handles is less expensive. All one must do in ensure a large enough cache to borrow from. 4) Relative path components are supported and the namespace is unified. It does not support full relative paths to an implied current directory; what is does support is use of "." and "..". Adding the former would not be very difficult. The namespace is unified in the sense that volumes may be specified several times along with relative parts, e.g.: "/<0>/foo/../../<1>/bar" :<=> "/<1>/bar". 5) Stack usage is down due to sharing of data, static allocation and less duplication of strings on the stack. This requires more serialization than I would like but since the number of threads is limited to a low number, the tradoff in favor of the stack seems reasonable. 6) Separates and heirarchicalizes (sic) the SIM and APP filesystem code. SIM path and volume handling is just like the target. Some aspects of the APP file code get more straightforward (e.g. no path hashing is needed). Dircache: Deserves its own section. Dircache is new but pays homage to the old. The old one was not compatible and so it, since it got redone, does all the stuff it always should have done such as: 1) It may be update and used at any time during the build process. No longer has one to wait for it to finish building to do basic file management (create, remove, rename, etc.). 2) It does not need to be either fully scanned or completely disabled; it can be incomplete (i.e. overfilled, missing paths), still be of benefit and be correct. 3) Handles mounting and dismounting of individual volumes which means a full rebuild is not needed just because you pop a new SD card in the slot. Now, because it reuses its freed entry data, may rebuild only that volume. 4) Much more fundamental to the file code. When it is built, it is the keeper of the master file list whether enabled or not ("disabled" is just a state of the cache). Its must always to ready to be started and bind all streams opened prior to being enabled. 5) Maintains any short filenames in OEM format which means that it does not need to be rebuilt when changing the default codepage. Miscellaneous Compatibility: 1) Update any other code that would otherwise not work such as the hotswap mounting code in various card drivers. 2) File management: Clipboard needed updating because of the behavioral changes. Still needs a little more work on some finer points. 3) Remove now-obsolete functionality such as the mutex's "no preempt" flag (which was only for the prior FAT driver). 4) struct dirinfo uses time_t rather than raw FAT directory entry time fields. I plan to follow up on genericizing everything there (i.e. no FAT attributes). 5) unicode.c needed some redoing so that the file code does not try try to load codepages during a scan, which is actually a problem with the current code. The default codepage, if any is required, is now kept in RAM separarately (bufalloced) from codepages specified to iso_decode() (which must not be bufalloced because the conversion may be done by playback threads). Brings with it some additional reusable core code: 1) Revised file functions: Reusable code that does things such as safe path concatenation and parsing without buffer limitations or data duplication. Variants that copy or alter the input path may be based off these. To do: 1) Put dircache functionality back in the sim. Treating it internally as a different kind of file system seems the best approach at this time. 2) Restore use of dircache indexes in the playlist and database or something effectively the same. Since the cache doesn't have to be complete in order to be used, not getting a hit on the cache doesn't unambiguously say if the path exists or not. Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8 Reviewed-on: http://gerrit.rockbox.org/566 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
2014-08-08Bootloaders need the reacharound to get at the internal goodsMichael Sevakis1-0/+1
They need to include kernel-internal.h in order to perform inits. Change-Id: I5b0f155e4ff49a065c6cb97691ecd4396a199979
2013-06-27Move load_firmware() to separate fileMarcin Bukat1-1/+3
The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2011-12-17Swap red and yellow for green on r31339's cranky builds.Michael Sevakis1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31340 a1c6a512-1295-4272-9138-f99709370657
2011-12-14Fix the real issue with AMS bootloader USB mode. A call to usb_enable was ↵Michael Sevakis1-2/+0
missing in usb.c when using the USB stack and USB_DETECT_BY_CORE was not enabled. Try to do it in a clean-ish way. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31245 a1c6a512-1295-4272-9138-f99709370657
2011-12-14Sansa AMS: fix usb in bootloaderRafaël Carré1-0/+2
No need to define HAVE_BOOTLOADER_USB_MODE That define might need some cleaning up Fix FS#12384 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31241 a1c6a512-1295-4272-9138-f99709370657
2011-09-08Remove return value from show_logo() in bootloader/Bertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30485 a1c6a512-1295-4272-9138-f99709370657
2011-08-27Initial framework for the Sandisk Sansa Clip ZipBertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30365 a1c6a512-1295-4272-9138-f99709370657
2011-07-02sansa AMS bootloader: make strings staticRafaël Carré1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30118 a1c6a512-1295-4272-9138-f99709370657
2010-08-12Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this ↵Thomas Martitz1-1/+2
and a bit further cleanup in main gets rid of a warning when compiling for android. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27788 a1c6a512-1295-4272-9138-f99709370657
2010-06-23sansa AMS bootloader: build if USE_ROCKBOX_USB isn't definedRafaël Carré1-0/+18
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27076 a1c6a512-1295-4272-9138-f99709370657
2010-06-23Sansa AMS bootloader: enter USB mode only when neededRafaël Carré1-34/+47
- If an error happens when reading partitions / rockbox.sansa - If the select button was pressed add an argument to error() to not power off, when we're going to enter USB mode to try to fix the problem, but display the error message anyway for debugging purpose git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27075 a1c6a512-1295-4272-9138-f99709370657
2010-06-18as3525*: enable MMU in bootloaderRafaël Carré1-2/+1
Reserve 1MB of DRAM for loading rockbox and use the rest as BSS Write sdram setup in assembler and move it to a separate file, together with MMU init code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26926 a1c6a512-1295-4272-9138-f99709370657
2010-06-18Sansa AMS: fix bootloader USB modeRafaël Carré1-6/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26914 a1c6a512-1295-4272-9138-f99709370657
2010-06-18as3525: bootloader USB modeRafaël Carré1-0/+28
not working yet : an empty drive is detected won't link on fuzev1: drivers allocated in usb_storage.c are too large git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26905 a1c6a512-1295-4272-9138-f99709370657
2010-02-05Make Clip+ bootloader buildRafaël Carré1-1/+2
Now making the Fuzev2 bootloader build should be pretty easy TODO: - write button driver (FlynDice found all buttons already) - find button light - decide if lcd-ssd1303.c must be modified for Clip+ using SSP or forked - check if backlight code works (I copied Clipv2 code) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24520 a1c6a512-1295-4272-9138-f99709370657
2009-12-31FS#10047 : Clipv2Rafaël Carré1-2/+2
Reuse some code from Clip (LCD) and a lot of code from AS3525 Add a new CPU type : AS3525v2, identical to AS3525 except it's an ARMv5 (arm926-ejs) SD code still not working For an unknown reason LCD doesn't work anymore (to be investigated) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24131 a1c6a512-1295-4272-9138-f99709370657
2009-06-17Sansa c200v2 : lcd & backlight support, using the c200v1 lcd driverRafaël Carré1-8/+4
The LCD driver is unified and lcd_send_command now takes 2 arguments : the command and its argument. If there is no argument, it's set to 0 and a NOP command is issued If there is more than one argument (set X/Y address), the 2nd argument is sent as a 2nd command, and a NOP command is issued after it. Benefit : c200v2 transfers the command and the argument in one 16 bits transfer Performance should not be affected since commands without argument are only used in lcd_init() and lcd_enable() lcd_send_data() now transfers whole lines (or columns) instead of single pixels yuv is disabled for c200v2 for now Some buttons can be read, including left button (bit 6 of DBOP_DIN), but for some reason they have no effect in rockbox: to be investigated git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21321 a1c6a512-1295-4272-9138-f99709370657
2009-06-08FS#10048 : enable MMU and data cache on Sansa AMS to give a major speed upRafaël Carré1-0/+2
- cache IRAM and DRAM - map IRAM just next to DRAM to remove the need for -mlong-calls and reduce binsize - tweak delays in Fuze button code - tweak delays in Clip button code (down button sometimes doesn't respond anyway : an alternate driver is being worked on) Before reporting any problem, please check your filesystem or format your player from the OF git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21228 a1c6a512-1295-4272-9138-f99709370657
2009-05-20Sansa AMS: Centralise mapping of RAM and IRAM in as3525.h via #defines. This ↵Thomas Martitz1-2/+2
will hopefully make ongoing mmu work easier as less places need to be changed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21000 a1c6a512-1295-4272-9138-f99709370657
2009-04-10FS#10066 by Michael Chicoine: Sansa AMS bootloader "Hold" switch detection.Mustapha Senhaji1-0/+13
(Not for the Fuze nor the Clip, because it seems pointless for them) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20681 a1c6a512-1295-4272-9138-f99709370657
2009-04-07commit FS#10092 (cleanup AMS system init) by Rafaël Carré. Dominik Wenger1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20640 a1c6a512-1295-4272-9138-f99709370657
2008-12-24Commit FS#9679 by Thomas Martitz. Adds c200v2 to the target tree. Has some ↵Michael Giacomelli1-0/+4
buttons defined, a bootloader, and stubs for most drivers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19574 a1c6a512-1295-4272-9138-f99709370657
2008-11-25Sansa AMS bootloader: consider the bootloader finishedRafaël Carré1-12/+3
Be verbose only if a keypress has been detected. Use enable/disable_irq() instead of inline assembly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19213 a1c6a512-1295-4272-9138-f99709370657
2008-11-11the delay in the as3525 bootloader was driving me mad so remove it and get ↵Jonathan Gordon1-4/+11
the bootloader closer to where a "finished" one should be (only show info if sometrhing needs to be shown, which is always for now.) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19085 a1c6a512-1295-4272-9138-f99709370657
2008-11-10Sansa AMS bootloader: use the correct (renamed) header fileRafaël Carré1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19075 a1c6a512-1295-4272-9138-f99709370657
2008-11-09Rename functions as3525_codec_* to ascodec_* to prepare re-use of as3514 ↵Bertrik Sikken1-1/+1
code for sansa v2 players git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19047 a1c6a512-1295-4272-9138-f99709370657
2008-11-09Sansav2 BootloaderRafaël Carré1-19/+47
Adds read-only SD driver, largely copied from ata-sd-pp.c Only tested on the embedded SD, on the Clip First steps to build a Normal firmware git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19045 a1c6a512-1295-4272-9138-f99709370657
2008-11-06AS3525: we won't use threads in the bootloaderRafaël Carré1-1/+1
Disable tick_start() Call kernel_init() _after_ system_init() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19028 a1c6a512-1295-4272-9138-f99709370657
2008-11-06AS3525: use kernel_init() in bootloaderRafaël Carré1-0/+1
This way creation of scrolling thread doesn't risk crashing the system git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19026 a1c6a512-1295-4272-9138-f99709370657
2008-11-01Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts1-2/+2
that, it also introduces sd_*, nand_*, and mmc_*. This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-10-29Embryo of a SD driver for Sansav2Rafaël Carré1-1/+4
Debug code included, needed until the bootloader is ready git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18926 a1c6a512-1295-4272-9138-f99709370657
2008-10-29e200v2: implement the backlight handling (copy/paste from the c200v1/e200v1 ↵Dave Chapman1-10/+7
code - this should probably be unified, along with other upcoming v2 code), plus clean up the lcd init by calling lcd_init() directly in the bootloader, instead of lcd_init_device(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18910 a1c6a512-1295-4272-9138-f99709370657
2008-10-28Sansav2 : initializes SDRAMRafaël Carré1-0/+2
The AS3525 SoC ships with an ARM PL172 MPMC controller Also correct the memory sizes in tools/configure git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18899 a1c6a512-1295-4272-9138-f99709370657
2008-10-26FS#9503 - Sansa v2 audio/PMU communication driver (for the AS3525 SoC)Bertrik Sikken1-0/+11
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18886 a1c6a512-1295-4272-9138-f99709370657
2008-10-19Add e200v2 and m200v2 targets. Move the telechips lcd-ssd1815.c (currently ↵Dave Chapman1-1/+3
used by Logik DAX and m200v1 ports) driver up in the target tree and share with the m200v2 - as2525 parts contributed by Rafael Carre. Includes the start (but is still very incomplete) of an LCD driver for the e200v2. m200v2 is not yet fully supported by mkamsboot - that will come soon. Also some minor cleanups for the Clip. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18836 a1c6a512-1295-4272-9138-f99709370657
2008-10-12Commit FS#9467 - initial work on port to Sansa Clip by Rafaël Carré and ↵Dave Chapman1-0/+58
François Dinel. A few cosmetic changes were made by me prior to committing: 1) TAB policing in button-clip.c; 2) Add François Dinel to CREDITS; 3) Add François Dinel as (C) holder in button-target.h (it was previously blank); 4) Add Rockbox header to bootloader/sansa_as3525.c with Rafaël Carré as (C) holder; 5) Change target_id to 50 (next available number) in tools/configure and fixed indentation; 6) Change MODEL_NUMBER in config-clip.h to 50 (next available number); 7) Remove unused in/out macros from system-target.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18782 a1c6a512-1295-4272-9138-f99709370657