Commit graph

10446 commits

Author SHA1 Message Date
Michael Sevakis
a931c76b3a Do some debug and preparatory work for ramcache and playlist
The file system rework introduced incompatibility between dircache
and the tagcache ramcache and playlist dircache path caching. This
update makes changes to filesystem code to reintegrate all that.

It also fixes a couple bugs that were found when vetting all the
code. The filestream cache was being reset without regard to
the stream even if it was shared in write mode (made work of
.playlist_control). Better handling of unmounting gives files a
better go at force-closing them without risk to disk integrity.

Did some miscellaneous pedantic changes. Improved efficiency of
testing a file's existence (a little) since the path parser will
be shared between file code and parsing for the sake of finding
dircache references, not duplicated as before.

This commit doesn't reenable said items just for the sake of
keeping changes separate and related.

Plan for the next is to enable dircache again for the playlists
(easy peasy) and reenable tagcache ramcache but *without* the
dircache path caching because it's rather substantial to change
in itself. The ramcache will still function without dircache.

Change-Id: I7e2a9910b866251fa8333e1275f72fcfc8425d2d
2017-01-17 14:35:36 -05:00
Amaury Pouly
7eaf55868d zen/zenxfi: remove obsolete comment
Change-Id: I1e4a726c85a9d87216412162fd0815747eb32cf6
2017-01-16 20:10:28 +01:00
Amaury Pouly
5d048e04a0 zen/zenxfi: add remark about pin
Clearly this pin does not control power so don't call it lcd_power.

Change-Id: I9a6794e2606de99cb44dd3e7288b5cce5beb8d0d
2017-01-16 20:09:39 +01:00
Amaury Pouly
b23b7088cb imx233: add small framework for LED
It handles GPIO and PWM based LEDs, possibly with several channels (red-green
LED for example). The debug allows one to play with the setting.
Currently the code supports the ZEN, ZEN X-Fi, and ZEN Mozaic.

Change-Id: I8c3b66e6ba21778acdb123daabb724280a7d1a4f
2017-01-16 20:08:13 +01:00
Michael Sevakis
4f7fea2add Fix path handling snafu for CheckWPS tool
Somehow it got hooked to simulator file functions when it should
be (and was) using raw OS functions.

Credit: Frank Gevaerts

Change-Id: Iac02fed1067830a432183632a047e00dfd03d3c2
2017-01-16 07:30:39 -05:00
Matthias Mohr
d984725cbf Renamed defines UNALIGNED to ROCKBOX_UNALIGNED - UNALIGNED is already
defined in mingw environments.

Renamed defines of UNALIGNED to ROCKBOX_UNALIGNED so that they don't
conflict with definitions in mingw32 cross-compiling environments
(defined in _mingw.h).

Change-Id: I369848c0f507e6bf5ff9ab4a60663bbbda6edc52
2017-01-15 21:32:49 +01:00
Amaury Pouly
42e54c508f imx233: workaround hardware dma bug
This bug mostly affects the ZEN and ZEN X-Fi and hangs the lcdif dma randomly
on boot.

Change-Id: I4255db90d87737b7a70d1d53e3ef84e4e14c8c13
2017-01-15 18:41:27 +01:00
Franklin Wei
ed6526404f Support using swapxx() and bswap_xx() for byteswaps in rbendian.h
- patch suggested by Massa in http://forums.rockbox.org/index.php/topic,51618.msg238760.html#msg238760

Change-Id: Iba93ff53119db00a18d944d52bc8b1c5fe593fc9
2017-01-15 12:37:46 -05:00
Michael Sevakis
0a5b0dd908 Dircache: Fix a tiny-block reclaim bug
Logic left over from before switching from NULL-terminated to
counted strings would prevent a single-byte tiny free block gap
from being properly reclaimed into free string bytes.

Due to rarity, not as disasterous to functionality so much as
wrong.

Change-Id: I68e0875b04bb0ab6cdead0fdf535144b9c1bc13e
2017-01-14 00:20:07 -05:00
Amaury Pouly
79e8cd4cfe imx233: fix audio debug screen on stmp3700
On STMP3700 there is no dedicated speaker amplifier but speaker is always on
lineout so it makes sense to report volume and power down of lineout.

Change-Id: If666bccf36d3a5ecc6d892823522d023f3206184
2017-01-14 01:17:25 +01:00
Amaury Pouly
c41a929119 imx233: add note about power down bits in audioout
Change-Id: I204acff8ee697d70fd16f9828010646b10a8f11b
2017-01-14 01:17:25 +01:00
Amaury Pouly
fd2629422c imx233: fix speaker enable/disable code
Change-Id: I6540f2f8ba09bc79b80d71e5f3b0adebd9fce727
2017-01-14 01:17:25 +01:00
Cástor Muñoz
954d934ad2 iPod Classic: fix small bug on PCM record
On PCM record initialization, an unknown clockgate is enabled instead
of the I2S clockgate. This bug does not produce incorrect functionallity
because the right clockgate is already enabled on PCM playback
initialization.

