summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
AgeCommit message (Collapse)AuthorFilesLines
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 Sevakis4-9/+84
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-11-21Implement a much more capable vuprintf()Michael Sevakis1-1/+1
New support as well as some buggy support fixed. Still no floating point support if ever that would be desired. Support (*): * Flags: '-', '+', ' ', '#', '0' * Width and precision: 'n', '.n', '*' and '.*' * Length modifiers: 'hh', 'h', 'j', 'l', 'll', 't', 'z' * Radix: 'c', 'd', 'i', 'n', 'o', 'p/P', 's', 'u', 'x/X' (*) Provision exists to switch lesser-used stuff on or off or when certain functionality isn't desired (bootloader?). The compulsory radixes are everything but 'o', 'n', 'p/P' and 'x/X' with length modifiers being optional. The default setup is 'l', 'z', 'c', 'd', 'p/P', 's', 'u', 'x/X'. * Move fdprintf() to its own file. It was in a strange place. * Make callers compatible and fix a couple snprintf() bugs while at it. Could smush it down in size but I'm gonna get over the binsize neurosis and just the let optimizer do its thing. Change-Id: Ibdc613a9b6775802c188b29b9dd46c568c94f7c3
2017-11-12Imx233 Disable Autoslow only at maximum cpu frequencyWilliam Wilgus1-2/+2
At normal loads: - disabling auto slow boosts performance at the cost of runtime (~ -5%) - disabling at max cpu does not noticibly decrease runtime Change-Id: I5de80201c9a24ce556862151cbd6b21b01708b63
2017-11-04fuzep: fix rdsAmaury Pouly1-3/+10
Change-Id: I15900f638f8f45cb7035a0e7b1caecb62d1d70e8
2017-10-30AMS: Convert ascodec_endofch() to use bit mod function's return value.Michael Sevakis1-8/+1
It cleans up the code and it was the initial inspiring reason to change them. Change-Id: I299499117b8a12d93d13d6563683bab89ab80555
2017-10-30Make atomic bit modification functions return previous value.Michael Sevakis2-48/+60
Change-Id: I19a94cf946735e1d9e51c3207cd82198fd4dfc1a
2017-10-29Add boot data to MOST AS3525 DevicesWilliam Wilgus1-1/+10
Adds boot data to as3525 devices Sansa C200v2 E200v2 Clip Clipv2 Clip+ ClipZip fuze, fuzev2 m200v4 Adds boot_data to features.txt default arm crt0.s now had boot data if HAVE_BOOTDATA is defined Change-Id: I614a556696540511a69fc12a4520b01c268bf8a9
2017-10-29Add boot data support to rockbox.William Wilgus1-0/+9
Bootdata is a special location in the Firmware marked by a magic header The bootloader is able to copy information to the firmware by locating this struct and passing data to the firmware when it is loaded but before it is actually executed Data is verified by a crc of the bootdata Change-Id: Ib3d78cc0c3a9d47d6fe73be4747a11b7ad6f0a9e
2017-10-28imx233: Implement mutex for cpu_boost_lock/unlockWilliam Wilgus2-0/+34
Playing AAC-HE files resulted in a race condition between audio/codec/buffering for set_cpu_frequency Change-Id: I35e1c1fd18db623e2990c305acdca03f57184d0d
2017-10-26Fix a few missed things in 16454efc (and hopefully clear the red).Michael Sevakis1-0/+27
Change-Id: I2ce88e4c41e6e08efbfbdf261122318dfb0f8b0f
2017-10-26Unify storage threads into oneMichael Sevakis16-1028/+623
* 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-09-17Don't call touchscreen functions when we don't have a touchscreenAmaury Pouly1-0/+12
Change-Id: Ia8c05f45c289729031d6333445d932bb5ac242ca
2017-09-17imx233: make debug usable with a touchscreenAmaury Pouly1-0/+7
Change-Id: I08a3302024646c0d915aa34855970678730eb44c
2017-09-17zenxfi2: fix touchscreen bugAmaury Pouly1-9/+6
Due to some undocumented behavior, the touchscreen was almost unusable in point mode. Now it's much better but still not very nice to use, probably it needs some filtering. Change-Id: Idc8a0214b09f268e6be907ee6ec3126cc0d88773
2017-09-05Initial commit for the Sony NWZ linux portAmaury Pouly1-1/+1
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-08-27zen/zenxfi: always set EMI frequency to 130MHzAmaury Pouly1-4/+7
The ZEN/X-Fi (STMP3700) don't handle memory frequency scaling really well, for this reason we run it at a fixed frequency. That frequency was previously set to 64Mhz because when the CPU run at its lowest frequency, we set the VDD voltage to 0.975 V and on STMP3700, VDDD=VDDDMEM and this is too low to run EMI at 130Mhz. This is not a good solution because under heavy load, running the EMI at 64Mhz results in frame drops and a sluggish device. Thus we now run the EMI at 130Mhz all the time now. To do so, increase the minimum VDD voltage to 1.275 V. This may result is a decreased battery life on those targets but it will also avoid all sorts of glictches and all the device to truly run at full speed. Change-Id: Ia8391492c29fe67bc2701aa7d8cfd00a9df349e8
2017-08-27imx233: fix potential bug in udelayAmaury Pouly1-1/+3
Change-Id: I5c8f5d9917f7a3353862c856bd9bbbbe9b291b1d
2017-08-27zen/zenxfi: increase LCD clock frequencyAmaury Pouly1-1/+1
Change-Id: I157e0d537a1b9d73eda4e18a4a64b10410c6fac4
2017-08-27imx233: update comment about vbusvalidAmaury Pouly1-2/+3
Change-Id: Ice1ece716657fa7f78f69736e5e733e1b7f67b59
2017-08-27zen/zenxfi: fix backlight white flash on backlight onAmaury Pouly1-9/+7
Change-Id: If028a208bd10f46dbe25e4aade085ba7ba13d7be
2017-08-16Fix stupid omissionFranklin Wei1-1/+0
Change-Id: I9d65b8feeeb4c31e14fa60b370a12c0cc8b13f54
2017-08-16Remove mutex_* calls from the MR:500 SPI driverFranklin Wei1-6/+0
As before, they would trigger a panic. Change-Id: I3c140f2897a9d3ed21e13f0a9e45025ede311de5
2017-08-10Remove bad mutex lock/unlock from tcc780x SD driverFranklin Wei1-4/+0
This should make cowond2 work again. Change-Id: Ib23d1548f72f9b604adad46fa1a1c0adee53c29e
2017-08-10Remove bad mutex_* calls in telechips i2c driverFranklin Wei1-7/+0
These were being called in a cpu mode they shouldn't have been, leading to panics. Change-Id: I7fbd0e4af5c6cbaf7177f9dafa901b3924617d7f
2017-07-31fix yellowAmaury Pouly1-1/+0
Change-Id: I682e8298aa926c3c9c073b22abdcef7f5dfef9aa
2017-07-31imx233: fix horrible bug in linreg offset calculationAmaury Pouly1-2/+2
This was actually harmless because it was only used for the debug screen. Change-Id: I76e802c947fdefa8df498ecfeb53e4b6ce0e12bb
2017-07-31imx233: don't print stmp3780 debug info on stmp3700Amaury Pouly2-3/+5
Change-Id: Iffad6f39b62af496e6bb5975610807228c2986c7
2017-06-14Slightly increase CVDD2 on AMSv2.Michael Giacomelli1-2/+2
At least one person found an SD card that wouldn't work at 2.7v. Change-Id: I84001f07acc9ce36c71165706cce28c2899ac6bf
2017-05-16imx233: fix touchscreen driverAmaury Pouly2-7/+31
One cannot call lradc_acquire in IRQ context. The solution is to reserve the channel once at init. There is an additional complication on STMP3600 where channel mapping is fixed. Change-Id: Idccbac634a4d9002703e2b1d57748beb9b245cbb
2017-05-16Samsung YP-Z5: keypad adaption to the new button APILorenzo Miori1-21/+20
After compiling the ypz5 target, I have discovered that the keypad system was refusing to compile, due to a much newer button API. This patch adapts the target to the current imx233 implementation. Additonally, some ADC button values have been re-adjusted. Change-Id: Ib9bfd6aeec5e9e8dfef5887c4147201dd9028a44
2017-04-16ipod6g: some fixes for recordingCástor Muñoz2-8/+51
- Fix broken recording from jack microphone. - Fix recording hardware detection on models that do not support the jack microphone. - Enable monitor mode when recording. Change-Id: Ib79a2746f2d75f74cf6667d33bc9ed6512bbc8a9
2017-03-12Do some housekeeping with fat.h and SECTOR_SIZEMichael Sevakis8-10/+5
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-03-03ipod6g: rename some target filesCástor Muñoz13-31/+31
As preparation to add new targets to the s5l8702 directory, rename files as: s5l8702/ipod6g/*-ipod6g.c -> s5l8702/ipod6g/*-6g.c Change-Id: I0cd03d6bcf39b2aa198235f9014cb6948bbafcd5
2017-02-11Improve radio RDS driver and frameworkMichael Sevakis3-50/+23
* 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-02-09ipod6g: bootloader v1bootloader_ipod6g_v1Cástor Muñoz2-27/+94
- dual boot - USB mode - battery trap Change-Id: I8586cfeb21ee63f45ab965430725225fdfc4212d
2017-02-07Slightly increase CVDD1 for Clip ZipMihail Zenkov1-1/+1
Change-Id: Ic784c72a643546c8e31affa820f701eb7982b7c7
2017-02-04zen/zenxfi: adjust maximum emi voltageAmaury Pouly1-2/+2
Running at 130MHz is unsafe since on those targets, we disable memory frequency scaling because it is unstable. That leads to situation where cpu is running at 64MHz and VDD is at 1.050V. But on STMP3700, the EMI uses the VDD rail instead of a dedicated VDDMEM rail as on STMP3780. Thus we are essentially running the EMI at 130MHz at 1.050V when the minimum recommened voltage is 1.2V. This commit runs the EMI at 64MHz all the time on the ZEN and ZEN X-Fi which will lead to reduce performance but hopefully increases stability. Change-Id: Ida6c2ec130b1778973e383d7c44a06a6ca8f9268
2017-02-04zenmozaic: adjust button voltageAmaury Pouly1-1/+1
The values were recorded for VDDIO at 3.46V and not 3.5 Change-Id: I12880c3d7336389bbac07fe01b8d63d9cd28d177
2017-02-04imx233: remove weak attribute on some functionsAmaury Pouly4-15/+13
This feature was never used and it is not even working because weak linking doesn't work in-between files in a library. Change-Id: I389ea5f17be1d9db0e2150828d704be5a091e09d
2017-02-04nano2g: fix dangerous mutex in hold switchCástor Muñoz1-2/+2
This is a quick patch to solve FS#13104, we can not disable the clickwheel LDO from within interrupt code, so for the moment we leave it enabled all the time, it is unknown how power comsumption is affected when the hold switch is locked. Change-Id: I8f675702e2b5becbcd9197c8b044e6b8daeea79f
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
2017-01-27sd-as3525v2: simplify logic and cleanupMihail Zenkov1-75/+33
Remove "low power mode clocking" as we stop clocking by hands after each transfer. Remove CGU_IDE and CGU_MEMSTICK as we don't use them. Simplify logic in sd_transfer_sectors. Change-Id: I120396d7ec5c99c62f3a746306aa8edd8686e08a
2017-01-26Move intrinsic RTC implmentation differences to driver filesMichael Sevakis2-2/+8
Some drivers set tm_wday just fine and do not need it coerced to be correct. Others set tm_yday, so don't overwrite what the driver sets; just zero it inside if it can't fill the field. Move calls to set_day_of_week() to the sorts of drivers that presumably required the hammer (FS#11814) in get_time() where the weekday isn't locked to the date. Change-Id: Idd0ded6bfc9d9f48fcc1a6074068164c42fcf24a
2017-01-25AMS: Return ascodec to interrupt-based I2C2 driverMichael Sevakis7-133/+583
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
2017-01-24imx233: remove redundant lines in linker scriptAmaury Pouly2-2/+0
Change-Id: Ief8ab0c33abdd3b36cd94b0578e2c5cad22bf2a6
2017-01-21Add CPU mode asserts to kernel on blocking functions.Michael Sevakis1-1/+24
This scourge finds it's way back in far too often. Right now, only defined for ARM. Have fun! Change-Id: Ib21be09ebf71dec10dc652a7a664779251f49644
2017-01-16zen/zenxfi: remove obsolete commentAmaury Pouly1-2/+1
Change-Id: I1e4a726c85a9d87216412162fd0815747eb32cf6
2017-01-16zen/zenxfi: add remark about pinAmaury Pouly1-6/+7
Clearly this pin does not control power so don't call it lcd_power. Change-Id: I9a6794e2606de99cb44dd3e7288b5cce5beb8d0d