summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pp (follow)
Commit message (Collapse)AuthorAge
* Do some housekeeping with fat.h and SECTOR_SIZEMichael Sevakis2017-03-12
| | | | | | | | | | | | | | Many includes of fat.h are pointless. Some includes are just for SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that and to define tuneable values that were scattered amongst various headers. Remove some local definitions of SECTOR_SIZE since they have to be in agreement with the rest of the fs code anyway. (We'll see what's in fact pointless in a moment ;) Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
* AMS: Return ascodec to interrupt-based I2C2 driverMichael Sevakis2017-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Slightly revised and regularized internal interface. Callback is used for read and write to provide completion signal instead of having two mechanisms. 2. Lower overhead for asynchronous or alterate completion callbacks. We now only init what is required by the transfer. A couple unneeded structure members were also nixed. 3. Fixes a bug that would neglect a semaphore wait if pumping the I2C interrupts in a loop when not in thread state or interrupts are masked. 4. Corrects broken initialization order by defining KDEV_INIT, which makes kernel_init() call kernel_device_init() to initialize additional devices _after_ the kernel, threading and synchronization objects are safe to use. 5. Locking set_cpu_frequency has to be done at the highest level in system.c to ensure the boost counter and the frequency are both set in agreement. Reconcile the locking inteface between PP and AMS (the only two currently using locking there) to keep it clean. Now works fine with voltages in GIT HEAD on my Fuze v2, type 0. Previously, everything crashed and died instantly. action.c calling set_cpu_frequency from a tick was part of it. The rest may have been related to 3. and 4. Honestly, I'm not certain! Testing by Mihail Zenkov indicates it solves our problems. This will get the developer builds running again after the kernel assert code push. Change-Id: Ie245994fb3e318dd5ef48e383ce61fdd977224d4
* Red AlertMihail Zenkov2016-04-06
| | | | Change-Id: I5ddb6e6b4f84e036a7464b142fa9496446708beb
* fix red againMihail Zenkov2016-04-06
| | | | Change-Id: I8e7ccbcf8a856bc3e08145a795695fb675794495
* fix redMihail Zenkov2016-04-06
| | | | Change-Id: Iaec43120ef213d9a3c77201bdf50ebbedd1c5b76
* Replace SAMSUNG_YH920_PAD with YH92XSebastian Leonhardt2016-01-25
| | | | | | | seems more logical to me, and is more consistent, since "SAMSUNG_YH92X_PAD" is already used in the tex files. Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
* 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>
* Base scheduler queues off linked lists and do cleanup/consolidationMichael Sevakis2014-08-16
| | | | | | | | | | | | | | | | | | | | | | | | | Abstracts threading from itself a bit, changes the way its queues are handled and does type hiding for that as well. Do alot here due to already required major brain surgery. Threads may now be on a run queue and a wait queue simultaneously so that the expired timer only has to wake the thread but not remove it from the wait queue which simplifies the implicit wake handling. List formats change for wait queues-- doubly-linked, not circular. Timeout queue is now singly-linked. The run queue is still circular as before. Adds a better thread slot allocator that may keep the slot marked as used regardless of the thread state. Assists in dumping special tasks that switch_thread was tasked to perform (blocking tasks). Deletes alot of code yet surprisingly, gets larger than expected. Well, I'm not not minding that for the time being-- omlettes and break a few eggs and all that. Change-Id: I0834d7bb16b2aecb2f63b58886eeda6ae4f29d59
* Fix some more straggling stuffMichael Sevakis2014-08-08
| | | | | | | | | | | | | | * HWCODEC bootloaders * Remove references to thread structures outside the kernel. They are private and should not be used elsewhere. The mrobe-100 is an offender that gets squashed. * The ata.c hack stuff for large sector disks on iPod Video gets squashed for the same reason. I will no longer maintain it, period; please find the real reason for its difficulties. Change-Id: Iae1a675beac887754eb3cc59b560c941077523f5
* Do some kernel cleanupMichael Sevakis2014-08-08
| | | | | | | | | | | | | | | | | | | | * Seal away private thread and kernel definitions and declarations into the internal headers in order to better hide internal structure. * Add a thread-common.c file that keeps shared functions together. List functions aren't messed with since that's about to be changed to different ones. * It is necessary to modify some ARM/PP stuff since GCC was complaining about constant pool distance and I would rather not force dump it. Just bl the cache calls in the startup and exit code and let it use veneers if it must. * Clean up redundant #includes in relevant areas and reorganize them. * Expunge useless and dangerous stuff like remove_thread(). Change-Id: I6e22932fad61a9fac30fd1363c071074ee7ab382
* Support for remote on Samsung YH920/YH925.Szymon Dziok2014-07-28
| | | | | | | Remote buttons are bound to the standard buttons in button-target.h, but they can have a separate buttonmap, if someone wants. Change-Id: Id8c78a3dfec0005bf588dc16416870b4c7c56836
* Samsung YH-925: Don't add anything to adc value while reading it.Szymon Dziok2014-07-28
| | | | | | | OF doesn't do such thing. Values in mV are converted proportionally, so no change to the battery meter. Change-Id: Ic545b0514535e7f17f0379ed02f6bdf515f69ac6
* Samsung YH-920: Proper values for battery monitoring, based on the OF formula.Szymon Dziok2014-07-28
| | | | Change-Id: I894eb6bad600bd059fe9a5ea1103737a736d4005
* Samsung YH-820: enable battery monitoringSebastian Leonhardt2014-07-27
| | | | | | | | | | The "percent_to_volt_charge" values are quite arbitrary and may need some more tweaking. Change-Id: I9f177d46681030d615fe2c2e78cf9bd2dde026af Reviewed-on: http://gerrit.rockbox.org/824 Reviewed-by: Szymon Dziok <b0hoon@o2.pl> Tested: Szymon Dziok <b0hoon@o2.pl>
* SA9200: Implement clicker.Szymon Dziok2014-07-26
| | | | | | It's not integrated with key click option for now. Change-Id: Ib0769b02bfebe7c55eca7b7ea61df5d6dd83cdd3
* crc-mi4: use const lookup table for crcMarcin Bukat2014-07-07
| | | | | | | | | This doesn't touch external tools as I see no need for. Change-Id: Ia69248c4b6a033c3772916525257e3540bddcffa Reviewed-on: http://gerrit.rockbox.org/891 Tested: Sebastian Leonhardt <sebastian.leonhardt@web.de> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* rolo: fix crc calculation for mi4Marcin Bukat2014-07-01
| | | | | | | | | crc32gentab() which initilizes crc table was called in bootloader but not in main binary. Fix this temporary by always calling it in load_mi4(). The proper fix probably to switch to const table and drop runtime initialization. Change-Id: I8b0c2c791642f56ed56189d156647661935a815d
* Radio and radio recording for Samsung YH-920.Szymon Dziok2014-06-18
| | | | | | | There is no simple method to detect radio through the 3-wire interface, so it's not implemented for the YH-925 for now. YH-920 always has a radio. Change-Id: Iea484d752915fcd40dbbbd7dbbf13e81aaf548db
* Separate keymaps for YH-820 and YH-920/925Sebastian Leonhardt2014-05-24
| | | | | | | | | | | | | | | Although both players basically have the same keys, the differences in the layout is rather big, so I think both deserve their own keymaps. (On the yh820 the FFWD/PLAY/REW buttons are located above the direction keys, on the yh920 at the side of the player. Furthermore the yh920/925 has a REC switch, whereas yh820 has a push button.) Change-Id: I0e62a1b101c387646c0bdb07ea142d9d2430ca15 Reviewed-on: http://gerrit.rockbox.org/814 Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
* Sansa View: define a GPIO bit for USB detection in order to compile the ↵Szymon Dziok2014-03-27
| | | | | | bootloader. Change-Id: I748a49f4b48385f328946e861d1f9a026b1efd7d
* Fix various reds. Some includes needed fixup.Thomas Martitz2014-03-03
| | | | Change-Id: I4327740bae17054131feb917abdd58846c451988
* kernel: Break out kernel primitives into separate files and move to separate ↵Thomas Martitz2014-03-03
| | | | | | | | | dir. No code changed, just shuffling stuff around. This should make it easier to build only select parts kernel and use different implementations. Change-Id: Ie1f00f93008833ce38419d760afd70062c5e22b5
* Do not include kernel.h in system.h.Thomas Martitz2014-01-05
| | | | | | | system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
* playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz2013-12-23
| | | | | | | | | | | | | | | | This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
* Add IAP support to iPod Mini 1G.andypotter2013-11-20
| | | | | | | | Tested on iPod Mini 1G. Change-Id: I67ac9b7ed84c34533107136d0aa72e5ce3bcc5bc Reviewed-on: http://gerrit.rockbox.org/668 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
* Updated IAP commands.Ralf Ertzinger2013-11-10
| | | | | | | | | | | | | | | | | | Originally written and uploaded by Lalufu (Ralf Ertzinger) in Feb 2012. They have been condensed into a single patch and some further additions by Andy Potter. Currently includes Authentication V2 support from iPod to Accessory, RF/BlueTooth transmitter support, selecting a playlist and selecting a track from the current playlist. Does not support uploading Album Art or podcasts. Has been tested on the following iPods, 4th Gen Grayscale, 4th Gen Color/Photo, Mini 2nd Gen, Nano 1st Gen and Video 5.5Gen. Change-Id: Ie8fc098361844132f0228ecbe3c48da948726f5e Co-Authored by: Andy Potter <liveboxandy@gmail.com> Reviewed-on: http://gerrit.rockbox.org/533 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
* Cleanup MV/MD macros a little.Michael Sevakis2013-08-17
| | | | | | | | | | 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
* Fix d2249dc errorsMichael Sevakis2013-07-19
| | | | | | I wonder why it didn't cause more mayhem. Change-Id: I4a585367d650417b4be3af2a0fe6235d8066c895
* Combine PortalPlayer .lds files into one for app and boot.Michael Sevakis2013-07-19
| | | | | | | | These nearly identical files are multiplying like rabbits as PP targets are added and make SoC-related changes a PITA. Just include the master .lds file from the target one as was done for bootloader USB. Change-Id: I65e9e653030f0688b1728e32ada16abf2932e029
* 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 data_abort_handler from ARM crt0 files.Boris Gjenero2013-05-24
| | | | | | | | | | | | This causes data_abort_handler from lib/unwarminder/safe_read.S to be used instead. It allows unwarminder to avoid data aborts when displaying the backtrace. A data_abort_handler remains in system-arm.c, but it is not used because it is declared as a weak symbol. Change-Id: I832066ed514347fe697e219872e90fbdd937f477 Reviewed-on: http://gerrit.rockbox.org/475 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com> Tested-by: Boris Gjenero <boris.gjenero@gmail.com>
* Get rid of usb_drv_attach() from USB code.Michael Sevakis2013-05-14
| | | | | | | 'Twas an idiosyncrasy of detecting a host upon bus reset, which is obsolete. Change-Id: I0adb25e1805022544f52cd0cb766819a367dbde4
* Add Serial Port 1 support for iPod Photo/Color/4G/Mini2Gandypotter2013-04-25
| | | | | | | | | | | | | | | | | | Based on FS#9920 by Ryan Press with changes to selection logic so that it works on my iPod Photo. Should also work on iPod Color/4G and Mini2G. Moved all target specific code from firmware/drivers/serial.c into new file firmware/target/arm/pp/uart-pp.c in the same manner as other target specific uart code. Update to fix build error on ipodmini2g by adding defines in config file. Removed unwanted whitespace Tested on iPod Photo. Change-Id: Ia5539563966198e06372d70b5adf2ef78882f863 Reviewed-on: http://gerrit.rockbox.org/455 Reviewed-by: andypotter <liveboxandy@gmail.com> Tested-by: andypotter <liveboxandy@gmail.com> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* Fix FS#12391 : Memory corruption on PP502x after commit_discard_idcache()Boris Gjenero2013-01-24
| | | | | | | | | | | | | | | In commit_discard_idcache(), cache lines were marked as invalid. When some cache lines are marked as invalid, memory corruption can occur. This caused instability when using PP502x ATA DMA because of the many more calls to that function. Here, commit_discard_idcache() is changed to avoid the problem. Also, the cache is filled after being enabled to to ensure there are never any cache lines that aren't marked as valid. Change-Id: Ia26300acef6b0573c1f40299c496ee5cbda3dac8 Reviewed-on: http://gerrit.rockbox.org/339 Reviewed-by: Szymon Dziok <b0hoon@o2.pl> Tested-by: Szymon Dziok <b0hoon@o2.pl> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* Remove STATICIRAM hackNils Wallménius2012-05-08
| | | | | | | | It was only needed by the old arm toolchain that we no longer use or support. Change-Id: Id0e6c67477f8834a637079b03cde5fbf9da68b1c Reviewed-on: http://gerrit.rockbox.org/233 Reviewed-by: Nils Wallménius <nils@rockbox.org>
* remove debug-target.hRafaël Carré2012-05-07
|
* Revise the PCM callback system after adding multichannel audio.Michael Sevakis2012-03-03
| | | | | | | | | | | | | | | | | | 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>
* Use commit_dcache() instead of commit_discard_idcache() where possibleBoris Gjenero2012-02-04
| | | | | | | | | - PCM playback DMA doesn't need the discard. Only recording DMA would need it. - When creating threads for another core, the core creating the thread only needs to commit. The discard on the other core is handled elsewhere. Change-Id: I864a0777e22f221a66218efd2c02ff3ad3889736
* ascodec-target.h: removeRafaël Carré2012-01-08
| | | | | | | | | | | 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
* lcd-remote-target.h: Use only in firmware/target/Rafaël Carré2012-01-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31614 a1c6a512-1295-4272-9138-f99709370657
* Reorganise USB initialisation to not depend on a specific enumeration ↵Frank Gevaerts2012-01-04
| | | | | | | | | | 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
* PP: move DEBUG_CANCEL definition to .cRafaël Carré2012-01-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31570 a1c6a512-1295-4272-9138-f99709370657
* dbg_hw_info(): remove duplicate prototypesRafaël Carré2012-01-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31560 a1c6a512-1295-4272-9138-f99709370657
* dbg_ports(): remove duplicate prototypeRafaël Carré2012-01-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31558 a1c6a512-1295-4272-9138-f99709370657
* Fix path to PP USB bootloader crt0Rafaël Carré2012-01-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31535 a1c6a512-1295-4272-9138-f99709370657
* move PP specific files to pp/Rafaël Carré2012-01-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31533 a1c6a512-1295-4272-9138-f99709370657
* arm/pp : assume CPU_PPRafaël Carré2012-01-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31532 a1c6a512-1295-4272-9138-f99709370657
* Move PP-specific headers to pp/ directoryRafaël Carré2012-01-03
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31530 a1c6a512-1295-4272-9138-f99709370657