Commit graph

495 commits

Author SHA1 Message Date
Solomon Peachy
f4bf27c26e jz4760: fix the new udelay() to use _micro_seconds, not milliseconds
Change-Id: I4877b1c8e4a95259b5ade126e28458b65fbd3c4b
2020-08-26 11:56:04 -04:00
Solomon Peachy
f791df1375 xduoox3: Update battery discharge curve and runtime estimates
(Brand new unit lasted one minute shy of 12 hours!)

Change-Id: I0330f43065412d432a45b555bb310f943eb526e7
2020-08-26 08:34:07 -04:00
Solomon Peachy
6920c089af jz4740: SD clock sequencing changes.
* 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
2020-08-25 14:01:44 -04:00
Solomon Peachy
0aa2197d93 jz4760: SD driver enhancements:
* 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
2020-08-25 12:07:50 -04:00
Solomon Peachy
1b31101fdd jz4740: Fix potential deadlock in SD init code.
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
2020-08-25 08:19:10 -04:00
Solomon Peachy
63ef81de31 jz4760: Give each SD interface its own DMA channel, semaphore, and mutex
* 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
2020-08-25 12:16:33 +00:00
Solomon Peachy
a9ac2d0ba3 jz4760: Use HW timer for more a more accurate udelay()
(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
2020-08-12 23:03:33 -04:00
Solomon Peachy
08c4b708ae jz4760: Move 11/22/44/88KHz back onto the PLL
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
2020-08-08 22:29:29 -04:00
Solomon Peachy
b3a0187416 jz4760: Major clocking improvements for audio PLL
* 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
2020-08-07 15:55:31 -04:00
Solomon Peachy
eb0e41c1cc jz4760: Support dynamic reclocking!
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
2020-08-07 11:42:45 -04:00
Solomon Peachy
62146ed735 jz4760: Fixes in PLL calculation and reporting
Change-Id: I890c661fbff549de5a224d90e3fbda34c71b3a7e
2020-08-07 11:42:45 -04:00
Solomon Peachy
e0bb30a1bd xduoox3: Set PLL0 to 480MHz, not 492.
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
2020-08-07 03:44:01 +00:00
Solomon Peachy
f554c78734 jz4760: Don't enable PLL1 until we need audio.
Change-Id: I6320ee9ac809da93c80e571d45f01e22c5bd1c40
2020-08-07 03:43:43 +00:00
Solomon Peachy
7ab063a157 jz7460: debugging improvements
Change-Id: Ie03609ebe8bff51eed26e3781fe2b8663cc49e3a
2020-08-07 03:43:43 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
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
2020-07-24 21:20:13 +00:00
Solomon Peachy
c54170e8f6 mips: Adjust stack sizes
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
2020-07-15 11:43:39 -04:00
Solomon Peachy
83963fcb15 XduooX3: Uncomment code that prevented hotswap from working.
Change-Id: I5efec00e60aacf05166407ad43b9d63340e18967
2019-07-29 11:14:41 -04:00
Solomon Peachy
1e076a7be8 jz7460: Disable IRQ-driven DMA transfers.
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
2019-06-02 13:09:19 +02:00
Solomon Peachy
d24edc605b Add HAVE_LINEOUT_DETECTION and associated logic
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
2019-01-04 23:52:42 +01:00
Solomon Peachy
52ed74aad0 mips: Adjust main & irq stack sizes to fit in IRAM on all targets
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
2019-01-02 19:52:05 -05:00
Solomon Peachy
36a50dd00f mips: Use a separate IRQ stack & optimize IRQ handling a little
Should prevent the IRQ-related stack overflows seen on MIPS targets.

Change-Id: I447336ef3fe37e11b3276a78ba220ce64c2f87f5
2019-01-02 23:30:04 +01:00
Solomon Peachy
7e7ca0c858 Fix Xduoo X3 bootloader build, and silence all warnings.
Also enable USB bootloader mode

Change-Id: I73224c2e694b9941993c89a114b48d2a907e0dfb
2019-01-02 05:01:50 +01:00
Solomon Peachy
d2cef81bba mips: fix some compile warnings.
Change-Id: Ia5e83702313c1c184480290d3b0e6a66f01b7277
2018-10-09 22:35:37 -04:00
Solomon Peachy
71abdf5d82 mips: jz4740: JZ4740 does not have a MSC clock source select.
Change-Id: Ic2af37d92bcb8b6b35684f113eb8e392fc2eb609
2018-10-09 11:37:43 -04:00
Solomon Peachy
a454b7f9ef jz4760: Lots of stability fixes to the USB driver.
It actually works for transferring data now!

Igor Poretsky gets full credit for this patch.

Change-Id: I247c70fdf45e590b4699b9b8668bbdab7bc3ef03
2018-09-20 21:11:40 -04:00
Solomon Peachy
a26c1c1459 xduoo_x3: Disable keypress IRQ since we poll for keypresses.
Change-Id: Ieab5f864751cf798b62c4e89e670acf7ade756ab
2018-09-20 19:38:58 -04:00
Solomon Peachy
640ada0389 jz4760: Enhancements and fixes to SD driver.
* Fully Interrupt-driven, with proper task yielding
 * Much more robust error handling
 * Eliminate duplicate code
 * Pile of bugfixes

 (Much of this adapted from Igor Poretsky's tree)

Change-Id: I46006412323cba2088b70094635d62a241be1d7e
2018-09-20 19:38:25 -04:00
Solomon Peachy
8edf4052c7 jz7460: Silence codec when changing playback frequency/mode
Silences some annoying clicks.

Change-Id: I3d32d4b33c0ccc61877e10f5af97fe05084d66e5
2018-09-20 18:59:19 -04:00
Solomon Peachy
1020897794 jz7640: SD driver improvements:
* Better multidrive support
 * Common slot1/slot2 handling code

Change-Id: Id0aed90cbba4246fdc71b42e03f016f8060d258a
2018-09-20 18:59:19 -04:00
Solomon Peachy
679a0bd193 jz74x0: MSC clock needs to be divided from PLL clock.
Change-Id: I0cf2f0d55e0859f896afef289e833935d7c5a599
2018-09-20 18:59:19 -04:00
Solomon Peachy
72820d8b2d jz4760: Greatly enhance debug code and silence some compilation warnings.
Change-Id: I1746d67c818ad099edea83e6242ffd5c79be0000
2018-09-20 18:59:19 -04:00
Solomon Peachy
0662793ca0 Add cleaned-up xDuoo X3 support
Cleaned up, rebased, and forward-ported from the xvortex fork.

(original credit to vsoftster@gmail.com)

Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
2018-07-28 10:56:31 -04:00
Michael Sevakis
e4a46c8d88 Fix a few missed things in 16454efc (and hopefully clear the red).
Change-Id: I2ce88e4c41e6e08efbfbdf261122318dfb0f8b0f
2017-10-26 16:32:53 -04:00
Michael Sevakis
1654efc313 Unify storage threads into one
* Editing a bunch of drivers' thread routines in order to
implement a new feature is tedious.

* No matter the number of storage drivers, they share one thread.
No extra threads needed for CONFIG_STORAGE_MULTI.

* Each has an event callback called by the storage thread.

* A default callback is provided to fake sleeping in order to
trigger idle callbacks. It could also do other default processing.
Changes to it will be part of driver code without editing each
one.

* Drivers may sleep and wake as they please as long as they give
a low pulse on their storage bit to ask to go into sleep mode.
Idle callback is called on its behalf and driver immediately put
into sleep mode.

* Drivers may indicate they are to continue receiving events in
USB mode, otherwise they receve nothing until disconnect (they
do receive SYS_USB_DISCONNECTED no matter what).

* Rework a few things to keep the callback implementation sane
and maintainable. ata.c was dreadful with all those bools; make
it a state machine and easier to follow. Remove last_user_activity;
it has no purpose that isn't served by keeping the disk active
through last_disk_activity instead.

* Even-out stack sizes partly because of a lack of a decent place
to define them by driver or SoC or whatever; it doesn't seem too
critical to do that anyway. Many are simply too large while at
least one isn't really adequate. They may be individually
overridden if necessary (figure out where). The thread uses the
greatest size demanded. Newer file code is much more frugal with
stack space. I barely see use crack 50% after idle callbacks
(usually mid-40s). Card insert/eject doesn't demand much.

* No forcing of idle callbacks. If it isn't necessary for one or
more non-disk storage types, it really isn't any more necessary for
disk storage. Besides, it makes the whole thing easier to implement.

Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-26 14:35:41 -04:00
Marcin Bukat
9ffd9327e3 Fix red/yellow
Change-Id: Ie01251af2cd843979b5fdefcfa541ba377d13bd7
2015-01-12 12:02:24 +01:00
Marcin Bukat
89ba7e818c Get rid of stupid _backlight_* function names
_remote_backlight_* and _buttonlight_* are cleaned as well

Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2015-01-12 11:09:27 +01:00
Michael Sevakis
7d1a47cf13 Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.

Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.

Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.

Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.

2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.

3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.

4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.

Key core changes:
1) Files and directories share core code and data structures.

2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).

