Commit Graph

605 Commits

Author SHA1 Message Date
William Wilgus 0a1d25d27a Sansa E200v1 Bootloader ensure USB unplug is detected
Change-Id: Ibec5bf5e0f7a518fafc7b9fb8b95d420ef4ddfc0
2021-10-04 16:42:36 -04:00
William Wilgus e6740ed562 Sansa E200v1 Bootloader add break statement to exit to load fw
Change-Id: I2516adc28d439dcbdb56f1ac51bd12d619a5f3d8
2021-10-04 16:02:06 -04:00
William Wilgus 7c67a48332 Sansa E200v1 Bootloader attempt at enabling USB in boot loader
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-10-04 10:56:33 -04:00
Solomon Peachy 93c98606f1 xduoox3: Further bootloader improvements
* 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-26 11:59:01 -04:00
Solomon Peachy 97b0e5b5a1 xduoox3: More minor bootloader tweaks
Change-Id: I16b5ada06842822e14c0e4fc262f2cb8067aff72
2021-08-22 11:58:30 -04:00
Solomon Peachy d282424ef2 xduoox3: Allow user to gracefully exit USB disk mode by pressing power
Change-Id: Ic0382059646b7169c275aebe88867b5c0b7dd672
2021-08-22 07:57:24 -04:00
Solomon Peachy 7059183438 bootloader: nuke a long-unused (and broken) code block
Change-Id: I8177c70ef01fd8938f3683e74adc0e008034f92d
2021-08-22 07:49:06 -04:00
Solomon Peachy 2c9e2db721 xduoox3: More bootloader updates
* 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-21 22:20:20 -04:00
Solomon Peachy e07c460eef xduoox3: Bootloader improvements:
* 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-21 21:53:03 -04:00
Solomon Peachy 04fe77a465 Remove the (very) incomplete port for the Tatung TPJ-1102
It was barely even a stub, and hasn't seen any development since 2009

Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-08-14 16:29:39 -04:00
Dana Conrad 3e7a09cb0d New Port: Eros Q Native
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-18 12:14:35 +00:00
Aidan MacDonald 4c60bc9e68 New port: Shanling Q1 native
- 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-13 22:01:33 +01:00
Aidan MacDonald 84362141a0 x1000: Unified flash bootloader installer
Change-Id: Ib1d41d4e7d663ff8a21eb08108c13568f7408533
2021-07-11 15:39:50 +01:00
Aidan MacDonald e9d228832c x1000: Unified bootloader
Change-Id: Ib1f2ca2a376866c61dd1bd62abd6e31210d11e5c
2021-07-11 15:39:40 +01:00
Aidan MacDonald 0e1a90ea1d x1000: SPL refactoring
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-08 16:01:38 +00:00
Tomasz Moń 2acf8db3e1
Sansa Connect: Power off LCD to save power
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-05 15:19:52 +02:00
James Buren 581081a3df mi4: replace chksum_crc32 with crc_32r
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-21 09:36:54 +00:00
Tomasz Moń 163e3507f8
Sansa Connect: Working USB Mass Storage
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-09 20:52:36 +02:00
Tomasz Moń 474293a12b Sansa Connect: Initial TNETV105 driver port
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-06 07:57:38 +00:00
Tomasz Moń 00b4626790 Sansa Connect: Clear recoverzap parameter
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-21 18:55:14 +00:00
Aidan MacDonald 3f26fcf340 FiiO M3K: New bootloader
SPL and UCL-compressed bootloader are now packed into one output,
bootloader.m3k, eliminating the separate SPL build phase.

The Rockbox bootloader now has a recovery menu, accessible by
holding VOL+ when booting, that lets you back up, restore, and
update the bootloader from the device.

Change-Id: I642c6e5fb83587a013ab2fbfd1adab439561ced2
2021-05-12 10:35:20 +00:00
Solomon Peachy 3ba2f6e5c7 Nuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAX
They were never finished, never saw any release ever, and haven't
compiled for the better part of a decade.  Given their HW capabilities [1],
they are not worth trying to fix.

[1] 1-2MB RAM, ~256MB onboard flash, no expandability

Change-Id: I7b2a5806d687114c22156bb0458d4a10a9734190
2021-04-26 07:41:51 -04:00
Aidan MacDonald 75cb8ba8a4 FiiO M3K/X1000: add USB support
This only required a minor patch to the usb-designware driver due
to DMA requiring physical addresses -- on the X1000, these differ
from virtual addresses so we have to do the usual conversion.

Both the mass storage and HID drivers work, but there are a few
issues so this can't be considered 100% stable yet.

- Mass storage might not be detected properly on insertion,
  and USB has to be replugged before it shows up
