Commit graph

38172 commits

Author SHA1 Message Date
Aidan MacDonald
d14ddcafd5 arm: implement cache maintenance ops for ARMv7-M
To keep the code size small, this hardcodes the D-Cache line
size and set/way information (which is defined by the target
and should be fixed for a given CPU) and assumes there is only
one level of cache.

Change-Id: Ia6d0e6a87b5dbfc6c39bda83b58461ed8767edf6
2025-04-21 13:07:38 -04:00
Aidan MacDonald
4d3190f416 arm: split ARM cache maintenance functions to separate header
Cortex-M processors don't have an MMU, but can still have caches
that need software management, so on those platforms we don't want
to include the MMU related functions.

While here, remove an outdated section of a comment referring to
deprecated cache maintenance functions which no longer exist.

Change-Id: I6f0fe694560bdee25ed7c69a846bf46e3e544cb1
2025-04-21 12:39:47 -04:00
Aidan MacDonald
bfa76dca9a arm: add ARM Cortex-M register definitions
Change-Id: Ifb90606d2b6c94c4f91798a41415c895e2888520
2025-04-20 20:19:10 -04:00
Solomon Peachy
96f5cb728c docs: Update the Plugin API document, which was _very_ out of date
Change-Id: I2490e86e6cc4d949eca0298498d384c3dba733f4
2025-04-20 17:07:40 -04:00
Solomon Peachy
6d656814dd api: Fix some basic syntax problems with the plugin API generator
Change-Id: I9e6afa5b75e7fb803ee4c29f8306b56d7f8d7f64
2025-04-20 17:07:40 -04:00
Solomon Peachy
3383060990 docs: Delete some _very_ obsolete documentation
Change-Id: I9c04c8eed8d7400d9d16f80c7dab1d6c8c42674f
2025-04-20 16:53:57 -04:00
Aidan MacDonald
89a9b5cf39 reggen-ng: add support for floating instances and nochild flag
Change-Id: I790149587b622f95f575964cd29caab4a0cff6d4
2025-04-20 16:28:07 -04:00
Solomon Peachy
bcee6318f0 headergen_v2: Add additional generator types to help output
Change-Id: I070c9554958c45e78462b8515cdce56fcee1a5ed
2025-04-20 16:26:50 -04:00
Aidan MacDonald
ecfc62cda6 headergen_v2: add ST generator for STM32 family
Change-Id: Id8f06a6f77cc58d3f0f94b72108dc91ba8037813
2025-04-20 16:25:58 -04:00
Aidan MacDonald
2db0627d38 headergen_v2: add ARM Cortex-M generator
Change-Id: If9059b0964ce6f905aa230139eb78b800ff6a102
2025-04-20 16:25:58 -04:00
Aidan MacDonald
08f800d5b8 headergen_v2: only generate MT_REG_INDEX macro when needed
This is only needed if the generator sets has_sct() to true.

Change-Id: Ie7fcb6a1f0f9d27e9ef8a5558c12a66ab6da4394
2025-04-20 15:53:54 -04:00
Aidan MacDonald
af9156406d headergen_v2: only generate GET_VARIANT macro if needed
This is an internal macro which is only used if has_sct()
is set by the generator, so don't generate it if we don't
need to.

Change-Id: I7ad51ad34ecabd833b84a270b5046e77131dcb41
2025-04-20 15:53:54 -04:00
Aidan MacDonald
f50455f6a7 headergen_v2: increase macro argument limit to 20
When registers have lot of 1- and 2-bit fields it's possible
to exceed the 13 argument limit. Usually this only shows up
when programming a configuration register, but it's annoying
to have to split up the write. 20 arguments should be enough
to avoid that.

Change-Id: I6240fae4a51ae14600afcfb8a4e3f1e983cbffa6
2025-04-20 15:53:54 -04:00
Aidan MacDonald
cffd158ace headergen_v2: add helper macros for base+offset addressing
Add a relative version of the register/field read/write operations
which takes a base address (which may be a void pointer or integer)
and computes the register address using offsets.

Change-Id: I7c012192e67adcd675a0fc1975ca4b16ed87bcac
2025-04-20 15:53:54 -04:00
Aidan MacDonald
387f67cab6 headergen_v2: add floating instances and nochild flag
Floating instances don't have an address and will only generate
child nodes and registers with offsets. The 'nochild' flag will
disable generating the children for a node but will generate the
node's own address, which can be used to generate base addresses.

