path: root/firmware/target
AgeCommit message (Collapse)AuthorFilesLines
2023-01-22ErosQNative: Enable Line Out capabilities on new revision playersDana Conrad3-33/+35
The newer players have some changed hardware, but most importantly the line out now appears to be routed through the stereo switch instead of being hardwired directly off the DAC. Disable muting the headphone amp, enable switching the stereo switch, and rename some of the GPIOs to be more generic since the DAC, headphone amp, and stereo switch all appear to have changed. Change-Id: I220fe5e37bcbcd959b544183e1fcf70673a83c13
2023-01-13fix red from #641e91aa2fSolomon Peachy1-1/+1
Change-Id: I7e648a7bdf1d706258afd49c1edd63655b2d2830
2023-01-13jz47xx: Add support for INIT regionSolomon Peachy4-7/+40
Change-Id: I100cd661e9b1225167463542800c6aafbc3c17b3
2023-01-13buflib: Refactor various debugging featuresAidan MacDonald1-1/+1
Gate buflib_get_data() checking, debug printing, and buflib integrity checks behind individual defines in buflib.h, and turn them all off by default. If needed, they can be turned on manually when compiling. The buflib debug menu is only available if debug printing is enabled, so after this commit it will no longer be included in normal builds -- it isn't very useful to end users. Change-Id: Iab25b7852bc7c5592ce04c9c45762046a87d5bc3
2023-01-13Remove buflib allocation names, part twoAidan MacDonald3-3/+3
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2023-01-12Add INIT_ATTR to i2c_init()Aidan MacDonald5-5/+5
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-12-31x1000: Add INIT_ATTR to various target specific functionsAidan MacDonald6-20/+19
Add INIT_ATTR to some low-hanging fruit in the X1000 code: GPIO init, GPIO initial state tables, clock init, and DMA init. Change-Id: Ia02b20945da1bbed103e2e01eaf60553eb5f72d4
2022-12-31x1000: Enable support for INIT_ATTRAidan MacDonald3-0/+32
Enable INIT_ATTR support in config.h. Load init code to the codec buffer, following the convention used by other targets that support INIT_ATTR. Change-Id: I8935fbaa100f0013bb328d71c4a49ec2ffafd003
2022-12-19jx47xx: Rename crt0 'init' sections to 'startup'Solomon Peachy2-3/+7
Mirrors the change made to the x1000 target Change-Id: I69663245b1d05c001500240af33164f222e70e90
2022-12-18x1000: Rename crt0 .init sections to .startupAidan MacDonald4-5/+9
Avoid startup code clashing with the .init section, which is by convention used for INIT_ATTR code that can be discarded after app initialization. Change-Id: Id59b7618ef41e65c33fc0f133644e07555a913eb
2022-12-18x1000: Simplify app linker scriptAidan MacDonald1-5/+13
Get the linker to automatically assign load addresses for the .iram and .tcsm sections. Taken from the i.MX31 linker script. Change-Id: Ic03d577d8690c777726daf373a3289316639bfb9
2022-12-18x1000: Add missing LCD activation event on LCD enableAidan MacDonald1-0/+3
This event is needed to trigger a GUI redraw when the backlight turns on. Change-Id: Ib2300dfd1aaeacd84c6df8151072292409357212
2022-12-07bugfix: for Eros Q / Surfans F20, when the scroll wheel is moved, in ↵Richard Goedeken1-0/+2
addition to resetting the power-off timer, we also need to reset the backlight timer and turn it on in case it's currently off. Change-Id: I73b463e74727a2d00b0d4ce599f0cc611fb98685
2022-12-04bugfix: for ErosQ/SurfansF20, reset poweroff timer when scroll wheel is ↵Richard Goedeken1-0/+2
moved so that we dont blank the screen while the user is scrolling through a list Change-Id: Ifdce301e2d75e3f6f54fba5b3eef15b2141cb954
2022-12-01x1000: Add support for DS35x1GAxxx flash chipsAidan MacDonald1-0/+4
This flash chip is found on some Surfans F20 units. For our purposes it's the same as the GD5F1GA4xExx so just #define an alias instead of adding a whole new chip struct. Change-Id: I2f4c4fbf1faf3a0c7a1503534430afacbddc426e
2022-10-28x1000: Pass CPM scratch register to the bootloaderAidan MacDonald1-2/+5
Change-Id: Iaef4606dc6f3cb9904d87ee92db69fb9ef48bcb0
2022-10-28x1000: Allow SPL and bootloader to pass arguments to next stageAidan MacDonald1-0/+13
Change-Id: I61591d704c14acf06cd192a6e9355f0a9c25d0d8
2022-10-28x1000: Add a basic sanity check for bootloader backupsAidan MacDonald2-0/+17
The bootloader backup is intentionally simple, but it's a little *too* simple. Add a sanity check to make sure what we're backing up or restoring contains the first 8 bytes of the SPL header. This isn't going to catch all possible problems, but it'll stop obviously non-functional backups from being restored. Change-Id: I6e80351aeb96c467f0514bd0ecd77d94ff72a8f8
2022-10-17mips: consolidate exception handling, add exception backtracesAidan MacDonald14-461/+419
Merge the x1000 and jz47xx exception handling code since they use the same exception vectors and handlers. The interrupt handler is now called from the common exception vector, but remains separate for each board since they have different IRQ layouts. The new exception handler can provide a stack traceback from the interrupted code, rather than the (uninteresting) caller traceback displayed by panicf. This allows you to see what led up to a null pointer deref or division by zero, which makes it _much_ easier to track down errors that occur in common leaf functions like strcmp. Change-Id: I59a0ebb5e40fcb36505c3bfdb47f8cac2f9936b1
2022-10-15move buflib_free invalid handle check to the functionWilliam Wilgus1-2/+1
allow buflib_free to check for invalid or already freed handles within the function -- remove all the invalid handle guards thru core_free Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
2022-10-13Revert "Remove YUV blitting functions and LCD modes"Solomon Peachy43-1/+8436
This reverts commit fe6aa21e9eb88f49005863efd2003d0982920048. Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
2022-10-10mips: Work around an issue with GCC 8.Solomon Peachy1-1/+5
Change-Id: I9867674978ab6d4c99f5fa67c93e5b830531aefd
2022-10-03Remove YUV blitting functions and LCD modesAidan MacDonald43-8436/+1
None of this is needed now that mpegplayer is gone. Change-Id: I360366db8513e4d988021e8d7b7d8eb09930efb8
2022-09-30Define LCD_STRIDEFORMAT unconditionallyAidan MacDonald2-5/+5
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-09-17x1000: add support for GD5F1GQ4xExx NAND flashAidan MacDonald1-0/+24
This is another chip used in newer Surfans F20 units. Like the Winbond chip, it's a 1-gigabit chip with on-die ECC. Notably it has an expanded 128-byte OOB area that is only accessible when on-die ECC is disabled. Change-Id: I2203918a15c914097f5a6bbe4afa2d3a60dc67f7
2022-09-17x1000: add support for the W25N01GVxx NAND flashAidan MacDonald2-0/+34
This chip is apparently used in some Surfans F20 units, and has the same geometry as the ATO25D1GA. It has an on-die ECC engine. Change-Id: I4d37a2455620ce43cec0a9bcbb32c776d1a8eba1
2022-09-17x1000: refactor NAND chip identificationAidan MacDonald2-60/+69
Decouple chip IDs from chips, and allow the chip ID table to list which read ID method should be used. Use a safe controller setup during identification instead of using the first chip's parameters. Change-Id: Ia725959c31b2838f4a3a30e5bb7fa6652ef377ed
2022-07-21x1000: simplify NAND command macrosAidan MacDonald2-15/+17
There is actually no need to parameterize most commands with row or column cycles, usually the opcode and row/column address width are linked. When this is not the case we can use raw SFC commands or define new macros. Change-Id: I22459d732dc01012e6a8ae026c4fb85495d372b4
2022-07-21x1000: move NAND commands to chip dataAidan MacDonald2-35/+18
Using predefined commands is too inflexible so allow the chip data to specify I/O commands directly. Change-Id: Ie8f943914da4b8299678a59b1063c4c6d226e83e
2022-07-19x1000: add NAND OTP access switchAidan MacDonald2-0/+9
Provide a way to toggle the OTP bit for reading OTP pages, mostly useful for debug purposes. Change-Id: Iec697de2dc188588c43d9ed466201971cac8f30c
2022-07-10Fix red in commit 131566b8f8Aidan MacDonald1-2/+2
Use per-function sections to avoid linking in x1000_boot_linux() on normal builds, which prevents link errors due to referencing a non-existent usb_close(). Change-Id: Ied7b233603c49fc856db8445e368675b181e2f1f
2022-07-10x1000: add support for simple on-die ECC with NAND flashAidan MacDonald2-0/+23
Many SPI NAND flash chips have on-die ECC engines that report ECC status via the status feature register. This code handles the common case where ECC status is reported with 2 bits: one bit to indicate if flips were detected & corrected, and another bit to indicate an uncorrectable error. Change-Id: I5d587cd960ca9d090d2629e890724a6bc411e70c
2022-07-10x1000: add setup_chip hook for NAND chipsAidan MacDonald2-0/+9
Add a chip setup hook for configuring vendor specific registers after the chip is identified. Change-Id: Ifffa7f01be16fd147a9db3d6e402b7b0debd7e12
2022-07-10x1000: remove 'typedef struct' from NAND driverAidan MacDonald5-42/+41
Using 'typedef struct' is not in line with the project coding style and somewhat problematic, so get rid of it here. Change-Id: Icfe79de72ed82cb7526e9f4e8296ec12084c01ac
2022-07-10x1000: support 2nd device ID byte for NAND flashAidan MacDonald2-9/+16
Some components have additional ID bytes. Add support for an optional 2nd device ID byte during the identification routine. Change-Id: I5bbad73fb57004067c6f13f223f7bf4d43ff7849
2022-07-10x1000: fix linux boot USB issuesAidan MacDonald1-4/+9
If the USB controller is active when we hand over to Linux it'll often trigger "irq nobody cared" warnings. Disabling the controller before boot prevents that. Also move the USB PHY bit workaround from the dualboot cleanup hook to the main Linux boot function. Mainline kernels don't clear these bits either. Change-Id: Ieaf896c3b8c3e58a8c47de5afeb384ae2511a5fa
2022-07-10x1000: fix command line passing for linux bootAidan MacDonald1-1/+1
Change-Id: I2a016a5f64ef980f49a8cbdcbb0e0af9ad768ce0
2022-06-12jz4760: Reformat USB driver a little. Prep work for later changes.Solomon Peachy1-143/+108
Change-Id: I74d068661ea8a8a59a88f0c2c5a938dcf6fb8b20
2022-05-30x1000: add flash probe tool to bootloaderAidan MacDonald1-0/+1
The flash probe mimics the boot ROM's flash read routines and dumps the manufacturer & device IDs and 16-byte parameter data to a file on the SD card. Change-Id: I3d413bd0cc05a9d7f2285b85454420c3e90274e9
2022-05-30x1000: move NAND commands to header fileAidan MacDonald2-33/+33
Change-Id: Ic95b80494a101f7b349e115d82e9dfe3a64b643f
2022-05-22mips: stop backtraces at main()Aidan MacDonald2-2/+2
Initialize ra=0 before calling main so backtraces don't walk through the startup code. Change-Id: Ia8796ce38b32d14025b47b3e00061267ee25cbaf
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