path: root/firmware/target/arm/tcc780x
AgeCommit message (Collapse)AuthorFilesLines
2020-10-13Fix a pile of yellow in the bootloaderSolomon Peachy1-0/+4
Change-Id: Ia89a33bbb13683566e421ac2a002baa20cdb07de
2017-10-26Unify storage threads into oneMichael Sevakis1-94/+35
* Editing a bunch of drivers' thread routines in order to implement a new feature is tedious. * No matter the number of storage drivers, they share one thread. No extra threads needed for CONFIG_STORAGE_MULTI. * Each has an event callback called by the storage thread. * A default callback is provided to fake sleeping in order to trigger idle callbacks. It could also do other default processing. Changes to it will be part of driver code without editing each one. * Drivers may sleep and wake as they please as long as they give a low pulse on their storage bit to ask to go into sleep mode. Idle callback is called on its behalf and driver immediately put into sleep mode. * Drivers may indicate they are to continue receiving events in USB mode, otherwise they receve nothing until disconnect (they do receive SYS_USB_DISCONNECTED no matter what). * Rework a few things to keep the callback implementation sane and maintainable. ata.c was dreadful with all those bools; make it a state machine and easier to follow. Remove last_user_activity; it has no purpose that isn't served by keeping the disk active through last_disk_activity instead. * Even-out stack sizes partly because of a lack of a decent place to define them by driver or SoC or whatever; it doesn't seem too critical to do that anyway. Many are simply too large while at least one isn't really adequate. They may be individually overridden if necessary (figure out where). The thread uses the greatest size demanded. Newer file code is much more frugal with stack space. I barely see use crack 50% after idle callbacks (usually mid-40s). Card insert/eject doesn't demand much. * No forcing of idle callbacks. If it isn't necessary for one or more non-disk storage types, it really isn't any more necessary for disk storage. Besides, it makes the whole thing easier to implement. Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-08-10Remove bad mutex lock/unlock from tcc780x SD driverFranklin Wei1-4/+0
This should make cowond2 work again. Change-Id: Ib23d1548f72f9b604adad46fa1a1c0adee53c29e
2015-01-12Fix red/yellowMarcin Bukat1-1/+1
Change-Id: Ie01251af2cd843979b5fdefcfa541ba377d13bd7
2015-01-12Get rid of stupid _backlight_* function namesMarcin Bukat4-12/+12
_remote_backlight_* and _buttonlight_* are cleaned as well Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis1-19/+13
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: Reviewed-by: Michael Sevakis <> Tested: Michael Sevakis <>
2014-03-03Fix various reds. Some includes needed fixup.Thomas Martitz3-1/+3
Change-Id: I4327740bae17054131feb917abdd58846c451988
2014-01-05Add missing kernel.h includes (hopefully all of them).Thomas Martitz1-0/+1
Change-Id: I9c1825296a788587b8d494d8514b3314847b0ff0
2013-08-17Cleanup MV/MD macros a little.Michael Sevakis1-2/+2
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-05-07remove debug-target.hRafaël Carré2-1/+0
2012-04-06arm: factor all exception handlers out of the crt0.S filesAmaury Pouly1-29/+0
Remove the implementations of all exceptions handlers from the various crt0.S files and have a single implementation in system-arm.h The new implementation is weak so that it can be overwritten by some specific code (like the unwinder) Change-Id: Ib3e041ed6037376bbe0e79286057e1051640dd90 Reviewed-on: Reviewed-by: Marcin Bukat <>
2012-01-08button-target.h : move prototypes to button.hRafaël Carré1-10/+0
no need to define BUTTON_REMOTE anymore git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-07cowond2's power-target.h -> rename in pmu-target.hRafaël Carré5-4/+4
other targets (ipod nano2g / classic) use that name for pmu git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_hw_info(): remove duplicate prototypesRafaël Carré1-23/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_ports(): remove duplicate prototypeRafaël Carré1-1/+0
git-svn-id: svn:// 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:// a1c6a512-1295-4272-9138-f99709370657
2011-12-18Add KEEP() around vectors in linker scripts.Boris Gjenero1-1/+1
Vectors are needed by the CPU, but they don't need to be accessed by Rockbox. Without the KEEP(), they can be removed when liking with --gc-sections, creating a broken binary without any warnings. This tells the linker to not remove them. It should enable use of --gc-sections for all targets. When not using --gc-sections, this does not change the binary. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-17Do some things to make -ffunction-sections work better.Michael Sevakis2-12/+8
* Add wildcards to various sections placements a la *(".text") => "*(.text*)" * Remove hacky bits from those linker scripts (no problem encountered testing) * Change section for asm functions from .<section> to .<section>.<function> so that -ffunction-sections works for those asm file too. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-16Convert remaining memframe LCDs that can be convert to common code.Michael Sevakis2-141/+34
Massage the way it interfaces a bit to make things more flexible. The chroma_buf scheme on Sansa Connect and Creative ZVx calling the lcd_write_yuv420_lines implementation in lcd-as-memframe.S with five params with a chroma buffer that the function can't use wouldn't work anyway so just have them use the stock implementation (really, how was that working?). git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-11-22FS#12397 : On targets which load .data directly into its final location and ↵Boris Gjenero1-9/+1
lack code for moving it, remove linker script trick which ignores section alignment and word-aligns the section instead. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-11-15Commit FS#12352 by Stanislav Chizhik. Add support for the PCF50635. ↵Michael Giacomelli1-2/+32
Enables detection of USB power sources. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-10-11Switch to SYS mode on arm FS#12322 by meMarcin Bukat1-11/+12
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-06-05Move dbg_hw_info() into target tree. FS#11735 by meMarcin Bukat2-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-01-18Try to get some control over #ifdef hell in usb.c by refactoring and inline ↵Michael Sevakis1-4/+0
function use. SYS_USB_DISCONNECTED_ACK hasn't been doing anything useful for the USB thread; remove it. USB thread simply ignores that value. Observe only valid usb_state transitions. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-11-06move dbg_ports() from apps/menu_debug.c to target tree. FS#11712 by me.Marcin Bukat2-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-09-20*/ remove STUBOFFSETRafaël Carré1-8/+2
This is related to gdb, and gdb can only work on SH and ifp This was mistakenly kept when was forked for each SoC Side-effect: fix DEBUG builds when the rockbox binary is expected to be loaded at the start of DRAM and there is no runtime relocation git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-08-28firmware/ : use lcd_putsf() (only in debug code)Rafaël Carré1-15/+7
ata-meg-fx: use unsigned line number, so % (modulo) is optimized tcc7*: use proper printf format and remove casting git-svn-id: svn:// 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:// a1c6a512-1295-4272-9138-f99709370657
2010-08-01Various minor cleanups for cowon d2Bertrik Sikken1-0/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-07-11D2: Fix another timing loop that broke when we switched to the EABI ↵Rob Purchase1-2/+5
compiler, this time in the LCD driver. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-06-21change the D2 bootloader to boot rockbox by default. boot OF is hold is on ↵Jonathan Gordon1-2/+6
or usb is connected git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-06-13cowond2: make the code consistent with the comments and really clear the bitsRafaël Carré1-2/+2
Untested on target git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-06-06Remove card_enable_monitoring() and use a mutex instead. The ↵Frank Gevaerts1-12/+1
card_enable_monitoring() method actually didn't eliminate the possible race conditions it was meant to fix. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-06-05remane hotswap.* to sdmmc.*. The contents have nothing at all to do with ↵Frank Gevaerts1-1/+1
hotswapping things git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-31Enable IRAM on TCC7801 (Cowon D2) for a 6-12% speedup in codecs that use it, ↵Rob Purchase2-8/+5
and a small increase in battery life. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-06Fix some more snprintf related warnings.Thomas Martitz1-1/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-06Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz2-2/+1
directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-03-08Fix a bunch of files so that they build with newer ld. The ↵Thomas Martitz1-2/+2
stack/bss sections need NOLOAD. otherwise the linker would try to include those into the binary. I don't know why this ever worked with our current ld version. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-01-24ARM: lr addresses the next instruction after the failing one in undefined ↵Rafaël Carré1-1/+1
instruction vector Substract 4 before passing the argument to UIE so the correct address is displayed git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-26Remove unused card_detect(), and make card_detect_target() static inline in ↵Thomas Martitz1-6/+5
each sd driver. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-31Remove svn:executable from firmwareMichael Chicoine1-0/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-29Make the TCC78x HW debug screen yield by including a button wait timeout.Rob Purchase1-9/+6
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-20Convert lcd_activation callbacks to use the event system to allow for ↵Thomas Martitz1-1/+1
multiple parallel callbacks (for custom statusbar). Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing). Removed corresponding functions from the core and plugin api. Bump min version and sort. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-20D2: Remove the hardcoded driver-level touchscreen calibration, since it's ↵Rob Purchase1-33/+3
done at apps level as well now. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-20Cleanup and expand D2 charger detection (not yet implemented for D2+).Rob Purchase1-2/+20
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-16Fix logic error in D2+ touchscreen driver.Rob Purchase1-3/+3
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-15Touchscreen support for newer Cowon D2+ hardware revisions (using TSC200x ↵Rob Purchase5-137/+269
touchscreen controller). Flyspray: FS#10671 Author: Jonas Aaberg git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-10D2: Don't read touchscreen co-ordinates when hold is enabled.Rob Purchase1-0/+3
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-10Initial support for runtime detection of the PMU used in newer D2+ models ↵Rob Purchase4-26/+117
(PCF50635). The backlight and battery monitoring should work, but the RTC and touchscreen are not yet implemented. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-10-08Remove an unused #defineRob Purchase1-3/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657