3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.

4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".

5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.

6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).

Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:

1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).

2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.

3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.

4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.

5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.

Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.

2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.

3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).

4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).

5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).

Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.

To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.

2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.

Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-08-30 03:48:23 +02:00
Marcin Bukat
2f21f77ade ingenic: crt0.S fixes #3
Hopefyly this time is the final one.

Change-Id: I386964f407ca98499e9a482507e4d5dfa02ee891
2014-03-04 10:28:02 +01:00
Marcin Bukat
7066197ccc ingenic: fix bugs introduced by 5900bf7
I must have been blind and copied some intermediate file
instead of final version. No functional change, only fixes.

Change-Id: Icaa868225517662c88f8492b1f04808407853361
2014-03-04 10:24:43 +01:00
Marcin Bukat
5900bf7315 ingenic: Tweak a few details in crt0.S
1) Avoid load/store delay slot by reorganizing instructions
   in copy loops
2) Fix off-by-one error in cache initialization code.
   This was harmless as it simply set line0 twice, now it sets
   every cacheline only once.
3) Fix off-by-word error in .bss clearing loop.
   The addiu in branch delay slot even if calculated is not seen
   by the branch instruction itself, so the code did one word
   too much in clearing.
4) Fix off-by-word error in deadbeefing stack.
   See above.

Change-Id: Iabb09a55979de7aa2e2b9234273683fc7e9762c5
2014-03-03 13:21:32 +01:00
Jean-Louis Biasini
df6eb82f51 touch devices: Disable touch on softlock.
Target that have a touchpad/touchscreen should disable it while
being locked (In order to avoid LCD to drain battery power due to
"key locked" constant reporting messages. If they a have a keylock
button this was already handled at driver level. If not (e.g. fuze+),
they will have to implement a switch at driver level that action.c
can operate on softlock.
This patch does the following for any target having a touchpad
or a touchscreen and no HAS_BUTTON_HOLD (ie any softlock target)
1) it implements the code to call button_enable_touch(bool en) in
action.c.
2) button_enable_touch is implemented in button.c and call
either touchpad_enable or touchscreen_enable
3) those two function are implemented respectively in touchscreen.c
and a new touchpad.c file. They provide a generic way to silents touch's
device and call a function at driver level where target specific code
can be implemented if possible/needed (for power saving for instance).
Those function name are touchpad_enable_device and touchscreen_enable_device
4) we implement an empty function at driver level of targets that need it
to have them still being able to compiled.

Change-Id: I9ead78a25bd33466a8533f5b9f259b395cb5ce49
Reviewed-on: http://gerrit.rockbox.org/569
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-09-05 20:02:07 +02:00
Michael Sevakis
a56f1ca1ed Cleanup MV/MD macros a little.
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal
with function parameters. IF_MD/IF_MV are enough.

Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0
if not.

Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2013-08-17 12:18:22 -04:00
Michael Sevakis
e61e9c61d0 Do some cleanup, adjustment and a couple fixes to recent sound changes.
* SOUND_x enum can be generated by audiohw_settings.h along with settings
entries and sound_val2phys.

* VOLUME_MIN and VOLUME_MAX are no longer necessary within sound.c. If
you need them, they are for target-defined purposes.

* Fix up SDL volume implementation in sdl.c. Move sim volume calculation
code to pcm-sdl.c.

* Min trigger tresholds were based upon VOLUME_MIN for some reason.
These setting have nothing to do with playback volume. Since it is no
longer present, set these at -89dB which is the minimum peak meter
sensitivity setting.

* Fix an oversight in wm8758.c. I forgot to add the dB->register
conversion to audiohw_set_volume.

Change-Id: Ie1df33f1793eee75e6793f16bc7bddd16edb7f75
2013-04-22 20:38:17 -04:00
Michael Sevakis
5261b19bdf Still at it for 0c7b787. Might be done now.
Change-Id: Idf45731dc6554954747f6036dc6dfcd4b63981a1
2013-04-15 14:58:00 -04:00
Michael Sevakis
0c7b787398 Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)

Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.

Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.

Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.

Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-15 12:02:05 -04:00
Michael Sevakis
f5a5b94686 Implement universal in-PCM-driver software volume control.
Implements double-buffered volume, balance and prescaling control in
the main PCM driver when HAVE_SW_VOLUME_CONTROL is defined ensuring
that all PCM is volume controlled and level changes are low in latency.

Supports -73 to +6 dB using a 15-bit factor so that no large-integer
math is needed.

Low-level hardware drivers do not have to implement it themselves but
parameters can be changed (currently defined in pcm-internal.h) to work
best with a particular SoC or to provide different volume ranges.

Volume and prescale calls should be made in the codec driver. It should
appear as a normal hardware interface. PCM volume calls expect .1 dB
units.

Change-Id: Idf6316a64ef4fb8abcede10707e1e6c6d01d57db
Reviewed-on: http://gerrit.rockbox.org/423
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-11 22:55:16 +02:00
Marcin Bukat
027c035a4e jz4740: a few minor fixes
This was spotted while playing with qemu-jz:
1) rockbox reads TECR and TESR which are described as write-only
   registers. Datasheet doesn't mention what happens if they are
   readed. Apparently this doesn't have fatal side effects.
   It comes down to two defines from jz4740.h
   __tcu_stop_counter(n) and __tcu_start_counter(n) which use
   read-modify-write sequence.

2) rockbox accesses out of bound offset 0xd4 in DMA memspace.
   It comes from dis_irq() in system-jz4740.c. NUM_DMA is 6 but
   DMA channels are 0-5 so (irq <= IRQ_DMA_0 + NUM_DMA)) bound
   check is wrong.

This are *NOT* tested on device.

Change-Id: I29dff6a4f828030877b7d50fbcc98866478b9e3d
Reviewed-on: http://gerrit.rockbox.org/338
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Tested-by: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-03-11 08:33:18 +01:00
Rafaël Carré
7ca2081036 remove debug-target.h 2012-05-07 00:55:59 -04:00
Rafaël Carré
ed38c5d953 remove unused prototypes 2012-05-07 00:51:13 -04:00
Michael Sevakis
286a4c5caa Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording  uses "void **addr".
"const" is put in place throughout where appropriate.

Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.

Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-03-03 07:23:38 +01:00
Jonathan Gordon
b37e6bc8c1 lcd drivers: Convert lcd_[remote_]framebuffer to a pointer
Change all lcd drivers to using a pointer to the static framebuffer
instead of directly accessing the static array. This will let us
later do fun things like dynamic framebuffer sizes (RaaA) or
ability to use different buffers for different layers (dynamic
skin backdrops!)

Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2012-02-28 11:44:59 +11:00
Thomas Martitz
c94cf3b888 Move optimized ffs to firmware/asm, using the new automatic-asm-picking infrastructure.
Change-Id: I5e7bdc8be7de50ef604c16078857fff1b84650dc
2012-01-22 18:46:45 +01:00
Thomas Martitz
a035261089 Move optimized memcpy and friends and strlen to firmware/asm,
using the new automatic-asm-picking infrastructure.
2012-01-22 18:46:45 +01:00
Thomas Martitz
991ae1e395 Create fimrware/asm directory for assembly optimized stuff.
This dir is suitable for stuff that doesn't fit the target tree, e.g. because
it also builds on hosted or otherwise. It also has a generic subfolder for
fallback C implementations so that not all archs need to provide asm files.