Change-Id: Ib1014de94531436d5708db46aa684741e7740ace
2025-04-20 15:53:54 -04:00
Aidan MacDonald
0f5c2877fe headergen_v2: generate register offsets and node addresses
Register offsets are defined as the address of the register minus
the address of the parent node. If enabled by the generator, these
will be emitted alongside defines for the node base addresses.

This allows the base address to be stored in a variable, and the
offset can be used to access registers relative to the base.

Change-Id: I15576aeb2945293a259007da7f00a26055f4d0f0
2025-04-20 15:53:54 -04:00
Solomon Peachy
81e050871b updatelang: Correct grammatical goofs in some of the errors
Change-Id: I3795d89e68453e636188b26a1620226a836c8a4d
2025-04-20 11:58:38 -04:00
Roman Artiukhin
17d73c968a Codecs: mp4: Fix possible glitch at the end of song
sample_to_chunk last value was ignored in some cases leading to invalid sample value in lookup_table.

Fixes FS#13600

Change-Id: I8f066966e15c384d3185f689b68a2cc2a3abad1d
2025-04-20 13:43:15 +03:00
Solomon Peachy
f563fe54c2 updatelang: Alter syntax for 'phrase missing entirely' errors
Instead of 'this phrase missing entirely [...]' followed by the
verbatim phrase copied from English, instead the message now
reads 'the 'PHRASE_ID' is missing entirely [...].  This allows
the warning to be self-contained.

Change-Id: I413c29e0c1f6616e74d875d197b34c4724330d67
2025-04-19 21:59:01 -04:00
Solomon Peachy
ceeca12f07 lang: Apply some mechanical corrections to Romanian and Korean
Change-Id: I01a2d4c2d4ee39e502913e58fc175ab5aaf8e9fd
2025-04-19 20:59:53 -04:00
Christian Soffke
ae54b06af4 playlist catalog: Hide Copy/Cut/Open With
It may make sense to only show these in the
file browser, where you'd expect to do more
general file operations involving other folders.

Change-Id: I008569d2017811ee54b4449acb30359843f35294
2025-04-19 20:59:16 -04:00
Solomon Peachy
b7b20c4a77 FS#13599: Updated Romanian translation (Mihai Alexandru Vasiliu)
Change-Id: Ia87c6a34c6776059e51c06f96708040914d3a97b
2025-04-19 17:43:14 -04:00
Aidan MacDonald
1aa9f26b02 arm: workaround to build Cortex-M7 targets with GCC 4.9
Cortex-M7 support was added in GCC 5, while GCC 4.9 only
supports the M4. The instruction set is almost identical
between both processors; the only difference is that the
M7 supports double-precision floating point and the M4
doesn't.

Since Rockbox currently doesn't use the FPU, building M7
targets as M4 works fine.

Change-Id: I5880d6e81a85fa9b3e16e08d57e7955b4493df0b
2025-04-19 13:16:36 -04:00
Aidan MacDonald
da4e02cdd3 codecs: disable incompatible ARM assembly for Cortex-M
Some assembly routines don't work on Thumb as-is. For now
just disable these so the codecs compile.

Affected codecs:

- libflac
- libmad
- libspeex
- libtta
- libwavpack

A few DSP routines need to be disabled for the same reason:

- crossfeed_process
- crossfeed_meier_process
- resample_hermite
- filter_process
- sample_output_stereo

Change-Id: I277e0719652096745a19a7e2b597eff32d8e1553
2025-04-19 13:00:17 -04:00
Aidan MacDonald
94c7c908b3 libmusepack: add ARMv7-M version of MPC_MULTIPLY_EX
We can't use Operand2 with register based shifts on ARMv7-M as it
isn't supported in the Thumb encoding. Instead, perform the shift
separately.

Change-Id: Ie96aa0a565e98bbca724dffc2ffc6d64fdb5d7c3
2025-04-19 12:26:47 -04:00
Aidan MacDonald
c249dea2b7 libsetjmp: fix unpredictable behavior warning on ARM Cortex-M
GAS warns about unpredictable behavior of "ldr sp, [a1], #4"
that exists on Cortex-M3 (errata 752419) but this warning is
incorrectly issued on other cores too (eg, Cortex-M7).

Since the fix is just one extra instruction we may as well
apply the workaround for all Cortex-M targets.

Change-Id: I0c2aa46837f776d67d0236b627af1572aa5ab307
2025-04-19 11:24:01 -04:00
Aidan MacDonald
6ea328f0f1 arm: add div0 handler for 64-bit division on ARMv7-M
Even though ARMv7-M has a hardware divider, 64-bit division is
handled in software and needs a div0 handler. The libgcc routines
call __aeabi_{i,l}div0 so we alias those to __div0.

