path: root/firmware/target/arm
AgeCommit message (Collapse)AuthorFilesLines
2023-10-06ipod: Support IAP remote MENU/SELECT/UP/DOWN keys in MODE2Solomon Peachy3-6/+21
Only the primary contexts (standard, wps, quckscreen, tree, radio) handle the new keys so far. Todo contexts: Settings, keyboard, pitchscreen, bookmark, & recording. Available docs for MODE4 don't list anything other than playback controls, so it's not clear if there is a path forward here. Change-Id: I91908092f75d96813e2e155e447129ba15f58051
2023-03-23Fix unified syntax in ARM inline assemblyAidan MacDonald2-2/+4
GCC 4.9 always emits assembly with divided syntax. Setting unified syntax in inline assembly causes the assembler to complain about GCC's generated code, because the directive extends past the scope of the inline asm. Fix this by setting divided mode at the end of the inline assembly block. The assembler directives are hidden behind macros because later versions of GCC won't need this workaround: they can be told to use the unified syntax with -masm-syntax-unified. Change-Id: Ic09e729e5bbb6fd44d08dac348daf6f55c75d7d8
2023-03-23Using ARM Unified Assembler LanguageChris Chua4-34/+36
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
2023-01-13Remove buflib allocation names, part twoAidan MacDonald2-2/+2
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2023-01-12Add INIT_ATTR to i2c_init()Aidan MacDonald4-4/+4
It's usually only called from init() in main.c, so this is safe. There is one more call in system-dm320.c from system_init(), but that's also "safe". I don't know if it's okay to call i2c_init() twice, but presumably it works... Change-Id: I9c1cd918d162d9955f7cf03209e836cbd5e30c57
2023-01-12Add INIT_ATTR to system_init()Aidan MacDonald1-1/+1
On single-core targets, system_init() is only called from init() in main.c, which is also INIT_ATTR, so this is safe. Multi-core targets additionally call system_init() from cop_main(), which isn't marked INIT_ATTR. I'm fairly certain that it would be safe to add INIT_ATTR to cop_main() with a bit of refactoring, but I don't have a way of testing it. So for now, leave INIT_ATTR off for multi-core targets. Change-Id: I8fe4358f975880ca317d46bda01d7d9db529d3e3
2022-10-13Revert "Remove YUV blitting functions and LCD modes"Solomon Peachy38-1/+7762
This reverts commit fe6aa21e9eb88f49005863efd2003d0982920048. Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
2022-10-03Remove YUV blitting functions and LCD modesAidan MacDonald38-7762/+1
None of this is needed now that mpegplayer is gone. Change-Id: I360366db8513e4d988021e8d7b7d8eb09930efb8
2022-09-30Define LCD_STRIDEFORMAT unconditionallyAidan MacDonald1-2/+2
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the macro it's simpler to have config.h define LCD_STRIDEFORMAT to the default of horizontal stride when the target leaves it unspecified. Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
2022-05-03add const to const * stringsWilliam Wilgus3-7/+7
I don't think this will amke any difference except maybe for hosted ports Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-03-21Lcd save function pointer to frame buffer get_address_fn before loopsWilliam Wilgus16-25/+44
Calling multiple levels of indirection in a loop slows things down Really these need to be rewritten to take a start and end address like most of the rest of the codebase But this is safer without having test hardware in hand Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
2022-03-11multiboot: Refactor duplicated functions to a separate fileAidan MacDonald1-88/+1
The implementation of write_bootdata() and get_redirect_dir() was copied verbatim in two different places, obviously a bad thing for maintainability. This moves them to a new file multiboot.c as they are only used for multiboot. Change-Id: Id0279216e4dd019f8bf612a81d3835eff010e506
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-11-18Sansa Clip+: add RDS supportWolfram Sang2-1/+7
Based on a patch by Amaury Pouly which was based on a patch from Ryan Hitchman. I mainly moved the code for polling into the tuner driver so it can be reused by other targets. I added the CONFIG parameter for the polling frequency (in ticks) to save energy. Also, I did some minor cleanups. Change-Id: I95a62e7e1e42c62dbf47ecb27a3b312a42be62aa
2021-11-10as3525: debug: use 'kHz' where applicable instead of "MHz" or "KHz"Wolfram Sang1-2/+2
Change-Id: I84c24402d664b5a1a37c81aebfc438bd04bc8af4
2021-10-16usb: introduce new control request APIAidan MacDonald6-7/+7
Change-Id: I6545d8985ab683c026f28f6a7c0e23b40d0a6506
2021-09-29Bugfix AS3525 usb driver unboosted the cpu without first boosting itWilliam Wilgus1-2/+11
Change-Id: Id2d45870a9128b19ace0e8d5c16d3b3fa4b923dd
2021-09-20usb: rename usb_drv_recv() to usb_recv_recv_nonblocking()Aidan MacDonald6-12/+11
IMHO the current name is somewhat misleading: - usb_drv_send() is blocking and we have usb_drv_send_nonblocking() for the non-blocking case. This inconsistent naming can only promote confusion. (And what would we call a blocking receive?) - Other hardware abstraction APIs in Rockbox are usually blocking: storage, LCD, backlight, audio... in other words, blocking is the default expected behavior, with non-blocking calls being a rarity. Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
2021-09-12iPod mini backlight initializationChristian Soffke2-1/+8
Fixes backlight not turning on after booting (tested on an iPod Mini 2G). backlight_hw_init() copied from iPod 4G. Change-Id: I9c32ca5ecd3dc74ea997e6cb843da79d303b0615
2021-08-14Fix red from 04fe77a4Solomon Peachy1-0/+2
Change-Id: I13a7b067e60eabe27be1fe983a7cced3ae8b18e3
2021-08-14Remove the (very) incomplete port for the Tatung TPJ-1102Solomon Peachy13-442/+0
It was barely even a stub, and hasn't seen any development since 2009 Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-08-14Remove Samsung YP-Z5 portAidan MacDonald13-1071/+0
It has only a couple GB of onboard flash storage with no storage driver in Rockbox. It hasn't seen any meaningful development since its initial commit, it's not on the build farm, and the bootloader build is broken by other refactoring. Change-Id: Idd9e3c46fac9b96f416ce444182f97a50770e747
2021-08-08As3525 wavpack_enc document some intentional switch fall throughWilliam Wilgus2-1/+7
Change-Id: I56bf439df2c05653d65f49238e886e4ef2291176
2021-07-25Fix yellow from e532714d1fAidan MacDonald1-1/+0
Change-Id: I4f49e93fc1efa78874fb76de6a436ad1fc894cc5
2021-07-25pcm: Remove unused function pcm_play_dma_get_peak_buffer()Aidan MacDonald13-151/+0
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2021-07-10Sansa Connect: Ensure LCD starts before backlightTomasz Moń1-0/+1
Extra delay prevents white flash after hold switch release. Change-Id: Ib0d33937dcbb738b913388e7df92ffdf9346c9f9
2021-07-10Sansa Connect: Use deviceid in USB Serial NumberTomasz Moń4-0/+118
Atmel AT88SC6416C CryptoMemory is almost I2C compatible. The device is connected to bitbanged I2C bus shared with compliant I2C devices. Change-Id: Iec54702db1bdfb93c01291eef18ec60391c63b16
2021-07-09Sansa Connect: Fix reported CPU frequencyTomasz Moń7-30/+66
Make frequency related comments accurate. Disable UART0 clock. Change-Id: I224a3d6656ad53165dcff68ed716fa2c6863240d
2021-07-09DM320: Regorganize LCD and TTB memory layoutTomasz Moń2-40/+80
Do not introduce any change for M:Robe 500 as it uses the two LCD frames in non-obvious way. Sansa Connect and Creative ZVM use only single front framebuffer. Place TTB at DRAM end to minimize memory loss due to alignment. Reserve as little as possible memory for the LCD frames. On Sansa Connect this change extends audio buffer by 858 KiB. Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
2021-07-07Sansa Connect: Reduce USB RX buffers from 129 to 2Tomasz Moń2-24/+27
Reducing number of fake RX buffers saves a bit more than 127 KiB RAM. Fix compilation with CPPI logging enabled. Change-Id: If1ad3a6fc251e284caaac78c2406a58f3d6547bb
2021-07-07Sansa Connect: Prevent unresponsive interfaceTomasz Moń1-1/+13
AVR interrupt signal can remain active if the state has changed during state read. In such case, there won't be intterupt and the interface would appear unresponsive until AVR thread received event (e.g. USB connection/disconnect). Solve the issue by not waiting for event if AVR interrupt signal is active prior to event wait. Change-Id: I86e388c7cd6da76e3abe7bf7114940f331e4c308
2021-07-07Sansa Connect: Read HDQ battery dataTomasz Moń3-1/+137
Make it possible for target to provide voltage, percentage and time to empty values. The voltage measurement is nice to have in debug menu even if the actions are taken only based on percentage. Perform battery level estimation based on voltage only if percentage is not available. Use time to empty based on actual power consumption. This makes the estimated runtime displayed in Rockbox Info to react to backlight setting. The bq27000 updates time to empty estimate every 5.12 seconds so it is possible to see the estimate with backlight off on the screen if user enters Rockbox Info, activates hold switch, waits 11 seconds and releases the hold switch. Change-Id: Iafe3fa0fb334e3428e3a0ad05b2c020d208dc934
2021-07-05Sansa Connect: Power off LCD to save powerTomasz Moń3-41/+84
Prevent startup screen flash by properly using AVR LCM functions. Power off LCD when not needed to improve battery runtime. Change-Id: I76e3c5c0208774f189fbc6f7d7b3c9e22c062285
2021-07-04Sansa Connect: Fix power off panic screenTomasz Moń2-2/+10
Queue power off requests because power_off() can be called within tick context that must not acquire mutex. Change-Id: I6f1a8f81d15518876cd03556118fc9eb37b8175f
2021-07-04Sansa Connect: Initial libertas WiFi driver portTomasz Moń4-2/+142
Import non-free firmware image from linux-firmware package. Firmware loading works but is disabled at compile time because just loading firmware without configuring device results in higher power consumption without any benefit to end user. Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
2021-06-27Sansa Connect: Ensure adequate AVR Slave Select delayTomasz Moń1-1/+2
Waiting 10 us between selecting slave and transmitting data on SPI resolves spurious startup glitches. Cache last read monotime value as it can differ from the first one. Change-Id: Ia6ac5696f6ee2bc3c6a8be27e33aaddd9ff4ce2a
2021-06-27Sansa Connect: Discard invalid monotime readsTomasz Moń1-22/+39
Read monotime twice in a row and only accept the value if it matches or the two reads are 1 second apart. Change-Id: Ibd289103a20404dd1b2bbd131fdfa8905852c788
2021-06-27Sansa Connect: More reliable AVR communicationTomasz Moń1-15/+16
AVR requires bigger delays between retries. Read state instead of version for synchronization purposes as it shifts more bytes. Change-Id: Ib7fa980496d3bc7744a086b45e1865861ef58b88
2021-06-25Sansa Connect: Retry AVR commands only 3 timesTomasz Moń1-16/+33
If the commands repeatedly fail it is likely that the AVR is not programmed. In such case simply continue normal operation. This is especially important in bootloader as it makes it possible to load new rockbox build using bootloader USB mode. Otherwise, the only recovery option would be to use I2C serial. Change-Id: I4b0999833e9a906ec6353bdfdd5b68211f07ac81
2021-06-25Sansa Connect: Implement RTC functionalityTomasz Moń1-23/+159
Use 32-bit monotime AVR counter for time tracking. Set the time by adding fixed offset to the counter value. Store the offset in rockbox directory to make it persistent between reboots. Do not implement alarm functionality as wakeup is only possible from sleep and not from complete power off. Change-Id: I615c7eb4df8ab0619dcbfcff107bc7051a15aace
2021-06-25Sansa Connect: Manually drive SPI Slave SelectTomasz Moń1-2/+19
Keep Slave Select active during command transmission. This relaxes timing requirements on the AVR side. Change-Id: Ia1a6cf45aba3c11f6aeaa7441c6793807ca827f0
2021-06-22Sansa Connect: Refactor AVR command handlingTomasz Moń3-103/+234
Add defines for all commands handled by AVR, including the unknown opcodes (0xC5, 0xD3, 0xD4, 0xD5, 0xD6). Properly synchronize with AVR and keep repeating command until it looks like AVR has accepted it. Change-Id: I3d42e973f135e33092c71c9887421906a900ab58
2021-06-21mi4: replace chksum_crc32 with crc_32rJames Buren1-3/+2
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-06-20Sansa Connect: Indicate charging statusTomasz Moń2-27/+40
Consider battery level down to 0 as safe as OF continues to operate normally even when at level 0. Change-Id: Ie3889e5662b9fa6588e20ad02d8953f29e28800c
2021-06-15DM320: Use SD/MMC data done interruptTomasz Moń1-17/+32
Wait on semaphore until DMA finishes instead of busy waiting. This allows the CPU to be used by other tasks during transfers. Increase peripheral clock frequency, divide AHB by 2 instead of 3. Function clock frequency is AHB divided by MMC divider + 1. Change-Id: Ic890634da7e3541962ea3501eae8fa2ca2db606a
2021-06-14Sansa Connect: Properly setup internal speakerTomasz Moń1-52/+56
Switch to internal speaker when headphones are disconnected. Change-Id: I7c04ac139ad540d85f960e9dadc2faaf4f856055
2021-06-12Sansa Connect: Disable endpoint double bufferingTomasz Moń1-2/+8
Disabling double buffering results in expected CPPI TX behaviour. With the double buffering enabled, sending single ZLP resulted in two ZLPs being available. The two ZLPs is problematic because this causes Windows to reset USB device after failed SCSI command. The problematic sequence on Windows 10 was as follows: * Host sends SCSI Mode Sense(6) Informational Exceptions Control(0x1C) * Device sends ZLP * Device sends command failed response With endpoint double buffering enabled the ZLP was read twice by host. As host was expecting command response on the second read (and got ZLP instead), host attempts recovery by resetting USB device and retrying. Change-Id: I64e95998f429ffb7b14143d956b1f29d20218d14
2021-06-10Sansa Connect: Remove fake battery voltage scaleTomasz Moń2-68/+8
Use battery percentage as reported by AVR. Change-Id: Id697d460b240798eb0b103f9e1f419906b87e9ca
2021-06-10Sansa Connect: Add missing includeTomasz Moń1-0/+1
Include usb.h to have usb_acknowledge() prototype. Change-Id: I2dd951315a93e7c1c456358d715f9ec44bf9e5af
2021-06-09Sansa Connect: Working USB Mass StorageTomasz Moń3-17/+9
Acknowledge SYS_USB_CONNECTED in all queues so USB task can gain exclusive access to the storage. Reduce CPPI requeue timeout to speed up disk access. Change-Id: I322aae4cac679696bb8186ccacf838a18f0715e9