Commit graph

36002 commits

Author SHA1 Message Date
Aidan MacDonald
8b4949381c x1000: add TCSM section to linker script
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-12 14:50:45 -05:00
Dominik Riebeling
0de2d3a0b6 utils: rework cmake deploy function.
Use named arguments for function and allow passing additional executable
targets to be copied to the deploy tree.

Update current uses and add ipodpatcher and sansapatcher to Rockbox
Utility deployment.

This is in preparation for moving ipodpatcher / sansapatcher
functionality out of Rockbox Utility so we eventually can avoid
elevation / sudo of the whole installer. Currently this only results in
Rockbox Utility releases shipping ipodpatcher / sansapatcher
executables.

Change-Id: Ibb6601b7e437648135059c580e2ce2532574835a
2022-03-12 20:40:08 +01:00
Dominik Riebeling
7319356dfd rbutil: Update build instructions.
Change-Id: Iaf08b0c84997d77b034dc23f40021c2dd52fc454
2022-03-12 20:40:08 +01:00
Dominik Riebeling
748b00a7fc ipodpatcher: Split executable only parts out.
Allow building both as library and executable at the same time.

Change-Id: Idc40354fdedaeace727043936352fc17232bf16e
2022-03-12 20:40:08 +01:00
Dominik Riebeling
08afedf1f5 sansapatcher: Add cmake target to build executable.
Change-Id: Idff5674acb5347643c8a26ef64506f892445977e
2022-03-12 20:40:08 +01:00
Aidan MacDonald
d56964cc2b x1000: add dual boot helpers for the main bootloader
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-12 18:25:10 +00:00
Aidan MacDonald
a87f93d8ff x1000: add function for booting linux kernels
Change-Id: I0750b084fe88d21a8686daf0681b32b1dcba8fec
2022-03-12 18:25:10 +00:00
Aidan MacDonald
e6c2f26e82 x1000: bootloader: add uImage loaders
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-12 18:25:10 +00:00
Aidan MacDonald
b87f2ed851 x1000: bootloader: refactor rockbox boot
Separate loading out into its own routine with a file name
parameter in preparation for multiboot support.

Change-Id: Ic651e9fa7738ea97789e4a9669834c4e3ef22d66
2022-03-12 18:25:10 +00:00
Aidan MacDonald
ed897d1359 x1000: bootloader: move the main function to its own file
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-12 18:25:10 +00:00
Aidan MacDonald
5bdb2fccdb x1000: bootloader: refactor usb handling
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-12 18:25:10 +00:00
Aidan MacDonald
7554a49309 x1000: bootloader: refactor init_disk
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-12 18:25:10 +00:00
Aidan MacDonald
905591215f x1000: bootloader: split off recovery menu code
Change-Id: I6c6a25dc248b5dcbca796781f761bef05337431c
2022-03-12 18:25:10 +00:00
Aidan MacDonald
e2fcbd04ea x1000: bootloader: split off rockbox boot code
Change-Id: Ie3a097b24ee96551f6c3d08938dcb83f59ba1073
2022-03-12 18:25:10 +00:00
Aidan MacDonald
22cf852db1 x1000: bootloader: split off installer code
Change-Id: I75918301214cd415392f8c95e8a07205cfa21659
2022-03-12 18:25:10 +00:00
Aidan MacDonald
6fb1b8b342 x1000: bootloader: split off GUI code
Change-Id: If716cfd117c48da2cff221b8854630022bb0fe48
2022-03-12 18:25:10 +00:00
Aidan MacDonald
8558255f45 x1000: bootloader: split off definitions to a header
Change-Id: Ic3e8bc8f61974dbfc30e833abd9a0f0b850e0a43
2022-03-12 18:25:10 +00:00
Aidan MacDonald
58225bd2c8 x1000: remove plugin and codec buffers on bootloader
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-12 18:25:10 +00:00
Aidan MacDonald
38eafb60ff x1000: use core_alloc in bootloader for loading rockbox
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-12 18:25:10 +00:00
William Wilgus
376ffbcf9a ARM support, optimize popcount fn
Change-Id: Iec02d0b5973721a3943b9c23ced3afc721cd3753
2022-03-12 00:00:01 -05:00
William Wilgus
eecf840989 playlist.c fix red for non-DIRCACHE targets
Change-Id: Id02f67dee6f40a80c832dea785f56f32885a5528
2022-03-11 22:52:02 -05:00
William Wilgus
a59b3c5d11 playlist_resume, wait for dircache to complete before loading songs
with root redirect and even relative paths eventually we need the dircache
to get files from the disk