Change-Id: I97a3a4a6f12131e492c1431359a0a976b68014be
2017-01-13 05:06:15 +01:00
Michael Sevakis
077e20664c Improve the implementation of a couple linked list routines.
ll_insert_next() and ll_remove_next() can be done more elegantly
by adding a level of indirection to reference the 'next' pointer.

Change-Id: If3ab2bc2a659b517c793749cfa9088938ae08d0d
2017-01-07 21:14:32 -05:00
Michael Sevakis
5c6ccb43b5 Fix track formatting problems in playlist.c
Some changes in behavior were made with filesystem code commit
for the sake of compatibility that changed expected behavior.

* Restore substitution of drive spec in fully-qualified DOS paths
with the playlists's volume spec (or root on univolume targets).
Drive-relative paths of the form "c:foo" (no separator after
':') will be treated as purely relative.

* Restore old behavior of preserving leading whitespace in the
source path and trimming only trailing tabs and spaces.

* Multivolume: Volume substition on fully-qualified UNIX/RB paths
has NOT been reintroduced (and perhaps wasn't intended in the
first place). They will not be modified because there is no
ambiguity to resolve. Doing so would prevent a playlist on
external storage from referencing a file on main storage without
qualifying it with "/<0>...".

* Plain relative paths are and always have been interpreted as
relative to the location of the playlist.

Change-Id: Ic0800cea79c59563b7bac20f8b08abb5051906c7
2017-01-07 19:10:02 -05:00
Amaury Pouly
622088c940 zenxfistyle: enable dualboot stub api
The ZEN X-Fi Style doesn't have an updater like the other stmp targets but at
least the stub enables rebooting to the OF.

Change-Id: I630653a37b94b77210ffdd0d30e1748b13eca96a
2016-12-19 18:32:51 +01:00
Amaury Pouly
ac0fc74d56 imx233: don't print disabled IRQs in debug screen
There are lot IRQ and most are unused most of the time, this is annoying on
devices with small screens.

Change-Id: I7f3453f2768b8e35a5a367fbcf1e4cf3cf73bcd7
2016-12-12 13:25:41 +01:00
Amaury Pouly
17277fa1bf imx233: add more icoll statistics
Those new statistics give the maximum time an IRQ took and also the total
time spent in IRQ, for each IRQ. Hopefully those do not take took much time
or space to collect. If this is the case, it can be enabled in debug builds only
the future.

Change-Id: I05af172897c5cb7ffcc9322452f974d8f968e29d
2016-12-12 13:20:10 +01:00
Amaury Pouly
a523c3fcfe imx233: fix IRQ handler w.r.t unwinder
The IRQ handler saves registers on the IRQ stack, saves the old PC to imx233
HW_DIGCTL_SCRATCH0 register and switcht to SVC for the actual handling. The
old code had a problem in that if the unwinder is called during the IRQ (for
example by the watchdog), then __get_sp() will use SPSR_svc to discover the
previous mode, switch to it and recover SP. But SPSR_svc is invalid, it should
be SPSR_irq but we switch from IRQ to SVC mode. The new code copies SPSR_irq
to SPSR_svc in IRQ to fix this problem. It also saves/restore SCRATCH0 in
case I one day renable nested interrupts or use SCRATCH0 for other purposes.
I also changed the old watchdog code to call UIE directly instead of trying
to make the code crash with a SWI.

Change-Id: Id87462d410764b019bd2aa9adc71cb917ade32e3
2016-12-12 13:17:33 +01:00
Amaury Pouly
89e6189dcb uda1380: document audiohw setting based on uda1380.c
Change-Id: Ia799e47249b4b0008bfe8e633c61548a667b9288
2016-12-12 13:14:22 +01:00
Amaury Pouly
4304d47d3b tlv320: document audiohw setting based on tlv320.c
Change-Id: I7cf354cb948444595ca541a4bf70dfbcf01147f2
2016-12-12 13:13:52 +01:00
Amaury Pouly
4d526df7ac wm8975: document audiohw settings
Change-Id: I0456f85e4ebc821c23e25026fbee3d8cf7526ee7
2016-12-12 13:13:13 +01:00
Amaury Pouly
69ea311398 wm8758: document and fix audiohw settings
It looks like a copy and paste error to me, those were completely wrong.

