Commit graph

37651 commits

Author SHA1 Message Date
Solomon Peachy
fdc17096b5 build: add 'lto' to features.txt if built with it
This makes it easy to tell at a glance if a build was with LTO or not.

Change-Id: I7ba9b412f7b74d300a0c55e36ea4cf522d46e6f2
2024-11-30 13:49:42 -05:00
Christian Soffke
a41cad6458 Playlist Viewer: align buffer
Change-Id: If93c7e3694a007ace62e3b75d96083b03557f3ec
2024-11-30 17:30:01 +01:00
Christian Soffke
0469a95bee Playlist Viewer: Mitigate FS#13518 (stack overflow)
Playlist Viewer hangs indefinitely on tracks with long Comment fields

Commit 2156d98 (metadata: mp3: Improve support for long tags) has
allowed the length of parsed tags to exceed ID3V2_MAX_ITEM_SIZE.

Overly long tags  may blow the stack due to a stack-allocated buffer
in the metadata parsing routine, that can reach 3 times the size of
the id3v2 and id3v1 buffers combined.

This patch moves the mp3entry struct used by the Playlist Viewer
off the stack and onto the plugin buffer instead, which helps prevent
a stack overflow in cases such as the example posted in FS#13518.

Future patches to either constrain ID3V2_BUF_SIZE to ~1120 bytes or
to lower the stack usage of metadata parsing will still be required
to fully address the issue.

Change-Id: I2f436195bc8df4d785b1880f6ab167783a162020
2024-11-30 15:45:40 +01:00
William Wilgus
c6fb789b3b test_fps add log buffering
most of the data gets wiped out by the next (or current) text

add some sleep and buffer the log text so we can display it after each test

needs tested:
	remote displays
	greyscale

Change-Id: I14e53aca71e925ff9f547a77c6805a75d2d37e67
2024-11-29 11:06:53 -05:00
William Wilgus
c115cb9472 [FixRed] 4ce8963c50 tree.c Maybe?
Change-Id: If959f6bcffa9b7afdd2942edc1ea683d275bac72
2024-11-29 00:51:44 -05:00
William Wilgus
4ce8963c50 [COV] tree.c rockbox_browse potential NULL deref
ultimately its only used as a way to prevent reentry
but coverity correctly identified the possibility..

Change-Id: I4738e52782ad4cac6134394238345a0491a50382
2024-11-29 00:25:03 -05:00
William Wilgus
c2bc7aa516 [BugFix] lib/printcell_helper.c vp buffer ovfl #2
found another place where vp width could exceed the buffer

Change-Id: I85d806cc58955b44327bd47c6a08dc7e556722c0
2024-11-29 00:23:51 -05:00
Christian Soffke
b1e70db6e7 Fix FS#13523 splashf crash on devices with remote LCD
regression introduced in ff2f912

Change-Id: Ifc9f37710e379605ad3325679325aab229003a21
2024-11-28 22:26:52 +01:00
William Wilgus
afb0e845cf strcasestr smaller function for PREFER_SIZE_OVER_SPEED
tester script:
https://onlinegdb.com/TbILrA5E7

Change-Id: Ie5a37db13500510e30e87a20782f13adfe2b4d78
2024-11-28 15:07:55 -05:00
Vencislav Atanasov
12aea7dae6 s5l87xx: Add support for S5L8720 to the GPIO driver
This is a part of the large iPod Nano 3G/4G support patch.

Credit: Cástor Muñoz <cmvidal@gmail.com>
Change-Id: I577eef01f42e8752ad9b2ee64e2b30ad0a9e55be
2024-11-27 21:06:30 -05:00
William Wilgus
da9d67a0fe Button queue handling is split from main button driver
First half of
https://gerrit.rockbox.org/r/c/rockbox/+/570

Change-Id: Icc64dfd8194c18f69564ed5f8bf7dd70a4330eb9
2024-11-27 20:16:53 -05:00
William Wilgus
5954a2fd48 runtime info add type to clear time dialog switch to simple_list
its nice to know which item you are clearing
simplelist does most of the background stuff for us

Change-Id: Ia2a2a92cecbb38d92297705ca1015aba2f81f18f
2024-11-27 15:48:28 -05:00
William Wilgus
cb478d9d3f add INIT_ATTR to dircache_load and core_load_key_remap
both of these are only called in main at init

Change-Id: If2020c2832df837aca23a331474bbf2352d803d4
2024-11-26 22:13:43 -05:00
Vencislav Atanasov
9b4bab7e0a ipod6g: Move pmu_is_hibernated() from bootloader to PMU driver, misc fixes
Added better comments about the PMU registers, added pmu_set_cpu_voltage() (still unused).

