Commit graph

10512 commits

Author SHA1 Message Date
Amaury Pouly
a0fca0c7bf Add simulator support for the A860
This requires a few changes unrelated to the A860 because configure unsets
APPLICATION but the NWZ is an application!

Change-Id: Id91aa23193383ac95886b281653da5286edd9caf
2017-09-17 00:03:45 +02:00
Amaury Pouly
ac57f96838 Add support for the NWZ-A860
Change-Id: Ibf0c5168ac31d4ba2aeaa86cbeca37a1011b75fa
2017-09-17 00:03:02 +02:00
Amaury Pouly
f22ccabac3 sonynwz: fix various drivers, notably touchscreen related
Change-Id: If43087ec9ad405ee6eeae8bedba8d221f8fb142f
2017-09-17 00:02:00 +02:00
Amaury Pouly
4580897d05 fix yellows
Change-Id: Ie27d3aa7d2485b4eb053af48ba34ad6526bf6472
2017-09-06 18:01:25 +02:00
Johannes Rauh
3a5ae7dd3a Add support for Sony NW-A20
Add original author to CREDITS

Change-Id: I7a0159635c7896e2b5521c078ef62618f568d89e
2017-09-06 17:16:55 +02:00
Amaury Pouly
1d121e8c08 Initial commit for the Sony NWZ linux port
SUPPORTED SERIES:
- NWZ-E450
- NWZ-E460
- NWZ-E470
- NWZ-E580
- NWZ-A10

NOTES:
- bootloader makefile convert an extra font to be installed alongside the bootloader
  since sysfont is way too small
- the toolsicon bitmap comes from the Oxygen iconset
- touchscreen driver is untested

