summaryrefslogtreecommitdiff
path: root/firmware/asm
AgeCommit message (Collapse)Author
2021-02-27Rename symbols of FiiO M3K Linux-based portAidan MacDonald
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX. Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2020-10-11New port: AIGO EROS Q / EROS KSolomon Peachy
The Q and K have a slightly different case, but the hardware under the shell is completely identical. These models are rebadged versions: * Hifiwalker H2 (== Q) * AGPTek H3 (== K) * Surfans F20 (== K) Other notes: * Significant improvements in the shared Hiby-platform launcher/loader * SD card can theoretically be hot-swapped now * Support external USB mass storage! * Some consolidation of Hiby-platform targets * Some consolidation of plugin keymaps Todo/known issues: * Keymaps need to be gone over properly * Convert to HAVE_SCROLLWHEEL? Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
2020-10-09New port: FiiO M3KSolomon Peachy
Most credit goes to: Roman Skylarov Additional integration and refactoring by myself. *** COMPLETELY UNTESTED *** Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b
2020-09-02mips: use .set push/pop in asm codeSolomon Peachy
Change-Id: I3e7bc7ffb8d6d0c5d18a6ab38b1a270559a62fb9
2020-07-24[1/4] Remove SH support and all archos targetsSolomon Peachy
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-03ARM: Rejigger the asm corelock functionsSolomon Peachy
This appears to solve _some_ of the crashes experienced when using gcc494 on the multicore PP targets (eg most older ipods). (With this change, the asm vs plain-C versions behave identically) corelock_lock(), corelock_unlock(), and corelock_trylock() were declared with the 'naked' attribute. However, naked functions are only allowed to have 'Basic Asm' components, and we used some extended asm, but without declaring clobbered registers, making assumptions about register arguments, and also directly returned to the caller via asm code. This is what the GCC docs have to say about this stuff: "While using extended asm or a mixture of basic asm and C code may appear to work, they cannot be depended upon to work reliably and are not supported." Change-Id: I79a9c4895584f9af365e6c2387595e9c45d89c7d
2020-04-06xDuoo X3II and X20 portMarcin Bukat
Provided by Roman Stolyarov Integration, Refactoring, and Upstreaming by Solomon Peachy X3II confirmed working by forum tester, X20 is nearly identical. This includes bootloader, main firmware, and the flash image patcher. Eventual Todo: * Further refactor AGPTek Rocker & xduoo hiby bootloaders * Further refactor AGPTek Rocker & xduoo hosted platform code Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
2018-09-07mips: Update the MIPS threading codeSolomon Peachy
Taken from Amaury Pouly's Fiio X1 patches in gerrit. Xduoo X3 no longer panics on startup Change-Id: I4c2dee832306755b9e496084cb47fb61f804af20
2018-09-07MIPS: fix memset()Marcin Bukat
swr/swl instructions used for word aligning were wrong. This made memset() terribly broken. I can't imagine how it went uncaught for soooo long. Spotted by Solomon Peachy. I run unit tests for alignments 0,1,2,3 size 1, 2, 3, 4, 5, 63, 64, 65, 127, 128, 129; and fill pattern 0x00 and other (since 0 is special case in this implementation). Change-Id: I513a10734335fe97734c10ab5a6c3e3fb3f4687a
2018-06-12Fix MIPS threading code to compile with older compilerMarcin Bukat
Official rockbox mips gcc is old and doesn't support symbolic register names in inline assembly Change-Id: If67230d06e28ccf31b0f8f8e1b622275fed3f6ff
2018-06-12Agptek Rocker: Initial commitMarcin Bukat
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2017-09-17fix warning in lcd-as-memframe.cAmaury Pouly
The fix is to actually remove unused variables. Those were unused from day 1, which I find slightly suspicious so either there is some problem or the code was copy-pasted and modified, making some variables useless. Change-Id: I41caf52d469b48c969ece969540de67d87e77357
2017-09-05Initial commit for the Sony NWZ linux portAmaury Pouly
SUPPORTED SERIES: - NWZ-E450 - NWZ-E460 - NWZ-E470 - NWZ-E580 - NWZ-A10 NOTES: - bootloader makefile convert an extra font to be installed alongside the bootloader since sysfont is way too small - the toolsicon bitmap comes from the Oxygen iconset - touchscreen driver is untested TODO: - implement audio routing driver (pcm is handled by pcm-alsa) - fix playback: it crashes on illegal instruction in DEBUG builds - find out why the browser starts at / instead of /contents - implement radio support - implement return to OF for usb handling - calibrate battery curve (NB: of can report a battery level on a 0-5 scale but probabl don't want to use that ?) - implement simulator build (we need a nice image of the player) - figure out if we can detect jack removal POTENTIAL TODOS: - try to build a usb serial gadget and gdbserver Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-07-27Fix arm memset() handling of negative argumentsFranklin Wei
This fixes the sgt-mines plugin. Same issue was present in an old glibc as well: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a7ed1adbecb6aac49af75aae3b3498798cf63abc
2017-02-04Fix dangerous castsAmaury Pouly
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is not valid. In any case, one should use intptr_t and ptrdiff_t when casting to integers. This commit attempts to fix all instances reported by GCC. When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-01-15Renamed defines UNALIGNED to ROCKBOX_UNALIGNED - UNALIGNED is alreadyMatthias Mohr
defined in mingw environments. Renamed defines of UNALIGNED to ROCKBOX_UNALIGNED so that they don't conflict with definitions in mingw32 cross-compiling environments (defined in _mingw.h). Change-Id: I369848c0f507e6bf5ff9ab4a60663bbbda6edc52
2014-11-10Fix YUV generic C performance function on 24-bit framebufferAmaury Pouly
When changed to handle 24-bit framebuffer, some places were missed. Change-Id: Iaa7e09ea723e5b40bd88b2042c93dafaa7311fee
2014-09-18Introducing Targets iBasso DX50 & iBasso DX90Simon Rothen
The port to for this two targets has been entirely developped by Ilia Sergachev (alias Il or xzcc). His source can be found at https://bitbucket.org/isergachev/rockbox . The few necesary modifications for the DX90 port was done by headwhacker form head-fi.org. Unfortunately i could not try out the final state of the DX90 port. The port is hosted on android (without java) as standalone app. The official Firmware is required to run this port. Ilia did modify the source files for the "android" target in the rockbox source to make the DX port work. The work I did was to separate the code for DX50 (&DX90) from the android target. On this Target Ilia used source from tinyalsa from AOSP. I did not touch that part of the code because I do not understand it. What else I changed from Ilias sources besides the separation from the target "android": * removed a dirty hack to keep backlight off * changed value battery meter to voltage battery meter * made all plugins compile (named target as "standalone") and added keymaps * i added the graphics for the manual but did not do anything else for the manual yet * minor optimizations known bugs: * timers are slowed donw when playback is active (tinyalsa related?) * some minor bugs Things to do: * The main prolem will be how to install the app correctly. A guy called DOC2008 added a CWM (by androtab.info) to the official firmware and Ilia made a CWM installation script and a dualboot selector (rbutils/ibassoboot, build with ndk-build). We will have to find a way to install rockbox in a proper way without breaking any copyrights. Maybe ADB is an option but it is not enable with OF by default. Patching the OF is probably the way to go. * All the wiki and manual to build: needed: android ndk installed, android sdk installed with additional build-tools 19.1.0 installed ./tools/configure select iBasso DX50 or iBasso DX90 make -j apk the content of rockbox.zip/.rockbox needs to be copied to /system/rockbox/app_rockbox/rockbox/ (rockbox app not needed) the content of libs/armeabi to /system/rockbox/lib/ (rockbox app needed) The boot selector is needed as /system/bin/MangoPlayer and the iBasso app as /system/bin/MangoPlayer_original. There is also the "vold" file. The one from OF does not work with DX50 rockbox (DX90 works!?), the one from Ilia is necessary. Until we have found a proper way to install it, it can only be installed following the instructions of Ilia on his bitbucket page, using the CWM-OF and his installation script package. Change-Id: Ic4faaf84824c162aabcc08e492cee6e0068719d0 Reviewed-on: http://gerrit.rockbox.org/941 Tested: Chiwen Chang <rock1104.tw@yahoo.com.tw> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-08-29Add mempcpy implementationMichael Sevakis
A GNU extension that returns dst + size instead of dst. It's a nice shortcut when copying strings with a known size or back-to-back blocks and you have to do it often. May of course be called directly or alternately through __builtin_mempcpy in some compiler versions. For ASM on native targets, it is implemented as an alternate entrypoint to memcpy which adds minimal code and overhead. Change-Id: I4cbb3483f6df3c1007247fe0a95fd7078737462b
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-18thread-unix patchup!Michael Sevakis
The changed thread code may not wish to save the old context under certain circumstances but thread-unix.c assumed it would, cached it and used it unconditionally. Also, prevent it from leaking away all the jump buffers (old problem). Creating and removing threads would eventually run it out of buffers and then it would crash after that. Plugins, like Pictureflow, which have worker threads could only be started a few times. Implement a simple O(1) allocator that will reuse them and stays self-contained to its own types (as it appears the original author intended). Change-Id: Icf65413c086b346fb79bf827102b725269e2812c
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-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-08-05One more shot; errno.h needs to be in the ARM one too :)Michael Sevakis
Change-Id: Icf5e5fb269c975eaaefc6e756f46d4530b982b1f
2014-08-05Hosted builds using thread.c have errno as thread context.Michael Sevakis
Never came up testing but I don't have those SDKs installed. Taking a jab at it. Change-Id: I4d0de1c666e0895d41b3de41dd9024626bd37601
2014-06-24zen/zenxfi: switch lcd driver to 24-bit modeAmaury Pouly
Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
2014-06-21lcd-24bit: Introduce a 24-bit mid-level LCD driverThomas Martitz
With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
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-02-05Samsung YP-R1 target portLorenzo Miori
This is the basic port to the new target Samsung YP-R1, which runs on a similar platform as YP-R0. Port is usable, although there are still some optimizations that have to be done. Change-Id: If83a8e386369e413581753780c159026d9e41f04
2012-10-24Revert "SH gcc 4.6.3 with link-time optimization, for Archos targets"Marcin Bukat
This was commited by accident, sorry.
2012-10-24SH gcc 4.6.3 with link-time optimization, for Archos targetsBoris Gjenero
This is work from FS#12431 synced to current HEAD and slightly tweaked (gcc 4.6.2 -> 4.6.3, binutils 2.21.1 -> 2.22) Change-Id: I76af91e80ac2a9c16a776c7f0a33cc51603bbf9b
2012-06-11Rearrange #ifdefs a bit, so SIGALTSTACK overrides CPU-specific threading.Frank Gevaerts
Change-Id: Ie3661f53bd7576d965fcc52facb532199b87c017
2012-03-28Apparently make doesn't like inline commentsThomas Martitz
Change-Id: If604af9713cf95dafbeb1a601219ca1b3a8964fa
2012-03-28build system: completely autodetect target cpu architecture.Thomas Martitz
The existing ARCH Makefile variable is exported to the C code as well. Additionally the version (arm-only for now) is detected as well. This allows to for complete autodetection, i.e. that optimized ASM is picked up if determined by preprocessor (CPU_ARM, etc). Building a sim/raaa on a arm host will now automatically generate a arm optmized build like we have for native targets. Change-Id: I0b35393f8fb3ebd20beaa9e7371fa57bf3782107
2012-03-12Coldfire: Optimize emac context save/restore in mixer ISR.Michael Sevakis
Save only once if emac is used in ISR and restore only once per ISR call if already saved. Change-Id: I0e40db5d4aab2a8552480f76873f59ff6ccd9977 Reviewed-on: http://gerrit.rockbox.org/176 Tested-by: Michael Sevakis <jethead71@rockbox.org> Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis
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-19beep/mixer code: Code police a bit.Michael Sevakis
/firmware is in the #include path with makes #include "asm/beep.c" sufficient. Add a comment to generic beep code and make another express intent better. Change-Id: I587cd704478b894785927bdfe2e647e28614df62
2012-02-18Split CPU-optimized beep code into the firmware/asm tree.Michael Sevakis
For now due to current lack of an apps/asm, place the ASM/generic code in the firmware/asm directory. Additionally, make generic beep code more generic. Change-Id: I4a69b6ffcbb97d9e6dfde2209c5a118de19e5638
2012-02-05Urgh...actually change all the stuff I'm supposed to.Michael Sevakis
Goofed a couple fn params. Change-Id: I2474d10fe08d2629ada54c83e201ee91c596d854
2012-02-05Make generic pcm-mixer.c more generic in the way it writes output.Michael Sevakis
Also remove unused firmmware/asm/generic directory. Change-Id: If1961f96f4292f00227a9b0148181152ac405e51
2012-02-04Generic find_first_set_bit can use __builtin_ctz instead of __builtin_ffsMichael Sevakis
The former gives 0-based indexes, which is what our implementation returns, making the "- 1" unnecessary. Change-Id: I172ab5e06695be62e4a18d4fd0415b8314f5dc26
2012-01-27find_first_set_bit tweaksMichael Sevakis
Correct sizing in m68k asm. Make the gerneric version far more generic. Change-Id: I32945f7431771979b3fe0da5472bdb110fd054ae
2012-01-22Fix typo in comment.Thomas Martitz
Change-Id: I3a6813a5eb024aad799bc59c569db54337cb8d1f
2012-01-22Move optimized ffs to firmware/asm, using the new automatic-asm-picking ↵Thomas Martitz
infrastructure. Change-Id: I5e7bdc8be7de50ef604c16078857fff1b84650dc
2012-01-22ypr0: Use generic lcd memframe driver.Thomas Martitz
2012-01-22Implement a C version lcd-as-memframe.c and move it and the asm to firmware/asm.Thomas Martitz
Change-Id: I20c3af0368202493d54fb776530300a39d47873a
2012-01-22Move optimized memcpy and friends and strlen to firmware/asm,Thomas Martitz
using the new automatic-asm-picking infrastructure.
2012-01-22Add framework to let make automatically pick optimized asm implementations ↵Thomas Martitz
over generic C ones to firmware. Example: for a file asm/foo.c, make will look for asm/arm/foo.[cS] and compile it if found. If not found it'll fall back to asm/foo.c. Also introduce new ARCH make variable. This is automatically detected by configure. It is distinct from CPU since CPU defines the dir used for the target tree (i.e. firmware/target/X, so it can be "hosted"). ARCH really has the target isa and can be x86 for sims/raaa too. Change-Id: I18e5d2b7b7bbc2ad2be551a74a0fcae5ffbcbf8b
2012-01-22Move pcm_mixer helper routines to firmware/asm.Thomas Martitz
2012-01-22Create fimrware/asm directory for assembly optimized stuff.Thomas Martitz
This dir is suitable for stuff that doesn't fit the target tree, e.g. because it also builds on hosted or otherwise. It also has a generic subfolder for fallback C implementations so that not all archs need to provide asm files. SOURCES should only contain "foo.c" where foo.c includes the specific <arch>/foo.c files from the subdirs using the preprocessor. This way automatic selection of asm versions or generic C verion is possible. For the start, the thread support files are moved, since ASM threads can be used on hosted platforms as well. Since core_sleep() remains platform specific it's moved to the corresponding system.h headers. Change-Id: Iebff272f3407a6eaafeb7656ceb0ae9eca3f7cb9