Change-Id: Id6ae025f4216ffccb1a8b8b790916d8b6c4694bd
2016-12-12 13:12:47 +01:00
Amaury Pouly
90a32ccad6 wm8751: document and fix audiohw settings
Document 3D depth range. Fix mismatch in recording volume: the displayed volume
is completely off the chart

Change-Id: I4c363f369e5d72f332391a6f96457b4e450404f9
2016-12-12 13:12:15 +01:00
Amaury Pouly
cc031d41ab wm8731: document audiohw settings
Change-Id: I78ec26a00a3e14a95c591ac81d96e1b480b9138e
2016-12-12 13:11:25 +01:00
Amaury Pouly
b55adf1ca2 as3514: document hardware setting based on as3514.c
Change-Id: Ifc3c4cf75f7091da0b4c4ce5b0c291b373cf9a3a
2016-12-12 13:10:52 +01:00
Amaury Pouly
af81cc4a93 imx233: slightly rework 3D audio setting
The old code made the setting appear as 0dB, 1.5dB, 3dB and 4.5dB when
in fact it is 0dB, 3dB, 4.5dB and 6dB. This commit clarifies the code and
also fix this at the same time. This imx233 3D enhancement is complete crap anyway
but now you can satisfy yourself with 6 dB of pure crap, clearly an enhancement.

Change-Id: Ia3e088987c1ff0cdde228905ff70f46476a499a2
2016-12-12 12:15:24 +01:00
Amaury Pouly
bfd3b08312 Document AUDIOHW_SETTING
Everytime I use it, I get highly confused because it's complicated and
undocumented. The code is spread all over the place and some targets clearly
use incorrect values. This is the first step of a series to cleanup audio settings
and document it properly.

Change-Id: I20cb7af2bfa33986cb8b0bf8573f17a92227f893
2016-12-12 12:15:07 +01:00
Amaury Pouly
1c97083ca7 imx233: refactor power off and reboot
There is no reason to use different code paths

Change-Id: I4894c7963c802b56b5d3576909e1008a7c401935
2016-12-12 12:06:42 +01:00
Amaury Pouly
9aeb6f48b8 Make it clear that the NWZ-E370 port also handles NWZ-E380
Change-Id: Icc061f15f4cac3d8bd9f95ea3b583556a9402f0b
2016-12-12 12:06:29 +01:00
Amaury Pouly
a983859291 imx233: add capability to boot OF or updater instead of Rockbox
This commit adds the necessary code in the dualboot stub (bootloader) to
let rockbox control the boot process. In particular, rockbox can now choose
if the next boot will be normal (boot rockbox or OF on magic key), to OF
or to updater.

The intents (to be added in follow-up commits) are:
1) Let the user more easily reboot to the OF. On some targets it is not trivial,
especially in USB mode.
2) Automatically reboot to updater when the user drop firmware.sb at the root
of the drive (currently, the user needs to do that in OF USB mode)
3) Document this OF magic

Change-Id: I86df651dec048c318c6a22de74abb8c6b41aa9ad
2016-12-12 12:03:08 +01:00
Szymon Dziok
68d192e722 SA9200: Remove duplicated and misleading define.
Change-Id: I51f61349de8c32eeb70ca1812e7b34823f482f18
2016-10-02 23:42:13 +02:00
Szymon Dziok
a0b79ce7fa HDD16X0/HDD63X0: Enable power status of charging from USB.
Change-Id: I7b1e5e87921ae0770f7783680c3dbcdbf6f257f3
2016-10-02 23:30:30 +02:00
Szymon Dziok
e3deec949d HDD6330: Implement ATA power on/off.
This should fix some errors, panics in some individual cases.

Change-Id: I27ce41f0563378e03371724f8b044404c6e69b76
2016-09-25 23:11:21 +02:00
Amaury Pouly
50c1de7092 Fix makefile not rebuilding rbversion.h in some cases
For example when running make VERSION="bla"

Change-Id: I8f8833f0fb200828346ed0a6842a9340e3653932
2016-09-23 23:03:23 +02:00
Amaury Pouly
6e553e315d fix red on stmp<3780
Change-Id: I74f0450e8f42032265b980b95f17b0b05d9dffa5
2016-09-22 21:13:12 +01:00
Amaury Pouly
420eb66cab imx233: add power-up source to the debug menu
Change-Id: Ib67385354b1d6529d41198bfdcb1ecd092e9b98b
2016-09-22 21:03:31 +01:00
Amaury Pouly
5e2600eb3a imx233: make microphone bias, bias pin and resistor configurable
This clearly fixes recording on targets where the bias pin was wrong. It may
also improve recording on targets where the bias voltage was wrong. I was unable
to find those parameters on the ZEN Mozaic, which fallback to default values.