- HID driver may occasionally panic or hang the machine

Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21 18:31:55 +00:00
Aidan MacDonald 1b8542490d x1000: Redesign SPL, and allow it to flash the bootloader
SPL is now designed so core X1000 code is in control of the boot,
under the reasonable assumption that the device boots from flash.
It should not be too hard to adapt to other X1000 ports.

The biggest functional change is that the SPL can now read/write
the flash, under the control of a host computer. The SPL relies
on the boot ROM for USB communication, so the host has to execute
the SPL multiple times following a protocol.

Change-Id: I3ffaa00e4bf191e043c9df0e2e64d15193ff42c9
2021-04-17 20:22:49 +00:00
Aidan MacDonald 4b26372591 MIPS: make sure to fill 'jr' branch delay slot with 'nop'
Inline assembly in RoLO and the FiiO M3K bootloader used 'jr' to
jump to a newly loaded Rockbox binary, but incorrectly left the
branch delay slot open. That gives GCC an opening to place illegal
instrutions, etc, which might cause an unhandled exception.

Change-Id: Ia7a561fe530e94a41189d25f18a767c448177960
2021-04-07 19:59:57 +01:00
Aidan MacDonald 3ec66893e3 New port: FiiO M3K on bare metal
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-03-28 00:01:37 +00:00
Aidan MacDonald aacb0811d9 Rename symbols of FiiO M3K Linux-based port
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX.

Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2021-02-27 23:53:28 +00:00
James Buren 1bc68d5ad7 h1x0/h300: change when the hold switch and failsafe are used
After reviewing the code awhile I realized that the failsafe and hold
switch have no impact on the boot process when the usb or charger is
connected. That makes no real sense to me. If these are connected then
neither will be used at all. The boot process will never revisit it
either once those other modes end and resume the boot process. It will
just continue to try to boot from disk as if these emergency settings
never existed.

I have decided it makes more sense for them to be evaluated once the
higher priority charge and disk mode have finished their roles. Given
how the code was originally written it seems to be they were not
intended to run prior to these at the very least since the logical
conditions preclude that possibility as they include the inverse of
the conditions that trigger the charge and disk modes.

Change-Id: I0531c97474572c573178f480c239c3c1659f9653
2020-11-15 11:01:53 +00:00
James Buren fc5c8192ff h1x0/h300: fix h300 bootloader hold switch check
This fixes an early boot bug on the h300 where hold_status is
read before it has a chance to properly check whether the hold
switch is even active. This was accomplished by porting over
the method the h1x0 uses to perform the same check.

Change-Id: I04679d82f65a2edcbee4be9a146437c3988040a2
2020-11-15 10:11:56 +00:00
James Buren 29a20bd209 h1x0/h300: consolidate a few code paths to logical equivalents
This saves a few bytes of precious space by consolidating paths where
they can be combined with no change to the underlying algorithm.

Change-Id: Ie6b7ead190a87d66fcbdcf2e351010bab751d952
2020-11-15 09:49:03 +00:00
James Buren 7d9ac021b5 h1x0/h300: bring the two bootloaders more in sync
The most major change here is the porting of the failsafe boot
menu and eeprom settings support from the h1x0 bootloader to the
h300 bootloader. This has been successfully tested already and
indeed works about the same as it does on the h1x0 bootloader.

The other major change is the addition of new code to both
bootloaders that will retry the flash boot function after
exitting disk mode. It still falls back to booting from disk
if this either fails or is not configured to boot from flash.

There were also various other modifications to bring the two
closer in sync so there are fewer differences.

Change-Id: I17a5724e03225b57e9d0071387294aa6cd025178
2020-11-14 23:20:43 +00:00
James Buren aaa9a2ccee h1x0/h300: clean up the bootloader source a bit
First this removes most of the conditionals for the CPP as they
are always true for the targets that use the bootloader source.

Second this moves some global variable references around to reduce
some redundancy in the h1x0 bootloader source.

All of this is done to make it easier to compare the two bootloaders
as they are very heavily related to each other.

Change-Id: I7eb4a3106fb9fce6059797310d9e053a3d3ecf63
2020-11-14 14:29:18 +00:00
James Buren 37eabbfe51 h1x0/h300: remove trailing whitespace from bootloaders
Change-Id: I8f3bfbc8287c8f520894e0cd258066d4c7a02197
2020-11-14 14:16:42 +00:00
James Buren 5a223080fa h300: enable usb charging for charge mode and disk mode
This enables USB charging when the bootloader is in charge mode or
disk mode. As a byproduct there is a small change in behavior where
charge mode is all that is available if it is triggered by the USB
cable insertion. Disk mode only becomes available if the user requests
to continue the boot process by pressing the power button. It had to be
done this way as there's no way to tell this early whether the user
wants to simply charge or trigger disk mode as well.