TODO:
- implement audio routing driver (pcm is handled by pcm-alsa)
- fix playback: it crashes on illegal instruction in DEBUG builds
- find out why the browser starts at / instead of /contents
- implement radio support
- implement return to OF for usb handling
- calibrate battery curve (NB: of can report a battery level on a 0-5 scale but
  probabl don't want to use that ?)
- implement simulator build (we need a nice image of the player)
- figure out if we can detect jack removal

POTENTIAL TODOS:
- try to build a usb serial gadget and gdbserver

Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-09-05 21:42:12 +02:00
Amaury Pouly
c7f897faa4 zen/zenxfi: always set EMI frequency to 130MHz
The ZEN/X-Fi (STMP3700) don't handle memory frequency scaling really well, for
this reason we run it at a fixed frequency. That frequency was previously set
to 64Mhz because when the CPU run at its lowest frequency, we set the VDD voltage
to 0.975 V and on STMP3700, VDDD=VDDDMEM and this is too low to run EMI at 130Mhz.
This is not a good solution because under heavy load, running the EMI at 64Mhz
results in frame drops and a sluggish device. Thus we now run the EMI at 130Mhz
all the time now. To do so, increase the minimum VDD voltage to 1.275 V.
This may result is a decreased battery life on those targets but it will also
avoid all sorts of glictches and all the device to truly run at full speed.

Change-Id: Ia8391492c29fe67bc2701aa7d8cfd00a9df349e8
2017-08-27 17:50:59 +02:00
Amaury Pouly
b81c1555ef imx233: fix potential bug in udelay
Change-Id: I5c8f5d9917f7a3353862c856bd9bbbbe9b291b1d
2017-08-27 17:49:45 +02:00
Amaury Pouly
7677a9946f zen/zenxfi: increase LCD clock frequency
Change-Id: I157e0d537a1b9d73eda4e18a4a64b10410c6fac4
2017-08-27 17:49:11 +02:00
Amaury Pouly
5d2d747247 imx233: update comment about vbusvalid
Change-Id: Ice1ece716657fa7f78f69736e5e733e1b7f67b59
2017-08-27 17:48:39 +02:00
Amaury Pouly
7ce764cdc3 zen/zenxfi: fix backlight white flash on backlight on
Change-Id: If028a208bd10f46dbe25e4aade085ba7ba13d7be
2017-08-27 17:33:29 +02:00
Franklin Wei
5645135092 Fix stupid omission
Change-Id: I9d65b8feeeb4c31e14fa60b370a12c0cc8b13f54
2017-08-16 11:02:55 -04:00
Franklin Wei
6df15ea653 Remove mutex_* calls from the MR:500 SPI driver
As before, they would trigger a panic.

Change-Id: I3c140f2897a9d3ed21e13f0a9e45025ede311de5
2017-08-16 10:51:29 -04:00
Franklin Wei
e00d78d5ab Remove bad mutex lock/unlock from tcc780x SD driver
This should make cowond2 work again.

Change-Id: Ib23d1548f72f9b604adad46fa1a1c0adee53c29e
2017-08-10 22:11:18 -04:00
Franklin Wei
0dbf7017be Remove bad mutex_* calls in telechips i2c driver
These were being called in a cpu mode they shouldn't have been,
leading to panics.

Change-Id: I7fbd0e4af5c6cbaf7177f9dafa901b3924617d7f
2017-08-10 21:53:55 -04:00
Amaury Pouly
3e1c8cca92 fix yellow
Change-Id: I682e8298aa926c3c9c073b22abdcef7f5dfef9aa
2017-07-31 09:18:25 +02:00
Amaury Pouly
70b4d1a9a6 imx233: fix horrible bug in linreg offset calculation
This was actually harmless because it was only used for the debug screen.

Change-Id: I76e802c947fdefa8df498ecfeb53e4b6ce0e12bb
2017-07-31 01:04:24 +02:00
Amaury Pouly
17e48e81af imx233: don't print stmp3780 debug info on stmp3700
Change-Id: Iffad6f39b62af496e6bb5975610807228c2986c7
2017-07-31 01:04:24 +02:00
Franklin Wei
c2546d3187 Fix arm memset() handling of negative arguments
This fixes the sgt-mines plugin. Same issue was present in an old
glibc as well:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a7ed1adbecb6aac49af75aae3b3498798cf63abc
2017-07-27 19:09:50 -04:00
Michael Giacomelli
365a005038 Slightly increase CVDD2 on AMSv2.
At least one person found an SD card that wouldn't work at 2.7v.

Change-Id: I84001f07acc9ce36c71165706cce28c2899ac6bf
2017-06-14 17:37:29 +02:00
Amaury Pouly
3210457764 imx233: fix touchscreen driver
One cannot call lradc_acquire in IRQ context. The solution is to reserve the
channel once at init. There is an additional complication on STMP3600 where
channel mapping is fixed.

Change-Id: Idccbac634a4d9002703e2b1d57748beb9b245cbb
2017-05-16 12:14:43 +10:00
Amaury Pouly
5dd443c033 Fix YP-Z5 plugin/codec buffer size
Change-Id: I8d01497c561bc3420b2b87ced2d7ab241b796a97
2017-05-16 12:14:17 +10:00
Lorenzo Miori
e9f7385bdf Samsung YP-Z5: keypad adaption to the new button API
After compiling the ypz5 target, I have discovered that the keypad
system was refusing to compile, due to a much newer button API.
This patch adapts the target to the current imx233 implementation.
Additonally, some ADC button values have been re-adjusted.

Change-Id: Ib9bfd6aeec5e9e8dfef5887c4147201dd9028a44
2017-05-16 12:10:50 +10:00
Amaury Pouly
6e69e3adaa zenxfi3,fuzeplus: disable AB repeat (not enough keys)
zenxki3: disable hotkey (not enough keys)

Change-Id: I294f622e994709dcab27462673792adeb48e7118
2017-05-16 12:10:28 +10:00
Michael Sevakis
0ca6650389 RDS: Fix a few goofs in the unicode table
Change-Id: I54c681a9eb3d5e90ee4aeedc3ec5dbd6243cb208
2017-04-21 19:47:25 -04:00
Michael Sevakis
4ffa052297 RDS on Samsung YPR0: Make compatible with RDS changes
si4700_rds_process() should only be called on the rising edge of
RDSR since it now rejects segments out of sequence. Receiving the
same segment multiple times due to rapid polling is of course out
of sequence so do no more processing until RDSR bit cycles to
avoid repeatedly sending the same data instance.

I don't have the tools installed to test compile so there could be
typos. However, I tested on gigabeat-s with YPR0 setup copied over
and it fixed the issue with PS and RT.

Change-Id: Iab511bef64030de8c07d4d22dcf338c8720e2ae2
2017-04-19 23:20:00 -04:00
Cástor Muñoz
3fffff90e2 ipod6g: some fixes for recording
- Fix broken recording from jack microphone.
- Fix recording hardware detection on models that do not support
  the jack microphone.
- Enable monitor mode when recording.

Change-Id: Ib79a2746f2d75f74cf6667d33bc9ed6512bbc8a9
2017-04-16 00:37:45 +02:00
Michael Sevakis
dbacee67c4 Optimize lld_remove() a bit
Just need to check prev and next for NULL to know whether to mess
with the head and/or tail pointers.

Change-Id: I0aee057111e11735b7806e7214af0a6038f0ab53
2017-04-13 18:59:45 -04:00
Michael Sevakis
eefc7c73e2 Fix some problems with playback crashing
I'm not sure all the situations it affects, to be honest. The fix
aimed to address the strange symptom here:
http://forums.rockbox.org/index.php/topic,50793.0.html

It turns out that ringbuf_add_cross was used when handles were
butted up against one another with the first parameter equal to
the last, which it interprets as being an empty case when it should
be interpreted as full in the context it was used. To fix this,
introduce full/empty variants of ringbuf_add_cross and ringbuf_sub
and use them at the appropriate time.

The other way to address the problem is ensure there's always at
least a space byte between the end of one handle and the start of
another but this make the code a bit trickier to reason about than
using additional function variants.

bufopen() may yield after creating a handle and so do some more
locking so that the buffering thread doesn't mess things up by
moving anything or not seeing the yet-to-be linked-in allocation.

Add alignof() macro to use proper method to get alignment of
struct memory_handle. That should be useful in general anyway.
It's merely defined as __alignof__ but looks nicer.

Change-Id: If21739eaa33a4f6c084a28ee5b3c8fceecfd87ce
2017-04-08 18:32:54 -04:00
Michael Sevakis
bfd04df480 Dircache: Improve freed name memory recallocation
There's only a need to check every MAX_TINYNAME+1 bytes and that the
last character of the needed size 0xff in order to verify the size
of the block since the minimum indirectly-stored string is
MAX_TINYNAME+1.

Change-Id: Ic789376b8575bab9266fcd54c610db0961de5d7f
2017-03-21 23:11:55 -04:00
Boris Gjenero
05739efe8d Avoid having to wait for dircache builds if shut down too soon
When dircache scanning is happening in the background, the user
can shut down the device before it is complete. Then, reset_cache()
sets size to 0 before it is copied to last_size at the end of
build_volumes(). When saved last_size is zero, scanning happens in
the foreground during next startup.

Avoid shrinking the size if the build is suspended.

Change-Id: Ife133e0be0dc0dfd53a4de119f70dba014c7ee68
2017-03-21 21:04:36 -04:00
Michael Sevakis
6db80020b4 Do some housekeeping with fat.h and SECTOR_SIZE
Many includes of fat.h are pointless. Some includes are just for
SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that
and to define tuneable values that were scattered amongst various
headers.

Remove some local definitions of SECTOR_SIZE since they have to be
in agreement with the rest of the fs code anyway.

(We'll see what's in fact pointless in a moment ;)

Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
2017-03-12 22:05:44 -04:00
Michael Sevakis
70c929179b Dircache: Refine name allocation and error handling.
* 8 bits is enough to allow 260 character base names when five
bytes is the minimum indirect storage size (0..255->5..260).

* Don't truncate anything that's too long as that can lead to
bad behavior, simply don't include the offending entry in the
parent.

* Set the .tinyname flag to 1 by default to indicate that
the entry's name doesn't need freeing. Clear it only when
allocating indirect storage.

* Rename some things to help catch all instances

Change-Id: Iff747b624acbb8e03ed26c24afdf0fc715fd9d99
2017-03-12 21:09:16 -04:00
Michael Sevakis
e3081b35cd Fix a couple dircache oopsies.
Moving binding from queued to resolved was messed up if it was the
first queued one and there were other resolved files open at the
time of resolving it.

Dircache info for a directory about to be recursively scanned should
be filled before opening it. Would only affect a directory if it
happened to be opening while it was being initialized.

Change-Id: I26ccf219c382d7caf1424b5ddddc4793e74cb390
2017-03-08 11:51:34 -05:00
Cástor Muñoz
1ba5ef716d ipod6g: rename some target files
As preparation to add new targets to the s5l8702 directory,
rename files as:

s5l8702/ipod6g/*-ipod6g.c -> s5l8702/ipod6g/*-6g.c

Change-Id: I0cd03d6bcf39b2aa198235f9014cb6948bbafcd5
2017-03-03 22:50:38 +01:00
Michael Sevakis
8ff1b6b603 Remove FF_CREAT and FF_EXCL flags in from file code.
These flags aren't stored for an open file because they're simply
actions for open() to take, corresponding to O_CREAT and O_EXCL.
Just pass the oflag argument along to the deeper call, with some
minor filtering.

Change-Id: Ic8bcfba718ebf4228bdc45de3088af1974820557
2017-02-14 17:54:50 -05:00
Michael Sevakis
eaf6aad690 Forgot to remove unused RDS buffers from the ipod remote tuner.
Also, use rds_reset() now to clear data on station change since
the rds driver internal buffers are used.

Change-Id: I043b09d661eeec21617381015347f0bcead4f7d4
2017-02-12 00:21:09 -05:00
Michael Sevakis
523ef4edbd Fix warnings and errors from fc9695e
* fmradio.c needs an implementation of tuner_get_rds_info() for the
sim (kill all the sims).

* Some macro bitflags shouldn't be seen unless HAVE_RDS_CAP is
defined.

Change-Id: Idd00c94ca2fc43cf32f9223aa4530d5a02fb3454
2017-02-11 23:16:39 -05:00
Michael Sevakis
fc9695eb47 Improve radio RDS driver and framework
* Remove unused bits like the radio event and simplify basic
radio interface. It can be more self-contained with rds.h only
required by radio and tuner code.

* Add post-processing to text a-la Silicon Labs AN243. The chip's
error correction can only do so much; additional checks are highly
recommended. Simply testing for two identical messages in a row
is extremely effective and I've never seen corrupted text since
doing that, even with mediocre reception.

Groups segments must arrive in order, not randomly; logic change
only accepts them in order, starting at 0.

Time readout was made a bit better but really we'd need to use
verbose mode and ensure that no errors were seen during receiving
of time and more checks would be need to have a stable PI. The
text is the important bit anyway.

* Time out of stale text.

* Text is no longer updated until a complete group has been
received, as is specified in the standard. Perhaps go back to
scrolling text lines in the radio screen?

* Add proper character conversion to UTF-8. Only the default G0
table for the moment. The other two could be added in.

* Add variants "RDS_CFG_PROCESS" and "RDS_CFG_PUSH" to allow
the option for processed RDS data to be pushed to the driver and
still do proper post-processing (only text conversion for now for
the latter).

Change-Id: I4d83f8b2e89a209a5096d15ec266477318c66925
2017-02-11 22:19:32 -05:00
Michael Sevakis
7373cf518f Restore dircache hookup in the database ramcache.
Do a few other changes to dircache and file code flags to
accomodate its demands.

Change-Id: I4742a54e8cfbe4d8b9cffb75faaf920dd907cf8a
2017-02-10 05:05:23 -05:00
Cástor Muñoz
882921efb6 ipod6g: bootloader v1
- dual boot
- USB mode
- battery trap

Change-Id: I8586cfeb21ee63f45ab965430725225fdfc4212d
2017-02-09 20:47:16 +01:00
Mihail Zenkov
0d0b163dd1 Slightly increase CVDD1 for Clip Zip
Change-Id: Ic784c72a643546c8e31affa820f701eb7982b7c7
2017-02-07 17:28:42 +01:00
Michael Sevakis
e5042fd090 Add some comments about the behavior of a couple path functions.
Critical reminders about the reasons path_dirname() and
path_basename() do certain things with a given kind of input and
how to interpret them.

Change-Id: I4e6ad29476bdd30abfb644f9360cc7dfd86298df
2017-02-07 02:45:26 -05:00
Michael Sevakis
72dc239299 Make sure dircache resolves outstanding references on volume root.
If a volume root was open at the beginning of a build, its dircache
reference wouldn't be resolved on an already open volume root
directory because the call to do it was simply omitted. Nothing
horribly bad unless a root were opened at mount time and kept open
long term.

Change-Id: I09de30ff8174ad1d14eeeb9539bd23fb51b9e31a
2017-02-06 03:21:25 -05:00
Michael Sevakis
29c493dd74 Fix a bug in disk.c that really wasn't affecting anything.
volume_onmount_internal() was being given the next volume to mount
instead of the one just mounted. Only dircache was being notified
for now, which always attempts to scan everything that needs to be
rebuilt, currently making the volume parameter value immaterial.

Put things in the right place and also set the disk sector
multiplier before notifying anybody of the new volume.

Change-Id: Ibc8f26c1d1eca672c753280b49fd8259fde51047
2017-02-06 02:25:22 -05:00
Amaury Pouly
d7871914ac Fix dangerous casts
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h

Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-02-04 17:24:47 +01:00
Amaury Pouly
1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
Amaury Pouly
c156c5f5e5 zen/zenxfi: adjust maximum emi voltage
Running at 130MHz is unsafe since on those targets, we disable memory frequency
scaling because it is unstable. That leads to situation where cpu is running at
64MHz and VDD is at 1.050V. But on STMP3700, the EMI uses the VDD rail instead
of a dedicated VDDMEM rail as on STMP3780. Thus we are essentially running the
EMI at 130MHz at 1.050V when the minimum recommened voltage is 1.2V. This commit
runs the EMI at 64MHz all the time on the ZEN and ZEN X-Fi which will lead to
reduce performance but hopefully increases stability.

Change-Id: Ida6c2ec130b1778973e383d7c44a06a6ca8f9268
2017-02-04 17:17:44 +01:00
Amaury Pouly
baec807d70 zenmozaic: adjust button voltage
The values were recorded for VDDIO at 3.46V and not 3.5

Change-Id: I12880c3d7336389bbac07fe01b8d63d9cd28d177
2017-02-04 17:17:11 +01:00
Amaury Pouly
501e8a7e71 imx233: remove weak attribute on some functions
This feature was never used and it is not even working because weak linking
doesn't work in-between files in a library.

Change-Id: I389ea5f17be1d9db0e2150828d704be5a091e09d
2017-02-04 17:16:32 +01:00