summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pp
AgeCommit message (Collapse)Author
2021-08-14Fix red from 04fe77a4Solomon Peachy
Change-Id: I13a7b067e60eabe27be1fe983a7cced3ae8b18e3
2021-08-14Remove the (very) incomplete port for the Tatung TPJ-1102Solomon Peachy
It was barely even a stub, and hasn't seen any development since 2009 Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-07-25pcm: Remove unused function pcm_play_dma_get_peak_buffer()Aidan MacDonald
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2021-06-21mi4: replace chksum_crc32 with crc_32rJames Buren
This uses an equivalent algorithm but with a different initial value than we normally use (all bits off vs all bits on). Use the new crc_32r to replace the original MI4 crc32 implementation. This frees up some extra space on mi4 targets which gives us more room on a few very space constrained targets (sansa c200/e200, etc). Change-Id: Iaaac3ae353b30566156b1404cbf31ca32926203d
2021-04-10pp: fix adc mistake where base 10 was used instead of base 16James Buren
Change-Id: I8562af8a11a22cd9edec149b2519ac0205d2b2dc
2021-04-01PP: More cache invalidation fixesSolomon Peachy
Take into account the size of the pointer in the loop termination condition. Change-Id: Ib4f7625ef143149a0d691a2109bad67aece6241c
2021-04-01PP: Use CURRENT_CORE instead of IF_COP_CORE(CPU)Solomon Peachy
Use of IF_COP_CORE was mistakenly introduced as part of 89acde6af2, effectively short-circuiting multiple tests resulting in the code paths always being executed, on both cores. Use the correct macro, so per-CPU paths are handled properly. Change-Id: Id346cf759fc1b06b7d56694d7af1f469caf785a4
2021-04-01H10 PP Crash -- FixedWilliam Wilgus
This appears to finally fix the issue turns out the status register we were writing was only for the CPU COP cache flush wiped out the CPU cache -- Added some defines to cut down on the magic numbers Added some comments explaining such Set the address to full 20 bit address 0x1FFFFF which is then left shifted 11 internally -- somewhere around 4GB? Link explains the cache status bits https://daniel.haxx.se/sansa/memory_controller.txt Change-Id: I57b7187c2f71a5b54ce145bf3a21ed492a8993cb
2021-02-27Disable UDMA 2 on iPod4G targetChristian Soffke
ATA DMA was enabled for all PP502x targets in d118f47 after previously reported instabilities were thought to have been fixed. The iPod 4G target remains unstable when UDMA 2 is enabled. File system corruption will eventually occur even using stock hardware in normal usage, according to both my own experience and that of several other forum users. UDMA 1 appears to be stable. Change-Id: I8526bad9e879f5dad5174cfe07cd8828d8b72406
2020-11-12pcm: Further cleanup of unused bits of the PCM ACPI:Solomon Peachy
* pcm_get_bytes_remaining() * pcm_calculate_peaks() * pcm_get_peak_buffer() Nothing in-tree uses these at all (except for the lua plugin wrapper) Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
2020-11-04pp5020: use ipod firmware timings for ATA PIO.Torne Wuff
Some mSATA adapters seem to have trouble working with Rockbox using our normal PIO timings; the timing value we use is probably out of spec and is different to the OF. Switch to using the OF's timings according to which PIO mode we select. This may not completely resolve problems with these adapters but allows Rockbox to boot and play audio. Change-Id: If73210700eb4af01864b373709ee1d15c775fb11
2020-10-31pcm: Get rid of pcm_play_pause() and associated APIsSolomon Peachy
Nothing in the core has used it for some time. It's exported to the plugin API but the last plugins to use it were switched to the mixer API back in 2011. This allows us to get rid of pcm_play_dma_pause() from all audio drivers Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-08-19Enable boot from SD for Sansa e200Johannes Rauh
Change-Id: I0940f2cd5fc914d6d5061b5798b1a636009649b7
2020-07-28Fix IPod 3G USB Recognition ProblemMichaelRey
Allow IPod 3rd generation to recognize when USB is connected and reboot into disk mode. This problem is listed at the bottom of the Ipod status page https://www.rockbox.org/wiki/IpodStatus Change-Id: I8f32afd065d3a91cddc56fe63454bd082bfa29b9
2020-07-05portalplayer: Fix three set-but-not-used warnings.Solomon Peachy
(They show up when building with gcc494) Change-Id: Id5e2bccf18114ed78a557ac1b369f46b4f07d042
2020-07-05arm: Fix PortalPlayer linker scripts with binutils 2.21+Solomon Peachy
For reasons that are still unclear, the 'ncbss' region was overlapping the "audiobuffer" when linked with 2.21, but okay with 2.20. Fixed it by making the audiobuffer explcitly use the current position instead of relying on it being implicit. With this change, portalplayer-based targets generate working binaries when built with binutils 2.21 or newer. This bug also theoretically affects imx233/imx31 targets as they also have NOCACHE_BASE games in their linker scripts, but I lack access to one to test with. Change-Id: Idb38ab20f03599b9ed3d4bc0eafe519f38677438
2020-04-04pp502x: Don't fill the cache starting from address 0x0Solomon Peachy
The pp502x cache init code tries to flush the cache by reading a block of DRAM. Change the starting point from 0x0 to 0x1000 so the compiler doesn't helpfully insert an undefined instruction to deliberately crash the target. (This behavior is intentional on the part of GCC, and was triggered by using -Os with my experimental 4.9.4 toolchain) Change-Id: I2d2719615a1164a035f3dac8a56dd3737bbab1d5
2017-10-26Unify storage threads into oneMichael Sevakis
* 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-03-12Do some housekeeping with fat.h and SECTOR_SIZEMichael Sevakis
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
2017-01-25AMS: Return ascodec to interrupt-based I2C2 driverMichael Sevakis
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
2016-04-06Red AlertMihail Zenkov
Change-Id: I5ddb6e6b4f84e036a7464b142fa9496446708beb
2016-04-06fix red againMihail Zenkov
Change-Id: I8e7ccbcf8a856bc3e08145a795695fb675794495
2016-04-06fix redMihail Zenkov
Change-Id: Iaec43120ef213d9a3c77201bdf50ebbedd1c5b76
2016-01-25Replace SAMSUNG_YH920_PAD with YH92XSebastian Leonhardt
seems more logical to me, and is more consistent, since "SAMSUNG_YH92X_PAD" is already used in the tex files. Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis
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-16Base scheduler queues off linked lists and do cleanup/consolidationMichael Sevakis
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
2014-08-08Fix some more straggling stuffMichael Sevakis
* 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
2014-08-08Do some kernel cleanupMichael Sevakis
* 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
2014-07-28Support for remote on Samsung YH920/YH925.Szymon Dziok
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
2014-07-28Samsung YH-925: Don't add anything to adc value while reading it.Szymon Dziok
OF doesn't do such thing. Values in mV are converted proportionally, so no change to the battery meter. Change-Id: Ic545b0514535e7f17f0379ed02f6bdf515f69ac6
2014-07-28Samsung YH-920: Proper values for battery monitoring, based on the OF formula.Szymon Dziok
Change-Id: I894eb6bad600bd059fe9a5ea1103737a736d4005
2014-07-27Samsung YH-820: enable battery monitoringSebastian Leonhardt
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>
2014-07-26SA9200: Implement clicker.Szymon Dziok
It's not integrated with key click option for now. Change-Id: Ib0769b02bfebe7c55eca7b7ea61df5d6dd83cdd3
2014-07-07crc-mi4: use const lookup table for crcMarcin Bukat
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>
2014-07-01rolo: fix crc calculation for mi4Marcin Bukat
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
2014-06-18Radio and radio recording for Samsung YH-920.Szymon Dziok
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
2014-05-24Separate keymaps for YH-820 and YH-920/925Sebastian Leonhardt
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>
2014-03-27Sansa View: define a GPIO bit for USB detection in order to compile the ↵Szymon Dziok
bootloader. Change-Id: I748a49f4b48385f328946e861d1f9a026b1efd7d
2014-03-03Fix various reds. Some includes needed fixup.Thomas Martitz
Change-Id: I4327740bae17054131feb917abdd58846c451988
2014-03-03kernel: Break out kernel primitives into separate files and move to separate ↵Thomas Martitz
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
2014-01-05Do not include kernel.h in system.h.Thomas Martitz
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2013-12-23playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz
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
2013-11-20Add IAP support to iPod Mini 1G.andypotter
Tested on iPod Mini 1G. Change-Id: I67ac9b7ed84c34533107136d0aa72e5ce3bcc5bc Reviewed-on: http://gerrit.rockbox.org/668 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2013-11-10Updated IAP commands.Ralf Ertzinger
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>
2013-08-17Cleanup MV/MD macros a little.Michael Sevakis
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
2013-07-19Fix d2249dc errorsMichael Sevakis
I wonder why it didn't cause more mayhem. Change-Id: I4a585367d650417b4be3af2a0fe6235d8066c895
2013-07-19Combine PortalPlayer .lds files into one for app and boot.Michael Sevakis
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
2013-06-27Move load_firmware() to separate fileMarcin Bukat
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>
2013-05-24Remove data_abort_handler from ARM crt0 files.Boris Gjenero
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>
2013-05-14Get rid of usb_drv_attach() from USB code.Michael Sevakis
'Twas an idiosyncrasy of detecting a host upon bus reset, which is obsolete. Change-Id: I0adb25e1805022544f52cd0cb766819a367dbde4