SOURCES should only contain "foo.c" where foo.c includes the specific
<arch>/foo.c files from the subdirs using the preprocessor. This way automatic
selection of asm versions or generic C verion is possible.

For the start, the thread support files are moved, since ASM threads can
be used on hosted platforms as well. Since core_sleep() remains platform
specific it's moved to the corresponding system.h headers.

Change-Id: Iebff272f3407a6eaafeb7656ceb0ae9eca3f7cb9
2012-01-22 18:46:44 +01:00
Rafaël Carré
2737a66471 lcd-target.h: remove some duplicate declarations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31625 a1c6a512-1295-4272-9138-f99709370657
2012-01-08 00:52:55 +00:00
Rafaël Carré
7f2156661c adc-target.h: cleanup
move adc_close() prototype to adc.h
don't duplicate prototypes of adc.h
remove license header and guards for a single include of another file or for empty content

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31623 a1c6a512-1295-4272-9138-f99709370657
2012-01-08 00:39:29 +00:00
Rafaël Carré
95cf63b294 button-target.h : move prototypes to button.h
no need to define BUTTON_REMOTE anymore

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31620 a1c6a512-1295-4272-9138-f99709370657
2012-01-08 00:07:19 +00:00
Rafaël Carré
66149b454b ingenic_jz: remove ata-nand-target.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31616 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 22:11:24 +00:00
Rafaël Carré
393f427a11 dbg_hw_info(): remove duplicate prototypes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31560 a1c6a512-1295-4272-9138-f99709370657
2012-01-04 05:29:30 +00:00
Rafaël Carré
b959497670 dbg_ports(): remove duplicate prototype
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31558 a1c6a512-1295-4272-9138-f99709370657
2012-01-04 05:21:52 +00:00
Thomas Martitz
c1bd9b0361 Rework powermgmt to enable code re-use on appliation and sims.
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application)
to break powermgmt.c's assumption about the ability to read battery voltage.
There's now additionally percentage (android) and remaining time measure
(maemo). No measure at all also works (sdl app). If voltage can't be measured,
then battery_level() is king and it'll be used for power_history and runtime
estimation.

* Implement target's API in the simulator, i.e. _battery_voltage(), so it
doesn't need to implement it's own powermgmt.c and other stubs. Now
the sim behaves much more like a native target, although it still
changes the simulated battery voltage quickly,

* Other changes include include renaming battery_adc_voltage() to
_battery_voltage(), for consistency with the new target functions and
making some of the apps code aware that voltage and runtime estimation
is not always available.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2012-01-03 23:44:38 +00:00
Rafaël Carré
f016893aaa onda: remove now inlined USB_INIT_GPIO()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31500 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:50:45 +00:00
Rafaël Carré
568c441fd8 usb-target.h: remove
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31498 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:44:55 +00:00
Rafaël Carré
db9ce6dc7f onda 747/777 : move USB_STATUS_BY_EVENT to config
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31497 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:44:43 +00:00
Rafaël Carré
c721c69987 onda usb code: merge into .c file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31496 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:44:37 +00:00
Rafaël Carré
280d5844a1 usb_drv_connected() is declared in usb_drv.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31490 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:44:07 +00:00
Rafaël Carré
df09274768 move usb_pin_init() declaration to PP's system-target.h
remove duplicate usb_detect() declaration
Remove all content from empty usb-target.h files

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31488 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:43:53 +00:00
Rafaël Carré
bce42fdc31 usb_init_device(): move prototype to usb.h
Get rid of some usb-target.h files

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31487 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 18:43:41 +00:00
Boris Gjenero
b4ffcb5224 Fix red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31397 a1c6a512-1295-4272-9138-f99709370657
2011-12-21 18:08:26 +00:00
Boris Gjenero
6c97145e7d Add missing includes found using -Wmissing-declarations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31396 a1c6a512-1295-4272-9138-f99709370657
2011-12-21 18:02:50 +00:00
Boris Gjenero
ca9111ef64 Add KEEP() around vectors in linker scripts.
Vectors are needed by the CPU, but they don't need to be accessed by Rockbox.
Without the KEEP(), they can be removed when liking with --gc-sections, 
creating a broken binary without any warnings. This tells the linker to not
remove them. It should enable use of --gc-sections for all targets. When not
using --gc-sections, this does not change the binary.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31351 a1c6a512-1295-4272-9138-f99709370657
2011-12-18 06:43:08 +00:00
Michael Sevakis
6a67707b5e Commit to certain names for cache coherency APIs and discard the aliases.
Wouldn't surprise me a bit to get some non-green.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31339 a1c6a512-1295-4272-9138-f99709370657
2011-12-17 07:27:24 +00:00
Michael Sevakis
09722dd28d thread.c includes gcc_extensions.h and thread-XXX.c files are includes inside thread.c therefore do not require their own.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31206 a1c6a512-1295-4272-9138-f99709370657
2011-12-10 20:47:59 +00:00
Boris Gjenero
59e71ee80c Introduce USED_ATTR wrapper for __attribute__((used)).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31188 a1c6a512-1295-4272-9138-f99709370657
2011-12-09 15:33:59 +00:00
Michael Sevakis
4db3e89652 Shuffle some functions around so that interfacing with playback.c in particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657
2011-09-01 12:15:43 +00:00
Michael Sevakis
a2b6703a36 Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2011-06-29 06:37:04 +00:00
Marcin Bukat
dceceef052 Move dbg_hw_info() into target tree. FS#11735 by me
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29964 a1c6a512-1295-4272-9138-f99709370657
2011-06-05 10:26:06 +00:00
Michael Sevakis
12375d1d3a Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
2011-03-02 08:49:38 +00:00
Andree Buschmann
5d849a963e Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM (code), use the already defined MEMORYSIZE instead.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 17:43:32 +00:00
Maurus Cuelenaere
a6debb65fa Fix red: defined(x || y) is not valid C preprocessor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29103 a1c6a512-1295-4272-9138-f99709370657
2011-01-21 12:46:00 +00:00
Maurus Cuelenaere
476e464901 Fix Onda VX747+ LCD not working on boot
Same fix as in r29083.

Flyspray: FS#11896
Author: Purling Nayuki

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29102 a1c6a512-1295-4272-9138-f99709370657
2011-01-21 12:38:03 +00:00
Michael Sevakis
453550a687 Try to get some control over #ifdef hell in usb.c by refactoring and inline function use. SYS_USB_DISCONNECTED_ACK hasn't been doing anything useful for the USB thread; remove it. USB thread simply ignores that value. Observe only valid usb_state transitions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29084 a1c6a512-1295-4272-9138-f99709370657
2011-01-18 14:10:06 +00:00
Maurus Cuelenaere
980225c3e2 Fix Onda VX777 LCD not working on boot
This fixes an issue with some Onda VX777's where the LCD doesn't seem to be
correctly inited by the OF SPL.

