summaryrefslogtreecommitdiffstats
path: root/bootloader
AgeCommit message (Collapse)AuthorFilesLines
2022-04-01Eros Q Native: Add Original Firmware Boot optionDana Conrad2-0/+35
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-25x1000: bootloader: Add button handlers for OF bootAidan MacDonald2-10/+31
The SPL soon won't be paying attention to buttons, so the bootloader should check them. Change-Id: I2048ca9fd19193f329bebecfefd986760c33fd68
2022-03-25x1000: bootloader: set touchscreen to button modeAidan MacDonald1-0/+3
The touchscreen "buttons" are used for screenshots on the Q1. Change-Id: I6bff00976c614d203986e810e51f859e78e372ab
2022-03-25x1000: bootloader: accept button input during splashAidan MacDonald1-1/+9
This allows screenshots to be taken while a splash is displayed. Change-Id: Id494189283db1b6877416f5a1ef1a13c8b654507
2022-03-25Fix double define of BL_SCREENSHOT_NAME on fiiom3kDana Conrad1-1/+1
Change-Id: Iaee40887de19ac2d78ec9bdea08cee678b7e50ef
2022-03-25x1000: bootloader: add screenshot functionAidan MacDonald4-4/+44
Screenshots of the recovery menu will be useful for documentation. This can be disabled by turning off HAVE_BOOTLOADER_SCREENDUMP in the target config file if the bootloader should ever run up against max size limits. Change-Id: I62ec1e465df2ca7a8a0e78625d88b31f6c4ef078
2022-03-25x1000: bootloader: skip bad blocks when loading flashed kernelsAidan MacDonald1-25/+83
Bad blocks in a kernel flash partition seem to be handled by skipping ahead to the next block; this is a common bad block management scheme for simple software like bootloaders (and is the default method for reading NAND partitions in u-boot). Extend the uImage flash reader to skip bad blocks while reading. Change-Id: I815875e83a2418e2642f736e04a3437c31b354ba
2022-03-24x1000: bootloader: add whole-chip flash dump optionAidan MacDonald3-0/+10
I don't expect this will be all that useful, but why not... Change-Id: Ieb486bb719c5cc61e0f3e95f9fb603a1c30c6528
2022-03-24x1000: bootloader: add debug tools menuAidan MacDonald1-15/+44
Add a debug menu to invoke two new actions, dumping the OF kernel and recovery images from flash to the SD card. Change-Id: I3ca943fac22e725a2d56b84d62f4a04821042fed
2022-03-24x1000: bootloader: add basic flash dump utilityAidan MacDonald2-0/+83
Change-Id: Id4ce0f00a78ef27399bdef6a7b32c23f89b9cb05
2022-03-24x1000: bootloader: display uimage load error codeAidan MacDonald1-2/+2
Change-Id: I08361aa85406303c10bb487636a6a61a93d2b127
2022-03-24x1000: bootloader: refactor splash/splash2Aidan MacDonald6-39/+82
Allow the use of printf formatting and multiple lines of text using newlines in the string. Change-Id: I65919bf29c16c34c38cf3995e02d2ddbbaa4bdf3
2022-03-24fiiom3k: trim OF kernel arguments to fix boot hangsAidan MacDonald1-2/+8
The M3K's kernel has an incredibly stupid function that mangles the kernel args and copies them to a 100-byte buffer without any kind of bounds checking. So, if the kernel arguments are more than 99 chars the stack may be corrupted, sometimes crashing the kernel. Fortunately, most of the arguments the OF uses are useless, and the truly necessary arguments fit within the absurd 99-char limit. Change-Id: I01ef4513298f79d3c08538239802c21e88509631
2022-03-24x1000: bootloader: fix Linux self-extracting kernel bootAidan MacDonald2-3/+44
Basically, there's longstanding bug in Linux with self-extracting kernels on MIPS which just happened to manifest now on the M3K as a hang on boot. The fix is applied to the M3K and Q1 since they both use this type of kernel image. Change-Id: I17d2bad6eebd677cd6d2e0bf146450c71fcf1229
2022-03-24x1000: bootloader: add mainline Linux boot optionAidan MacDonald3-0/+93
This adds a *very basic* Linux loader to the Rockbox bootloader, which allows running a mainline Linux kernel using the following file layout on the SD card: - /uImage - /linux_cmdline.txt The command line arguments are listed in linux_cmdline.txt, all lines are concatenated together and whitespace is converted into spaces. Comments aren't supported however. The loader doesn't support the modern devicetree boot protocol, so it can only pass command line arguments. It would be easy to support an appended dtb though. Change-Id: I373f465dbbdafe94738f619748cbb0278fc2c25f
2022-03-24x1000: bootloader: add original firmware boot capabilityAidan MacDonald3-1/+76
Adds the ability to boot the OF's player or recovery kernels from the bootloader. Works on Shanling Q1 but broken on the FiiO M3K (kernel hang) so leave it disabled for the M3K. Change-Id: I26b973fba1c22afb906a78865963a96dd2107932
2022-03-24firmware: minor screendump related cleanupsAidan MacDonald4-20/+0
- Remove unused redefinitions of screen_dump() from bootloaders - Use empty do-while when screendump is compiled out Change-Id: I3ccdb0390ddaa28d8f561ff744d0db6aaef17f5d
2022-03-12x1000: bootloader: use list widget for the recovery menuAidan MacDonald1-47/+78
This allows the menu to scroll when there isn't enough vertical space to display the whole menu. Change-Id: I6dc3e84cde0c1b003e579f107ae7f13e0ea33a5a
2022-03-12x1000: bootloader: add GUI list widgetAidan MacDonald2-0/+88
Change-Id: Ic5bf4747ed99b713b7c035153865ed9bdebd89b0
2022-03-12x1000: bootloader: add uImage loadersAidan MacDonald2-0/+83
Adds loaders for uImages on the SD card or on a raw flash partition. These work similarily to load_rockbox() and return a buflib alloc and size. Booting the image is left up to the caller. Change-Id: I0d58e8c6a61d8349bc5223431cdd06dfdf2503fa
2022-03-12x1000: bootloader: refactor rockbox bootAidan MacDonald3-20/+35
Separate loading out into its own routine with a file name parameter in preparation for multiboot support. Change-Id: Ic651e9fa7738ea97789e4a9669834c4e3ef22d66
2022-03-12x1000: bootloader: move the main function to its own fileAidan MacDonald2-27/+4
Now that everything has been refactored into separate files the main routine is the only thing left to move. Put it in main.c. Change-Id: I53aba87ed281b52944fb80d9a62beaec1c87f152
2022-03-12x1000: bootloader: refactor usb handlingAidan MacDonald4-39/+29
Drop init_usb(), instead initialize USB early in the main function so the hardware is placed into a known good state after a USB boot. The impact on boot time should be minimal. Change-Id: I9774ddfc2c27811363bdb0c54cb0e57b5ca59d73
2022-03-12x1000: bootloader: refactor init_diskAidan MacDonald6-33/+62
Add check_disk() to query the disk insertion status and prompt the user if necessary. Use this in place of init_disk(). Perform an unconditional disk_mount_all() from the main function. Change-Id: I9a8cc42266edf99cd15ece3aee8fa25835df04ae
2022-03-12x1000: bootloader: split off recovery menu codeAidan MacDonald4-109/+143
Change-Id: I6c6a25dc248b5dcbca796781f761bef05337431c
2022-03-12x1000: bootloader: split off rockbox boot codeAidan MacDonald4-42/+79
Change-Id: Ie3a097b24ee96551f6c3d08938dcb83f59ba1073
2022-03-12x1000: bootloader: split off installer codeAidan MacDonald4-58/+92
Change-Id: I75918301214cd415392f8c95e8a07205cfa21659
2022-03-12x1000: bootloader: split off GUI codeAidan MacDonald4-81/+130
Change-Id: If716cfd117c48da2cff221b8854630022bb0fe48
2022-03-12x1000: bootloader: split off definitions to a headerAidan MacDonald2-37/+65
Change-Id: Ic3e8bc8f61974dbfc30e833abd9a0f0b850e0a43
2022-03-12x1000: use core_alloc in bootloader for loading rockboxAidan MacDonald1-6/+10
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: support new binary header in bootloaderAidan MacDonald1-21/+1
Change-Id: I89754215139ec027bb122759f5b54400f544d3c1
2022-01-02x1000: Fix USB connection problems in bootloaderAidan MacDonald1-28/+26
This problem actually had nothing to do with USB boot; it's because the cable is plugged in when the USB mode menu item is selected. The USB thread detected the select button press and went into charge-only mode (as it usually does when you hold down a key in Rockbox). This is fixed by having the USB thread ignore most keys in the bootloader. USB connect events are delivered via the button queue, and there were also cases where the connection could be missed if the event happened within another UI screen. This should also be fixed. Change-Id: I077d705a6ac845c8713219eee45d26aa6addfa61
2021-10-04Sansa E200v1 Bootloader ensure USB unplug is detectedWilliam Wilgus1-0/+11
Change-Id: Ibec5bf5e0f7a518fafc7b9fb8b95d420ef4ddfc0
2021-10-04Sansa E200v1 Bootloader add break statement to exit to load fwWilliam Wilgus1-0/+1
Change-Id: I2516adc28d439dcbdb56f1ac51bd12d619a5f3d8
2021-10-04Sansa E200v1 Bootloader attempt at enabling USB in boot loaderWilliam Wilgus1-1/+6
there is a 1MB free region that is used to load the firmware but we shouldn't need that till after a USB connection so here is my 2nd try Change-Id: I2552db3a7fba019d7e7188984432f758ddafe548
2021-08-26xduoox3: Further bootloader improvementsSolomon Peachy1-36/+24
* Power button is what forces entry into USB mode (can't use the other buttons due to the long SADC warmup) * Inching closer to working USB disk mode (starts then disconnects! Change-Id: I45ff1c61f39e0e0c3615b38278f5c91b6ef2ed6c
2021-08-22xduoox3: More minor bootloader tweaksSolomon Peachy1-5/+6
Change-Id: I16b5ada06842822e14c0e4fc262f2cb8067aff72
2021-08-22xduoox3: Allow user to gracefully exit USB disk mode by pressing powerSolomon Peachy1-0/+3
Change-Id: Ic0382059646b7169c275aebe88867b5c0b7dd672
2021-08-22bootloader: nuke a long-unused (and broken) code blockSolomon Peachy1-84/+1
Change-Id: I8177c70ef01fd8938f3683e74adc0e008034f92d
2021-08-21xduoox3: More bootloader updatesSolomon Peachy1-19/+48
* Rework the LCD initialization a bit * Power off after 5 seconds if we hit a fatal error * Turn on verbose output if PLAY is held down on powerup * Minor code style cleanups The goal is to not perform the LCD init unless it's needed; ie only if we run into an error or enter USB mode. Change-Id: I3f93e881ff55d104f453985ed452f35b433a7d99
2021-08-21xduoox3: Bootloader improvements:Solomon Peachy1-18/+26
* Explicitly clear the caches prior to launching the binary * Ensure the function that launches the binary is in iram * Re-sequenced some of the subsystem initializations * Fixes for USB mode Change-Id: Ie020b18586b2599edeb88529dd3d7337e33a5a6f
2021-08-14Remove the (very) incomplete port for the Tatung TPJ-1102Solomon Peachy2-105/+0
It was barely even a stub, and hasn't seen any development since 2009 Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-07-18New Port: Eros Q NativeDana Conrad2-1/+12
What works: - LCD: 16-bit RGB565 - all buttons, including scrollwheel - SD Card - Battery level and charging/not charging status - USB - audio - sample rate switching - HP / LO detect, with "safe" fixed LO volume - LO volume will only be put to user-defined max volume if headphones are not present. - rtc - Plugins build, tried a couple and they seem OK - Bootloader, installable to nand via usbboot What doesn't work: - Dual Boot - power on/off has intermittent, low volume audio click (sometimes it's completely silent, sometimes there's a click) - Audio uses 16-bit volume scaling, so clicking/popping is pretty bad at lower volumes - need 32 bit volume scaling, 24 bit I2S data - USB HID keys not yet defined - no jztool support Unknowns: - Stereo Switch pins: Direction select, AC_DC (probably not even hooked up) - What is the actual purpose of the Stereo Swtich? - How does the bluetooth module connect? "Someday" stuff: - get LCD working at higher bit depth - Bluetooth Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
2021-07-13New port: Shanling Q1 nativeAidan MacDonald2-1/+12
- Audio playback works - Touchscreen and buttons work - Bootloader works and is capable of dual boot - Plugins are working - Cabbiev2 theme has been ported - Stable for general usage Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps. There's a few minor known issues: - Bootloader must be installed manually using 'usbboot' as there is no support in jztool yet. - Keymaps may be lacking, need further testing and feedback. - Some plugins may not be fully adapted to the screen size and could benefit from further tweaking. - LCD shows abnormal effects under some circumstances: for example, after viewing a mostly black screen an afterimage appears briefly when going back to a brightly-lit screen. Sudden power-off without proper shutdown of the backlight causes a "dissolving" effect. - CW2015 battery reporting driver is buggy, and disabled for now. Battery reporting is currently voltage-based using the AXP192. Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
2021-07-11x1000: Unified flash bootloader installerAidan MacDonald1-17/+6
Change-Id: Ib1d41d4e7d663ff8a21eb08108c13568f7408533
2021-07-11x1000: Unified bootloaderAidan MacDonald3-361/+491
Change-Id: Ib1f2ca2a376866c61dd1bd62abd6e31210d11e5c
2021-07-08x1000: SPL refactoringAidan MacDonald1-11/+2
This streamlines the boot code a bit and reduces target specific boilerplate. The clock init hack used by the bootloader has been "standardized" and works for the main Rockbox binary now, so you can boot rockbox.bin over USB without special hacks. Change-Id: I7c1fac37df5a45873583ce6818eaedb9f71a782b
2021-07-05Sansa Connect: Power off LCD to save powerTomasz Moń1-2/+4
Prevent startup screen flash by properly using AVR LCM functions. Power off LCD when not needed to improve battery runtime. Change-Id: I76e3c5c0208774f189fbc6f7d7b3c9e22c062285
2021-06-21mi4: replace chksum_crc32 with crc_32rJames Buren3-5/+4
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-09Sansa Connect: Working USB Mass StorageTomasz Moń1-14/+46
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