Credit: Cástor Muñoz <cmvidal@gmail.com>
Change-Id: I0ca21a49ece007c913c1b199952009e4dcae80e5
2024-11-26 20:15:25 -05:00
Solomon Peachy
6b348d7f75 Fix nano2g build from 88a1d902
Change-Id: I7f760ce84a2b8e8f5b118b7fe3b57c64d0f4af05
2024-11-26 20:12:59 -05:00
Vencislav Atanasov
88a1d90236 s5l87xx: Add S5L8720 registers
This adds some confirmed and some to-be-confirmed (TBC) registers for Samsung S5L8720, which is used in iPod Nano 4G, iPod Touch 2G and the 920-0614-03 development/prototype board.

All credit goes to Cástor Muñoz <cmvidal@gmail.com>

Change-Id: I9fe5052fe9f05cd33f34de4e228cdb291944aa11
2024-11-26 19:04:12 -05:00
Solomon Peachy
6231407df7 fat: MAX_VIRT_SETOR_SIZE -> MAX_VIRT_SECTOR_SIZE
Change-Id: I18d7998e0f23cbe9b95f5e8c90214975ae03a10e
2024-11-26 09:00:58 -05:00
Solomon Peachy
dfbbfb12d4 storage: Misc corrections and cleanups
* Make the partial sector logic a little clearer (no functional change)
 * Corrections for debugging messages
 * Also use MAX_VIRT_SECTOR_SIZE in BOUNCE_BUFFER calculations

Change-Id: I89363824b092b2e3bddd5e0f75bf81200c9bc513
2024-11-26 08:37:55 -05:00
Solomon Peachy
127b583a4d ipod6g: Turn on STORAGE_NEEDS_BOUNCE_BUFFER
The s5l8702's ATA controller can only DMA in/out of cacheline-
aligned buffers.  The more general buffering code already ensures
its buffers are aligned, but this covers the rest of the
users of the general I/O path.

Change-Id: Iae54d98797efb61756cb73e3901308775a0c5e52
2024-11-26 08:20:02 -05:00
Solomon Peachy
b8d2ba3fc4 fat: Ensure bounce buffer is a multiple of MAX_PHYS_SECTOR_SIZE
* if MAX_VARIABLE_LOG_SECTOR is defined, use that
 * if MAX_PHYS_SECTOR_SIZE is defined, use that
 * use SECTOR_SIZE

Change-Id: Ia314f590fdb300e99df2c60587657c9563b9ce80
2024-11-26 08:20:02 -05:00
William Wilgus
ff9da12763 skin engine small cleanup optimize find_tag() remove string copy
since we now have the length of tag names thru the param_pos var

we can simplify the find tag function to skip if the length doesn't match
this allows us to no longer make a string copy in order to terminate
the buffer

move some of the more frequently encountered tags to the top of the
lookup list

only SKIN_TOKEN_UNKNOWN position matters as its empty string is used
as the sentinel

Change-Id: Ib82d081a9ebedc228768845ae54a3d9466faaef1
2024-11-25 12:40:36 -05:00
Solomon Peachy
303fc090a7 logf: Fix warnings that only happen with simulator builds.
Change-Id: I51d960877201534f5683ba2ecbb829913f6a8afa
2024-11-25 09:34:03 -05:00
Solomon Peachy
03555cc7b5 logf: Correct two format string problems in plugins
Change-Id: I67ab14b2079de8fb660aaa5c1391db053aad2cc5
2024-11-25 09:08:32 -05:00
Solomon Peachy
87e55baaad ata: Use a better default for SET_MULTIPLE_MODE
* If the device returns a valid upper limit (word 47) use that.
 * If the current limit (word 59) is valid, use that.
 * Fall back to 1 as a default, not 16!

Note this is only used for PIO transfers!

Change-Id: I269b751466242bbcce91ee991d9ade449cc84b6b
2024-11-24 23:26:09 -05:00
Vencislav Atanasov
375a6bc9b1 s5l87xx: Use pointer arithmetic in register address calculation
This allows to reuse a register definition across similar SoCs that have the same layout of registers (same offsets), but are using a different base address for the peripheral. The include guard was also fixed to reflect the new file name of the header.

Some registers were renamed in order to match the datasheet and for consistency with the other register numbering.

Change-Id: I0192e227a3c467504b8fcd1eb684a7fc861f7896
2024-11-24 20:02:44 -05:00
Christian Soffke
18fdb41b2c plugins: simple viewer: prevent audio dropouts when scrolling
Change-Id: Idf3ee45585985beaccb991f4f66cd895aa3f7a4c
2024-11-24 23:55:40 +01:00
William Wilgus
1fddea5e8e Revert "[BugFix] Enums are only 2 bytes on some Devices"
This reverts commit 4ec34f6986.

