* Don't stop clock before switching speeds
* Don't stop clock prior to transactions
* Stop clock at the end of transactions
Will result in slightly better performance and some power saving when
we're not actively using the SD peripheral.
Change-Id: I1c82476cad97137b1469900645ecf7bb0887119a
* Check to see if clock is [not] running prior to [en|dis]abling it
* Stop clock _prior_ to resetting controller
* Stop clock after transaction is completed, not before initiating it
* Use controller's low power mode (disables clocks when idle)
* Fix, and enable, interrupt-driven DMA transfers
* Fixes for full interrupt-driven operation (WIP, still broken)
Change-Id: I723ffa6450fc85f97898c8a8b3e538ae31c4858e
There's a code path that calls sd_init_device() while we hold sd_mtx, but
sd_init_device() tries to obtain the mutex while doing its work.
Change-Id: I882c595e9e7cd2224b1db0d413925668628476e9
* Allows both SD interfaces to have requests in flight simultaneously
* Fixed a deadlock in the hotswap code
* Ensure TX DMA is idle before initiating a request (bug due to a typo)
Change-Id: I988fa29df5f8e41fc6bbdcc517db89842003b34d
Firmware now includes rudimentary redirect functionality
but this only supports /.rockbox in the root of the device
This patch allows loading external drive and directory into root namespace
Root Redirects can now be put into different folders
For instance placing '/_test' into SD1/rockbox_main.<playername>
will redirect to /<1>/_test/.rockbox
Debug menu>Bootdata now has root directory listed in addition to RAW Bootdata
Redirect root work from Michael Sevakis g#1556
Redirect will be updated if code refactor is ever done
Requires Multiboot bootloader (already in main)
Change-Id: I697b3d0499f85e789c3020bc2133fbe0023f72a2
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.
Defaults are in export/rbpaths.h
It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.
Change-Id: I90b5c0a1c949283d3102c16734b0b6ac73901a30
(More specifically, use the SoC's "OS Timer", slaved to the main XTAL so
it doesn't matter how the main CPU is clocked)
Change-Id: I799561ac823ff7f659a05144cf03b6a13d57ea7b
PLL1 clock for those frequencies has been dropped from 508 to 169.5 MHz,
so it's still a respectable reduction.
(I'm not sure how/why it ever worked with the XTAL source, but it did,
and was off by an audible amount)
Change-Id: I614d87e7dfdfe9210702b9c646d3863c06d6780b
I never added multiboot awareness to ROLO
When a new firmware file was loaded [Bootdata] would not be
copied to the new instance resulting in the firmware
running off the internal drive till next reboot
Bootloaders shares the rb-loader code but should not be
affected by the removal of static from write_bootdata()
Change-Id: Iccb18eebeee5c59f9534df51eb6826876c441762
* for <= 48KHz, BCLK must be 256*freq (ie bdiv = 4)
* for <= 96KHz, BCLK must be 128*freq (ie bdiv = 2)
* for 11/22/44/88 KHz, disable PLL1 and run off XTAL
* cut PLL1 with 12/24/48/98 KHz audio from 516->86MHz
* cut PLL1 with 8/16/32/64 KHz audio from 426->106.5MHz
This should result in significant power savings for
common 44.1KHz audio playback, and pretty good savings
for everything else.
As an added bonus:
* enable de-emphasis filters at 32, 44.1, and 48 KHz
Change-Id: Ie59067cd46c47e62abf4a32c53519efad104d6c8
default/low speed is 192 MHz, Max is 576
Downclock PCLK/MCLK/etc to 96MHz to save a bit of juice
Honestly the high speed could be dialed down to, eg 384
as this thing is so bloody fast..
Change-Id: Ie65597c74290f1603e65f69dae8e75b59c8ba0b4
PLL0 Needs to be a multiple of 48MHz for sane USB operation!
(Indeed, "typical" clock for this part is 528, but that seems a
waste of power)
Also fixes a minor bugaboo in the jz4670 usb divisor calculation
that won't matter until we enable reclocking
Change-Id: I40b1fd1ae48871e50885981ccc8b01feb711b9a5
Allow IPod 3rd generation to recognize when USB is connected and reboot into disk mode.
This problem is listed at the bottom of the Ipod status page https://www.rockbox.org/wiki/IpodStatus
Change-Id: I8f32afd065d3a91cddc56fe63454bd082bfa29b9
Note: I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.
Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.
Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
HAVE_LCD_BITMAP is now redundant.
lcd_bitmap is always-on in features.txt so manual and lang strings
don't have to change
Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
If we come up and the RTC is in a reset state, we need to release that
before trying to initialze anything else. (See IMX23RM 23.8.1 and 39.3.10)
Change-Id: I1820ab771ba81f7d428d07040b7d188d9f688127
Main/IRQ from: 7.5/0.75 to: 7.25/1.0
With the reduction of the opus codec stack usage, giving the IRQ stack
some additional breathing room is now possible.
Change-Id: Id0cd3747fcaab70e2360667ac8c1a97ba7234ccf
when buflib_init is called with a buffer smaller than
sizeof(union buflib_data); size will be zero
Later when the alloc fails buflib will keep try to free items
in order to satisify the request this crashes in the sim
I suspect this behavior holds true on device as well
but I havent verified this as of yet.
patch adds minimal overhead to the buflib and panics when the size is too small
Change-Id: I46e510367fc1cac19ce01ee6f92d8cf0d65ef914
The FC-1307 CF->SD converter that is the basis of a lot of ATA->CF
devices (including several iflash iFlash models) claims to not support
ATA power management commands.
Rockbox unconditionally issues those commands as support is mandated by
the ATA spec. This patch checks the capability bit, and if it's not
supported, does not attempt to put the ATA subsystem to sleep.
It is not clear if the problems lie with the SLEEP commands or the wakeup
process, but who knows where else the FC1307 violates the ATA specs, and
reliability is much more important than power savings.
Change-Id: I8b539c579d0449a8a3cfa63cdd1387db990fe820
The "try to mount as superfloppy" fails with some partitioning layouts
because sector 0 can have a mostly-valid FAT32 signature. However, in
all dumps I've looked at, sector 0's fsinfo offset value points at a place
which lacks the fsinfo signature.
Resolves FS#13213, no known regressions.
Change-Id: Ib323d35cca6ca54e11aca6ba77041bf33a05a277
This was broken when the major update to iap was comitted.
ia-lingo7.c created and various iap related files modified.
On 4G, 6G and Nano 1/2Gen iPods the remote will function
even though the radio won't.
Tested on 4G Greyscale, 4G Color, 4G Photo, 4G Mini 1st Gen,
4G Mini 2Gen, Nano 1G, Nano 2G, Video 5G, Video 5.5G
Change-Id: Ia74e3d07d9ab5edc6da8eafa96801ede722be331
Linux offers the high-level i2c-dev driver to directly access the
i2c bus(ses) on the system. This system device is used to get rid
of the (rather silly) radio chip kernel module for ypr0 target and
correctly enables radio access also for the ypr1 target.
fm-radio chip is located on i2c-0 bus on the ypr0 target while it
is located on i2c-1 bus on the ypr1 target.
Power-up (RST) pin is also handled for both targets, which is wired
to another GPIO of the i.MX 37 platform.
Additionally, this patch simplifies the RDS low-level handling by
exploiting the Si4709 debug interface which comes with a mutex
protection as free bonus.
Change-Id: I839282bec4a27ad0ad8403c5a8dd86963b77e1bf
For reasons that are still unclear, the 'ncbss' region was overlapping
the "audiobuffer" when linked with 2.21, but okay with 2.20.
Fixed it by making the audiobuffer explcitly use the current position
instead of relying on it being implicit.
With this change, portalplayer-based targets generate working binaries
when built with binutils 2.21 or newer.
This bug also theoretically affects imx233/imx31 targets as they
also have NOCACHE_BASE games in their linker scripts, but I lack
access to one to test with.
Change-Id: Idb38ab20f03599b9ed3d4bc0eafe519f38677438
This appears to solve _some_ of the crashes experienced when using
gcc494 on the multicore PP targets (eg most older ipods).
(With this change, the asm vs plain-C versions behave identically)
corelock_lock(), corelock_unlock(), and corelock_trylock() were declared
with the 'naked' attribute. However, naked functions are only allowed
to have 'Basic Asm' components, and we used some extended asm, but
without declaring clobbered registers, making assumptions about register
arguments, and also directly returned to the caller via asm code.
This is what the GCC docs have to say about this stuff:
"While using extended asm or a mixture of basic asm and C code may
appear to work, they cannot be depended upon to work reliably and are
not supported."
Change-Id: I79a9c4895584f9af365e6c2387595e9c45d89c7d
This allows for a superfloppy that has MBR-like data in the BPB.
this solves FS#12294 while allowing arbitrary partition types.
Change-Id: I53880fe7dd53e5015f5f15be0ddba11105fcd778
If we aren't going to check for the partition type, we don't need the array of
known FAT partition types.
Original Author: Torne Wuff <torne@wolfpuppy.org.uk>
Change-Id: I558d4287189408c513dfbca49e13906cdb7918b1
Instead of only mounting partitions with a FAT partition type, try any
partition that isn't type 0 (unallocated) or 5 (extended). This makes it easier
to reformat SDXC cards which have the exFAT partition type, and also brings us
in line with pretty much every other OS at this point. Anything with a
valid-looking FAT superblock will get mounted.
original author: Torne Wuff <torne@wolfpuppy.org.uk>
Change-Id: I3ea8d437a79f9da270f9d119cc670e472331a9da
On some devices, the button driver allows a "software poweroff" by long-
pressing a certain key. This behavior is inconvnient when that button needs
to be held down for other purposes, such as moving the cursor in rockpaint
or sgt-untangle.
This patch allows selectively disabling the software poweroff (enabled by
default) from both core and plugin code.
Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
Loop terminator needed a preincrement rather than postincrement, and
also used a proper #define instead of a magic number.
Change-Id: Iafd6a0dce0304cb94e4f1d04cce46d2ca603507a
User reported LCD screen corruption via forum in 3.14 and 3.15
turning backlight off and back on seems to fix the issue
http://forums.rockbox.org/index.php/topic,53192.0.html
Change-Id: Id0b34d2f9b77e79ab0ecabace331f0b203184724
No targets are enabled, but the hosted Hiby-based targets could have this
feature enabled if they weren't so buggy:
* No generic way to determine wakeup reason under Linux
* No generic way to be asynchronously notified if the alarm is
triggered when we're already awake
* Shutting down may clobber RTC wakeup (driver/etc dependent)
* Rocker's kernel's RTC driver has some 24h clock and timezone-related
issues.
So, the infrastructure is arguably useful, but the only applicable
hardware I have is pathologically brain-dead.
Change-Id: Ie1aa38e72b831c8a0695ff684f260e514eef9710
Only AGPTeck Rocker is enabled for now, and it doesn't work properly:
* No generic way to determine wakeup reason under Linux
* No generic way to be asynchronously notified if the alarm is
triggered when we're already awake
* Shutting down may clobber RTC wakeup (driver/etc dependent)
And finally:
* AGPTek kernel's RTC driver has some 24h clock and
some timezone-related issues.
So, the infrastructure is arguably useful, but the only applicable
hardware I have is pathologically brain-dead.
Change-Id: Iac6a26a9b6e4efec5d0b3030b87f456eb23fc01d
Once some missing power optimization stuff was added to the X3ii code,
they were completely identical.
Change-Id: I68e4db5e270e8ff22f91e521616a054bd7baa95d
On file systems with 2048 bytes per cluster, the bpb_secperclus value
gets multiplied by 4 when the meta data is loaded. This patch changes
the sanity check to consider (and reverse) that multiplication before
checking the cluster size.
Signed-off-by: Stefan Ott <stefan@ott.net>
Provided by Roman Stolyarov
Integration, Refactoring, and Upstreaming by Solomon Peachy
X3II confirmed working by forum tester, X20 is nearly identical.
This includes bootloader, main firmware, and the flash image patcher.
Eventual Todo:
* Further refactor AGPTek Rocker & xduoo hiby bootloaders
* Further refactor AGPTek Rocker & xduoo hosted platform code
Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
For some reason it was defined as 'unsigned short' but all arguments to
the threading functions and other structs used size_t. The SDL plugin
tried to allocate a 2MB stack and this resulted in much badness.
This is a _very_ old bug, and might be responsible for countless subtle
bugs!
Change-Id: I8b7fd79a10c21e3ab524a89b4d40d9afa4fab638
The pp502x cache init code tries to flush the cache by reading
a block of DRAM. Change the starting point from 0x0 to 0x1000
so the compiler doesn't helpfully insert an undefined instruction
to deliberately crash the target.
(This behavior is intentional on the part of GCC, and was triggered
by using -Os with my experimental 4.9.4 toolchain)
Change-Id: I2d2719615a1164a035f3dac8a56dd3737bbab1d5
Stop gap till I get a chance to work on the root folder stuff
Makes whatever volume marked by bootdata.boot_volume
the base or root volume, mounts all other volumes after
the specified boot volume.
Has the effect of swapping the SD card to the slot for internal
and Internal storage is mounted as the Sd-card.
Does not honor root redirect -- uses .rockbox folder in the root of boot volume
Change-Id: I0f786aa0c8721e21cba607366775be3e3c0cf474
on timer_unregister callbacks are not removed
It seems (at least on the Rocker) timers continue to fire (for a bit??)
Now we store the registered callback in the sigev structure and check
that the callback matches the one registered when the timer is created.
This should stop the possible case of a new timer getting spurious callbacks
We also now NULL the callbacks on un-register which should stop the segfaults
Added some notes to timer.c and timer.h
Change-Id: Ia155c3a4e4af89f474d55ed845560ccc1fab85aa
7442742 ("iPod Classic: disable IRAM1") was causing subsequent ipod6g
bootloader builds to result in a completely black screen upon
installation, with recovery only possible with a reflash through DFU
mode.
IRAM1 is re-enabled for bootloader only.
Change-Id: I92d489c91f81cad55d66a8647c1e61a45f468770
Gives us the lowest HW sample rate that's >= 22KHz.
Needed because some targets that don't support 22K support 11K or 8K, so
HW_SAMPR_MIN will give us much lower quality than is acceptable.
Take advantage of this new macro in the SDL, MIDI, and MIKMOD plugins,
and implement a crude "fast enough" test to enable higher sample rates
on more capable targets.
Change-Id: I6ad38026fb3410c62da028e78512e027729bb851
The screen content is only poorly visible without backlight, it's not
really usable this way.
Removing HAVE_TRANSFLECTIVE_LCD also fixes the "flashing screen"
issue that appeared on some models when "lcd_awake()" is called.
Change-Id: I3ba954c944077a32016820462f782dc27a31f8d8
This reverts commit a89bf68e88.
HAVE_MULTIVOLUME && HAVE_MULTIDRIVE implicitly means "allow 4 volumes
per drive" whereas the normal MULTIDRIVE behavior is to only allow 1
volume per drive.
Addition of rtc support for AGPtEK ROCKER broke building the UI Simulator
for Windows. This patch removes the rtc support if building UI Simulator for
Windows.
Remove dependency on settings.g for bootloader
ifdef out AUDIOHW_HAVE_EQ Settings these should be indexing the
global_settings.hw_eq_bands[AUDIOHW_EQ_BAND_NUM] struct
Change-Id: I1d1a8556ef88ce43397b600261696dacdf372034
Adds:
sound_current(int setting)
returns the current sound setting from global_settings
complements sound_max, sound_min and sound_default
Change-Id: I35bd893753c958f808492906fe533edc51d5d57c
The Quake plugin is the only code that actually relies on float
formatting. Because Quake only runs on targets with huge memory
anyway, limiting their formatting to just those targets will minimize
the increased memory use in the core.
Change-Id: Icdbe26ec6ede564861cc01ac4add76a12b00ecd5
Wanted to see how gnarly it is to do.
Big number handling could be done with better algorithms
since it can get a bit slow with large integers or tiny
fractions with many lead zeros when only a few digits are
needed.
Anyway, it supports %e, %E, %f, %F, %g and %G. No %a or long
double support seems warranted at the moment.
Assumes IEEE 754 double format but it's laid out to be able to
replace a function to handle others if needed.
Tested in a driver program that has a duplicate vuprintf and
the content was pasted in once it looked sound enough to put
up a patch.
Change-Id: I6dae8624d3208e644c88e36e6a17d8fc9144f988
For unknown reasons, -thumb builds need -lfirmware after -lrbcodec (but
still before -lunwarminder)i. Other builds are still happy if we do that.
Including it via CORE_LIBS instead of explicitly achieves that.
Change-Id: Id69e4a0c042f90f71cfd9a72202ce4d8ef6a4181
The bug was introduced in a06d9c8.
The patch also fixes some (more or less) related obsolete comments.
Change-Id: I5e491d64574c37cdbc46b146d7cfc555d86b9a11
This greatly increases the stability of SD card write operations.
(I suspect the underlying problem is not IRQ operation itself, instead
being exacerbated by it..)
Change-Id: Ia00f0656abd4b3cb0b1b5fc9db7c1b6a02847956
This is one of those fancy gold-plated devices. Of course it breaks my scripts
that were nicely expecting every device to start with NW.
Change-Id: I161320f620f65f4f92c2650d192b26a9831eeb9d
This should be done even if the backlight is set to "always off",
i.e. if the LCD is sleeping, a button press should be "eaten"
and just wake up the LCD.
Change-Id: I3946bdbbdc81f23eae3f47423123cefa275e0afc
This patch simulates the three possible states of a transflective
LCD: backlight on (bright screen as usual), backlight off (dimmed
screen) and LCD off (black screen).
Makes use of already defined 'BACKLIGHT_OFF_ALPHA'.
Change-Id: I9b0fc79b8d50c29e024ba1e6d9c2501119a7e0e0
This patch is relevant for targets with a transflective display.
If the backlight was set to "always off" (e.g. to use the lcd
in a pure passive way), and the sleep timer ran off, the LCD
would stay disabled and didn't wake up when a button is pressed.
Change-Id: I0a157c7f421d9fc4c7d8ba903f2cf93f6cef51d0
This allows targets to automatically switch audio settings when the
line out is plugged/unplugged.
Only hooked up on the xDuoo X3, but there are other potential users.
Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
New amounts:
7.50K main stack
0.75K irq stack
Prior values of 8K+1K overflowed IRAM by ~660 bytes on Onda 7x7 targets,
but worked on the xDuoo X3.
(The discrepancy is due to the Onda targets having more LCD code shoved
into IRAM.)
Change-Id: I16fcfae3c5f3e36db688dfa9167b620584e79df8
Original patch by Alexander Spyridakis
Modified by Steve Bavin and Igor Poretsky
Keymap fixes by Marianne Arnold
Change-Id: I5a252d97d2b05c533e048931f7354f4261f76499
Patch taken from Igor Poretsky's tree.
Original clip-radio-tick.patch modified to acts only when screen is
deemed, or when recording, in order to preserve indicators
functionality.
Change-Id: I62afb24a0dad7ad2ecc9272c24810b37f032408d
Unifies time formatting in settings_list.c allows time format to
display as HH:MM:SS.MSS or any consecutive combination thereof
(hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss)
works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING'
Time is auto-ranged dependent on value
Adds talk_time_intervals to allow time values to be spoken similar to
display format: x Hours, x Minutes, x Seconds, x Milliseconds
Table lookups merged or removed from recording, clip meter and lcd timeout
-String_Choice replaced with TABLE_SETTING or INT_SETTING for these
functions as well, cleaned-up cfg_vals that get saved to cfgfile
RTL Languages ARE supported
Negative values ARE supported
Backlight on/off are now Always and Never to share formatter with LCD
Timeout
Added flag to allow ranged units to be locked to a minimum index
Added flag to allow leading zero to be supressed from the largest unit
merged talk_time_unit() and talk_time_intervals()
optimized time_split()
optimized format_time_auto()
Backlight time-out list same as original
Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
__builtin found fix for rbendian.h
tools/configure defines SIM_USE_BYTESWAP_H if byteswap.h is found in
/usr/include/ maybe there is a better mechanism for this
Change-Id: I4d004e68313e8b32aa5587582be36bc459fdaf6b
__builtin found fix for rbendian.h
tools/configure defines SIM_USE_BYTESWAP_H if byteswap.h is found in
/usr/include/ maybe there is a better mechanism for this
genshortcut.sh is a simple script to make .desktop shortcut files
several newer distros don't allow you to run the simulator from the
file manager, this or perhaps a different method can probably be
included while building a sim at a later date.
for now it can be run manually like so:
similar to ../tools/configure
run from your simulator folder
../tools/genshortcut.sh exepath shortname icon
ex. ../tools/genshortcut.sh ./rockboxui clip+sim music-app
Change-Id: Ia05d3a9349b27c5968a4a7a68b2eb480e60faec3
when precision is not specified memchr recieved -1 for count
count is unsigned so it looks in a potentially very large area
for a terminator and returns this whole area if \0 is not found
Instead we should use memchr when precision is specified
and if precision is not specified use strlen
Fixes 60+Mb Config.cfg files
Change-Id: Ic4d1439334588f999c9071235430c42df2af5cc4
is_diacritic is used for pretty much all of the text display sizing
Timing here matters, so important it uses a
priority buffer in order to cut down on searching the database.
This patch is verified functionally equlivalent but
saves 80 bytes and is ~20% faster for the clip+ I tested it on
Several things were done:
Optimizing the copy loop for the priority buffer
Globbing some operations together
but the main one has to do with the database structure its self
--
Rather than a bit packed struct it combines the lower 8 bytes into
one value [info] and uses flags to access the values instead
Change-Id: I475073419b647639ef1eeaa3b9213e4e1067c0db