Change-Id: Ifb5f823c9cbd01f0d9a80fa5d49d93972c8b7cfe
2016-09-21 00:36:51 +01:00
Amaury Pouly
9dc4b00df1 imx233: fix recording gain
For some reason, there was a mismatch between the setting (decibel) and the
audiohw code (centicel). This resulted in a gain divided by 10. This may
explain why some people experienced low volume with the mic on the fuze+.

Change-Id: I138ac18dd93c36f43a7dfce735efc826405c598c
2016-09-21 00:29:14 +01:00
Amaury Pouly
afe7f1b915 as3543: fix audio gap when switching from dac to line-in/recording
Also clarity parts of the code. The old code suffered from two defects:
- it was very unclear because it made changes to whole registers
  (using as3514_write) instead of fields (using as3514_set/clear/write_masked).
  Also the routing code was spread accross several functions which made it hard to
  follow.
- it did not properly reroute audio on monitor changes. In particular, the following
  could happen: when switching from DAC to radio, the code would fail to clear
  SUM_off, resulting in a weird situation where the main mixer was off
  (SUM_off) but the headphone where using the main mixer as input. Incredibly this
  worked anyway (at least on AMSv2 and YP-R0) but resulted in strange volume gaps
  between DAC and radio mode.

Change-Id: I7826835fdb59c21f6483b223883ca9289e85caca
2016-08-29 08:16:27 +02:00
Amaury Pouly
09bdb5132f Fix two typos in comments
Change-Id: I39e42c5e4505e78711e30f8826b6760419434ca0
2016-08-22 23:37:57 +01:00
Amaury Pouly
82b09144e9 imx233: add alarm value to debug menu
Hopefully this can help debugging alarm problems.

Change-Id: Id8c5603a6372744dfc62890443a37de2dd92a7c0
2016-08-22 23:37:33 +01:00
Cástor Muñoz
7083110f81 iPod Classic: NOR support for bootloader
- NOR driver (based on emCORE)
- read/write IM3 images
- read 'flsh' files

Change-Id: Ie0654e0d298affc0f47ed64b823767118bd1aa3f
2016-08-19 00:15:59 +02:00
Cástor Muñoz
bf89c757dd iPod Classic: hardware AES and SHA1 for bootloader
Based on emCORE.

Low level functions that do not depend on Rockbox kernel,
intended to be used by the bootloader, dualboot-installer,
RB drivers or other .dfu tools.

Change-Id: I3c616ded42260c6626bda23b7e580791981df61d
2016-08-19 00:15:44 +02:00
Cástor Muñoz
57a44854e3 iPod Classic: SPI driver for bootloader
Based on emCORE.

Low level functions that do not depend on Rockbox kernel,
intended to be used by the bootloader, dualboot-installer,
RB drivers or other .dfu tools.

Change-Id: Iad369627b55bf1778eab437424072f1a653e4db6
2016-08-19 00:15:36 +02:00
Cástor Muñoz
6a1644c52a as3525v2: use the new USB DesignWare driver
Targets: sansaclipplus, samsaclipv2, sansaclipzip, sansafuzev2.

Change-Id: I7773528a4e26707dd33fe9cb8948750d49570701
2016-08-15 02:56:23 +02:00
Cástor Muñoz
578525b463 iPod Classic: rework on I2C driver
- Some rewrite with the intent to get ride of these random errors
  appearing on some builds/devices (not much noticeable on RB but
  can ruin bootloader builds).
- Error handling (ACK).
- IIC clock increased to be the same as in OF.

Change-Id: Idf8cfa3c230a0a61ec9c879bf6f0ea8b061a4607
2016-08-12 14:17:46 +02:00
Cástor Muñoz
adbd2969e6 iPod Classic: ADC updates
Add code to read USB D+/D- and accessory ADCs, it is shown in HW
debug menu, might be useful in future for RB and/or the bootloader
to identify external USB chargers.

Change-Id: Ia48ca5e06bb7ddc52bb55abedde6734653ce8dba
2016-08-12 14:17:46 +02:00
Mihail Zenkov
a25d0c58aa Increase CVDD1 only for Clip+ version 0
Change-Id: I839ba2191a5c52ef6f58fd4a273db628b690a05c
2016-08-11 19:49:57 +00:00
Mihail Zenkov
cfa1c843f2 Increase CVDD1 for Clip+ to prevent ATA error
Change-Id: I0424d02196a6c5fb6d0185b007df5ece24b10b82
2016-08-10 01:36:11 +00:00