1
0
Fork 0
forked from len0rd/rockbox
Commit graph

11582 commits

Author SHA1 Message Date
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
Solomon Peachy
c51a9821e7 rk27xx: Fix simulator errors brought upon by HAVE_MULTIDRIVE but not HAVE_HOTSWAP
Change-Id: I0171d01dfffbb936e8041c0e2fc5207c620ddce3
2024-07-07 16:02:38 -04:00
Solomon Peachy
60c3fdbc11 More red fixes:
* hostfs_removeable()/present() needed IF_MDVOID() in their prototypes
 * SIM_EXT_INSERTED/EXTRACTED are gated by HAVE_HOTSWAP

Change-Id: Id8c688f3538db99586a4f5062c83466374451883
2024-07-07 15:40:27 -04:00
Solomon Peachy
5a2bd580cd Hopefully fix the last of the stragglers.
* xDuoo X3 fix some warnings due to an incorrect #ifdef
 * stub storage_removeable() and storage_present() for non-HOTSWAP builds
 * sim_trigger_external() is gated by HOTSWAP, not MULTIDRIVE

Change-Id: I38f14fdfeba13957899c378051d49afc2e8245e5
2024-07-07 15:13:53 -04:00
Solomon Peachy
1528b44349 More red fixes
Change-Id: If22cdb286edac47b08b158bee6910ba7a539b041
2024-07-07 14:47:07 -04:00
Solomon Peachy
dc364e44ef Disable HAVE_MULTIVOLUME for bootloaders
Multivolume support is only necessary if mounting multiple volumes
simultaneously, which the bootloader won't do.

Change-Id: I725061dd2aa47abe7652b0d27258dd3af821c913
2024-07-07 12:43:10 -04:00
Solomon Peachy
f37b5a8349 Fix the remaining red in red from ea80d1cc9ca
Notably:

  * double-paste in ihifi760 config.h
  * jz4740 ATA & SD drivers used MULTIVOLUME instead of MULTIDRIVE
  * Simulators implicitly rely on HAVE_HOTSWAP

Change-Id: I44fc7f98f0f6df366f016567c330f87e9f3ca6a6
2024-07-07 12:29:19 -04:00
Solomon Peachy
181fe7530a Fix most of the (extensive) red in ea80d1cc9ca
Change-Id: Ie494df80caa222423a52977031920d54bd058c3c
2024-07-07 12:05:18 -04:00
Solomon Peachy
ea80d1cc9c config: Change default HAVE_MULTIVOLUME settings
* HAVE_MULTIDRIVE implies HAVE_MULTIVOLUME as the latter is always
   removeable storage
 * SD storage implies MULTIVOLUME
 * ATA storage (with HAVE_LBA48) implies MULTIVOLUME
 * Replace HAVE_MULTIDRIVE && NUM_DRIVES == 1 with HAVE_MULTIVOLUME

Since SD and ATA can exceed 2TB, we need multiple volumes to fully
utilize available storage with FAT32.

In practice I believe this only affects the ipod devices.

Change-Id: Ia597770948b0e2b47630f7264ad34f225a33a640
2024-07-07 11:35:04 -04:00
Solomon Peachy
e2fb4ecd5c xduoox3: Completely strip USB support out of the bootloader.
Change-Id: I7167e051a56a3be3c285c209b1c8fca7de251b09
2024-07-03 16:51:58 -04:00
Solomon Peachy
80b9127727 Revert "jx47xx: Rename crt0 'init' sections to 'startup'"
This reverts commit 83bb89d0b8.

...It breaks the jz47xx bootloaders.
2024-07-03 16:51:58 -04:00
Solomon Peachy
e55618d07a hosted: Minor corrections to the linux framebuffer driver.
* Query variable info _before_ mmaping the framebuffer
 * Sanity-check the resolution/bitdepth, and if it doens't match
   try to set it to what we want.

This is functionally a no-op.

Change-Id: I087ff81775d8f63bf7846b7fef19f6fc36c1cc84
2024-07-01 09:51:50 -04:00
Solomon Peachy
5f26f21ab2 samsungypr0/1: Minor improvements to framebuffer driver.
* Distinct error codes for all failures
 * Corrected some comments and error messages

The ypr0/r1 target should be switched over to the generic lcd-linuxfb
driver, but that will come later.

Change-Id: Idc3867a96db7e431847473708712f88dd2725a96
2024-07-01 09:50:33 -04:00
Solomon Peachy
025841cfb5 ata: Use consistent error values for all invocations of set_features()
set_features() returns an error between -1 and -39, so make sure
every caller adds -60 to that so no matter where an error is printed
the value is consistent.

Change-Id: Ic81108ee70a2cb5ff7ea2445f086420fe850d07e
2024-06-29 10:07:25 -04:00
Solomon Peachy
dca5fb9514 simulator: Fix Samsung YP-R0 windows simulator build
Change-Id: I2940cd9fed7e24c17d221402928737606d4d0ab6
2024-06-26 20:45:59 -04:00
Vencislav Atanasov
4691152f92 Add SysCfg viewer for iPod 6G in the debug menu
Change-Id: I4e142f40777c7f8ae58f2b46fc6a3ec4f12aa530
2024-06-24 21:00:25 -04:00
Solomon Peachy
54e2facb85 Fix yellow introduced in f7a3b4dfa
Change-Id: I38d53cfe52745762f89fa017dc8199c897379493
2024-06-23 20:58:10 -04:00
Szymon Dziok
f7a3b4dfa3 Radio support and detection for Samsung YH92X [FOR TESTING].
Status:

- tested on:

  Samsung YH920 - it uses this detection too, it always should have
                the radio.
  Samsung YH925 with the radio.

- untested on:

  Samsung YH925 without the radio.

Change-Id: I68b39c09d6b7e26a4c373fbd8bf9401a97e86123
2024-06-23 20:11:59 -04:00
Vencislav Atanasov
9c458bbb0d Use literal ATA serial number for USB SN descriptor if the string is printable
Change-Id: Ic2c853a0b124d7b590ea36229347c56f96a32f33
2024-06-23 08:00:06 +03:00
Vencislav Atanasov
9fda39d1ad Prevent using PP-based iPods' set_serial_descriptor on S5L87xx-based ones
On PortalPlayer iPods, it looks like the serial number is available in a
specific memory location. When adding support for Samsung S5L87xx-based
iPods, this algorithm has not been limited to PP-only, so it sets the
serial number USB descriptor to random memory data.
With this change, it will use the ATA HDD serial number on iPod 6G. On
Nano 2G it won't provide a serial number at all.

Change-Id: I53d48915d629dbd87b2dbbcba5f228ca5949fa9b
2024-06-23 05:24:04 +03:00
Solomon Peachy
b4668e2bd6 libc: Check for a null string argument in *printf
If we are passed a null string argument, use the fixed string "(null)"
instead.

Change-Id: I4f70ae76cdcac1104ff1e42dc3b1a5f03e2723fe
2024-06-20 15:22:36 -04:00
William Wilgus
7b12cc3927 pathfuncs.c remove strip_leading_separators()
This should actually be strip_extra_leading_separators() but
its not used anywhere else yet and I don't see enough callers
in core to make it worth the extra overhead

Change-Id: Icdd292869b4198bed7725c51820f6b2111ad739d
2024-06-16 12:33:16 -04:00
Solomon Peachy
ae25a425b6 ATA: Fix regression when trying to set power management mode with CF cards
Some CF cards claim to support Advanced Power Management, but error
out when the command is issued.  There is a special case in the
code that ignored errors when issuing the APM command, but was referenced
against a specific index in the feature table.

When the tagle was reorganized, the index was wrong depending
on if ATA_DMA was enabled or not.

The fix is to test against the specific subcommand ID instead of the
table index.

Change-Id: I2ef7a05b2d70675c38e41d70b5189b394056cb74
2024-06-14 10:56:23 -04:00
William Wilgus
c6473f4e7f [Fix Yellow] imx233_debug fix yellow
Change-Id: I2d04340a8383edd03350045085188d2191e41526
2024-06-05 20:03:02 -04:00
William Wilgus
c96d728d81 [coverity] debug-imx233.c dbg_hw_info_audio() use strlcat, fix snprintf call
technically this isn't currently causing any issue but
coverity correctly identified the potential for buffer ovfl

Change-Id: I4af462c9860c44f22d05b5b2b4c685364823d395
2024-06-05 19:16:07 -04:00
William Wilgus
d68c314cea [coverity] vuprintf.c format_double_radix() initialize data struct
it appears this is  false positive but its compliaining
about the uninitialized pointer,
 not a bad idea to initialize pointers to NULL anyway

Change-Id: I5832a19ab13971c7d55580694eef70591a3a9acb
2024-06-05 19:16:07 -04:00
William Wilgus
e54dedd8df [coverity] fat.c fatlong_parse_entry() buffer overrun, fix warning basisname
BYTES2INT16() uses [i + 0] and [i + 1] therefore 30 is the max element
available in the raw byte array of size 32

 (((uint32_t)array[pos+0] << 0) | \
 ((uint32_t)array[pos+1] << 8))

 struct /* raw byte array */
 {
     uint8_t  data[32];
 };

 basisname is only uninitialized in the . and .. dir entries
both are likely false positives but cheap enough to guard against

Change-Id: Iab3d186fed6050d2d61185071765a2c0feb9515f
2024-06-05 19:13:47 -04:00
William Wilgus
74552d5404 [coverity] RFC ata-imx31.c UDMA mode timing tables out of bounds reads
mode only goes 0-4 the original commit mixed up the index and mode
bad stuff must happen but its been here for 16 years

Change-Id: I7e69f4e2574029a6bc3cea76e8803d2d0357d9e2
2024-06-05 19:00:15 -04:00
Roman Artiukhin
2109d524e8 samsung yp-r0: Fix displaying non-Latin filenames on SD card
Supply iocharset=utf8 mount option. Otherwise, cyrillic symbols appear as question marks.

Change-Id: Ibf40a15ff429cfe2bf6e7970330870505e2470b7
2024-06-04 19:29:19 -04:00
William Wilgus
dad01f29ff [coverity] multiboot.c write_bootdata_ fix memset size
the payload arg was swapped with the size arg

Change-Id: I1e1ef6e842a4fd00f7d4a656438fccbe7abc429a
2024-06-04 15:56:56 -04:00
William Wilgus
82dcf32736 [BugFix] headphone should be removed on first toggle
Change-Id: I10a77f210896a9ec317f9cbc7de21dccabafe426
2024-06-02 17:09:24 -04:00
William Wilgus
cc67f420f2 [coverity] font.c load_cache_entry check for successful read
Change-Id: Ic2d8d6e498417983af7ee691f53dfb1e951561fa
2024-06-02 10:32:47 -04:00
William Wilgus
aca41be3ca [Feature] Simulator add headphone and lineout toggling
Change-Id: I0b019414643e5c9037c0128093488da49e1a4c0d
2024-05-30 12:12:29 -04:00
Solomon Peachy
8b8c0c7c2a checkwps: Validate translated strings (%Sx)
In verbose mode it will log valid the strings found, otherwise it will
only complain when we encounter a missing string.

Unfortunately a missing string is not inherently a problem, due to
conditional expressions.  So all we can do is complain in checkwps
or if wps debugging is turned on.

Meanwhile, this is the first step in actually enumerating the translated
strings used by themes.

Change-Id: Ia93b333085e825d5b085c4d372ad8e13aa3e3ba1
2024-05-24 21:37:54 -04:00
Dana Conrad
5f377c2613 Eros Q Native: Add Stereo SW behavior setting
Hopefully this should cover our bases so we can change
the behavior of the stereo switch to keep line out working
when they change the hardware on us!

Change-Id: Ic36bcb3778d5681a5f3f158c689df9c1420c1d7e
2024-05-12 09:42:02 -04:00
Aidan MacDonald
e37cd0f2f5 x1000: Enable NOCROSSREFS_TO()
Start enforcing the correctness of references to the .init section.

Change-Id: I507891a25be9cccff4cf8ec13fdc799b73c75176
2024-05-08 22:14:10 -04:00
Solomon Peachy
1957237a46 Fix red in 8c86fb6da0 (ipod5g only)
Change-Id: Idf6a488728b0187779bc4a9232c7e7e9400afeec
2024-05-08 22:03:59 -04:00
Solomon Peachy
8c86fb6da0 arm: Use -masm-syntax-unified when compiling with gcc8 or newer
Annoyingly, this makes all of the '.S' files we compile get treated as
divided syntax, so we need to make the syntax in them explicit.

Change-Id: I56a3916b7b24c84a1214a5d6bc4ed4d651f002cf
2024-05-08 21:45:42 -04:00
William Wilgus
efcea66280 Revert "readdir_r use in tagcache.check_dir, ft_load"
This reverts commit 0c737d3b2e.

Reason for revert: Not really a concern as open_stream returns an independent buffer since g#566

Change-Id: Idbd2f4a7cc2ea6362b7714629469eeb7b3d19b3b
2024-05-02 13:38:32 -04:00
William Wilgus
0c737d3b2e readdir_r use in tagcache.check_dir, ft_load
Change-Id: Ibcde39ed247e100dd47ae877fb2a3625bbb38d8b
2024-05-02 09:33:29 -04:00
Solomon Peachy
aa7357861a ipod6g: Issue a FLUSH_CACHE[_EXT] command if device can't sleep.
Additionally, synchronize with the standard ATA driver's feature table

 * Acoustic management set to quietest
 * Set power mode to lowest w/o standby

Change-Id: I12e64354d4c946228e9a55fc8da2114127d08d28
2024-04-26 07:28:01 -04:00
Solomon Peachy
9a17185e63 ata: Enable volatile write cache (if device supports it)
Rejigger the options table a little for clarity

Change-Id: I02fdcc6521e42cc735d9b1da741b80db5b739858
2024-04-26 07:25:35 -04:00
Solomon Peachy
2905ba2f72 ipod6g: ata: Don't power down devices that can't handle it
...by checking to see if the mandatory ATA PM feature flag is set

The common CF->SD adapters don't report this.

TODO:  When PM is not available, issue a CMD_FLUSH[_EXT] instead?

Change-Id: If9200bd3c03a984376203aeea4fbe11e230a9b4d
2024-04-22 15:47:10 -04:00
Solomon Peachy
4b423e21f6 pp5020: Use DMA Writes by default for SSDs
It is likely that these things accept data far faster than the spinning
rust drives ever would, and while there is a question about PIO timings,
DMA timings seem to be solid.

Change-Id: I70644e0ad85a6ed429c8704e66ca7af91d78765c
2024-04-22 15:46:50 -04:00
Solomon Peachy
886060475e ata: Heavily rework sleep and poweroff logic
* Use of ata_disk_can_poweroff() was inverted, resulting in SATA SSDs
   getting powered off but leaving _everything_ else on, including spinning
   rust!
 * Replace the can_poweroff() heuristic with a test for the mandatory
   ATA power mgmt feature flag. Notably, the CF->SD adapters don't claim
   to support this!
 * Eliminate duplicated tests in sleep code
 * Wrap all poweroff-related code with HAVE_ATA_POWER_OFF
 * Don't ever use SLEEP command, only STANDBY_IMMEDIATE
 * Gate call to STANDBY_IMMEDIATE behind a can_poweroff() test
 * Prefer FLUSH_CACHE_EXT to FLUSH_CACHE where available.
 * Improve SSD detection heuristics to any of these:
   * Explicltly identifies as SSD (covers newer CF and SATA)
   * TRIM support
   * CFA compliant AND (CF level 0 OR high speed support)
 * Report SSD detection in debug menu

Change-Id: I7fcb83b6d6eabddc11c64326a573b08ab85412b5
2024-04-22 15:46:30 -04:00