1
0
Fork 0
forked from len0rd/rockbox
Commit graph

11626 commits

Author SHA1 Message Date
Solomon Peachy
563da70139 ipod6g: Reworking the bespoke ATA driver
ipod6g was configured with SECTOR_SIZE of 4096, but this ATA driver
unconditionally translated these to 512B operations on the actual
storage device.

Rockbox's storage layer already has robust support for "logical sectors
larger than physical storage sectors" through use of
MAX_LOG_SECTOR_SIZE.  So switch to that mechanism, allowing the ipod6g
ATA driver to be simplified.

If we want to support drives with physical sector sizes > 512B, then
we need to port the MAX_PHYS_SECTOR_SIZE logic from the primary ATA driver.

Additional changes:

 * Simplify MWDMA/UDMA selection logic
 * Report CE-ATA mode in debug menu
 * Use LBA48 commands only if drive is over 128GiB.
 * Drop default sleep/poweroff time from 20s to 7s (matching main ATA driver)

Finally, the bulk of the changes are the first phase of a badly needed
style cleanup that made reading this driver a lot harder than it should
be. I intend to split this into a separate patch.

Change-Id: I2feca9fd319c8d6cfb3c2610208970428d2fa947
2024-10-17 20:30:37 -04:00
Solomon Peachy
d3b7eba405 debug: Correct formatting when displaying drive size.
Change-Id: I95e9a257dcad548ec4378d01c0f9b4370ebf5318
2024-10-15 18:25:28 -04:00
Solomon Peachy
8daf1f1bfe ata: SSDs: Only check for _legal_ "rotational rate" values
I'm 98% sure that the "byteswapped" value I saw was due to another bug
(bad PIO timings on ipods leading to data corruption) and none of the
growing pile of identify device data files that I have include the
backwards one.

Change-Id: Iea47b7419b120a3c8a282b2e3a8f65b8965356ce
2024-10-15 17:00:46 -04:00
Solomon Peachy
cda2f90e10 nano2g: Work around GCC9 warning in the FTL code.
As far as I can tell it's a false positive.

Change-Id: Ib4f993c717d673e53f1ec70b9f4701acc0ca6f27
2024-10-14 08:56:12 -04:00
Christian Soffke
152ec1946c ipod 4g/color: Fix unresponsive buttons after booting
The iPod 4g and color always ignored the very first
button press after booting, i.e. you needed to either
press another button or scroll for a bit first.

Not sure whether any other PP iPods exhibit the same
behavior, although it is not reproducible on an iPod
video.

This patch basically copies the code from FS#5230
that fixed unresponsive buttons whenever the HOLD
switch was turned off (committed as a5961c944b).

Change-Id: I8d3444094e5d000e0f8e30e39a23f054abeeb0f5
2024-10-13 11:36:33 +02:00
Solomon Peachy
38211e627d AS3525: Get rid of duplicate 'const' in a single definition
(Another GCC9-produced warning)

Change-Id: I9fd1ec692faded8afc52d7f3e522bc7198366dc5
2024-10-12 15:09:18 -04:00
Solomon Peachy
6cb0bc3468 coldfire: Silence a warning generated by GCC >= 9
Basically, there are weak aliases for all possible IRQ handlers,
pointing at a NORETURN function. GCC complains that the aliases
don't have the same attribute, but that's actually what we want.

Change-Id: I7f877e00193ed457589c8442db82e93ddea0d60a
2024-10-12 13:54:22 -04:00
Solomon Peachy
8dc42711b4 libc: Correct definition of labs()' and add llabs()
Change-Id: Ie1f4a5660ef17ea3ba383441f257ad7ee02c2061
2024-10-12 12:01:36 -04:00
Solomon Peachy
94d6265df0 gcc9: Move structure packing to the struct definition
Silences GCC9 warnings about possible casting misalignments.

Change-Id: I2120638d4d143e9e539b7f240c31653ad55ae4e0
2024-10-12 09:23:37 -04:00
Christian Soffke
8b9ef7cf8d sdl: Remove SDL_RENDERER_ACCELERATED flag
The flag would apparently make hardware accelerated
rendering  mandatory. SDL2 will still attempt to use
hardware acceleration, if the flag is missing.

Change-Id: Icfdcad90591d2a5003a1540f2a669c7e54dcfc3b
2024-10-11 22:57:37 -04:00
Solomon Peachy
7d60b13584 pdf50606: Fix questionable code that GCC9 complains about
Instead of:

  bool &= ~bool;

do this:

  bool &= !bool;

Change-Id: I815f56c98596d6c58390e843a1e3290d3525db72
2024-10-11 22:56:44 -04:00
Solomon Peachy
edbcf0b0f4 erosq: Initial PM support for "hw4" variant
(They renamed the battery from 'battery' to 'axp_battery')

