Commit graph

785 commits

Author SHA1 Message Date
Aidan MacDonald
75cb8ba8a4 FiiO M3K/X1000: add USB support
This only required a minor patch to the usb-designware driver due
to DMA requiring physical addresses -- on the X1000, these differ
from virtual addresses so we have to do the usual conversion.

Both the mass storage and HID drivers work, but there are a few
issues so this can't be considered 100% stable yet.

- Mass storage might not be detected properly on insertion,
  and USB has to be replugged before it shows up
- HID driver may occasionally panic or hang the machine

Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21 18:31:55 +00:00
Aidan MacDonald
c71a47f649 Move usb-designware out of ARM target tree
Change-Id: Ic981737976655596ea622b7b4d15a2d841bd993d
2021-04-18 18:45:28 +01:00
Aidan MacDonald
1b8542490d x1000: Redesign SPL, and allow it to flash the bootloader
SPL is now designed so core X1000 code is in control of the boot,
under the reasonable assumption that the device boots from flash.
It should not be too hard to adapt to other X1000 ports.

The biggest functional change is that the SPL can now read/write
the flash, under the control of a host computer. The SPL relies
on the boot ROM for USB communication, so the host has to execute
the SPL multiple times following a protocol.

Change-Id: I3ffaa00e4bf191e043c9df0e2e64d15193ff42c9
2021-04-17 20:22:49 +00:00
Aidan MacDonald
3ec66893e3 New port: FiiO M3K on bare metal
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-03-28 00:01:37 +00:00
Aidan MacDonald
94b40ed314 Add asynchronous I2C bus API
The driver core is based off of the i.MX233 I2C implementation and
should work on any platform.

Change-Id: I3b9c15e12a689ef02a51c285be08d29d35e323dc
2021-03-23 15:42:54 +00:00
Solomon Peachy
555299af9f hosted: Consolidate the code that polls the battery charging status
affects all hiby targets, fiiom3k, and ibasso dx50/dx90

As well as deduplicating a small pile of code, this also implements
hysteresis so we're not doing a sysfs read/lookup multiple times
back-to-back every time the power management tick fires.

Change-Id: I2f7672acbb36341becf67e07960c24c681270d09
2021-03-10 18:29:29 -05:00
Aidan MacDonald
aacb0811d9 Rename symbols of FiiO M3K Linux-based port
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX.

Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2021-02-27 23:53:28 +00:00
Solomon Peachy
125e97b0bf hosted: Consolidate common /dev/input code shared by the hiby targets
* Enable dynamic number of input devices, needed for bluetooth support

Change-Id: Ic2425834eb9b0fff298899ab45f3115ce1d95e91
2020-10-31 14:17:22 +00:00
Solomon Peachy
d544ce46a7 hosted: Unify the USB code for the hiby-based players.
* Specify exported USB VID/PID in target config header
 * Don't fail if the sd filesystem has already been remounted
   (ie due to platform hotplug)

Change-Id: Ifd2dae0c4f15086bf2bf89eb093018b3c4d2b75d
2020-10-15 10:18:16 -04:00
Solomon Peachy
2a471e288c New port: AIGO EROS Q / EROS K
The Q and K have a slightly different case, but the hardware under the
shell is completely identical.

These models are rebadged versions:

 * Hifiwalker H2   (== Q)
 * AGPTek H3       (== K)
 * Surfans F20     (== K)

Other notes:

  * Significant improvements in the shared Hiby-platform launcher/loader
    * SD card can theoretically be hot-swapped now
    * Support external USB mass storage!
  * Some consolidation of Hiby-platform targets
  * Some consolidation of plugin keymaps