Reason for revert:
 -fshort-enums makes them smaller if the explicitrly enumerated values will fit in a smaller type

Change-Id: I834dfd2b2039eda91bc02c9cf95a0f9dfc5783f6
2024-11-24 11:38:16 -05:00
William Wilgus
4ec34f6986 [BugFix] Enums are only 2 bytes on some Devices
using enums to hold values larger than 0xFFFF could be problematic

WIP

Change-Id: I3a9be957265364b545f022fe26163f0869569e3e
2024-11-24 10:23:53 -05:00
Vencislav Atanasov
9e2c85e076 Merge s5l8700.h and s5l8702.h into s5l87xx.h
This is part of the preparation to add support for iPod Nano 3G and Nano 4G. There are some optimisations left, like merging similar blocks of registers that share the same layout, but the base address have changed between SoC generations.

Change-Id: I4f06727b4061977141b65d39ae19591bd5b29680
2024-11-24 15:56:23 +02:00
Vencislav Atanasov
7fcc6a34a5 Unify S5L87xx register definitions
This is a preparation for merging both files to a new header named s5l87xx.h. Also removed unused register types.

Change-Id: I6aa231064d6a7c734aa297e68b899d6988a88bdc
2024-11-24 15:56:23 +02:00
Solomon Peachy
0624e265ab build: Various LTO fixes
* Give arm panicf_f() USED_ATTR
 * Ensure start_thread() has USED_ATTR

Change-Id: I6a833be7fbe25410c21e0df233fcae91e451bf00
2024-11-24 08:43:23 -05:00
Solomon Peachy
bdf1690cb2 build: Allow LTO to work globally, not just codecs/plugins
IMPORTANT: There is no guarantee this will compile cleanly much less
_work_ on any given target.  This is purely to enable future hackery.

Change-Id: Ib58f21b717719fd4325622b446a60779406ae035
2024-11-24 08:23:38 -05:00
Solomon Peachy
200529532b configure: Allow bootloader to be specified under advanced options
This required renaming the LTO build option.

Change-Id: Ibd93e55d37b5226e7b3270d56cf07bf96a780f28
2024-11-24 08:16:07 -05:00
Solomon Peachy
7ea64a315b Revert "storage: Disk Cache buffer size may need to be larger than SECTOR_SIZE"
This reverts commit dcec6828a3.

This did not solve the reported problem, and it turns out that the original
code did the right thing with respect to the device's logical sector size.

Change-Id: I5bed2520ba8f5ca01df0ddd71588d3ed69c1d77c
2024-11-24 00:57:57 -05:00
Solomon Peachy
dcec6828a3 storage: Disk Cache buffer size may need to be larger than SECTOR_SIZE
The file I/O code operates in terms of the FILESYSTEM sector size, which
may be much larger than the underlying device's logical sector size. So
the disk cache buffers need to be the the larger of:

 * Max allowed filesystem sector size (MAX_VIRT_SECTOR_SIZE) (if defined)
 * Max allowed logical sector size (MAX_VARIABLE_LOG_SECTOR) (if defined)
 * Fixed logical size (SECTOR_SIZE)

Change-Id: Ica0ec36d113406f24c12c696317a8d3520e7852c
2024-11-24 00:00:04 -05:00
Solomon Peachy
7df324b819 sdmmc: the tCardInfo.initialized field needs to be an integer, not bool
Some drivers (Notably the PP SD driver) uses negative values to indicate
errors.

Change-Id: I9dbb065cbe90a62cde8a1d89bf6b450f40721790
2024-11-23 23:07:12 -05:00
Solomon Peachy
f24bae5baf ...This time, fix the non-multidrive+non-multivolume builds.
I swear, this is getting old.

Change-Id: If810a6559eaebbed0a0f0c6a0891b09101783be6
2024-11-23 23:07:12 -05:00
Solomon Peachy
fb2316b9b0 Hopfully fix up the remaining warnings
Change-Id: Iba1facabf4980b491d80842ef91e92d6bc374cfa
2024-11-23 22:39:35 -05:00
William Wilgus
1bf19eaaff tag_table use unsigned short rather than enum
we have 190 tags

mips padded with extra 2 bytes * 2

saves ~768 bytes

Change-Id: I1d9bd8bf435bc1e3bc4564356c290c883c4724de
2024-11-23 21:44:04 -05:00
Solomon Peachy
21ebfd574a fix more red in hosted targets that don't share the generic system implementation
Change-Id: I38f59005e75fb7326e655f22bbe63048f31573a3
2024-11-23 21:20:17 -05:00
Solomon Peachy
57cd8cd712 fix warnings and errors in a41a001258
* volume_partition() wasn't defined for hosted targets
 * wrap the "special" volume stuff in HAVE_MULTIDRIVE