Change-Id: Ia443f473f09dd534674d5fdb71251214ce01eed7
2022-03-11 22:30:39 -05:00
William Wilgus
97ec0a7e73 Root redirect un-hide root volume
this appears to be problematic for now

Change-Id: Ieb789f5ec10a0d25c559e9bfc2497cbc4f59c0ad
2022-03-11 20:11:31 -05:00
William Wilgus
95af36d0dd playlist.c fix red for non multivolume targets
Change-Id: Ic0fdb325bc9c8d886c7627679fb2d02521400da7
2022-03-11 20:05:14 -05:00
William Wilgus
eb32238b22 playlist.c use basename for playlist_get_filename_crc32
strip the vol and use the relative portion

Change-Id: I6259343e63a84f0ab97bd6f491de09320d74eac4
2022-03-11 19:45:58 -05:00
William Wilgus
359c66982f playback.c use file_exists rather than open to check for bad files
the worst case is really slow for open

Change-Id: Ifcfe366ad9bee7ff43a0572e52f15b5c6f608288
2022-03-11 19:45:58 -05:00
Aidan MacDonald
603412f447 x1000: Clarify definition & usage of RAM areas
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-11 11:15:56 -05:00
Aidan MacDonald
cdee5284d4 jztool: support new binary header on x1000
Change-Id: If0d3fb3d5b03cf6ed87cbbb8a968ef48edb660f7
2022-03-11 11:15:56 -05:00
Aidan MacDonald
35242c8d98 x1000: support new binary header in bootloader
Change-Id: I89754215139ec027bb122759f5b54400f544d3c1
2022-03-11 11:15:56 -05:00
Aidan MacDonald
428491df69 x1000: support new binary header in rolo
Change-Id: I192c3d69616c39534ff329174c4d8d4a357d014d
2022-03-11 11:15:56 -05:00
Aidan MacDonald
7fa48faeb5 multiboot: Refactor duplicated functions to a separate file
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-11 10:58:20 -05:00
Aidan MacDonald
439b4e8bca multiboot: Remove bad multiboot code from hosted RoLo
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-11 10:58:20 -05:00
Aidan MacDonald
eae9f6f5b7 erosqnative: Fix missing END marker in LCD enable sequence
Change-Id: I75b3a396174e84d72e70c6f177bc1702021805f1
2022-03-11 10:42:18 -05:00
William Wilgus
355553baf4 playlist_resume, fix control fd, add some error info
I ocassionally see Playlist Invalid messages but which part is failing?
eventually it works so its probably a race

Change-Id: Ib2b09ab13ce09a55130430a2e94bc0498443b6ec
2022-03-11 09:40:31 -05:00
William Wilgus
f6a2bf28e1 BUGFIX file.c open failure leaves open file handle
Change-Id: Iad8eef2f65af0549da4dbec654c85adb2f325711
2022-03-11 03:18:38 -05:00
William Wilgus
68d0175172 BUGFIX arm aeabi_sdivmod crashes in interupt mode
Change-Id: I6e89334b0f5df1d513a3f466e1db9cdc198944fe
2022-03-11 03:05:15 -05:00
Dominik Riebeling
57cffae369 rbutil: Change MacOS bundle identifer to org.rockbox.
Change-Id: I06d0513a25197a942b222a59d04f44275edb7a5a
2022-03-09 19:02:01 +01:00
William Wilgus
01e76548c3 backtrace, put pc and sp on their own lines
Change-Id: Ia5853c4f2d1b86dc1e2cd0882f5da27e4eba5724
2022-03-08 23:37:50 -05:00
William Wilgus
a8b997e4e9 skinparser cleanup, optimize
hash clause strings for =, ==, !=, <, > <=, >=
store result of get_param() where possible

Change-Id: Ia5a4dbf613d6ec9e21546fa0c6a8de28eb7aa347
2022-03-08 16:51:04 -05:00
Dominik Riebeling
b1965b4197 rbutil: Fix setting bootloader "file" for Ipod bootloader.
On Ipods we use the bootloader "filename" to pass the mountpoint, which
is then used to determine the correct device to use.

Change-Id: I1dd2060ae9176bfdece9337160db08caf326e1f5
2022-03-08 22:42:34 +01:00
Dominik Riebeling
3cebc983a2 rbutil: Fix a crash for devices without bootloader file.
Don't try to get a bootloader filename from an empty list. This happens
if the device doesn't have a bootloader file on disk.

Change-Id: Idd4c265e7ae298913c5feefb3963120867a0e858
2022-03-08 22:32:13 +01:00
Dominik Riebeling
911b216aff rbutil: Properly initialize sansa / ipod bootloader buffer.
Fixes a crash on MacOS.

Change-Id: Ibb64a37266182c4ddfee32b2ac47b9d8f25a78e5
2022-03-08 22:32:13 +01:00
Aidan MacDonald
ca12478df6 x1000: add simple binary header to declare the load address
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-06 23:22:49 +00:00
William Wilgus
19d95d7b56 keyremap add plain text import and export
allows users to edit and view keymaps in a text editor
(parser requires one entry per line (LF or CRLF work as line endings)

allow naming of files on save

Change-Id: Id6627171eb96210b2deeef8d15bab3f8d1e0ab3f
2022-03-06 17:00:27 -05:00
William Wilgus
bc3fa53937 Sansa Multiboot Root Redirect Enhance + bug fix
filename buffer was too small to retrieve redirect path

if redirected to sd root remove <SD1> as it is redundant

Change-Id: I1326601f1ba4a18d6bc173798759eb762b55528c
2022-03-06 16:42:26 -05:00
Aidan MacDonald
ee87bfb933 Add support code for dealing with U-Boot uImages
Adds a loader for the legacy uImage format that is commonly used on
embedded Linux systems. It verifies checksums and supports uncompressed
and gzipped images. Supports arbitrary reader functions to allow the
images to be streamed off any storage device, for optimal RAM use.

Change-Id: I93c35f9a6f323999a22a07300e05627fabfcbd2c
2022-03-04 09:02:56 -05:00
Aidan MacDonald
d541a3a191 x1000: fix nand driver reference counting
Somehow I screwed this up as well. Seems it didn't cause trouble.

Change-Id: I5ab99dd9182a4e60d55984fecbf20ca823dbd004
2022-03-04 08:57:35 -05:00
Aidan MacDonald
3cb7167e22 x1000: fix bug in nand_read_bytes
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-04 08:57:35 -05:00
Aidan MacDonald
3bd5f335f7 inflate: Add helper for getting decompressed data size
Helper for another semi-typical operation: find out how big of a
buffer should be allocated before decompressing. This can be useful
when the stream container doesn't specify the decompressed size.

Change-Id: I5f1536f809bb6f9bc6023120c024c3de7cea4269
2022-03-04 08:44:56 -05:00
Aidan MacDonald
ce4620413b inflate: Add helpers for using in-memory buffers
Using an in-memory buffer for the input or output data for 'inflate'
is likely to be extremely common and there's really only one way to
do it, so predefined helpers should be provided.

Change-Id: Ifd22e7b140a08e0e7dc05aec6b340dff5e2d9d0a
2022-03-04 08:44:56 -05:00