Based on FS#11888 by Purling Nayuki.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29083 a1c6a512-1295-4272-9138-f99709370657
2011-01-18 12:10:09 +00:00
Maurus Cuelenaere
b787c0dd05 Onda VX767: get some facts about the state of the current LCD driver straight
* Remove wrong comment in config
* Add a note to the LCD driver stating that it isn't complete and thus non-working atm

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28558 a1c6a512-1295-4272-9138-f99709370657
2010-11-11 13:04:22 +00:00
Marcin Bukat
b8a7f5137b move dbg_ports() from apps/menu_debug.c to target tree. FS#11712 by me.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28522 a1c6a512-1295-4272-9138-f99709370657
2010-11-06 14:24:25 +00:00
Rafaël Carré
66f8fb52a9 */app.lds: remove STUBOFFSET
This is related to gdb, and gdb can only work on SH and ifp
This was mistakenly kept when app.lds was forked for each SoC
Side-effect: fix DEBUG builds when the rockbox binary is expected to
be loaded at the start of DRAM and there is no runtime relocation

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28124 a1c6a512-1295-4272-9138-f99709370657
2010-09-20 17:09:55 +00:00
Thomas Martitz
637bb2e608 Also rename cpucache_invalidate() function for mips. There's more in the target tree of mips which I have overlooked yesterday.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28057 a1c6a512-1295-4272-9138-f99709370657
2010-09-09 16:41:03 +00:00
Rafaël Carré
71b2d2811b jz4740 debug: use lcd_putsf() instead of redefining it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27934 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 23:12:04 +00:00
Thomas Martitz
3478bc5d6d mips is predefined by gcc, but we want it for paths. Don't let others fall into this trap again. Use __mips instead
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27872 a1c6a512-1295-4272-9138-f99709370657
2010-08-24 13:41:45 +00:00
Thomas Martitz
0e2286f226 Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this and a bit further cleanup in main gets rid of a warning when compiling for android.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27788 a1c6a512-1295-4272-9138-f99709370657
2010-08-12 13:38:25 +00:00
Nils Wallménius
6d732a32bc Don't duplicate byteswap code. Invent system where NEED_GENERIC_BYTESWAPS is set if the generic functions from system.h are needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27440 a1c6a512-1295-4272-9138-f99709370657
2010-07-15 22:01:06 +00:00
Nils Wallménius
74063845c0 Properly fix warning by copying the swap16 and swap32 inline functions from system.h to mips/ingenic_jz47xx/system-target.h to replace the defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27433 a1c6a512-1295-4272-9138-f99709370657
2010-07-15 17:15:20 +00:00
Frank Gevaerts
9c43b2ce17 Remove card_enable_monitoring() and use a mutex instead. The card_enable_monitoring() method actually didn't eliminate the possible race conditions it was meant to fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26627 a1c6a512-1295-4272-9138-f99709370657
2010-06-06 13:20:47 +00:00
Frank Gevaerts
a0557b23f0 remane hotswap.* to sdmmc.*. The contents have nothing at all to do with hotswapping things
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26598 a1c6a512-1295-4272-9138-f99709370657
2010-06-05 21:12:16 +00:00
Michael Sevakis
555ad6710f Threading: Split processor support code into respective target files. C files from /target/xxx are included into thread.c because of essential inlining and files are code, not declarations. Copyrights in each new file go to whoever implemented the first functional support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26479 a1c6a512-1295-4272-9138-f99709370657
2010-06-02 12:45:36 +00:00
Michael Sevakis
1f5b9434da Cleanup r26253 red and yellow.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26254 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 16:57:48 +00:00
Michael Sevakis
d56999890f Make PCM->driver interface about as simple as it will get. Registered callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 16:42:32 +00:00
Michael Sevakis
ff25b3a208 ata: do some threading-related corrections (some sync related where it matters). Make sure 'sleeping' is 'false' before the powerup sequence (throws-off powermgmt and it *is* about to woken again and powermgmt will need to compensate). Avoid looking at mutex flag directly; there's no tangible benefit I can discern and changes to the kernel that alter the meaning shouldn't be able to break anything. For that, in the jz sd driver, have sd_disk_is_active just return 'false' like all the other SD drivers do. If it *must* return this, it should implement it's own method but it seems to not matter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26234 a1c6a512-1295-4272-9138-f99709370657
2010-05-21 15:33:31 +00:00
Michael Sevakis
e73a175d6d Hopefully finish off the red from r26051.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26053 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 14:16:35 +00:00
Michael Sevakis
4d04132c76 PCM bottom layer simplification. pcm_rec_peak_addr variable no longer has to be handled there. Driver can just return current pointer for recording peaks. A new define, HAVE_PCM_REC_DMA_ADDRESS, specifies that physical addresses are being used for recording and translation is needed before starting a new block. The drivers need not worry about aligning start and size nor should care if either will be zero. All this will be checked in the logical layer first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25970 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 14:05:36 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Maurus Cuelenaere
adb506df14 Ingenic Jz4740: Use lcd_putsf() instead of lcd_puts() in exception handler
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25849 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 19:28:12 +00:00
Maurus Cuelenaere
056f608f78 Ingenic Jz4740: eliminate EP0 state machine + small cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25797 a1c6a512-1295-4272-9138-f99709370657
2010-05-03 20:36:34 +00:00
Maurus Cuelenaere
35f341464b Ingenic Jz4740: cleanup USB driver a bit (no externally visible functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25796 a1c6a512-1295-4272-9138-f99709370657
2010-05-03 19:18:10 +00:00
Rafaël Carré
f2f34881ec Remove pcm_mute() which has been unused since r19308
Remove audiohw_mute from header as well, and make this function static
to each driver (commented out when it was unused)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25733 a1c6a512-1295-4272-9138-f99709370657
2010-04-27 00:05:02 +00:00
Maurus Cuelenaere
443cba7507 Onda VX747/VX777: only enable SD clock when transferring data
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24172 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 17:32:15 +00:00
Maurus Cuelenaere
69b182dc9a Onda VX747/VX777: fix not closing I²C all times
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24171 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 17:32:11 +00:00
Maurus Cuelenaere
338b1dec5f Onda VX747/VX777: update battery charge cycle
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24170 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 16:55:18 +00:00
Maurus Cuelenaere
6acbff4673 Onda VX747/VX777: cleanup linker files a bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24169 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 16:34:56 +00:00
Maurus Cuelenaere
d3bbe51629 Onda VX747/VX777: centralise LCD clock en-/disabling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24168 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 16:28:15 +00:00
Maurus Cuelenaere
4fdf4ad728 Onda VX747/VX777: disable LCD when backlight is off (saves power)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24167 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 15:57:09 +00:00
Maurus Cuelenaere
f15e6ff061 Onda VX747: fix USB charging detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24160 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 13:07:30 +00:00
Maurus Cuelenaere
d42cdfd91c Onda VX747/VX777: fix FM radio
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24074 a1c6a512-1295-4272-9138-f99709370657
2009-12-18 12:41:12 +00:00
Maurus Cuelenaere
953f4d4acc Onda VX747(+)/VX777: update battery discharge curve
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23894 a1c6a512-1295-4272-9138-f99709370657
2009-12-08 00:20:03 +00:00
Maurus Cuelenaere
8facd57896 Ingenic Jz4740: fix CPU boosting (was reversed)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23864 a1c6a512-1295-4272-9138-f99709370657
2009-12-05 19:55:29 +00:00
Maurus Cuelenaere
972a7efcb4 Jz4740: init I²C GPIO pins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23771 a1c6a512-1295-4272-9138-f99709370657
2009-11-27 14:54:55 +00:00
Maurus Cuelenaere
507465be94 Define sd_drive_nr also when HAVE_HOTSWAP is defined (fix red).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23764 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 17:49:05 +00:00
Maurus Cuelenaere
eab70ca28c - Split off strip_volume() to a separate file
- fix some yellows

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 17:39:30 +00:00
Maurus Cuelenaere
5afb4a97c2 Fix Onda VX767
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23761 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 17:22:32 +00:00
Maurus Cuelenaere
d052ced874 Merge branch 'hotswap'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 16:57:30 +00:00
Thomas Martitz
ee7cf6c63c Remove unused card_detect(), and make card_detect_target() static inline in each sd driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23757 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 00:51:09 +00:00
Andrew Mahone
81f72ddef6 Set DRMODE_SOLID, uniform colors, and sysfont before clearing LCD to display panic or exception messages - see FS#10665.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23623 a1c6a512-1295-4272-9138-f99709370657
2009-11-14 11:27:41 +00:00
Jeffrey Goode
59dd433ccd Removed unneeded includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23578 a1c6a512-1295-4272-9138-f99709370657
2009-11-09 05:46:08 +00:00
Jeffrey Goode
9d842683eb Comment out LOGF_ENABLE defines everywhere, replace evil comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23497 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 16:25:03 +00:00
Maurus Cuelenaere
e415395c5b The Onda VX777 has only one button, add it to the keymap.
Also fix a typo that erroneously enabled button_hold in button-target.h

Flyspray: FS#10732
Author: Yann Muller

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23383 a1c6a512-1295-4272-9138-f99709370657
2009-10-28 21:16:45 +00:00
Thomas Martitz
d85c3ec410 Convert lcd_activation callbacks to use the event system to allow for multiple parallel callbacks (for custom statusbar).
Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing).
Removed corresponding functions from the core and plugin api. Bump min version and sort.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23302 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:59 +00:00
Michael Sparmann
f0a96580ae Core changes to allow storage drivers to do cleanup on shutdown, and iPod Nano 2G shutdown code rework (FS#10668)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23057 a1c6a512-1295-4272-9138-f99709370657
2009-10-09 20:36:09 +00:00
Maurus Cuelenaere
249392c2d3 Add a BTN_MASK for the VX777 (aka fix red)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22461 a1c6a512-1295-4272-9138-f99709370657
2009-08-21 22:50:50 +00:00
Maurus Cuelenaere
9f6d3a758f * Onda VX777: add support for its single physical button
* Use real wakeup events in the battery ADC driver
 * Adjust battery charge information a bit


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22458 a1c6a512-1295-4272-9138-f99709370657
2009-08-21 21:35:12 +00:00
Nils Wallménius
47608e06b3 fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22432 a1c6a512-1295-4272-9138-f99709370657
2009-08-19 22:15:45 +00:00
Maurus Cuelenaere
caf2011311 Onda's: add touchscreen boot menu for targets without/not much physical buttons (VX777)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22416 a1c6a512-1295-4272-9138-f99709370657
2009-08-19 00:26:06 +00:00
Karl Kurbjun
1474b93011 Fix Yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22315 a1c6a512-1295-4272-9138-f99709370657
2009-08-14 23:16:20 +00:00
Karl Kurbjun
7ca4c7358d Hopefully get all of the touchscreen drivers to act the same so release events get the appropriate data.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22314 a1c6a512-1295-4272-9138-f99709370657
2009-08-14 23:08:50 +00:00
Maurus Cuelenaere
e9b061a717 Fix red: only use SW_VOLUME_MIN if HAVE_SW_VOLUME_CONTROL is defined
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22107 a1c6a512-1295-4272-9138-f99709370657
2009-08-01 21:50:19 +00:00
Maurus Cuelenaere
3c7c79189e * Move DSP_CALLBACK_* enum to sound.h
* Add software based volume control for a certain range (SW_VOLUME_MIN -> SW_VOLUME_MAX)
 * Make Onda VX747 use it
 * Don't change volume or frequency in Ingenic Jz4740 codec driver when they're already set


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22106 a1c6a512-1295-4272-9138-f99709370657
2009-08-01 21:38:18 +00:00
Maurus Cuelenaere
ddd82d6ab5 Ingenic Jz4740 timer driver: fix stupid mistake
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22096 a1c6a512-1295-4272-9138-f99709370657
2009-08-01 16:06:41 +00:00
Maurus Cuelenaere
d0a132a7a4 Jz4740 timer driver: only init timer in timer_set() when start is true
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22075 a1c6a512-1295-4272-9138-f99709370657
2009-07-27 19:01:40 +00:00
Maurus Cuelenaere
e38f3abac9 Jz4740 PCM driver: do 32-bit or 16-bit burst sizes if 16-byte ones won't fit (improves PDBox)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22074 a1c6a512-1295-4272-9138-f99709370657
2009-07-27 18:58:22 +00:00
Maurus Cuelenaere
86ef57b975 Jz4740 PCM driver: check whether pcm_callback_for_more isn't NULL (fixes metronome)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22072 a1c6a512-1295-4272-9138-f99709370657
2009-07-27 17:00:26 +00:00
Maurus Cuelenaere
682a991f0f Ingenic Jz4740 targets: turn backlight on when an exception occurs and EXTENDED_EXCEPTION_DESC is defined
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22052 a1c6a512-1295-4272-9138-f99709370657
2009-07-26 14:00:25 +00:00
Maurus Cuelenaere
4ce26ff328 Onda VX747: don't fully init the LCD when not doing an USB_BOOT compile (fixes flashes when booting up)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22051 a1c6a512-1295-4272-9138-f99709370657
2009-07-26 13:27:12 +00:00
Frank Gevaerts
a7548d3bc7 Make sd_present() and mmc_present() look only at the actual presence of a card, not at initialisation state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21981 a1c6a512-1295-4272-9138-f99709370657
2009-07-20 13:47:21 +00:00
Frank Gevaerts
c0a5a67387 Commit FS#9545, storage cleanup and multi-driver support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 22:28:49 +00:00
Rafaël Carré
9191b3c16e remove nand_soft_reset and nand_disk_is_active already voided in storage.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21924 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 16:34:41 +00:00
Rafaël Carré
bdb5974c0e Revert r21912 : "Storage API : remove undeeded target-specific functions"
After a discussion mixed on mailing list and irc, it was agreed that
more abstraction for plugins is better (so developers don't have to add
a check to HAVE_DISK_STORAGE when writing disk-specific code)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21923 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 16:34:34 +00:00
Maurus Cuelenaere
cf9935d636 Onda VX747: add dual-boot capability + make it possible to permanently 'stick' Rockbox to your DAP
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21919 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 14:30:42 +00:00
Rafaël Carré
8eba69f91b Storage API : remove undeeded target-specific functions
storage_sleep, storage_spin, storage_spindown are only defined if #defiend (HAVE_DISK_STORAGE), not for MMC/ATA/SD
remove already unneeded nand_disk_is_active, nand_soft_reset

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21912 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 00:09:14 +00:00
Maurus Cuelenaere
e63904c7e9 Onda VX747 backlight: use a higher frequency to reduce flickering
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21671 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 18:58:06 +00:00
Maurus Cuelenaere
eabeb928dd Ingenic Jz4740: add basic frequency switching
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21625 a1c6a512-1295-4272-9138-f99709370657
2009-07-03 21:34:40 +00:00
Maurus Cuelenaere
7f2ddc4923 Ingenic Jz4740 PCM driver: add some locking here and there (doesn't fix all PCM issues)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21622 a1c6a512-1295-4272-9138-f99709370657
2009-07-03 11:50:58 +00:00
Maurus Cuelenaere
6dbf4cf827 Ingenic Jz4740: remove some unneeded stuff and simplify SD driver (also thanks to Rafaël Carré)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21621 a1c6a512-1295-4272-9138-f99709370657
2009-07-03 11:40:50 +00:00
Rafaël Carré
293b499093 Move sd_get_info() into common sd code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21610 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 23:39:57 +00:00
Maurus Cuelenaere
ccbd8f4f31 * Move some more stuff to the general SD driver
* Ingenic SD driver: cleanup DMA part a bit (not working yet)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21606 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 22:56:14 +00:00
Rafaël Carré
90d7a8c4fc Ingenic jz4740 SD driver: remove custom list of SD commands
Replace most references to MMC/mmc with SD/sd
Remove MMC failover code since MMC cards aren't supported

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21604 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 22:41:33 +00:00
Rafaël Carré
c0eb9aeb9e add firmware/driver/sd.c which contains common code between SD drivers
ingenic SD driver needs more cleanup so it still doesn't use the common code
correct a comment in hotswap.c: card_extract_bits assume most significant word of register first (so, use this order)
fix debug menu which used MMC specific commands / bits positions in csd/cid
move the default block size of 512 into sd.h
move the mantissa & exponent table into a single file (sd.c) to reduce binsize. we don't need to export it anymore anyway

TODO : ingenic cleanup (will happen soon so building sd.c is not conditional)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21601 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 21:49:13 +00:00
Rafaël Carré
93f6e3df24 card_extract_bits() take the start bit argument as defined in public SanDisk specifications for SD and MMC, i.e. bit 0 is the lsb
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21600 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 19:13:01 +00:00
Maurus Cuelenaere
f3a4a7635e Ingenic Jz4740 SD driver: remove some unneeded stuff + fill the OCR field in card_get_info_target()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21596 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 17:03:51 +00:00
Maurus Cuelenaere
898475bf4f Ingenic Jz4740 SD driver: fix SD clock init (fixes problems with SDHC cards)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21592 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 13:56:54 +00:00
Maurus Cuelenaere
e4003539bc Also cleanup Onda VX747 ata-sd-target.h file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21587 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 10:21:01 +00:00
Rafaël Carré
e0e24cbf0a Merge tCardInfo struct (MMC) and tSDCardInfo struct (SD)
Put specific members under #ifdef (CONFIG_STORAGE & STORAGE_xx) (2 members for SD and 1 for MMC)
Fix a typo: tsac doesn't exist and must be read taac
Move card_get_info functions declaration inside hotswap.h to remove mutual inclusion of ata_mmc.h and hotswap.h
Move static const data structures from SD drivers into sd.h (sd_exponent and sd_mantissa)
Fix sd_command prototypes in SD drivers (card registers are unsigned long)
Fix speed calculation in Sansa AMS driver (PP SD driver needs to be checked)
Move ata-sd-target.h to sd-pp-target.h to reflect the PP specifity. Now it only contains declaration of microsd_int()
Remove unused ata-sd-target.h for injenic

TODO:
- check if CSD register bits are extracted correctly in PP driver
- correctly define read_timeout and write_timeout unit for MMC & SD, and use timeouts in Sansa AMS driver

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21586 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 10:07:22 +00:00
Rafaël Carré
ffefe0c08b Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h
Note : SH has TIMER_FREQ defined to CPU_FREQ, so any code wanting it must include #config.h before #cpu.h

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21560 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:30:12 +00:00
Rafaël Carré
c5dedd7d76 Remove the TIMER_* macros and declare target-specific functions in timer.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21559 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:57 +00:00
Rafaël Carré
89ccd5c145 Remove int_prio argument from timer_register, and move the only use for it into alpine_cdc plugin, since this plugin is only built on SH7034
Also remove it from TIMER_START()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21558 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:46 +00:00
Rafaël Carré
b3ed33d04a Move SH7034 timer code in the target tree
Add an argument int_prio to TIMER_START() macro because SH7034 needs it
Leaves a target specific code in timer_register (could be given to target code through timer_set and __timer_set() )

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21556 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:14 +00:00
Rafaël Carré
e0640c3c4b Rename TIMER_REGISTER macro to TIMER_START and TIMER_UNREGISTER to TIMER_STOP to reflect what they does exactly.
registering and unregistering are handled by the non target-specific functions of timer.c
Remove arguments from the new TIMER_START since they are unused by targets

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21553 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:28:56 +00:00
Maurus Cuelenaere
20e5ffe306 Onda VX747: make backlight setting range from 1->16 instead of 0->15
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21494 a1c6a512-1295-4272-9138-f99709370657
2009-06-24 20:27:55 +00:00
Maurus Cuelenaere
5acfa34b9c Use a logarithmic scale for the Onda VX747 backlight (thanks to Bertrik Sikken)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21492 a1c6a512-1295-4272-9138-f99709370657
2009-06-24 19:52:03 +00:00
Maurus Cuelenaere
582942016b * Commit a modified FS#10354 (thanks to Davide Quarta) - add support the VX747+ in scramble and configure
* Add support for the VX777
* Remove the touchscreen mode switching combo from the button driver



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21379 a1c6a512-1295-4272-9138-f99709370657
2009-06-20 10:54:13 +00:00
Maurus Cuelenaere
7c6a725e8e Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21332 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 18:27:53 +00:00
Maurus Cuelenaere
2fb6396f5a Ingenic Jz4740: enable IRAM (only core, without ibss)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21331 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 18:16:15 +00:00
Maurus Cuelenaere
5a5cccf10b Make some asm() statements volatile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21313 a1c6a512-1295-4272-9138-f99709370657
2009-06-16 18:35:57 +00:00
Maurus Cuelenaere
143f62e8cc Onda VX747: fix backlight driver so it doesn't 'flicker' upon init
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21310 a1c6a512-1295-4272-9138-f99709370657
2009-06-16 11:41:48 +00:00
Maurus Cuelenaere
733bab0886 Onda VX747: clean up SD GPIO initialization
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21288 a1c6a512-1295-4272-9138-f99709370657
2009-06-15 11:22:03 +00:00
Maurus Cuelenaere
0711190db1 Correct some comments (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21236 a1c6a512-1295-4272-9138-f99709370657
2009-06-09 19:18:30 +00:00
Maurus Cuelenaere
b91ebdd600 Properly implement backlighting on Onda VX7x7 (using PWM).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21235 a1c6a512-1295-4272-9138-f99709370657
2009-06-09 17:19:43 +00:00
Maurus Cuelenaere
99c854e30a VX767: cleanup LCD driver a bit + add forgotten backlight-target.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21214 a1c6a512-1295-4272-9138-f99709370657
2009-06-08 08:59:37 +00:00
Maurus Cuelenaere
aa7b081bad Ingenic Jz4740: fix debug messages not being readable due to backdrop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21186 a1c6a512-1295-4272-9138-f99709370657
2009-06-04 12:08:33 +00:00
Maurus Cuelenaere
48203093ce Fix RoLo on MIPS targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21185 a1c6a512-1295-4272-9138-f99709370657
2009-06-04 11:57:43 +00:00
Maurus Cuelenaere
398e1059c5 Ingenic Jz4740: should fix timer (thanks to Rafaël Carré)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21184 a1c6a512-1295-4272-9138-f99709370657
2009-06-03 22:52:54 +00:00
Maurus Cuelenaere
63bc7c9009 Ingenic Jz4740: add extended exception debug reporting option
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21183 a1c6a512-1295-4272-9138-f99709370657
2009-06-03 16:25:54 +00:00
Maurus Cuelenaere
aa7d43f7a6 Fix reds & yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21162 a1c6a512-1295-4272-9138-f99709370657
2009-06-01 21:21:29 +00:00
Maurus Cuelenaere
fd11471a3f Onda VX747: try at implementing FM tuner support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21160 a1c6a512-1295-4272-9138-f99709370657
2009-06-01 21:00:31 +00:00
Maurus Cuelenaere
a0458dac2b Fix audio on Onda VX747
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21097 a1c6a512-1295-4272-9138-f99709370657
2009-05-26 22:57:49 +00:00
Bertrik Sikken
2dc2054319 Remove some unused declarations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21010 a1c6a512-1295-4272-9138-f99709370657
2009-05-21 12:32:26 +00:00
Maurus Cuelenaere
0e725551af Replace some TABs with spaces (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21009 a1c6a512-1295-4272-9138-f99709370657
2009-05-21 12:29:51 +00:00
Maurus Cuelenaere
d2595ec075 Onda VX747: improve the USB insertion detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21001 a1c6a512-1295-4272-9138-f99709370657
2009-05-20 21:59:51 +00:00
Maurus Cuelenaere
9c2ebdf724 Speed up LCD driver on Ingenic Jz4740 by doing some sort of partial LCD updates.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20997 a1c6a512-1295-4272-9138-f99709370657
2009-05-20 12:43:23 +00:00
Maurus Cuelenaere
8bcb4a6971 Fix Ingenic Jz4740 USB driver (USB IN <-> OUT) and some whitespace cleaning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20996 a1c6a512-1295-4272-9138-f99709370657
2009-05-20 12:37:56 +00:00
Maurus Cuelenaere
0fd94237f3 Ingenic Jz4740 PCM driver: set correct sample rate
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20981 a1c6a512-1295-4272-9138-f99709370657
2009-05-17 22:55:40 +00:00
Maurus Cuelenaere
6208ee0479 Don't define LOGF_ENABLE..
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20979 a1c6a512-1295-4272-9138-f99709370657
2009-05-17 16:08:33 +00:00
Maurus Cuelenaere
649671eae3 Get interrupt endpoints fully working on Ingenic Jz4740 targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20978 a1c6a512-1295-4272-9138-f99709370657
2009-05-17 15:41:05 +00:00
Maurus Cuelenaere
03ea249297 Try at implementing interrupt endpoints in the Ingenic Jz4740 USB driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20973 a1c6a512-1295-4272-9138-f99709370657
2009-05-16 23:04:54 +00:00
Frank Gevaerts
69a4117c1d Add working USB HID driver, by Tomer Shalev (part of his GSoC work).
This needs support for usb interrupt transfers, so there are some changes in various USB drivers as well (only usb-drv-arc supports it at this point, others won't have working HID yet).

HID is disabled for now, as the apps/ part is not included yet.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20962 a1c6a512-1295-4272-9138-f99709370657
2009-05-16 15:30:09 +00:00
Maurus Cuelenaere
c066258321 Merge Onda VX7?7 backlight-target.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20788 a1c6a512-1295-4272-9138-f99709370657
2009-04-25 20:55:23 +00:00
Thomas Martitz
0600b4ba3c Fix onda red. Unlike all other targets, it built the whole backlight driver in the bootloader.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20787 a1c6a512-1295-4272-9138-f99709370657
2009-04-25 20:53:13 +00:00
Maurus Cuelenaere
5c82d2c004 Fix yellow (forgot file)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20759 a1c6a512-1295-4272-9138-f99709370657
2009-04-20 20:17:54 +00:00
Maurus Cuelenaere
be8a27ad81 Onda VX747: fix touchscreen issues when switching from bootloader to 'normal' Rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20754 a1c6a512-1295-4272-9138-f99709370657
2009-04-20 18:28:51 +00:00
Maurus Cuelenaere
c147d39bb5 Ingenic Jz4740: put stack in IRAM & optimize/clean up crt0.S a bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20742 a1c6a512-1295-4272-9138-f99709370657
2009-04-19 15:16:37 +00:00
Maurus Cuelenaere
dc8db2a820 MIPS: set load address of .iram to the start of .bss so RAM doesn't get wasted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20741 a1c6a512-1295-4272-9138-f99709370657
2009-04-19 14:10:59 +00:00
Maurus Cuelenaere
42c7fb6b8b Remove some redundant links in MIPS linker scripts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20740 a1c6a512-1295-4272-9138-f99709370657
2009-04-19 13:58:55 +00:00
Maurus Cuelenaere
069191d9d4 Fix some issues with YUV blitting on Onda VX747 (still not working properly)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20736 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 21:00:32 +00:00
Maurus Cuelenaere
2c0da9d152 Really fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20734 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 20:25:16 +00:00
Maurus Cuelenaere
8b6b46f3c4 Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20732 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 18:33:41 +00:00
Maurus Cuelenaere
a54e0b6dba Onda VX747:
* Add YUV support
 * Clean up LCD driver a bit and speed it up


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20730 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 17:38:55 +00:00
Maurus Cuelenaere
c606fd04c8 Jz4740:
* Optimize & cleanup thread handling a bit
 * Unify exception return and fix a potential bug


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20659 a1c6a512-1295-4272-9138-f99709370657
2009-04-08 14:30:33 +00:00
Maurus Cuelenaere
ae723815fa Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20650 a1c6a512-1295-4272-9138-f99709370657
2009-04-08 00:05:25 +00:00
Maurus Cuelenaere
91239472ae Add LED indication to Jz4740 SD driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20649 a1c6a512-1295-4272-9138-f99709370657
2009-04-08 00:04:51 +00:00
Maurus Cuelenaere
453b053c29 Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20627 a1c6a512-1295-4272-9138-f99709370657
2009-04-05 15:14:45 +00:00
Maurus Cuelenaere
72503b5dc1 Fix Onda VX767 LCD clock init code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20626 a1c6a512-1295-4272-9138-f99709370657
2009-04-05 14:36:36 +00:00
Maurus Cuelenaere
cfb20fdf2b Should be the last one...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20542 a1c6a512-1295-4272-9138-f99709370657
2009-03-25 22:57:13 +00:00
Maurus Cuelenaere
b84c06372b Jz4740: Optimize interrupt handling by using a find_last_set_bit() implementation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20539 a1c6a512-1295-4272-9138-f99709370657
2009-03-25 22:42:24 +00:00
Maurus Cuelenaere
52cb340962 Really fix it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20538 a1c6a512-1295-4272-9138-f99709370657
2009-03-25 22:29:49 +00:00
Maurus Cuelenaere
6432363476 Fix MIPS FFS implementation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20536 a1c6a512-1295-4272-9138-f99709370657
2009-03-25 21:19:51 +00:00
Maurus Cuelenaere
19bd97bccc Correct the set_frequency() function on the Onda VX747 (fixes sound)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20512 a1c6a512-1295-4272-9138-f99709370657
2009-03-24 17:59:44 +00:00
Bertrik Sikken
bef264264c Add missing #includes for the ondas.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20457 a1c6a512-1295-4272-9138-f99709370657
2009-03-22 15:40:40 +00:00
Maurus Cuelenaere
d63a8fcb7b Don't forget to fix these too...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20419 a1c6a512-1295-4272-9138-f99709370657
2009-03-20 23:27:41 +00:00
Maurus Cuelenaere
fe064db965 Kill some yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20416 a1c6a512-1295-4272-9138-f99709370657
2009-03-20 23:02:10 +00:00
Thomas Martitz
4ed387d603 Fix reds and yellows (hopefully). Some targets apparently didn't properly #ifdef lcd_enable and lcd_sleep code out, so that it got partly active in the bootloader; rename the ui simulator stub fixes most reds; for the clip: move the hook code into lcd-1bit-vert.c which should fix the bootloader red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20333 a1c6a512-1295-4272-9138-f99709370657
2009-03-17 03:36:36 +00:00
Thomas Martitz
b7739fbf1c Rework lcd_enabled and lcd_set/call_enable hook
a) lcd_enabled() is now lcd_active(), and is available for HAVE_LCD_SLEEP only targets (e.g. ipod video) too. It was depandent on HAVE_LCD_ENALE only before
b) rename the hook accordingly, and implement the hook for other other targets too (e.g. the clip [the only mono target with lcd_enable/lcd_sleep yet, so the code is still in the lcd driver], ipod, fuze, c200)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20331 a1c6a512-1295-4272-9138-f99709370657
2009-03-17 02:43:47 +00:00
Jens Arnold
bcb0fc2c12 Allow mkinfo.pl to read the RAM usage correctly. All other targets define both loadaddress and _loadaddress as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20300 a1c6a512-1295-4272-9138-f99709370657
2009-03-12 07:43:20 +00:00
Maurus Cuelenaere
01c390d5c5 Make Onda VX767 compile + restructure firmware/SOURCES a bit (wrt Jz4740 specific files)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20297 a1c6a512-1295-4272-9138-f99709370657
2009-03-11 22:12:23 +00:00
Maurus Cuelenaere
70ab3fca0d Onda VX747:
* Fix warnings
 * Add fake battery level information to make sure Rockbox doesn't shutdown
 * Enable switching between touch modes by pressing (VOL_DOWN|VOL_UP)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20269 a1c6a512-1295-4272-9138-f99709370657
2009-03-09 22:17:37 +00:00
Maurus Cuelenaere
98a53f0287 * Onda VX767: fix some redundant files + add some missing functions for apps/ compilation (still needs keymap though).
* Add Onda VX767 SADC driver
* Unify Onda VX747(+) and Onda VX767 backlight driver
* Also be more consistent wrt file naming.
* Add speaker-onda_vx747.c to SOURCES (forgot to commit this)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20259 a1c6a512-1295-4272-9138-f99709370657
2009-03-09 21:26:39 +00:00
Maurus Cuelenaere
c6bf842eca * Unify Onda VX747 and VX747+ config files
* Conditionalise (void)drive; in NAND & SD drivers


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20256 a1c6a512-1295-4272-9138-f99709370657
2009-03-09 20:41:59 +00:00
Bertrik Sikken
1fb8242d96 Simplify generic_i2c, removing the link between i2c address and i2c interface, adding the concept of an i2c bus index.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20193 a1c6a512-1295-4272-9138-f99709370657
2009-03-03 18:00:17 +00:00
Maurus Cuelenaere
6c252a6751 Onda VX747:
* Add speaker en-/disable driver
  * Add apps/ setting to en-/disable the speaker


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20174 a1c6a512-1295-4272-9138-f99709370657
2009-03-02 18:18:24 +00:00
Maurus Cuelenaere
dfd32efc63 Onda VX747: redo keymap (which fixes the not-working emulated touchscreen buttons). Also make check for & CONTEXT_REMOTE conditional in keymap-touchscreen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20120 a1c6a512-1295-4272-9138-f99709370657
2009-02-26 22:05:34 +00:00
Maurus Cuelenaere
38436038a9 Ingenic Jz4740:
* Add initial RoLo support
 * Don't enable IRAM in plugins for now
 * Initial try at getting PCM working (doesn't crash anymore at least)
 * Replace hard-coded constant with #define in usb-jz4740


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20115 a1c6a512-1295-4272-9138-f99709370657
2009-02-26 21:15:40 +00:00
Maurus Cuelenaere
9bcb96f490 Ingenic Jz4740:
* Fix USB issues + add DMA support (doesn't work fully)
 * Make exception handler a bit more descriptive


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20091 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 16:10:46 +00:00
Maurus Cuelenaere
44eba07516 Add generic touchscreen driver which allows calibration (apps/ layer will follow later).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20055 a1c6a512-1295-4272-9138-f99709370657
2009-02-19 22:15:02 +00:00
Maurus Cuelenaere
360d3d720b Onda VX747:
* Rework battery reading
 * Get power off back working
 * Add time to debug view
 * Convert TABs to spaces in firmware/export/mips*.h


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20024 a1c6a512-1295-4272-9138-f99709370657
2009-02-16 22:49:58 +00:00
Maurus Cuelenaere
4532d145f1 Onda VX747:
* Add preliminary keymap
 * Split up generic MIPS stuff from Ingenic specific
 * Make apps/ compilable
 * Add SD driver
 * Fix RTC driver
 * Add debug screen
 * Other cleanups/rewrites/fixes


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19993 a1c6a512-1295-4272-9138-f99709370657
2009-02-13 00:45:49 +00:00
Maurus Cuelenaere
04c7379ac5 Onda VX747: commit some parts to get apps/ to compile (more will follow)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19954 a1c6a512-1295-4272-9138-f99709370657
2009-02-09 10:02:38 +00:00
Maurus Cuelenaere
e1aee31878 Fix MIPS ffs implementation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19930 a1c6a512-1295-4272-9138-f99709370657
2009-02-05 21:36:11 +00:00
Maurus Cuelenaere
b0a3a563a1 MIPS memset: use a bigger buffer (yields more performance)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19922 a1c6a512-1295-4272-9138-f99709370657
2009-02-04 20:18:30 +00:00
Maurus Cuelenaere
d5827d5f9a MIPS:
* Add missing mmu-mips.h change

Onda VX747:
 * Correct USB power handling
 * Improve NAND handling
 * Other minor fixes


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19921 a1c6a512-1295-4272-9138-f99709370657
2009-02-04 17:37:05 +00:00
Maurus Cuelenaere
9b13a5d151 MIPS:
* Add assembly optimised variants for memcpy, memset and find_first_set_bit
 * Add option to map_address in MMU to set caching algorithm


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19920 a1c6a512-1295-4272-9138-f99709370657
2009-02-04 17:33:19 +00:00
Maurus Cuelenaere
a4e7bc383e Onda VX747:
* Implement lcd_flip()
 * Add support for multiple banks in NAND driver
 * Add basic I²C driver (untested)
 * Get audio back working
 * Add power driver
 * Other minor fixes and cleanups


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19863 a1c6a512-1295-4272-9138-f99709370657
2009-01-27 00:38:58 +00:00
Maurus Cuelenaere
311d2f12ed Onda VX747: get NAND driver working
generic NAND ID driver: clean up


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19817 a1c6a512-1295-4272-9138-f99709370657
2009-01-22 00:04:20 +00:00
Maurus Cuelenaere
e79fc8aaef Onda VX747: disable DMA for now on NAND for performance
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19816 a1c6a512-1295-4272-9138-f99709370657
2009-01-21 21:29:47 +00:00
Maurus Cuelenaere
29b136b82d Onda VX747:
* Get USB working (it isn't good at writing support though)
  * Clean up NAND & SD a bit
  * Other comments/fixes
Ingenic Jz4740/MIPS:
  * Split MMU from system


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19815 a1c6a512-1295-4272-9138-f99709370657
2009-01-21 20:58:33 +00:00
Maurus Cuelenaere
09ba2bbf39 Onda VX7x7: commit working USB driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19754 a1c6a512-1295-4272-9138-f99709370657
2009-01-12 18:13:53 +00:00
Michael Sevakis
4ed78f5c72 Clean up panicf and introduce system_exception_wait to do further target tasks and wait for a button when an unrecoverable error has occurred (panic, UIE, etc.). Returning from that function should reboot or don't return from it. Move UIE and __div0 for ARM to its own file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19716 a1c6a512-1295-4272-9138-f99709370657
2009-01-08 10:15:32 +00:00
Maurus Cuelenaere
5bf0cf5910 Ingenic Jz4740:
* Fix compiling
 * More USB work


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19628 a1c6a512-1295-4272-9138-f99709370657
2008-12-31 18:15:24 +00:00
Maurus Cuelenaere
9ac7af749b Ingenic players:
* Further implement USB driver
 * Add preliminary clock setup
 * Fix USB VID/PID


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19618 a1c6a512-1295-4272-9138-f99709370657
2008-12-31 01:11:04 +00:00
Maurus Cuelenaere
e4c09799a0 Ingenic players:
* Enable clocks when needed
 * Fix VX747+ button_hold()


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19505 a1c6a512-1295-4272-9138-f99709370657
2008-12-20 13:10:04 +00:00
Maurus Cuelenaere
ec380a79d9 Ingenic players: disable LCD clock when unneeded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19497 a1c6a512-1295-4272-9138-f99709370657
2008-12-20 01:57:55 +00:00
Maurus Cuelenaere
c983e3b1d2 Ingenic targets:
* LCD rework
 * Dynamic DMA enabling
 * PCM cleanup
 * USB: replace printf() with logf()
 * System: get rid of in_interrupt_mode()
 * Backlight: add support for software PWM


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19495 a1c6a512-1295-4272-9138-f99709370657
2008-12-20 01:48:46 +00:00
Maurus Cuelenaere
9da2456c26 Fix SVN properties
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19482 a1c6a512-1295-4272-9138-f99709370657
2008-12-19 11:29:18 +00:00
Maurus Cuelenaere
40ec543052 * Add support for Onda VX747+ (FS#9674 by Olivier Barbut)
* Fix Onda VX767 support
 * Small cleanup


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19481 a1c6a512-1295-4272-9138-f99709370657
2008-12-19 11:13:58 +00:00