summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
AgeCommit message (Collapse)AuthorFilesLines
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
2021-06-09Sansa Connect: Fix sending ZLP on non-zero endpointTomasz Moń1-2/+13
This fixes panic when mass storage driver sends failed result. Change-Id: I14ae975b1f23aee7bc2f7bad6ed68dde29cf5e36
2021-06-09Sansa Connect: Fix bulk transfers greater than 64 bytesTomasz Moń1-4/+19
Correctly set endpoint maximum packet size so host will not consider end of transfer after receiving first packet when transfer is larger than 64 bytes (at High Speed the endpoint max packet size was set to 64 but according to descriptor it is 512). Split DMA transfers up to CPPI_MAX_FRAG so we get single interrupt after each call to tnetv_cppi_send(). Change-Id: I385b66bc5d71975a4e3e9167efac0b1334bd3ffc
2021-06-09DM320: Fix SDHC response format 2 handlingTomasz Moń1-9/+17
Return complete R2 response to caller. Due to incorrect bitfield handling only bits [127-96] were ever returned to caller. Change-Id: I83726af35fb24a8051fcca8b8d019ad89d17500e
2021-06-06Sansa Connect: Initial TNETV105 driver portTomasz Moń7-54/+3033
Port USB driver from Sansa Connect Linux kernel sources. The device successfully enumerates and responds to SCSI commands but actual disk access does not work. The SCSI response sent to host mentions that both internal storage and microsd card are not present. Change-Id: Ic6c07da12382c15c0b069f23a75f7df9765b7525
2021-06-05DM320: Fix buffer overrun in sdmmc driverTomasz Moń1-5/+4
Modify count, buffer and start address only after successful transfer. This makes the retry operation to use the same address and buffer as the just failed transfer. Change-Id: I4f49bbdc861d634e33ea5e939a9693474411d24d
2021-06-04ipod6g:: Get rid of magic command numbers in ata driverSolomon Peachy1-14/+33
Use CMD_* macros instead. Makes the code a bit easier to follow. No functional change. Change-Id: Ieb3d8f6fcca503421d3067aafbd0011a908368e0
2021-05-21Sansa Connect: Clear recoverzap parameterTomasz Moń2-9/+9
Clearing recoverzap parameter exists the Recovery Mode. This makes it possible to run Rockbox on Sansa Connect without relying on original Linux firmware. Enable write-through cache on flash memory as write-back complicates handling without any real benefits. The flash memory accepts commands as series of writes at predefined addresses, so it is important that the cache does not interfere with the writes. Change-Id: I219f962f20953d84df43012cf16bbb16d673add8
2021-05-12Add tm->yday to RTC ports missing itMoshe Piekarski2-2/+2
Change-Id: I86882262bafb8d06f925aabb87ebd1b5dcb0cd53
2021-04-26Nuke the never-functional iriver ifp-7xx portSolomon Peachy19-1780/+0
It never worked, and hasn't compiled in something like a decade, Given the HW capabilities (limited onboard flash, no expandability) there's really no point in trying to fix/complete it. Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc