There are numerous sub-commands, this makes it possible to call the others.
Also in this patch is the ability for the "default" ATA driver to
query smart data too
Change-Id: Ie3aaf9e0b2d7a5d25d09dea34e4f10ee29047e1b
This is the first step towards enabling this feature for all ATA
devices.
Only the ipod6g supports it out of the box with its stock storage device
but with the prevalence of flash/ssd mods of one sort or another, this
really should be determined at runtime.
Change-Id: Ie35d97fd857bec8213cd0a2ad80695e8bb04a2d6
when battery_bench is run
exports a file in the rockbox directory called 'battery_levels.default'
if the user wants their own levels they can rename the file battery_levels.cfg
and it will be loaded at boot
some minimal error checking is performed prior to using the values
added manual entry
Change-Id: Ia0126faced0c7229fcf8385a1bcb584b5a9dc378
This makes it possible to reuse the SysCfg reading logic in other places.
Tested on ipod6g (normal + bootloader).
Change-Id: Iae6de2ee671bce4edb0153d26c57579ad47d0335
Since the SPI NOR flash is only used for the bootloader, rename the files accordingly, This is a preparation for the nandboot driver will be introduced, since S5L8720+ don't have an SPI NOR flash anymore.
This is a part of the large iPod Nano 4G and iPod Touch 2G support patch.
Credit: Cástor Muñoz <cmvidal@gmail.com>
Change-Id: Iea835fd2029470bfe9f813631ad4f3db711facc3
Check for the ES9018K2M dac in the bootloader for
hw1/hw2 devices. Assume that all devices newer than
hw2 have ES9018K2M DAC unconditionally.
All devices will now report the correct hw revision
in the debug menu under Device Data.
Add devicedata.version field, current version 0.
Rename device_data.lcd_version to device_data.hw_rev.
hw2 devices with older bootloaders which ID as hw1 are special-
cased to keep using hwvol on them. They should still upgrade though.
Change-Id: If0fd5ce3bc6e85e511047721ec18e42fb89312e7
replace with simplelist_reset_lines(void)
there was one user saving one short string
remove the feature to simplify list code
fix scrolling in dircache debug item
Change-Id: I71f933f224c2de5f7a68feab904a2fe0b81e1362
add simplelist_setline() to allow literal strings or owner buffer
to be shown in the simplelist
this makes simplelist more versatile by allowing static strings
to be added directly instead of copying into the simplelist buffer
(ie not consuming the simplelist text buffer)
add bounds checking to simplelist_setline/addline
No one has more than SIMPLELIST_MAX_LINES.. right?
-- there are actually a few places this isn't checked..
use new setline function in debug menu
share the simplelist buffer with the list_draw fn for gui_synclist
since they shouldn't be in-use simultaneously we can save some stack
Change-Id: I4a1e64d3a621d326ff094241da55452c0ff746ba
This is a preparation to introduce support for the following SoC models: S5L8720 (iPod Nano 4G, iPod Touch 2G), S5L8730 (iPod Nano 5G), S5L8723 (iPod Nano 6G) and S5L8740 (iPod Nano 7G)
The whole family consists of SoCs which are similar, running ARMv6 and Thumb2 instructions, but some peripherals are located at a different address.
No functional change is to be expected so far.
Change-Id: If1f7669c49cf110ccc52c5234cc42ffd6f2b4e80
The 'll' printf modifier is currently broken. Fortunately all but
one of the uses is printing MB instead of bytes, which means we can
cast the value to a 'unsigned long' without risk of overflow/wraps.
...There's one remaining use ('%llx') which still needs to be sorted
out.
Change-Id: I89f406f6c085be153531d1ec1f2a314ae172b129
....It's specified in 16-bit words, not bytes. So multiply it by 2.
(This hasn't been a problem in practice as everything uses 512B logical
sectors so far..)
Change-Id: I0b1abd0f6184330f0b7f5c000c5ad547038f7c95
* FLUSH_EXT is used if featureflag is set and we are using LBA48
(unconditionally used for CE-ATA on ipod6g)
* FLUSH is used if featureflag is set (ATA6+) or if device claims to be ATA5+
* Rename ata_disk_can_power_off() to ata_disk_can_sleep() as that is
what it actually tests for. Only use it to gate issuing the
STANDBY IMMEDIATE command.
* Restore behavior of ata_disk_is_active() to return 1 if drive is
"spinning" or powered up.
* Allow poweroff if drive claims PM support OR we are able to issue
FLUSH/FLUSH_EXT commands.
* Added ata_flush() to explicitly trigger a flush operation, and hook it
up to storage_flush() in the device shutdown path. (Flushes were
only previously used in the storage device power management path)
* After issuing all settings, re-issue IDENTIFY_DEVICE to make sure
it reflects everything we've enabled.
* Update manual section on Flash/SSD mods.
Change-Id: I6770a54ef3a87f4c47120bcb96c944a6652f1bf4
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
And fix up all the problems I've found so far.
...This will undoubtedly introduce a pile of new warnings.
Change-Id: I868de507a0e9790f289676c198e2977c26755f22
* 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
- decrease max entries to the required minimum
- merge two info lines
- fix value in too many entries error message
Change-Id: I72eeca5dd9c7c2fbb4978d0972d4db532dfa901e
* 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
Allow the database path to be set from the file browser's
"Set As" context menu, so it can be changed without editing
the .cfg file by hand.
Change-Id: Ie1a84bcb2084ee3b1a0a18cc51f564238515f164
v1 passes the drive and partition number of the boot volume
instead of using the volume number. The volume number isn't
reliable because the same filesystem might get a different
volume number once the firmware is loaded, which will cause
the firmware to use the wrong root volume and fail to locate
the correct .rockbox directory.
Using drive and partition numbers avoids this issue because
drive numbering is fixed and determined by the target.
Change-Id: I7e68b892d9424a1f686197a6122e139b438e5f7e
Instead of verifying the CRC before every access of the boot data,
verify the CRC once at startup and set a flag to indicate the boot
data is valid.
Also add a framework to support multiple boot protocol versions.
Firmware declares the maximum supported protocol version using a
version byte in the boot data header. The bootloader chooses the
highest version supported by it and the firmware when deciding
what boot protocol to use.
Change-Id: I810194625dc0833f026d2a23b8d64ed467fa6aca
fixes some of the places where SYS EVENTS cause issues with action switches
that don't have handling for system events
more exist..
Change-Id: Ie6f4b05ed7ef1119d43e65ee49be8f754af83f52
Gate buflib_get_data() checking, debug printing, and buflib
integrity checks behind individual defines in buflib.h, and
turn them all off by default. If needed, they can be turned
on manually when compiling.
The buflib debug menu is only available if debug printing is
enabled, so after this commit it will no longer be included
in normal builds -- it isn't very useful to end users.
Change-Id: Iab25b7852bc7c5592ce04c9c45762046a87d5bc3
Amachronic raised concern about open() blocking causing a static buf
to get overwritten in multiple calls its prudent to just have the caller
supply the buffer to minimize stack issues later
Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a