summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx
AgeCommit message (Collapse)AuthorFilesLines
2019-07-29XduooX3: Uncomment code that prevented hotswap from working.Solomon Peachy1-2/+2
Change-Id: I5efec00e60aacf05166407ad43b9d63340e18967
2019-06-02jz7460: Disable IRQ-driven DMA transfers.Solomon Peachy1-1/+1
This greatly increases the stability of SD card write operations. (I suspect the underlying problem is not IRQ operation itself, instead being exacerbated by it..) Change-Id: Ia00f0656abd4b3cb0b1b5fc9db7c1b6a02847956
2019-01-04Add HAVE_LINEOUT_DETECTION and associated logicSolomon Peachy2-7/+36
This allows targets to automatically switch audio settings when the line out is plugged/unplugged. Only hooked up on the xDuoo X3, but there are other potential users. Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
2019-01-02mips: Adjust main & irq stack sizes to fit in IRAM on all targetsSolomon Peachy2-4/+4
New amounts: 7.50K main stack 0.75K irq stack Prior values of 8K+1K overflowed IRAM by ~660 bytes on Onda 7x7 targets, but worked on the xDuoo X3. (The discrepancy is due to the Onda targets having more LCD code shoved into IRAM.) Change-Id: I16fcfae3c5f3e36db688dfa9167b620584e79df8
2019-01-02mips: Use a separate IRQ stack & optimize IRQ handling a littleSolomon Peachy3-38/+60
Should prevent the IRQ-related stack overflows seen on MIPS targets. Change-Id: I447336ef3fe37e11b3276a78ba220ce64c2f87f5
2019-01-02Fix Xduoo X3 bootloader build, and silence all warnings.Solomon Peachy2-1/+106
Also enable USB bootloader mode Change-Id: I73224c2e694b9941993c89a114b48d2a907e0dfb
2018-10-09mips: fix some compile warnings.Solomon Peachy4-5/+5
Change-Id: Ia5e83702313c1c184480290d3b0e6a66f01b7277
2018-10-09mips: jz4740: JZ4740 does not have a MSC clock source select.Solomon Peachy1-1/+1
Change-Id: Ic2af37d92bcb8b6b35684f113eb8e392fc2eb609
2018-09-20jz4760: Lots of stability fixes to the USB driver.Solomon Peachy1-84/+292
It actually works for transferring data now! Igor Poretsky gets full credit for this patch. Change-Id: I247c70fdf45e590b4699b9b8668bbdab7bc3ef03
2018-09-20xduoo_x3: Disable keypress IRQ since we poll for keypresses.Solomon Peachy1-4/+7
Change-Id: Ieab5f864751cf798b62c4e89e670acf7ade756ab
2018-09-20jz4760: Enhancements and fixes to SD driver.Solomon Peachy1-279/+239
* Fully Interrupt-driven, with proper task yielding * Much more robust error handling * Eliminate duplicate code * Pile of bugfixes (Much of this adapted from Igor Poretsky's tree) Change-Id: I46006412323cba2088b70094635d62a241be1d7e
2018-09-20jz7460: Silence codec when changing playback frequency/modeSolomon Peachy1-2/+6
Silences some annoying clicks. Change-Id: I3d32d4b33c0ccc61877e10f5af97fe05084d66e5
2018-09-20jz7640: SD driver improvements:Solomon Peachy1-27/+25
* Better multidrive support * Common slot1/slot2 handling code Change-Id: Id0aed90cbba4246fdc71b42e03f016f8060d258a
2018-09-20jz74x0: MSC clock needs to be divided from PLL clock.Solomon Peachy2-2/+7
Change-Id: I0cf2f0d55e0859f896afef289e833935d7c5a599
2018-09-20jz4760: Greatly enhance debug code and silence some compilation warnings.Solomon Peachy4-109/+138
Change-Id: I1746d67c818ad099edea83e6242ffd5c79be0000
2018-07-28Add cleaned-up xDuoo X3 supportSolomon Peachy27-6/+6013
Cleaned up, rebased, and forward-ported from the xvortex fork. (original credit to vsoftster@gmail.com) Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
2017-10-26Fix a few missed things in 16454efc (and hopefully clear the red).Michael Sevakis1-4/+0
Change-Id: I2ce88e4c41e6e08efbfbdf261122318dfb0f8b0f
2017-10-26Unify storage threads into oneMichael Sevakis1-72/+24
* 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
2015-01-12Fix red/yellowMarcin Bukat1-1/+1
Change-Id: Ie01251af2cd843979b5fdefcfa541ba377d13bd7
2015-01-12Get rid of stupid _backlight_* function namesMarcin Bukat5-19/+19
_remote_backlight_* and _buttonlight_* are cleaned as well Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis1-18/+11
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-03-04ingenic: crt0.S fixes #3Marcin Bukat1-6/+5
Hopefyly this time is the final one. Change-Id: I386964f407ca98499e9a482507e4d5dfa02ee891
2014-03-04ingenic: fix bugs introduced by 5900bf7Marcin Bukat1-6/+6
I must have been blind and copied some intermediate file instead of final version. No functional change, only fixes. Change-Id: Icaa868225517662c88f8492b1f04808407853361
2014-03-03ingenic: Tweak a few details in crt0.SMarcin Bukat1-13/+14
1) Avoid load/store delay slot by reorganizing instructions in copy loops 2) Fix off-by-one error in cache initialization code. This was harmless as it simply set line0 twice, now it sets every cacheline only once. 3) Fix off-by-word error in .bss clearing loop. The addiu in branch delay slot even if calculated is not seen by the branch instruction itself, so the code did one word too much in clearing. 4) Fix off-by-word error in deadbeefing stack. See above. Change-Id: Iabb09a55979de7aa2e2b9234273683fc7e9762c5
2013-09-05touch devices: Disable touch on softlock.Jean-Louis Biasini1-0/+7
Target that have a touchpad/touchscreen should disable it while being locked (In order to avoid LCD to drain battery power due to "key locked" constant reporting messages. If they a have a keylock button this was already handled at driver level. If not (e.g. fuze+), they will have to implement a switch at driver level that action.c can operate on softlock. This patch does the following for any target having a touchpad or a touchscreen and no HAS_BUTTON_HOLD (ie any softlock target) 1) it implements the code to call button_enable_touch(bool en) in action.c. 2) button_enable_touch is implemented in button.c and call either touchpad_enable or touchscreen_enable 3) those two function are implemented respectively in touchscreen.c and a new touchpad.c file. They provide a generic way to silents touch's device and call a function at driver level where target specific code can be implemented if possible/needed (for power saving for instance). Those function name are touchpad_enable_device and touchscreen_enable_device 4) we implement an empty function at driver level of targets that need it to have them still being able to compiled. Change-Id: I9ead78a25bd33466a8533f5b9f259b395cb5ce49 Reviewed-on: http://gerrit.rockbox.org/569 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-08-17Cleanup MV/MD macros a little.Michael Sevakis2-5/+5
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-04-22Do some cleanup, adjustment and a couple fixes to recent sound changes.Michael Sevakis1-3/+3
* SOUND_x enum can be generated by audiohw_settings.h along with settings entries and sound_val2phys. * VOLUME_MIN and VOLUME_MAX are no longer necessary within sound.c. If you need them, they are for target-defined purposes. * Fix up SDL volume implementation in sdl.c. Move sim volume calculation code to pcm-sdl.c. * Min trigger tresholds were based upon VOLUME_MIN for some reason. These setting have nothing to do with playback volume. Since it is no longer present, set these at -89dB which is the minimum peak meter sensitivity setting. * Fix an oversight in wm8758.c. I forgot to add the dB->register conversion to audiohw_set_volume. Change-Id: Ie1df33f1793eee75e6793f16bc7bddd16edb7f75
2013-04-15Still at it for 0c7b787. Might be done now.Michael Sevakis1-1/+1
Change-Id: Idf45731dc6554954747f6036dc6dfcd4b63981a1
2013-04-15Straighten out the mad twisted state of sound.c and related areas.Michael Sevakis1-24/+0
This is going right in since it's long overdue. If anything is goofed, drop me a line or just tweak it yourself if you know what's wrong. :-) Make HW/SW codec interface more uniform when emulating HW functionality on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to- DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX" APIs are all in sound.c with none in DSP code any longer. Reduce number of settings definitions needed by each codec by providing defaults for common ones like balance, channels and SW tone controls. Remove need for separate SIM code and tables and add virtual codec header for hosted targets. Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-11Implement universal in-PCM-driver software volume control.Michael Sevakis1-9/+18
Implements double-buffered volume, balance and prescaling control in the main PCM driver when HAVE_SW_VOLUME_CONTROL is defined ensuring that all PCM is volume controlled and level changes are low in latency. Supports -73 to +6 dB using a 15-bit factor so that no large-integer math is needed. Low-level hardware drivers do not have to implement it themselves but parameters can be changed (currently defined in pcm-internal.h) to work best with a particular SoC or to provide different volume ranges. Volume and prescale calls should be made in the codec driver. It should appear as a normal hardware interface. PCM volume calls expect .1 dB units. Change-Id: Idf6316a64ef4fb8abcede10707e1e6c6d01d57db Reviewed-on: http://gerrit.rockbox.org/423 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-03-11jz4740: a few minor fixesMarcin Bukat1-1/+1
This was spotted while playing with qemu-jz: 1) rockbox reads TECR and TESR which are described as write-only registers. Datasheet doesn't mention what happens if they are readed. Apparently this doesn't have fatal side effects. It comes down to two defines from jz4740.h __tcu_stop_counter(n) and __tcu_start_counter(n) which use read-modify-write sequence. 2) rockbox accesses out of bound offset 0xd4 in DMA memspace. It comes from dis_irq() in system-jz4740.c. NUM_DMA is 6 but DMA channels are 0-5 so (irq <= IRQ_DMA_0 + NUM_DMA)) bound check is wrong. This are *NOT* tested on device. Change-Id: I29dff6a4f828030877b7d50fbcc98866478b9e3d Reviewed-on: http://gerrit.rockbox.org/338 Reviewed-by: Bertrik Sikken <bertrik@sikken.nl> Tested-by: Purling Nayuki <cyq.yzfl@gmail.com> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2012-05-07remove debug-target.hRafaël Carré2-1/+0
2012-05-07remove unused prototypesRafaël Carré1-4/+0
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis1-7/+5
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-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon1-2/+2
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2012-01-22Create fimrware/asm directory for assembly optimized stuff.Thomas Martitz1-0/+24
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
2012-01-08lcd-target.h: remove some duplicate declarationsRafaël Carré1-6/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31625 a1c6a512-1295-4272-9138-f99709370657
2012-01-08adc-target.h: cleanupRafaël Carré1-2/+0
move adc_close() prototype to adc.h don't duplicate prototypes of adc.h remove license header and guards for a single include of another file or for empty content git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31623 a1c6a512-1295-4272-9138-f99709370657
2012-01-08button-target.h : move prototypes to button.hRafaël Carré2-16/+0
no need to define BUTTON_REMOTE anymore git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31620 a1c6a512-1295-4272-9138-f99709370657
2012-01-07ingenic_jz: remove ata-nand-target.hRafaël Carré2-29/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31616 a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_hw_info(): remove duplicate prototypesRafaël Carré1-27/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31560 a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_ports(): remove duplicate prototypeRafaël Carré2-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31558 a1c6a512-1295-4272-9138-f99709370657
2012-01-03Rework powermgmt to enable code re-use on appliation and sims.Thomas Martitz2-2/+2
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application) to break powermgmt.c's assumption about the ability to read battery voltage. There's now additionally percentage (android) and remaining time measure (maemo). No measure at all also works (sdl app). If voltage can't be measured, then battery_level() is king and it'll be used for power_history and runtime estimation. * Implement target's API in the simulator, i.e. _battery_voltage(), so it doesn't need to implement it's own powermgmt.c and other stubs. Now the sim behaves much more like a native target, although it still changes the simulated battery voltage quickly, * Other changes include include renaming battery_adc_voltage() to _battery_voltage(), for consistency with the new target functions and making some of the apps code aware that voltage and runtime estimation is not always available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2011-12-31onda: remove now inlined USB_INIT_GPIO()Rafaël Carré1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31500 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-target.h: removeRafaël Carré3-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31498 a1c6a512-1295-4272-9138-f99709370657
2011-12-31onda 747/777 : move USB_STATUS_BY_EVENT to configRafaël Carré1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31497 a1c6a512-1295-4272-9138-f99709370657
2011-12-31onda usb code: merge into .c fileRafaël Carré3-87/+17
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31496 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb_drv_connected() is declared in usb_drv.hRafaël Carré2-4/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31490 a1c6a512-1295-4272-9138-f99709370657
2011-12-31move usb_pin_init() declaration to PP's system-target.hRafaël Carré2-2/+0
remove duplicate usb_detect() declaration Remove all content from empty usb-target.h files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31488 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb_init_device(): move prototype to usb.hRafaël Carré2-2/+0
Get rid of some usb-target.h files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31487 a1c6a512-1295-4272-9138-f99709370657