I must have been blind and copied some intermediate file
instead of final version. No functional change, only fixes.
Change-Id: Icaa868225517662c88f8492b1f04808407853361
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
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>
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
* 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
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
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>
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>
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>
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
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
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
* 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
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
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
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
* 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
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
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
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
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
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
* 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
* 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
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
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
* 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
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
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
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
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
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
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
* 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
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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* Get audio working (only noise atm)
* Clean up some stuff in USB
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19329 a1c6a512-1295-4272-9138-f99709370657
* Get rid of bug when interrupts are enabled
* Get threading to work (although with some weirdness)
* Other fixes/optimizations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18512 a1c6a512-1295-4272-9138-f99709370657
* Make IHFSsplit compile under Windows
* Change SDRAM base address + remove hack for Onda VX747
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18395 a1c6a512-1295-4272-9138-f99709370657
* Overall cleanup (still needs work)
* Add preliminary USB support
* Add power off support
* Add preliminary MMU handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18348 a1c6a512-1295-4272-9138-f99709370657
* kill TABs in jz4740.h
* clean up LCD
* make CONFIG_ORIENTATION work in both ways
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18286 a1c6a512-1295-4272-9138-f99709370657
* Make current_tick increase
* Convert button driver into SADC driver
* Make touchscreen handling work better (still needs good calibration routine)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18240 a1c6a512-1295-4272-9138-f99709370657