Change-Id: Ic42c31e1d5c01eafc3fe01b144d9f22d88933e04
2024-10-10 10:12:29 -04:00
Solomon Peachy
56ec2e2e4a Only increase sigalthreads stack size for simulator or aarch64 builds.
The 12K-per-thread necessary on arm64 linux systems caused an
unnecessary 180K increase in RAM usage on the hibyos hosted ports.  So
back off to the old size unless we know it was needed.

Change-Id: I1e25417433052027ae02a51903b0f5245819db44
2024-10-07 12:15:02 -04:00
Solomon Peachy
0222ed3639 simulator: Fix SDL2 simulator build of touchscreen-based targets
(cowond2, mrobe500, vx747, shanlingq1, zenxfi2)

Change-Id: Iae68fbf80300d0268f3027ca97b06f6c64170a48
2024-10-07 12:05:42 -04:00
Solomon Peachy
7927423e34 SDL: Migrate to SDL2
Incorporates large portions of g#5879 g#5282 g#5285 g#5286 g#5287

Differences from the above patches:

 * Removed all MacOS-specific stuff
 * Removed support for SDL1 entirely
 * Properly implement mousewheel support
 * Bumped up minimum stack size for sigalstack threading
 * Check for overflow before enqueing scrollwheel events

Tested on:

 * sdl application (Linux)
 * Simulator (x86_64, Linux) -- xduoox3/ipod4g/sansafuze
 * Simulator (i686, Windows) -- xduoox3
 * Simulator (arm64, Linux)

Change-Id: Ia3012dd1be123feb2888798a42d5b7cc149f382b
2024-10-06 12:05:53 -04:00
Solomon Peachy
d13029ebdd kernel: Add queue_full() API call
This allows callers to see if it's safe to enqueue something instead
of triggering a panic if the queue turns out to be full.

Change-Id: Idb887e7a47cfbfef998f27d9d85090f3c0ed2230
2024-10-06 11:17:54 -04:00
Solomon Peachy
2f3b9ab68a tms320dm320: Correct a warning with newer toolchains
Change-Id: Ic9d745b9117ee50d82f4c71e07753bf71afc559e
2024-10-06 09:30:32 -04:00
Solomon Peachy
395311f7a1 simulator: Make sure we define the right stuff for sigaltstack()
We got some of this stuff through SDL1 implicitly.

Change-Id: I349be640ac15f79048d860bb58bae93a74a0e1ec
2024-09-21 19:08:32 -04:00
Solomon Peachy
a7fba55fcf warble: Fix build
Change-Id: I52028c2244a9951fc4a04f82cf1c85557539a50b
2024-09-21 19:08:31 -04:00
Solomon Peachy
6ed8b9091c Misc: Compiling under SDL2 uncovered a few issues unrelated to SDL itself
Change-Id: I625d5dd02d3f70bc6484a8641eafdaf13812f4a7
2024-09-21 16:32:58 -04:00
Christian Soffke
bc56e9a9dc SDL: Don't apply settings when starting DMA playback
This seems to be redundant since it
already happens in pcm.c

Change-Id: Ib27d1a225758e5f2919446ceb6de4a038abfa062
2024-09-21 15:14:54 -04:00
Solomon Peachy
e0df9952fd ata: Alter ata_is_active() when drive doesn't support power management
Due to the heisenberg principle, we don't want to check the battery
level when the ATA drive is "spun up".

Unfortunately some ATA devices *cough most SD adapters cough* don't
support mandatory ATA power management commands like flushing caches and
(safely) shutting down so we have to leave them "spinning".

This leads to us never updating our battery status with these
out-of-spec devices.  Work around this issue by having is_active() always
return false if that's what we have.

Change-Id: I629f3fdbc7e5cffb0a4d546c80cb5fca8529c0e6
2024-09-18 08:26:14 -04:00
Dana Conrad
a7cfee640d erosqnative: only check for EROSQN_VER if bootloader build
Change-Id: If1dea2414b5c55d54dfd48aa9b24d29bdd49001a
2024-09-08 17:10:04 -04:00
Dana Conrad
a5462d6192 erosqnative: Give erosqnative_v3 its own target ID and modelname
This is needed so "make clean; make reconf" will work correctly.

Change-Id: Ife13e59ac6054f04f7095aa2263ec64595eeb3a2
2024-09-08 12:29:03 -04:00
Dana Conrad
878e29396c ErosQNative: Add v3 LCD support, conditional on bootloader
bootloader passes the player version to rockbox for LCD init changes

Credit ZappBranigan2972 on forums for original changes
Credit Bilgus for devicedata additions

Change-Id: Ia2ca493edef49b7457e84dc19b05397dc915fa5a
2024-09-02 13:29:43 -04:00
William Wilgus
a2cc7546d8 Add DeviceData to bootloaders
same vein as bootdata but for devices that need to pass info back to a
running firmware

Change-Id: I0cdcdc0475804dfbbee415ab487104ae8fc8ac69
2024-09-02 13:29:43 -04:00
William Wilgus
49bbfe7505 Fix red fbc8b2156f
lcd_scroll is include in a weird manner and includes need to go in
scroll_engine.c instead and still be blocked from bootloaders

Change-Id: Ic99d123f7d428d511380c7064a9453de56218a17
2024-08-28 21:26:06 -04:00
Paul Sauro
f69d9c8a95 Settings: Add a new option to prevent text scrollings in the home screen
This option is especially useful for theme creators that want to create themes with lockscreens. When text is scrolling, it is breaking the lockscreen so setting this option to true prevent this. Text will continue to scroll normally in all other contexts.

Change-Id: I194f6837217881d50f567a775b81d0b422caf35c
2024-08-28 20:24:44 -04:00
Dana Conrad
56dd7ead63 rolo: Write bootdata regardless of whether running from root or redirect
As long as bootdata is valid, write it.

Change-Id: I63114b835d43c800217d2b688f9f7e2c2fb34c15
2024-08-27 07:43:25 -04:00
Dana Conrad
cd91c238de Bootloaders: Include HAVE_MULTIVOLUME if BOOT_REDIR also present
We need HAVE_MULTIVOLUME in bootloaders for redirect
functionality to work.

Change-Id: I50dbbb179bd012696e592ca843809fcc5fb78994
2024-08-21 18:31:28 -04:00
Dana Conrad
5ddfdf6e2f ErosQNative: Set extra ES9018K2M options
Set number of FSR edges required for DPLL/ASRC lock
Set DPLL bandwidth larger

Both should help prevent dropouts, especially with
sample rates >=96khz

Credit to ZappBranigan2972 on the forums

Change-Id: I55a90d44ac7fcec5894377e32cdadad66bb05610
2024-08-21 08:57:50 -04:00
William Wilgus
3b040673cc Add verification to multiboot redirect
check that a firmware file exists before we redirect
to an invalid directory

Change-Id: Id496fde3508158bc80f90dfb18a31ebae7229787
2024-08-20 00:34:03 -04:00
Solomon Peachy
05354e1bef Hopefully fix the remaining red from 15e52374
(imx233, ipodnano2g, !multidrive hosted/sims)

Change-Id: I9c89887078f9f50d3aac73f468ac323699e1fd1f
2024-08-12 15:20:13 -04:00
Solomon Peachy
15e5237469 storage: 64-bit sector offsets
* Create new 'sector_t' type alias:
    * uint64_t for all targets with HAVE_LBA48 or HAVE_SDUC
    * unsigned long for the everything else
 * Alter all storage APIs to use sector_t instead of 'unsigned long'
 * Alter Volume/Partition/storage info structures to use sector_t
 * Disk cache converted to sector_t
 * ATA Core:
    * convert to using sector_t for sector addresses and drive sizes
    * Always fill out upper 16 bits of LBA48 addresses
    * IDENTIFY INFO is fixed at 512 bytes, not SECTOR_SIZE
 * USB mass storage:
    * convert to using sector_t for sector addesses and drive sizes
    * Implement READ_16/WRITE_16 for LBA48 addresses
 * Convert FAT code to use sector_t for all sector references
 * output_dyn_value() now accepts int64_t instead of 'int'
 * Corrected "rockbox info" to work for (MULTIVOLUME & !MULTIDRIVE)
 * Better reporting of disk and (logical+physical) sector sizes in debug info
 * Detect SDUC cards and report on storage debug_info screen

To-do: SDUC

 * Refactor SD core to remove duplicate code in every driver
   * Card probe and init state machine
 * Implement core SDUC support
   * SD2.0 needs to be 2.0+ (fixed for jz47xx and x1000)
   * Host and Card ID (ACMD41)
   * 32-bit addressing for all read/write/erase operations (CMD22)
 * ADD SDUC to target device drivers, defining HAVE_SDUC as appropriate

Change-Id: Ib0138781a0081664d11511037685503df1b93608
2024-08-12 14:23:44 -04:00
Dana Conrad
ef9490f683 ErosQNative: Debounce jack detection and make Line-Out default
Making line-out default output should allow detection to work
correctly. Headphone detection should work whether or not
headphone is currently the active output due to the
low impedance (relatively) of the headphones. Line-Out sinks
will likely be high impedance, so we need the output
as a pull-down for detection.

Debounce detection to prevent false triggers due to voltage swings
during playback.

Change-Id: If5e497d900330f64d0f49a135e953ee6b0499668
2024-07-30 11:39:47 -04:00
Solomon Peachy
e722334ab1 init_volume_names() has to be called AFTER storage_init()
...So just move that call into storage_init and be done with it!

Hopefully this doesn't cause any functional regressions.

Change-Id: I08700fbd1613638606a23ee3a0c2149123c2c24a
2024-07-28 21:15:41 -04:00
Solomon Peachy
78283bda64 talk: Voice the volume name when browsing and when voicing full paths
Change-Id: I56660e168edd135a09cd5c021504a58ec9d40093
2024-07-28 16:54:33 -04:00
William Wilgus
67db38e766 [Bugfix] initialize the volume names for the sim
init_volume_names() wasn't being called by the sim

Change-Id: Ife0d345cf29bd4a0a658ed194ee85ca4852bc92f
2024-07-24 23:43:36 -04:00
Solomon Peachy
e8975cf85c Fix typo inadvertantly introduced in 89b4cd59ef
Didn't cause any compile problems becuase we have no APPLICATION
targets that support recording.

Change-Id: I84594481abaccde01646a491e7d9c6b3abc36954
2024-07-24 09:01:57 -04:00
William Wilgus
89b4cd59ef [BugFix] extra slashes in recording directory
the define for HOME_DIR has a single slash for native

hosted does or doesn't but native always has 2

Change-Id: I2ff546da8e422feb04027de164caf3747f6d9355
2024-07-23 22:14:16 -04:00
William Wilgus
c0ac043c6d get_volume_name generate volume names once then reuse
Change-Id: I36c62bfb28af9770b551a1193fbb66eb6fbac76a
2024-07-23 18:35:52 -04:00
Solomon Peachy
fe5bee50be Multivolume: Hosted targets are also limited to just one volume per "drive"
(It would be interesting to try and work around this but it would have to
 be done on a per-target/platform basis)

Change-Id: I7a27199082998420fea3c6abbbf5f3c526ccaec4
2024-07-20 08:46:21 -04:00
Solomon Peachy
82cf845625 simulator supports only one logical volume per drive
Change-Id: I8f32743c98771ca38c04d42bf6b2dd4768cfedad
2024-07-19 22:04:00 -04:00
Solomon Peachy
87ef6bb9e1 hosted: Don't unconditionally pull in mv.h on hosted environments
It causes some conflicts in plugins with the upcoming 64-bit storage enablement

Change-Id: Ia8615c5266c2b29216a05a8d85c3da5186c98d1c
2024-07-19 18:42:11 -04:00
Solomon Peachy
01ec79663d ATA: Rework ata_isssd() slightly:
* If CF Timing mode is specified, treat it as SSD
   (some SD adapters don't report CFA supported but but report this,
    and _all_ microdrives seen do not report this)
 * If CFA compliant and CF power level 0, treat as SSD

Change-Id: Ia8c88b4636af9bae75fbd1c253d8b2b01bca6584
2024-07-16 17:35:53 -04:00
Solomon Peachy
942e013eac pp5020: Cache the result of the is_ssd check.
...So we don't look it up on every write.

Change-Id: I85b0abe5032a60588535b401cc719661601807ee
2024-07-16 17:35:53 -04:00
Solomon Peachy
27a0cda6ac PP5020: Unconditionally use stock PIO timings
The SSD detection heuristic is flawed, and when it fails
(due to very crappy CF->SD adapters) we end up corrupting things.

So let's give up a slight amount of performance on the original hard
drives (which are aging out anyway) in favor of guaranteeing safety.

Change-Id: Id92583a6b9ae6ec543b91b3e0f8f28b57ac38cb0
2024-07-16 17:35:53 -04:00
Solomon Peachy
9c53fa1b0a pp5020: It's okay to use DMA reads on non-SSDs
Fixes a regression introduced in 4b423e21f6

Change-Id: Ief4a4a562840524b98ad5988999bac87586dec41
2024-07-16 13:37:14 -04:00
Solomon Peachy
a6f0044d40 Revert "ata: Use PIO0 when ATA_SET_PIO_TIMING is not defined"
This reverts commit 95d6c74627.
2024-07-16 13:26:49 -04:00
Solomon Peachy
95d6c74627 ata: Use PIO0 when ATA_SET_PIO_TIMING is not defined
If we have no way to tell the controller what timing to use, go with
the slowest possible speed.

Change-Id: I1ed3474d8bfecc08cfe4a9e7667f57775fef4d43
2024-07-16 11:47:43 -04:00