Change-Id: I5152c43d39e25e03f31404753f13978a614aca06
2025-04-19 09:43:40 -04:00
Vencislav Atanasov
545506c923 New port: iPod Nano 4G
Currently, only the development bootloader can be built successfully.

This is a part of the large iPod Nano 3G and iPod Nano 4G support patch.

Credit: Cástor Muñoz <cmvidal@gmail.com>
Change-Id: I74ea0da999ddb1d8ce5d0f5434141b3f0b5f7448
2025-04-18 20:40:49 -04:00
Vencislav Atanasov
d6cd237f80 New port: iPod Nano 3G
Currently, only a bootloader can be built successfully. The development bootloader is functional, it enables further progress on the port.

This is a part of the large iPod Nano 3G and iPod Nano 4G support patch.

Credit: Cástor Muñoz <cmvidal@gmail.com>
Change-Id: Idf85e42334b0e0ae36f9ed273e2940d5d7736e34
2025-04-18 20:10:29 -04:00
Christian Soffke
96615af033 Shortcuts & QS: Fix tree sort settings not immediately applied
Change-Id: I51158f786ad7dae46ce6201826cb35958e8014ec
2025-04-18 20:00:42 -04:00
Solomon Peachy
d307568410 FS#13598: Updated Spanish translation (Guillermo Garcia Rojas)
Change-Id: Ida5f5319c0b9f37b04ac2d7be35186f798e3480a
2025-04-18 17:30:41 -04:00
Aidan MacDonald
3ed9fb3115 arm: add initial ARM Cortex-M support
M-profile cores manage interrupts differently from classic cores
and lack the FIQ. Split the interrupt management parts out into
separate headers but keep the endian swapping routines (which are
not profile-dependent) in the common system-arm header.

The initial part of the vector table is common to all Cortex-M
CPUs and is intended to be included by the target linker script,
with the vendor-specific part of the vector table appended to it.

Change-Id: Ib2ad5b9dc41db27940e39033cfef4308923db66d
2025-04-18 13:19:42 -04:00
Aidan MacDonald
96b6a7b4e4 arm: implement get_sp for Cortex-M
On Cortex-M we can just return SP directly, which will return
PSP/MSP depending on the current processor mode.

Note that unwarminder doesn't handle Cortex-M exception frames
yet, so a panic from an interrupt handler will currently stop
at the exception boundary.

Change-Id: I8818126c065c896d781bd52b877965a4094dee2a
2025-04-18 12:47:03 -04:00
Solomon Peachy
8d5fd1b20b manual: add 'manual-7zip' build target for 7zipped HTML manual.
7zip produces files nearly *half* the size of a zipped one.

Change-Id: Ic8bc4129dd4106a32060c98049061ea3848ebddc
2025-04-18 11:24:40 -04:00
Aidan MacDonald
c33aafcd5c arm: add ARMv7-M version of ARMv6 mixer code
GCC cannot compile the existing assembly here on ARMv7-M,
claiming impossible constraints. It is actually possible to
compile if the input arguments (addresses and sizes) are
first moved to a high register so as not to conflict with
the use of r0-r7 in ldm/stm -- this is exactly what GCC does
for ARMv6, but it won't do it on ARMv7-M for some reason.

We can get a result similar to the ARMv6 code by manually
moving the inputs into temporaries, but the generated code
is a actually a bit smaller on ARMv7-M if the r0-r7 block is
shifted up to r3-r10. This only works since ARMv7-M supports
the 32-bit Thumb encoding -- 16-bit Thumb can't represent an
ldm/stm instruction of this type.

It's worth #ifdef'ing the code because although the ARMv7-M
version works on ARMv6 too, it spills a lot of registers on
the stack even though register use is mostly similar.

Change-Id: I9bc8b5c76e198aecfd0a0e7a2158b1c00f82c4df
2025-04-18 10:57:45 -04:00
Vencislav Atanasov
a1bf19de36 Fix unused function warning
Change-Id: I6252a6db2a0f9cdd3d0c18262b5809856a5bd977
2025-04-18 10:57:04 -04:00
Aidan MacDonald
1c96d51717 arm: add ARMv7-M support for thread context switching
On ARMv7-M, stm/ldm instructions can't include SP, so we must
load and store that separately. This changes the order of
registers in the context struct, but it doesn't seem to be
accessed anywhere else so this shouldn't cause any problems.