Change-Id: I32f29398b22a76e5e754efdc9beecae39dd122d5
2020-11-14 12:11:30 +00:00
William Wilgus 47e1f96427 Bugfix Backlight_init should be called after lcd_init
the rest..

Change-Id: I50585ba2191aa8134de3045b1445859b27503a68
2020-11-13 13:57:39 -05:00
William Wilgus f65fb2a64a h300, Others Bugfix Bootloader backlight_init()
backlight_init needs to be called after lcd_init when using
lcd_enable()

Change-Id: Id034835c903801fea49e2b972c110c1ec5106976
2020-11-13 18:08:01 +00:00
William Wilgus 40e98a2e49 Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26 12:38:22 -04:00
William Wilgus d78a37676e ClipPlus BOOTLOADER DONT FIT!
REMOVED FROM ALL NATIVE BOOTLOADERS:
finish removing the text scrolling
pare down printf to a minimal subset (%c %s %l %d %u and %x(%p))
remove diacritic and rtl language support

GOAL 134000

START 135305

CURRENT 133700

SUCCESS! (ASSUMING IT WORKS -- UNESTED)

Change-Id: Ic3f6ac1dc260578f581ee53458b3e5bb47d313ec
2020-10-23 20:38:59 -04:00
Solomon Peachy 4873a1ac61 fiiom3k: Temporarily disable filter rolloff programming
(Hardware control isn't wired into ALSA properly)

Change-Id: Iac537d2d90a6119b8c002cd38a558a4ebb3321eb
2020-10-15 07:43:14 -04:00
Solomon Peachy ca4d63d4d9 m3k: Fixes to the launcher/loader.
* Execute the correct OF player binary
  * We don't have adb, so error out

Change-Id: I4fb39fcdf5e437450c059e6c1296ea6cb99298fe
2020-10-14 13:42:52 -04:00
Solomon Peachy 105a0eb0b7 mrobe500 bootloader fix
Change-Id: I0ab99a427df34ef6c5899a280953250660ffc156
2020-10-13 21:33:55 -04:00
Solomon Peachy e2adc6781f bootloader: Work around linker wonkiness that broke PP bootloader builds.
Change-Id: I8e32c1605c0844c6f1980919ede61ca674b00bbb
2020-10-13 19:02:27 -04:00
Solomon Peachy b94db707fb Fix more warnings.
Change-Id: Ib3a9fc622a46b1fc72e94dcbc6d29d2e430cd81b
2020-10-13 15:48:31 -04:00
Solomon Peachy db6f21e295 hosted: sanitize handling of HOME_DIR
* HOME_DIR is now either "/" or special "<HOME>"
   * target-specific "home dir path" is defined solely by PIVOT_ROOT
 * PIVOT_ROOT path is now defined in toplevel config files
 * Make Samsung YP-R0/R1 and SONY_NWZ use PIVOT_ROOT too
 * Do not prepend PIVOT_ROOT path if the path already has it!
 * Do not play these games for __PCTOOL__ builds

Change-Id: I3d51ad902a5f9cafe45ba15ba654f30f1ec6113a
2020-10-11 17:47:34 -04:00
Solomon Peachy 2a471e288c New port: AIGO EROS Q / EROS K
The Q and K have a slightly different case, but the hardware under the
shell is completely identical.

These models are rebadged versions:

 * Hifiwalker H2   (== Q)
 * AGPTek H3       (== K)
 * Surfans F20     (== K)

Other notes:

  * Significant improvements in the shared Hiby-platform launcher/loader
    * SD card can theoretically be hot-swapped now
    * Support external USB mass storage!
  * Some consolidation of Hiby-platform targets
  * Some consolidation of plugin keymaps

Todo/known issues:

 * Keymaps need to be gone over properly
 * Convert to HAVE_SCROLLWHEEL?

Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
2020-10-11 16:37:17 -04:00
Solomon Peachy aabc8aca47 New port: FiiO M3K
Most credit goes to:  Roman Skylarov
Additional integration and refactoring by myself.

 *** COMPLETELY UNTESTED ***

Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b
2020-10-09 12:41:18 -04:00
Solomon Peachy 9a28912f26 ondavx747: Fix bootloader build
Change-Id: Ibdff6a3d18cc065f7edd67a9ea77b2cb6b4629d1
2020-09-03 20:26:23 +00:00
Johannes Rauh da190727e7 Enable boot from SD for Sansa e200
Change-Id: I0940f2cd5fc914d6d5061b5798b1a636009649b7
2020-08-19 19:17:01 -04:00
Solomon Peachy 092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
Solomon Peachy 0c4ae417d5 bootloader: Consolidate xDuoo X3ii/X20 and AGPTek Rocker bootloaders
Bonus changes:

 * boot mode selection stored on SD card

Change-Id: I225a06d149ae71c1882f632c30d0fe4ab5308a74
2020-07-22 17:43:25 +00:00