Change-Id: Icbea256ab6438e1f7e45d361ed61724feec7ef0b
2024-11-23 20:59:32 -05:00
Solomon Peachy
a41a001258 info_menu: Don't print a line for volumes that don't exist
This is an example of what could happen:

 HD1: Not present
 ouping Not present
 ouping Not present
 ouping Not present

We have up to 4 fixed volume slots (==partitions) per drive, but
shouldn't display an entry if the slot isn't used, ie the normal case.
Instead, we _were_ displaying a partially-unitialized entry!

There is a special case for targets that support multiple *drives*, in
that we want to show 'not present' for the first volume slot of the
2nd drive.

Change-Id: I717edd305cd654ff4e13ba9ffb57e7a4c9935c17
2024-11-23 20:33:26 -05:00
William Wilgus
213686b55c [Fix Yellow] skin_parser.c const correctness
Change-Id: Ibc3696d807649c649db68cbdfab19b20391eab71
2024-11-23 20:20:13 -05:00
William Wilgus
75a4937568 skin_tags save space in tag_table
skin_tags have name and sometimes valid parameters

storing a pointer results in a lot of wasted space
instead record size of name and write the parameter string just after

Change-Id: Ied32f9e820deec9092dc6b97a93e2660d7abc8b2
2024-11-23 19:41:29 -05:00
Christian Soffke
237c83852a Fix: read_color_theme_file needed beyond init
Change-Id: Icb1e2bf42149b1b27ed11046ec79e9faf105f289
2024-11-24 00:42:50 +01:00
Vencislav Atanasov
1535a42b68 Add include guard to s5l8700.h
Change-Id: I246a626c788bc0173cb7709fb5b004bdaac97883
2024-11-23 17:19:18 -05:00
Vencislav Atanasov
f4bbddb044 ipod6g: Fix config
- NOR flash size is 1MB, not 10MB
- BOOTFILE_EXT2 is not used, the Rockbox binary is always unencrypted on iPod 6G. This looks like a leftover from ipodnano2g config

Change-Id: Iea76c1e87f27e25b3d59924ef02e22d91448e39d
2024-11-23 17:19:18 -05:00
Christian Soffke
46a4361bf1 playlist viewer: move on-disk playlist struct to playlist.c
Change-Id: I40281142f2fa930f0c68b9612c12fca14885ac37
2024-11-23 09:05:39 -05:00
William Wilgus
2591f6ad02 filetypes.c small cleanup
no functional changes

Change-Id: I9c27689920ba89abf5ba16d84ed0dad8747be74a
2024-11-22 23:20:32 -05:00
Dana Conrad
253eb79db3 erosqnative: hw4 support
Support hw4 units with AXP2101 PMU

Bootloader successfully compiles and loads onto device.
The LCD appears to be identical to hw3 units.
Scroll wheel and buttons work
Audio output works, including volume.
HP/LO detect works
Rockbox build is generic
GPIO gating logic seems to be working as intended now.

 - Added new GPIO definitions - some significant overlaps with pins
    from previous hardware revisions...
 - Added some GPIO definitions for older players we didn't know about
 - Add register definitions for AXP2101 from datasheet
    (these are very different from AXP192!)
 - Add AXP2101 regulator definitions, need to support multiple step
    sizes per regulator.
 - Verify AXP2101 voltage set multi-range logic
 - Verify AXP2101 voltage get multi-range logic
 - Make AXP2101 its own driver
 - AXP2101 driver should be "minimally viable", though I think
    there is some extra functionality that could be implemented.
 - Disabling the coulomb counter stuff - we could maybe make
   the E-Gauge work for the same purpose, but it only appears to
   be used on the debug screen at the moment so it doesn't seem
   like it's worth the effort.
 - Found new button GPIOs
 - Found error in my GPIO setting logic, blue light works now!
 - Set LDO/DCDC output voltages to OF's settings, as far as
   I can tell.
 - Determined we probably want TCS1421_CFG1:0 to be 0x00,
   for UFP behavior
 - Tested this rb build with both old and new bootloaders on hw1.5,
   hw2, hw4 in as many configurations as I can think of, works across
   the board.
 - Bootloader can install itself on hw4, so nand chip isn't novel
 - Uninstallation file can be made by patcher script, works on hw4
 - Installation file can be made by patcher script, works on hw4
 - Added HW4 to rbutil, manual

Change-Id: I5b75782273e81c2c6f2b9c79501c8b7cbf88391f
2024-11-22 17:01:39 -05:00