path: root/firmware/target/arm/imx31
AgeCommit message (Collapse)AuthorFilesLines
2022-02-07RFT: convert Gigabeat RDS to threadWolfram Sang1-35/+14
This kind of reverts 7b596416bf ("Gigabeat S: Update RDS processing to use asynchronous I2C rather than thread."). However, requiring RDS to run in thread context will a) allow more upcoming features and b) remove quite some complexity from the codebase (see the diffstat here) because Gigabeat is the only user. iMX31 should be able to handle one more thread, as it can even run Linux. Change-Id: I46130034595ba66392c5417c275d036f4bd26943
2021-07-25pcm: Remove unused function pcm_play_dma_get_peak_buffer()Aidan MacDonald1-28/+0
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2021-04-01gigabeats: Fix hang on startup caused by a stack overflowSolomon Peachy1-1/+1
headphone ADC thread stack was slightly too small. Bump it up a bit. (it was _perfectly_ sized for the prior older toolchain+optimization flags...) Change-Id: I2ca67c2b85c54f879892a31e281d7696f893389c
2020-11-12pcm: Further cleanup of unused bits of the PCM ACPI:Solomon Peachy1-24/+0
* 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-10-31pcm: Get rid of pcm_play_pause() and associated APIsSolomon Peachy1-14/+0
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-10-13imx31: Work around an apparently not-quite-kosher abuse of CPPSolomon Peachy3-4/+19
(we were trying to foward-declare functions from within static initializer context. GCC no longer accepts this) Change-Id: I58f316ecc84c8ab45fffc054955727a55714b0a3
2020-07-05imx31: Fix regression in bootloader caused by cd9906Solomon Peachy1-1/+1
Change-Id: I1b561c9136a727f49e02e53798e46ef9197a3958
2020-07-05arm: Fix PortalPlayer linker scripts with binutils 2.21+Solomon Peachy2-4/+4
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
2018-01-14Gigabeat S: Remove unwanted partitions on the flyMichael Sevakis1-16/+18
Windows now ignores the hidden flag, so just nullify the entries to hide depending upon whether or not bootloader install mode is activated. Change-Id: I00d0797e40ea3b5f5d5d8e1243b50cfcdd029bb4
2017-11-21Convert i.MX31 and AMS target to use RTC interruptMichael Sevakis2-0/+31
Instead of checking ticks, set a sticky dirty flag that indicates that the RTC needs to be read. This gives a timely update and more accurate readout without actually reading the RTC until it changes. The implementation should atomically read the flag and clear it. Setting the flag would typically happen in an RTC tick ISR. Change-Id: I6fd325f22845029a485c502c884812d3676026ea
2017-10-26Unify storage threads into oneMichael Sevakis1-4/+0
* 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-02-11Improve radio RDS driver and frameworkMichael Sevakis1-37/+20
* Remove unused bits like the radio event and simplify basic radio interface. It can be more self-contained with rds.h only required by radio and tuner code. * Add post-processing to text a-la Silicon Labs AN243. The chip's error correction can only do so much; additional checks are highly recommended. Simply testing for two identical messages in a row is extremely effective and I've never seen corrupted text since doing that, even with mediocre reception. Groups segments must arrive in order, not randomly; logic change only accepts them in order, starting at 0. Time readout was made a bit better but really we'd need to use verbose mode and ensure that no errors were seen during receiving of time and more checks would be need to have a stable PI. The text is the important bit anyway. * Time out of stale text. * Text is no longer updated until a complete group has been received, as is specified in the standard. Perhaps go back to scrolling text lines in the radio screen? * Add proper character conversion to UTF-8. Only the default G0 table for the moment. The other two could be added in. * Add variants "RDS_CFG_PROCESS" and "RDS_CFG_PUSH" to allow the option for processed RDS data to be pushed to the driver and still do proper post-processing (only text conversion for now for the latter). Change-Id: I4d83f8b2e89a209a5096d15ec266477318c66925
2017-01-29i.MX31: Restore screen clearing in DVFS/DPTC debug screenMichael Sevakis1-1/+2
Somewhere along the line the screen stopped being cleared prior to writing new text on each frame, which left visible bits of previously-displayed text when it changed. Change-Id: I344e03c234daa77f4e64ed89281c40db887e4498
2017-01-29Improve imx31 interrupt code for PMIC and GPIOMichael Sevakis16-444/+489
Fix stuff that was bugging me about the way I did it at first. While messing around I found RDS code wasn't masking its GPIO ISR as it should, which might lead to two different interrupts messing with the static data. Change-Id: I54626809ea3039a842af0cc9e3e42853326c4193
2015-01-12Get rid of stupid _backlight_* function namesMarcin Bukat3-10/+10
_remote_backlight_* and _buttonlight_* are cleaned as well Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2014-03-06Gigabeat S: Improve headphone thread implementation.Michael Sevakis1-81/+54
Implement scanning as binary tree in array. Make the ADC calls fewer without compromising read quality. Declare the thread function as 'noreturn' to save some stack. Reduce stack size (regardless, % use is now a bit lower). Change-Id: I239792fd2a0a2c019d1ec4af1d6d4b466cdf0ef5
2014-03-03Fix more reds.Thomas Martitz7-2/+12
Change-Id: I4b58dda0953b7f9799238c32b78037b0a5403c04
2014-01-05Add missing kernel.h includes (hopefully all of them).Thomas Martitz1-0/+1
Change-Id: I9c1825296a788587b8d494d8514b3314847b0ff0
2013-05-14Get rid of usb_drv_attach() from USB code.Michael Sevakis1-2/+0
'Twas an idiosyncrasy of detecting a host upon bus reset, which is obsolete. Change-Id: I0adb25e1805022544f52cd0cb766819a367dbde4
2013-05-11Set the right variable type for ucallback :)Michael Sevakis1-1/+1
Change-Id: I19eace9452d9d0b2a6c7770549930c83ece05c80
2013-05-11i.MX31: Remove long udelay from DVFS interrupt handlerMichael Sevakis6-88/+140
Split the ISR into two parts and alllow quick return from first half. Introduces a uevent() API to have a callback happen in a specified number of microseconds. Right now only one event is supported. Change-Id: Ib1666165be2f6082e5275d64961f083cab104f9f
2012-05-23Gigabeat S: Fix the recording locking upon using it a second time.Michael Sevakis1-4/+4
Apparently I got the "just-in-case" RXFIFO purge in there before the RXFIFO was enabled, causing severe hardware spasms. Change-Id: I2ea4b6d28e06372b61cb3f21ab2fce71dd408213
2012-05-07remove debug-target.hRafaël Carré2-27/+0
2012-05-01Make INITDATA_ATTR work on everything that has INIT_ATTR enabled for code.Michael Sevakis1-1/+0
Change-Id: If9936bfbbd3bc3eb2a3e3e290701b8517eabfb13
2012-04-06arm: factor all exception handlers out of the crt0.S filesAmaury Pouly1-29/+0
Remove the implementations of all exceptions handlers from the various crt0.S files and have a single implementation in system-arm.h The new implementation is weak so that it can be overwritten by some specific code (like the unwinder) Change-Id: Ib3e041ed6037376bbe0e79286057e1051640dd90 Reviewed-on: Reviewed-by: Marcin Bukat <>
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis1-63/+56
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: Reviewed-by: Michael Sevakis <> Tested-by: Michael Sevakis <>
2012-01-08button-target.h : move prototypes to button.hRafaël Carré1-4/+0
no need to define BUTTON_REMOTE anymore git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-07charging_algorithm_close() declaration has movedRafaël Carré1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-07powermgmt-target.h: move prototypes to powermgmt.hRafaël Carré1-4/+0
Implement empty stubs if needed instead of empty static inline git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04Reorganise USB initialisation to not depend on a specific enumeration ↵Frank Gevaerts1-7/+0
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:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04imx31: move DEBUG_CANCEL definition to .cRafaël Carré2-1/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_hw_info(): remove duplicate prototypesRafaël Carré1-1/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04dbg_ports(): remove duplicate prototypeRafaël Carré1-1/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-04Fix beast warning.Thomas Martitz1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-03Rework powermgmt to enable code re-use on appliation and sims.Thomas Martitz1-3/+3
* 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:// a1c6a512-1295-4272-9138-f99709370657
2012-01-03i.MX31: need an additional ISR lockout instance when closing driver.Michael Sevakis1-1/+3
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-03Gigabeat S: Dump some now-irrelevant comments.Michael Sevakis2-5/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-03i.MX31: Fix a couple oopses from r31528Michael Sevakis2-3/+2
Enabled a PMIC event where it should be disabled. Used constant from wrong enum to get sense bits (??) which messed up main charger detection. Also remove an obsolete struct declaration. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-02i.MX31 - Dethreading operations continueMichael Sevakis7-153/+161
Dispense with "pmic" thread and process PMIC events directly within ISR. Add sense bit reading as part of the handling. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2012-01-01Gigabeat S: Revert removal of usb_plugged in r31489Michael Sevakis2-2/+8
Synchronous cable read is still required because the timing of the receipt of the cable event cannot be known for sure-- basically it introduced a thread race between main and pmic. If a keypress is desired instead to enter BL USB mode a la AS3525, then it's possible to remove that. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-target.h: removeRafaël Carré2-2/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-31gigabeats usb-target: merge in system-target.hRafaël Carré2-43/+15
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb_plugged() is PP onlyRafaël Carré2-9/+3
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb_init_device(): move prototype to usb.hRafaël Carré1-1/+0
Get rid of some usb-target.h files git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-29Forgot a "static" in r31462.Michael Sevakis1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-29Gigabeat S: Update RDS processing to use asynchronous I2C rather than thread.Michael Sevakis1-22/+41
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-29i.MX31: Implement asynchronous version of I2C driver.Michael Sevakis2-158/+262
Scheme is more flexible and should help to enable threadless RDS. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-29i.MX31: Some tweaks with variable declaration in SPI driver.Michael Sevakis1-19/+14
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-26i.MX31: Rename somethingMichael Sevakis4-7/+7
Might as well rename spi_enable_module to spi_enable_node for consistency as well so long as I'm being picky. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-12-26i.MX31: Silly little change to enable/disable a SPIMichael Sevakis4-45/+34
Unify spi_enable/disable_module into one spi_enable_module call for API consistency's sake with I2C driver. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657