Change-Id: Ie1cd23272f23384e030f51f0b76739624fa7332b
2025-04-18 10:55:32 -04:00
Aidan MacDonald
6712779ccb x1000: fix regression on Q1 with misaligned write pointer
Commit 1fb906500a ("x1000: LCD DMA fix") caused a regression
on the Q1 by breaking the LCD_X1000_DMA_WAIT_FOR_FRAME logic,
since the wrong branch of lcd_wait_frame() was taken.

Change-Id: Icb44335f506a1a691280de8219188526bb11468f
2025-04-18 10:49:27 -04:00
Aidan MacDonald
76c62dc429 x1000: remove bogus modes from lcd_dma_start()
These 'modes' don't do anything here except clutter the code.

Change-Id: I4e0eef39e0c3bac288c40d571ba855c9ffd7c1a1
2025-04-18 10:49:27 -04:00
Aidan MacDonald
b71337f1fd x1000: remove LCD fast sleep define
All the X1000 targets use "fast" sleep, as opposed to the normal
HAVE_LCD_SLEEP define which creates a user-configurable option.
Remove the ifdefs to make the code a bit easier to read.

Change-Id: Ibb80c92a8e23191651fee61fc8cf6f4e4fac8750
2025-04-18 10:35:49 -04:00
Vencislav Atanasov
7e2019fde9 iPod Nano 2G NAND: Use the correct bit names for FMCSTAT
Looks like they were always off-by-one, so the wrong functions have been used to rectify this bug. This is now properly fixed.

No changes to the ipodnano2g binaries (bootloader, rockbox)

Change-Id: I19fe1b89f9e5d722f7e877d60f68fc3275c3642a
2025-04-18 10:26:57 -04:00
Aidan MacDonald
a0bfcd77c8 arm: enable unified assembly syntax in more files
This makes these files compileable, or in some cases less
broken, on Cortex-M targets.

In lcd-16bit.c, newer versions of GAS complain about the
infix condition codes so we use the suffix form instead,
which requires unified syntax to compile on GCC 4.9.

Change-Id: If45166d3fc83d64c692cbb331096a966397aa9e9
2025-04-18 10:26:02 -04:00
Aidan MacDonald
639b587fc7 arm: add support for processors with hardware division
ARMv7-M has hardware division, so it doesn't require __div0
or any support functions for 32-bit division.

Change-Id: I840683a1a77d737f378899ca4bcf858216b81014
2025-04-18 09:22:48 -04:00
Aidan MacDonald
7e8a818d95 arm: add ARM architecture profile detection
Add some logic to detect classic and M-profile cores, and make
this info available to the build system. All existing targets
are classic profile.

Change-Id: I07bfcd418bcaa6297b9bbf889fc189f167147428
2025-04-18 09:22:48 -04:00
Solomon Peachy
9e79ebf78d bootloader: Fix red on hosted bootloaders
Fixes: 888ce7cae8
Change-Id: I802779cf158634d5b3b547d74999798cb56d2882
2025-04-17 08:31:33 -04:00
Christian Soffke
93b1611474 tagtree: defer context menu disk access
When the database isn't loaded into RAM,
or the "quick" load setting is enabled,
filenames for tracks must be retrieved
from disk.

With a single track selected, this
can cause a delay before its context
menu is displayed.

Since filenames are only needed after the
user has selected something from the menu,
it makes sense to defer retrieval until
disk access becomes inevitable.

Change-Id: I72b57eff3102b50f3e19441119e20aad903b1f2b
2025-04-17 08:23:45 -04:00
Roman Artiukhin
be47d646f0 jpeg: Add support for FORMAT_RETURN_SIZE flag
Change-Id: I01f883400d775ffee5cdaa107fc3d6fb89b02573
2025-04-17 08:23:32 -04:00
Solomon Peachy
888ce7cae8 disk: Dump partition tables when we can't find a usable partition
Change-Id: I10a1b4f149657da4292f34ac8a14e58ec6cdcf72
2025-04-17 08:15:13 -04:00
Roman Artiukhin
08bd5cdd3d plugins: db_folder_select, disktidy, main_menu_config: Fix selection dialog with Show Icons set to No
Temporarily enable icons for required lists. Probably not a proper fix but a simple workaround.

Fixes FS#13574

Change-Id: I011a80e2a9f03019927b32e92cd5a35275c051e1
2025-04-10 12:30:29 +03:00
Solomon Peachy
b3caf32f78 voice: Disable Greek voicing in daily and release builds
...Its coverage is below the 80% threshold.  If anyone complains, they
can help improve the translation coverage first.

Change-Id: I0201497ec1209a7d125ac99ec45de6e2a9e41098
2025-04-07 08:44:43 -04:00