summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525
AgeCommit message (Collapse)AuthorFilesLines
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis2-49/+36
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-01-05Add missing kernel.h includes (hopefully all of them), take #3.Thomas Martitz1-2/+4
Change-Id: I68ed0e914239f0caf83082a41c2480a01b69285a
2014-01-05Add missing kernel.h includes (hopefully all of them), take #2.Thomas Martitz1-2/+2
Change-Id: I62cedf992bb096987050621cfc34f0432e9da170
2014-01-05Add missing kernel.h includes (hopefully all of them).Thomas Martitz2-1/+4
Change-Id: I9c1825296a788587b8d494d8514b3314847b0ff0
2014-01-05Do not include kernel.h in system.h.Thomas Martitz3-3/+6
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2013-08-17Cleanup MV/MD macros a little.Michael Sevakis2-12/+12
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2012-11-12AMS: make sure ROM clock is always onRafaël Carré1-7/+2
Change-Id: Ib73b21b944cb609cc26f7f6955d2c894628f65ad
2012-07-22Revert my previous commit disabling the internal ROM clock during normalMichael Giacomelli1-4/+6
operation. The interal ROM clock seems to be needed to reboot the player, so disabling it is too dangerous. Hopefully this will prevent problems where crashes during the abort handler resulted in a stock player that needed the battery to drain in order to reboot. Change-Id: I7d1e64743dde15b64d718ad3255dada3d570736f
2012-05-19lcd-ssd1303: Fix big oops putting height where there should've been width.Michael Sevakis1-2/+13
Rid code of dar commasar and substitute huggy braces while we're at it. :P Change-Id: If91974b93660bb0de32a0c92629eb83cea99d266
2012-05-19ssd1303: make sure sansa clip and whatever others clip updates properly.Michael Sevakis1-6/+12
Sometimes I do want to update outside the screen boundaries and it was messing it up; such things should not cause display problems. Change-Id: Ic9deec609b19e5a1c603601b20c66599dd44f892
2012-05-07remove debug-target.hRafaël Carré1-0/+0
2012-05-07Sansa AMS: more compat irq namesRafaël Carré1-7/+7
2012-05-06sansa AMS: i2s_reset() is never usedRafaël Carré1-28/+0
2012-05-01Make INITDATA_ATTR work on everything that has INIT_ATTR enabled for code.Michael Sevakis1-1/+1
Change-Id: If9936bfbbd3bc3eb2a3e3e290701b8517eabfb13
2012-04-30AMSv1: rename USB interrupt handlerRafaël Carré1-1/+1
Fix FS#12660 (broken in c9c13497)
2012-04-28usb-s3c6400: merge the 2 driversRafaël Carré1-2/+2
Player-specific code remaining: usb_drv_(init,exit) The iPods lack a MMU, so: - physical, virtual, and uncached addresses are identical - since we can't access uncached memory we discard caches when receiving data Still not quite reliable on nano2g Change-Id: Iebb79df64818b9ae3b68eccb8be8975ebd6c21ea
2012-03-19sansa clip+: properly reset display using the reset pinBertrik Sikken1-1/+3
Change-Id: Ic4bb85cfca4e21d908e187381b868d3f7ef18f88
2012-03-04AMSv2: add proper definitions for charge currentBertrik Sikken1-4/+4
Change-Id: I6a14570e94df1be62ae46816d2ff4e3f2b7bc21a
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis1-8/+12
Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-02-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon4-5/+5
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2012-01-30Clipv2: fix button reading on some modelsRafaël Carré1-0/+1
We neet to setup the XPD to work as GPIO storage unaffected Tested on working-already Clipv2 and on a 'brickable' clipv2 Change-Id: Idcbdfb6bd50d51b7f6f7e00b21df24fac9b3a6d8
2012-01-29AMSv1/AMSv2: show CCU_IO in debug menuBertrik Sikken1-2/+1
Change-Id: I8ee9d464a6a3aebc21b60ac88e1b3833dca48885
2012-01-11lcd: fix function name in comments in assembly files (lcd_write_yup_420 ↵Amaury Pouly1-2/+2
instead of lcd_write_yuv420)
2012-01-08AS3525v1/2: Enable nested handling of interruptsMichael Sevakis5-29/+71
Mostly for the sake of reducing latency for audio servicing where other service routines can take a long time to complete, leading to occasional drops of a few samples, especially in recording, where they are fairly frequent. One mystery that remains is GPIOA IRQ being interrupted causes strange undefined instruction exceptions, most easily produced on my Fuze V2 with a scrollwheel. Making GPIOA the top ISR for now, thus not interruptible, cures it. SVC mode is used during the actual calls. Hopefully the SVC stack size is sufficient. Prologue and epilogue code only uses the IRQ stack and is large enough. Any routine code that should not be interrupted should disable IRQ itself from here on in. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31642 a1c6a512-1295-4272-9138-f99709370657
2012-01-08Remove duplicate #include "button.h"Bertrik Sikken1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31636 a1c6a512-1295-4272-9138-f99709370657
2012-01-08ascodec-target.h: removeRafaël Carré11-106/+47
move prototypes to ascodec.h move code to ascodec*.c YPR0: use adc-as3514.c instead of duplicating it TODO: merge as3514.h and ascodec.h ? git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31626 a1c6a512-1295-4272-9138-f99709370657
2012-01-08lcd-target.h: remove some duplicate declarationsRafaël Carré1-3/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31625 a1c6a512-1295-4272-9138-f99709370657
2012-01-08adc-target.h: cleanupRafaël Carré1-25/+0
move adc_close() prototype to adc.h don't duplicate prototypes of adc.h remove license header and guards for a single include of another file or for empty content git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31623 a1c6a512-1295-4272-9138-f99709370657
2012-01-08fix previous commitRafaël Carré1-1/+1
implement button_init_device for ondio include button.h to get prototypes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31621 a1c6a512-1295-4272-9138-f99709370657
2012-01-08button-target.h : move prototypes to button.hRafaël Carré15-85/+5
no need to define BUTTON_REMOTE anymore git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31620 a1c6a512-1295-4272-9138-f99709370657
2012-01-07powermgmt-target.h: move prototypes to powermgmt.hRafaël Carré1-4/+0
Implement empty stubs if needed instead of empty static inline git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31617 a1c6a512-1295-4272-9138-f99709370657
2012-01-04Reorganise USB initialisation to not depend on a specific enumeration ↵Frank Gevaerts1-16/+0
sequence, by Bartosz Fabianowski, with minor tweaks by Michael Sevakis (FS#12497) FreeBSD apparently sends a SET_ADDRESS first, which confused our code. This patch fixes that, and also simplifies the connection handling a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31582 a1c6a512-1295-4272-9138-f99709370657
2012-01-04as3525: move debug-target.h content to .cRafaël Carré2-27/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31572 a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_hw_info(): remove duplicate prototypesRafaël Carré1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31560 a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_ports(): remove duplicate prototypeRafaël Carré1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31558 a1c6a512-1295-4272-9138-f99709370657
2012-01-03Rework powermgmt to enable code re-use on appliation and sims.Thomas Martitz1-1/+1
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application) to break powermgmt.c's assumption about the ability to read battery voltage. There's now additionally percentage (android) and remaining time measure (maemo). No measure at all also works (sdl app). If voltage can't be measured, then battery_level() is king and it'll be used for power_history and runtime estimation. * Implement target's API in the simulator, i.e. _battery_voltage(), so it doesn't need to implement it's own powermgmt.c and other stubs. Now the sim behaves much more like a native target, although it still changes the simulated battery voltage quickly, * Other changes include include renaming battery_adc_voltage() to _battery_voltage(), for consistency with the new target functions and making some of the apps code aware that voltage and runtime estimation is not always available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-drv-as3525v2.c: merge in usb-s3c6400x.cRafaël Carré1-441/+0
as3525v2 specific part is 400 LoC, ipod specific less than 300 (comments and whitespace included) TODO: merge properly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31509 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-s3c6400: use more complete functions from usb-drv-as3525v2Rafaël Carré1-24/+0
update copyright git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31508 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-drv-as3525v2.h: removeRafaël Carré2-76/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31507 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-s3c6400x: start factorizationRafaël Carré1-44/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31506 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-drv-as3525v2: cosmeticsRafaël Carré1-12/+12
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31501 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-target.h: removeRafaël Carré4-3/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31498 a1c6a512-1295-4272-9138-f99709370657
2011-12-31firewire/usb_remove/insert_int: move to system-target.hRafaël Carré2-27/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31491 a1c6a512-1295-4272-9138-f99709370657
2011-12-31move usb_pin_init() declaration to PP's system-target.hRafaël Carré1-1/+0
remove duplicate usb_detect() declaration Remove all content from empty usb-target.h files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31488 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb_init_device(): move prototype to usb.hRafaël Carré2-2/+4
Get rid of some usb-target.h files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31487 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-drv-as3525v2: move interrupt disableRafaël Carré1-1/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31486 a1c6a512-1295-4272-9138-f99709370657
2011-12-28usb-srv-as3525v2: backport r31458Michael Sparmann1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31459 a1c6a512-1295-4272-9138-f99709370657
2011-12-22usb-drv-as3525v2: use all endpointsRafaël Carré1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31399 a1c6a512-1295-4272-9138-f99709370657
2011-12-21Add missing includes found using -Wmissing-declarations.Boris Gjenero1-0/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31396 a1c6a512-1295-4272-9138-f99709370657
2011-12-19usb-drv-as3525v2: revert part of r31243Rafaël Carré1-18/+15
assigning a partially initialized structure (through casting) will initialize members unspecified in the initialization git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31372 a1c6a512-1295-4272-9138-f99709370657