path: root/firmware/target
AgeCommit message (Collapse)AuthorFilesLines
2022-05-03add const to const * stringsWilliam Wilgus6-11/+11
I don't think this will amke any difference except maybe for hosted ports Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-04-01ErosQ Native: Make power delay bootloader-onlyDana Conrad1-0/+2
gotta go fast Change-Id: Ic01e4aa70a2bec4c48ae7cf8f32f8dfd366decad
2022-04-01Eros Q Native: Add Original Firmware Boot optionDana Conrad2-0/+30
Hold "Play" to boot the OF, or boot it from the recovery menu by holding "Vol. Up". If you had the hosted port installed on your player before installing the native port, you'll still have to go through the hosted bootloader. A couple notes: - When booting from the menu, the recovery menu disappears, then reappears before going into the OF. - You need to hold the play button for like a half second after the blue light comes on in order to get into the OF. The recovery appears to be there, but it doesn't seem to be intended for end users - it just says "Updater V1.1 - Insert TF Pls". I haven't tested it beyond seeing that it boots, so I'm going to comment it out for now. Change-Id: Ie271ee479bb628cc74141b7fe07273b3f193f358
2022-03-31hosted: call 'sync' before poweroffAidan MacDonald1-0/+1
Might be needed to avoid filesystem corruption with buggy OF kernels. Change-Id: I589eec6c1536beccf849716f11204b4b83a942a1
2022-03-27x1000: Add multiboot supportAidan MacDonald1-0/+6
Enables multiboot for the FiiO M3K, Shanling Q1, and Eros Q native port. Note this requires an up-to-date Rockbox _and_ bootloader. Usage instructions will (eventually) be found on the wiki: Change-Id: Ia2da1ad6ef611e499d2fbafa93838387bc1023ba
2022-03-25x1000: remove the last vestiges of boot option supportAidan MacDonald4-57/+28
There should be no need for any compatibility hacks since this value was mostly used internally between the SPL and bootloader. clk_init() was the only user in the main Rockbox binary which accessed it, but when loaded by the Rockbox bootloader that code will not be reached since BOOT_FLAG_CLK_INIT is already set. Change-Id: Idd68b9834172e652b47432bfb1e00c923ea35407
2022-03-25x1000: spl: remove selectable boot option supportAidan MacDonald5-238/+65
Now the SPL boots the Rockbox bootloader unconditionally, which allows for some simplification. Change-Id: Id75c82db25a87e0e9043bb0771f622b1fc9482fb
2022-03-25x1000: spl: remove dual boot support codeAidan MacDonald4-220/+0
Removes the SPL's dual boot support code, and removes the dual boot selection code on the M3K and Q1 since they can now do it from the main bootloader. Change-Id: Ie1b27e98c6ed4b3e37db86cfb485d6f3a6c5b25e
2022-03-25x1000: spl: split off NAND storage to separate fileAidan MacDonald2-25/+50
Just tidying. No functional changes. Change-Id: I8aa85c789d1a6bd357797c6c95e38a7325eba809
2022-03-24x1000: add bad block marker position to nand_chip infoAidan MacDonald2-0/+4
Change-Id: I6f466d87f6f11bc3e23463c469f318ecb7049ba7
2022-03-24x1000: bootloader: add LCD dualboot cleanup for the M3KAidan MacDonald1-7/+5
Disable LCD interrupts before booting the OF - the OF kernel hangs at boot if they are enabled. Change-Id: I4f119818d0243953cdd620e17d9509b4fb16cc28
2022-03-21Lcd save function pointer to frame buffer get_address_fn before loopsWilliam Wilgus21-34/+62
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-16x1000: restore crt0.S cache flushAidan MacDonald1-1/+19
I-cache must be flushed after copying code to IRAM... duh. Change-Id: I6eacc4b7c4385175724c947f6c53f7bbddcb6295
2022-03-16x1000: optimize crt0.S, improve correctnessAidan MacDonald1-58/+43
Replace inline section copy/fill loops with subroutines, which reduces code size a bit and and handle zero size copies properly. Remove the cache initialization loop as well. There's no actual reason for this because the SPL initializes the caches and just dropping the cache can even be harmful (in this case it wasn't, because the SPL flushes the whole cache right before calling in). Change-Id: I7cddc9ed6d060b1f1bdd75544297883d014cad2d
2022-03-12x1000: add TCSM section to linker scriptAidan MacDonald2-0/+22
This is intended for debugging OF kernel boot problems and has to be enabled manually at compile time to make it usable. Change-Id: Ie5ce9f0a7639be0acf5e3879cfc3a7b8b89caa5c
2022-03-12x1000: add dual boot helpers for the main bootloaderAidan MacDonald2-1/+151
Two helpers (_init_clocktree and _init_uart2) already existed in the SPL and are copied verbatim from there. The SPL versions are still present and will be removed when dual boot works from the main bootloader. The other two helpers (_cleanup and _load_pdma_fw) are new. Change-Id: I4661667966e26f52e6c5142f1947d2a34b7008ef
2022-03-12x1000: add function for booting linux kernelsAidan MacDonald2-0/+32
Change-Id: I0750b084fe88d21a8686daf0681b32b1dcba8fec
2022-03-12x1000: remove plugin and codec buffers on bootloaderAidan MacDonald1-0/+7
On the bootloader there's no point reserving memory for these, the only users of codecbuf/pluginbuf are in the apps/ tree. Change-Id: Ib57b4d59aff8f4dcc753d7993956ed15e61cdc52
2022-03-12x1000: use core_alloc in bootloader for loading rockboxAidan MacDonald1-2/+0
Using the audio buffer directly is a bad idea because this will render core_alloc non-functional if load_firmware() writes into the buffer but then fails, for example on a checksum mismatch. Change-Id: Ib2d17bcea53bdea1c4c5496cec0c4eee5dd66069
2022-03-11x1000: Clarify definition & usage of RAM areasAidan MacDonald2-5/+3
Document what the symbols are supposed to mean, fixup SPL's usage of DRAM_END which should really be SDRAM_END instead. No functional changes. Change-Id: Ie85b0ee35fea8b7858891e5b9d6634eaae42c9f8
2022-03-11x1000: support new binary header in roloAidan MacDonald2-0/+114
Change-Id: I192c3d69616c39534ff329174c4d8d4a357d014d
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-03-11multiboot: Remove bad multiboot code from hosted RoLoAidan MacDonald1-16/+0
This looks like it was copy-pasted blindly from elsewhere and it wouldn't even compile, since hosted RoLo is completely different from native RoLo. Change-Id: I4074f5323dcbdae85db8a04f222c858e9a228432
2022-03-11erosqnative: Fix missing END marker in LCD enable sequenceAidan MacDonald1-0/+1
Change-Id: I75b3a396174e84d72e70c6f177bc1702021805f1
2022-03-06x1000: add simple binary header to declare the load addressAidan MacDonald1-0/+14
The header format is basic, a variable length list of values tagged by 4-byte strings. The main application to to allow a loader to determine the load address of the binary at runtime instead of using a hardcoded address. But the header contents aren't fixed and it could be extended for other purposes too. Change-Id: If51d85b4c2eb53c919a91b54985b157e8e5c20ef
2022-03-04x1000: fix nand driver reference countingAidan MacDonald1-3/+5
Somehow I screwed this up as well. Seems it didn't cause trouble. Change-Id: I5ab99dd9182a4e60d55984fecbf20ca823dbd004
2022-03-04x1000: fix bug in nand_read_bytesAidan MacDonald1-4/+4
This didn't account for partial page reads properly which resulted in corrupted data. Fortunately, current released bootloaders do not perform such reads so they don't trigger this bug. Change-Id: I426a95ef8d0f20f4567498530e216d80e1aceef2
2022-03-03Fix Red SDL, Android mounting root directory, and all the yellow tooWilliam Wilgus2-30/+0
Change-Id: Ic5077140fdcb1e3168111336bc428c27a782123c
2022-03-03Fix Red SDL, Android mounting root directoryWilliam Wilgus2-0/+30
Not actually used in either atm Change-Id: I40e0143fdde1970ac485bf664962c62d4c493d57
2022-02-12buflib: add a common dummy callbacks struct & use itAidan MacDonald1-1/+1
There are various allocations that can't be moved or shrunk. Provide a global callback struct for this use case instead of making each caller declare its own dummy struct. Also fixed ROLO and x1000 installer code which incorrectly used movable allocations. Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
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
2022-01-30Shanling Q1: fix DAC power mode switchingAidan MacDonald1-1/+1
The OST prescaler bugfix (7a5130a277) broke runtime switching between 1.0V and 2.0V modes. The 1ms delay after shutting down the DAC isn't long enough to reset it, so it gets stuck in the power mode assigned at boot. Change the delay back to 4ms, the effective value prior to the OST bugfix. Change-Id: Ic4583d1a6fa82540062aa185386f14bbf785a3f4
2022-01-29FiiO M3K: audio recordingAidan MacDonald1-6/+121
Recording works now, although I'm sure there will be a few things that need fine-tuning. A major issue is that writing to the SD card creates noticable interference, which happens on the original firmware too but seems worse under Rockbox. (Since Rockbox waits until RAM fills up before writing data, the interference will only be heard on >50 MiB recordings.) Change-Id: I5561dd9668c3bdd34e92f34ef50848aef8c0b7eb
2022-01-16audiohw: avoid magic numbers for DAC power modeAidan MacDonald2-2/+2
Define proper symbolic constants for power mode. Also allow targets to define the default power mode setting. Change-Id: Ia07cf854dce47d0a6aa88e067471f1ff9fbc45fb
2022-01-16x1000: core PCM recording supportAidan MacDonald2-55/+130
Change-Id: I71883272cc3bffadc1235b0931c3f42bb38e4c1e
2022-01-09axp-pmu: adc refactorAidan MacDonald3-8/+31
Remove the battery power ADC since it's not used right now, and seems to fluctuate too rapidly to be of much use. Change-Id: If115e4e3ce14d4c18ce899f5a889f7f99ab66489
2022-01-09Revert "AXP PMU rewrite (again)"Aidan MacDonald6-171/+87
This caused LCD problems on the ErosQ, where the screen would go white until being put through a sleep/wake cycle. The exact reason for this isn't obvious, but the problem didn't exist prior to the AXP driver rewrite. The two dependent changes, 42999913ba - x1000: Increase USB current limit to 500 mA at all times 90dd2f84a9 - x1000: Correctly limit USB charging current ended up bringing the USB charging situation back to where it was prior to the rewrite, so the cleanest option is to revert the whole lot. This reverts commit 42999913ba3a76221fceb04b1f935ed4e0e71476. This reverts commit 90dd2f84a9174c38dbfb07d582ec6ee7697b1939. This reverts commit 2d891439623bb76d38b98202ca5f3eea3c01c5f0. Change-Id: I1cff2bfdd1b189df14bcf8cce42db725caa470d7
2022-01-02x1000: Increase USB current limit to 500 mA at all timesAidan MacDonald3-6/+6
The 100 mA USB current limit added in commit 90dd2f84a9 is a problem when booting with a completely dead battery. Often 100 mA isn't enough to power the player, never mind charge the battery, so revert to the old behavior of only limiting charge current. Given that the original firmware on these devices isn't following the USB spec to the letter, it's probably not worth trying to make Rockbox do so unless and until it causes a real problem - which hasn't happened yet. Change-Id: I179a08310c226fe01460680c62fd25fd69079256
2021-12-28x1000: Correctly limit USB charging currentAidan MacDonald3-5/+63
The way this was done before was wrong - limiting the charge current is not enough since the device will draw additional power to run. Use the AXP192's vbus current limit control to stay compliant with the USB specification. Change-Id: I91b84e3480a432e49bec53cf2a17e4e3444404a4
2021-12-28AXP PMU rewrite (again)Aidan MacDonald6-84/+110
I noticed a few mistakes in the old driver code and it was in need of an overhaul anyway... I decided to scale things back, simplify the code and remove most of the debug menus, netting a nice code size savings. One new feature is an advanced debug menu which is accessible by recompiling the code with AXP_EXTRA_DEBUG. It adds quite a bit of code size and isn't useful other than for development so it must be manually enabled by editing the source. Change-Id: I30e17c1194c14823decd726a574ed14451d4cb2d
2021-12-23Revert "powermgmt: Remove an unnecessary function"Aidan MacDonald1-3/+2
This reverts commit 6ff1a935b923b69d34d18e68af612297912c806b. Reason: it created a mismatch between the displayed voltage and percent since the voltage was unfiltered but percentage was based off the filtered voltage. Change-Id: I4cba099f2e1edf0ef7c4e17a32f566aa66f5b933
2021-12-23Report battery current on all X1000 native targetsAidan MacDonald3-0/+30
This allows battery run time to be calculated from the actual battery usage on the FiiO M3K and Shanling Q1. This isn't very good for the time being and the estimate tends to go all over the place due to small variations in current or voltage. The Eros Q can support this feature as well, but since it already has fixed estimates defined and the quality of the "real time" estimate is low I am not enabling it there. Change-Id: Id34a93ee4b7d66f9f7e56ef0f5149f67e8e72039
2021-12-10m3k simulator: remove white borderChristian Soffke1-3/+3
Change-Id: I1503dadc966af568c8a4482e1d7f5641092594f0
2021-12-10m3k simulator: add screen bezelChristian Soffke1-4/+4
Change-Id: I4a34e5be7a459f909b81266b70c30f2968068696
2021-12-05powermgmt: Remove an unnecessary functionAidan MacDonald1-2/+3
Remove battery_read_info() which is a simple wrapper function only used by debug screens. Use the polling functions directly to save a bit of code size. Change-Id: I2919f78105bab186f6933dc1823f9fa67fe74f3e
2021-12-05fiiom3k: Remove unneeded powermgmt-target.hAidan MacDonald1-0/+0
Change-Id: I6af46c860d62d9bc297467050d43e47bff2049b8
2021-12-05Remove a couple of #ifdefsAidan MacDonald2-0/+0
Give iBasso DX50/DX90 empty adc-target.h headers like all the other hosted targets to avoid special cases. Change-Id: Iaae15642fdec4ff18bc9ac01245753135128f676
2021-12-02Make inline functions in headers 'static inline'Aidan MacDonald2-4/+4
Future-proofing against newer versions of GCC/binutils which are stricter about the use of 'inline' functions in headers. Change-Id: Id620812ed340f0d790ba6c5b8b5cb1d700acfbbf
2021-11-27x1000: Fix AIC I2S divider clamping with EXCLK sourceAidan MacDonald1-2/+4
Change-Id: I19c2d25bbd7276ac5efd6f6b3b9ee64d6801f972
2021-11-27Update microtar users to new library APIAidan MacDonald1-10/+10
Change-Id: I8e74efb53b8a8c9a4d69b2a20024434e2868e4e0