Todo/known issues:

 * Keymaps need to be gone over properly
 * Convert to HAVE_SCROLLWHEEL?

Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
2020-10-11 16:37:17 -04:00
Solomon Peachy
6533d983ca hosted: Add ROLO support for hosted targets
Change-Id: I2d46a63ee8225a9d9d77dd80a06c418af78c260c
2020-10-11 14:18:42 +00:00
Solomon Peachy
aabc8aca47 New port: FiiO M3K
Most credit goes to:  Roman Skylarov
Additional integration and refactoring by myself.

 *** COMPLETELY UNTESTED ***

Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b
2020-10-09 12:41:18 -04:00
Solomon Peachy
dc81f96fd1 Don't compile audio codecs into native bootloader builds.
Change-Id: I0b2cc143572bf88423bdf7647cee0af567aee684
2020-10-08 19:20:50 -04:00
William Wilgus
f850bbbbc4 Revert root_redirect :(
This reverts commit 31fc46ded6.

Change-Id: Ia78618c0e8b25ca65f7c8ae0db1cb9c9b321bad9
2020-08-20 21:54:00 -04:00
William Wilgus
5ef28cccf9 Allow mounting of any directory as the root directory.
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.

Defaults are in export/rbpaths.h

It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.

Change-Id: I90b5c0a1c949283d3102c16734b0b6ac73901a30
2020-08-20 23:08:57 +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
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
0c4f89370d [2/4] get rid of HAVE_LCD_CHARCELLS
HAVE_LCD_BITMAP is now redundant.

lcd_bitmap is always-on in features.txt so manual and lang strings
don't have to change

Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
Lorenzo Miori
b1c72afd4d Samsung YP-R0: fix simulator build
Protect source code files which are not meant to be built on simulator builds.

Change-Id: I81ad440d8f86e9eda27807e6b71647ced5071b44
2020-07-07 16:50:19 +00:00
Solomon Peachy
53b93ea6a6 hiby: Refactor X3ii/X20 and Rocker LCD code
Once some missing power optimization stuff was added to the X3ii code,
they were completely identical.

Change-Id: I68e4db5e270e8ff22f91e521616a054bd7baa95d
2020-04-08 15:56:06 +02:00
Marcin Bukat
180cef835b xDuoo X3II and X20 port
Provided by Roman Stolyarov
Integration, Refactoring, and Upstreaming by Solomon Peachy

X3II confirmed working by forum tester, X20 is nearly identical.

This includes bootloader, main firmware, and the flash image patcher.

Eventual Todo:

 * Further refactor AGPTek Rocker & xduoo hiby bootloaders
 * Further refactor AGPTek Rocker & xduoo hosted platform code

Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
2020-04-06 18:15:41 +02:00
Michael Sevakis
b70fecf21d Add proper float formatting to vuprintf
Wanted to see how gnarly it is to do.

Big number handling could be done with better algorithms
since it can get a bit slow with large integers or tiny
fractions with many lead zeros when only a few digits are
needed.

Anyway, it supports %e, %E, %f, %F, %g and %G. No %a or long
double support seems warranted at the moment.

Assumes IEEE 754 double format but it's laid out to be able to
replace a function to handle others if needed.

Tested in a driver program that has a duplicate vuprintf and
the content was pasted in once it looked sound enough to put
up a patch.

Change-Id: I6dae8624d3208e644c88e36e6a17d8fc9144f988
2019-07-19 22:07:41 -04:00
Solomon Peachy
d4942cc74c Add Xuelin iHIFI 770/770C/800 support
Taken from the xvortex fork (Roman Stolyarov)
Ported, rebased, and cleaned up by myself.

Change-Id: I7b2bca2d29502f2e4544e42f3d122786dd4b7978
2019-01-02 08:10:01 -05: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
Marcin Bukat
5c015ada90 Agptek Rocker: Implement lcd_enable()
In theory this should slightly improve battery life.

Change-Id: Iaf55beb7dbc20e7562017958aeb0386459d49a31
2018-06-14 10:03:07 +02:00
Marcin Bukat
307ea8382e Fix merge errors which broke sony linux targets
Change-Id: Ic0c618c6e2034609d1964bb3e9ff96c7a7cf1d40
2018-06-12 12:50:09 +02:00
Marcin Bukat
7f4d183f17 Fix ipod classic build
Change-Id: I55a2849bd1a22b40c0f75dcaeac481866f7dbf61
2018-06-12 11:19:24 +02:00
Marcin Bukat
7692558674 Agptek Rocker: Implement USB mass storage driver
Agptek uses composite android driver.

Change-Id: Iece188ad640f3dfd24c171946c14da4c3516b6d5
2018-06-12 10:31:15 +02:00
Marcin Bukat
d5889b3d94 Agptek Rocker: Make simulator compile and run
There are some things to fix left but at least it starts
and you can navigate.

Change-Id: I76084bfc50334deeb55f46a10e97b5d6639815ac
2018-06-12 10:31:15 +02:00
Marcin Bukat
d55680993d Agptek Rocker: Initial commit
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2018-06-12 10:31:14 +02:00
Michael Sevakis
5c9688961e Implement a much more capable vuprintf()
New support as well as some buggy support fixed.

Still no floating point support if ever that would be desired.

Support (*):
* Flags: '-', '+', ' ', '#', '0'

* Width and precision: 'n', '.n', '*' and '.*'

* Length modifiers: 'hh', 'h', 'j', 'l', 'll', 't', 'z'

* Radix: 'c', 'd', 'i', 'n', 'o', 'p/P', 's', 'u', 'x/X'

(*) Provision exists to switch lesser-used stuff on or off or when
certain functionality isn't desired (bootloader?). The compulsory
radixes are everything but 'o', 'n', 'p/P' and 'x/X' with length
modifiers being optional. The default setup is 'l', 'z', 'c', 'd',
'p/P', 's', 'u', 'x/X'.

* Move fdprintf() to its own file. It was in a strange place.

* Make callers compatible and fix a couple snprintf() bugs while
at it.

Could smush it down in size but I'm gonna get over the binsize
neurosis and just the let optimizer do its thing.

Change-Id: Ibdc613a9b6775802c188b29b9dd46c568c94f7c3
2017-11-21 05:00:27 -05:00
Amaury Pouly
0fe7b8becf nwzlinux: add support for radio
None of the Sony up to A15 seem to support RDS (they use either Si4702 or Si4708),
thus I did not add any code to support RDS.

Change-Id: I64838993b9705b36b94665f8470c7a89c772c961
2017-11-06 21:37:06 +01:00
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
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
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
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
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
Michael Sevakis
2220a4b695 Improve imx31 interrupt code for PMIC and GPIO
Fix stuff that was bugging me about the way I did it at first.

While messing around I found RDS code wasn't masking its GPIO
ISR as it should, which might lead to two different interrupts
messing with the static data.

Change-Id: I54626809ea3039a842af0cc9e3e42853326c4193
2017-01-29 19:07:55 -05: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
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
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
ef572fec52 iPod Nano 2G: use the new USB DesignWare driver
Change-Id: I8d1561bf4e239b55617a8d5075457a668e0c312c
2016-08-02 04:57:50 +02:00
Cástor Muñoz
3c5aa754de iPod Classic: use the new USB DesignWare driver
Change-Id: I36aabb5cb9cfe2d8c4f8fbcea944efec58ef9671
2016-08-02 04:57:50 +02:00
Cástor Muñoz
5e305d35c9 Introduce new USB driver for Synopsys DesignWare USB OTG core.
Based on g#844 and g#949, it is intended as a replacement for the
current s3c6400x USB driver.

The DesignWare USB OTG core is integrated into many SoC's, however
HW core version and capabilities (mainly DMA mode, Tx FIFO mode,
FIFO size and number of available IN/OUT endpoins) may differ:

CPU       targets        HW ver  DMA  NPTX FIFO  FIFO sz  #IN/OUT
--------  -------------  ------  ---  ---------  -------  -------
as3525v2  sansaclipplus  2.60a   Yes  Dedicated  0x535    4/4
          sansaclipv2
          sansaclipzip
          sansafuzev2
s5l8701   ipodnano2g     2.20a   Yes  Shared     0x500    4/5
s5l8702   ipod6g         2.60a   Yes  Dedicated  0x820    7/7
          ipodnano3g
s5l8720   ipodnano4g     ?       ?    ?          ?        ?

Functionality supported by this driver:
- Device mode, compatible with USB 1.1/2.0 hosts.
- Shared FIFO (USB_DW_SHARED_FIFO) or dedicated FIFOs.
- No DMA (USB_DW_ARCH_SLAVE) or internal DMA mode.
- Concurrent transfers: control, bulk (usb_storage, usb_serial) and
  interrupt (usb_hid).

Actually this driver is not used by any CPU, it will be enabled for
each individual CPU/target in next patches.

Change-Id: I74a1e836d18927a31f6977d71115fb442477dd5f
2016-08-02 04:57:49 +02:00
Amaury Pouly
d42a4a4eb4 zenxfi3: rewrite mpr121 driver
The new driver uses an asynchronous architecture for touch status reading.

Change-Id: Ic75a8b91bc47ee16c3af873afde178cd70186376
2016-06-01 23:09:27 +02:00
Amaury Pouly
b2afd931e2 fuze+: rewrite touchpad driver
The old driver was bad in many respect, it had some race conditions, it was
using a thread to serialize transfers because of the legacy i2c interface.
It also had huge latency (typically 50ms but delays up to 300ms can happen),
thus some presses were missed.
The new driver takes advantage of the new i2c driver to do everything
asynchronously. It also does not need a thread anymore because queueing
ensures proper serialization. It provides much better and reliable latency
(typically ~2ms).
Also fix the debug screen which was horribly broken. The new screen also
displays the deadzones.

Change-Id: I69b7f99b75053e6b1d3d56beb4453c004fd2076e
2016-06-01 23:08:17 +02:00
Cástor Muñoz
e863f9a0ce iPod Classic: piezo support for bootloader
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: If80214d26e505265ace19d9704f1e1300f98b2f4
2016-05-25 10:59:44 +02:00