summaryrefslogtreecommitdiff
path: root/bootloader/telechips.c (follow)
Commit message (Collapse)AuthorAge
* Get rid of stupid _backlight_* function namesMarcin Bukat2015-01-12
| | | | | | _remote_backlight_* and _buttonlight_* are cleaned as well Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
* Rewrite filesystem code (WIP)Michael Sevakis2014-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix up the bootloadersMichael Sevakis2014-08-28
| | | | | | They can't access the raw RBVERSION define any longer. Change-Id: I698062b36306399945c01de54cdccaa1a1a8434e
* Bootloaders need the reacharound to get at the internal goodsMichael Sevakis2014-08-08
| | | | | | They need to include kernel-internal.h in order to perform inits. Change-Id: I5b0f155e4ff49a065c6cb97691ecd4396a199979
* Move load_firmware() to separate fileMarcin Bukat2013-06-27
| | | | | | | | 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>
* Remove return value from show_logo() in bootloader/Bertrik Sikken2011-09-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30485 a1c6a512-1295-4272-9138-f99709370657
* Sansa AMS bootloader: enter USB mode only when neededRafaël Carré2010-06-23
| | | | | | | | | | | - 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
* Generate C file / header for svn version stringRafaël Carré2010-05-27
| | | | | | | | | | | | | | | | | | | | | | | | It's now easier to force rebuild of files depending on the svn revision version.c/version.h are generated once with new tools/genversion.sh Changes in the VCS are still not auto detected, so you'll have to remove builddir/version.* if you want to change the string in your binaries APPSVERSION is now called RBVERSION and is defined in the generated header instead of being defined by the Makefiles appsversion is now called rbversion (the plugin api number didn't change since old modules are still binary compatible) Change some bootloaders to use knwon-at-buildtime RBVERSION instead of "%s" + rbversion You'll need to run make clean to regenerate dependencies after the removal of apps/version.h To build binaries with a different version string, hand-edit tools/version.sh or tools/genversion.sh (which calls the former) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26320 a1c6a512-1295-4272-9138-f99709370657
* bootloader/telechips: disable irqs before jumping to rockboxVitja Makarov2009-09-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22762 a1c6a512-1295-4272-9138-f99709370657
* TCC78x: Enable interrupts/threading in the bootloader (required now that the ↵Rob Purchase2009-06-24
| | | | | | storage driver yields). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21486 a1c6a512-1295-4272-9138-f99709370657
* Hopefully mop-up remaining red.Michael Sevakis2008-12-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19317 a1c6a512-1295-4272-9138-f99709370657
* Show the Rockbox logo in the Telechips bootloader.Rob Purchase2008-11-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19129 a1c6a512-1295-4272-9138-f99709370657
* Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts2008-11-01
| | | | | | | | | 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
* telechips usb: not ready for use but, something is working, needs improvement.Vitja Makarov2008-10-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18806 a1c6a512-1295-4272-9138-f99709370657
* Trivial changes to make the main Rockbox builds for the Sansa m200 and Logik ↵Dave Chapman2008-09-22
| | | | | | DAX ports compile. Note that some codecs are currently disabled (due to lowmem on these targets), but that needs more work and analysis to decide how much RAM we want to allocate to codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18566 a1c6a512-1295-4272-9138-f99709370657
* Initial commit of iaudio 7 port by Vitja Makarov (FS#9245). Port is at ↵Dave Chapman2008-09-06
| | | | | | quite an advanced stage, but is troubled by the lack of a reliable NAND driver (similar to the Cowon D2 port) and is not yet suitable for non-developers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18435 a1c6a512-1295-4272-9138-f99709370657
* Fix a few dead references in the manual and add an 's' where one was missing.Marc Guay2008-07-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17972 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
* Add the Sansa c100 as a build target with basic drivers.Marc Guay2008-06-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17742 a1c6a512-1295-4272-9138-f99709370657
* Add the Sansa M200 (v1) as a target - it's extremely similar to the Logik ↵Dave Chapman2008-05-02
| | | | | | DAX (the LCD driver worked unchanged). Plus various tcc77x work, including a working tick interrupt (enabled in the bootloader). Rockbox itself builds for the M200 (there are no keymaps yet for the DAX), but doesn't progress very far due to the lack of an ATA (NAND flash) driver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17306 a1c6a512-1295-4272-9138-f99709370657
* Enable 'touchscreen areas' on the D2, based on JdGordon's m:robe code. ↵Rob Purchase2008-04-27
| | | | | | Disable the bootloader debug screen, as that stuff is all available from the Debug menu now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17257 a1c6a512-1295-4272-9138-f99709370657
* D2: Update dual boot to use the hold switch. Update bootloader to show ↵Rob Purchase2008-04-08
| | | | | | messages until HOLD released, keep holding POWER to show old debug screen (these modes will eventually be removed). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17032 a1c6a512-1295-4272-9138-f99709370657
* Make the Telechips bootloader slightly less messy, kill some warnings and ↵Rob Purchase2008-03-29
| | | | | | allow entry to the bootloader debug screen via the D2's hold switch. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16879 a1c6a512-1295-4272-9138-f99709370657
* Enable tick IRQs on TCC780x. The main menu is now working on the D2.Rob Purchase2008-03-22
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16749 a1c6a512-1295-4272-9138-f99709370657
* Cowon D2: Make the bootloader functional (usage instructions to appear on ↵Rob Purchase2008-03-12
| | | | | | the CowonD2Info wikipage shortly). Also re-enable IRAM by reducing Tremor's ICODE usage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16646 a1c6a512-1295-4272-9138-f99709370657
* D2: Make lcd_init_device() actually turn on the LCD, in preparation for ↵Rob Purchase2008-03-05
| | | | | | booting the main image. Previously this required an explicit lcd_enable(true). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16523 a1c6a512-1295-4272-9138-f99709370657
* Shutdown needs about 2 seconds, but it seems to work :)Christian Gmeiner2008-02-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16317 a1c6a512-1295-4272-9138-f99709370657
* D2: Further work-in-progress on the NAND driver.Rob Purchase2008-02-13
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16308 a1c6a512-1295-4272-9138-f99709370657
* Read ID codes & raw page data from D2 NAND flash (work in progress; Rob Purchase2008-01-25
| | | | | | | no logical->physical address translation yet) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16167 a1c6a512-1295-4272-9138-f99709370657
* Initial Cowon D2 commit:Rob Purchase2008-01-14
| | | | | | | | * bootloader test program (basic LCD & button drivers, reads touchscreen) * work-in-progress stubs for main build git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16090 a1c6a512-1295-4272-9138-f99709370657
* Hardware controlled backlight brightness for iPod Video and Nano, retaining ↵Jens Arnold2007-11-12
| | | | | | the software PWM fade in/ fade out. * Backlight handling cleanup, getting rid of one layer of 'lowlevelness'. * Use atomic GPIO bit manipulation for PP502x backlight handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15599 a1c6a512-1295-4272-9138-f99709370657
* Button driver for Logik DAX, plus some changes to the debug info displayed ↵Dave Chapman2007-11-01
| | | | | | in the bootloader build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15396 a1c6a512-1295-4272-9138-f99709370657
* Initial work on a port to the Logik DAX 1GB MP3/DAB player. The bootloader ↵Dave Chapman2007-10-28
build compiles and runs (but only displays some debugging info), and the LCD and ADC drivers are working. Two different bootloader builds are possible: 1) The default build is just a test application for uploading to the device via tcctool; 2) Adding -DTCCBOOT to EXTRA_DEFINES in the build directory Makefile will compile the bootloader so that it can be appended to the end of the original firmware and installed on the device, dual-booting. This commit also includes some work by Hein-Pieter van Braam on a port to the iAudio 7, but that doesn't build yet. A large part of these ports will be generic to all TCC77x devices - see the TelechipsInfo wiki page for some other devices with this CPU. NOTE: Compiling these builds requires an arm-elf-gcc with armv5 support - the current version of rockboxdev.sh compiles such a gcc. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15339 a1c6a512-1295-4272-9138-f99709370657