Commit Graph

4965 Commits

Author SHA1 Message Date
Aidan MacDonald d6220f618b MIPS: emulate -ffunction-sections with macros in mmu-mips
Using a macro to put each function in its own .icode-based section
allows us to put the functions in IRAM _and_ have linker GC. This
removes a troublesome #ifdef BOOTLOADER_SPL on the X1000 target.

Change-Id: Ia7b59778f5c36b7970dee4280547e434a1f4fc5a
2021-04-25 14:04:38 +00:00
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 088ebb5fac Minor enhancements to axp173 driver
- Added register names to reduce usage of magic numbers
- Added function to control max charging current, needed for USB
- Corrected comment about axp173, since FiiO M3K has an axp192

Change-Id: I6604ce8d44e5a2ee84061cf042d17ccc4734ac57
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 92140752d7 FiiO M3K: disable CPU frequency switching
After conducting some simplistic tests, I found that the power usage
did not appear to be affected by the CPU frequency.

I tested by playing back a 44.1 KHz FLAC file on single track repeat,
and measured current with the AXP173's battery discharge current ADC.
The button and LCD backlights were set to always on. Headphones were
unplugged and the volume was muted to eliminate any influence from
the headphone amp.

On average the current usage was between 78-81 mA at 1008 MHz, 252 MHz,
and 112 MHz. If anything, 1008 MHz drew _less_ current than the lower
frequencies, by about 1-3 mA.

A possible explanation for this, assuming it's not just a bias of the
test, is that the CPU idle state saves so much power that it's better
to maximize the real time that the CPU spends idling. More systematic
testing is needed to confirm this.

Change-Id: I527473e8c4c12bc1e94f8d4e849fecc108022abe
2021-04-17 20:24:36 +00:00
Aidan MacDonald fceffb7d4a x1000: disable CPU idle stats by default
There's no point including this in normal builds: the stats are not
used for anything, they are not really of interest to anyone except
developers, and add a small overhead to the kernel tick.

Change-Id: I1b4f67cc62d11d634a8cec279dca513dd10eea96
2021-04-17 20:24:21 +00:00
Aidan MacDonald 01d1eb4258 FiiO M3K/X1000: Do system clock initialization in the SPL
Initializing the clocks in the SPL brings Rockbox in line with
how the FiiO M3K's original SPL works. It's likely other X1000
devices do this too.

There was a logic error in the previous setup: the code falsely
assumed that DDR memory would always be running from MPLL, but
it would be switched to APLL by the bootloader. Rockbox would
then try to re-init APLL, albeit with the same parameters. Maybe
this was the cause of the boot hang on some units.

Change-Id: I64064585e491bbdf1e95fe9428c91a9314f2a917
2021-04-17 20:24:07 +00:00
Aidan MacDonald e123c5d2f2 x1000: don't reset all GPIOs at boot
What we really want is to avoid any interrupts being generated
before the drivers which handle them are properly initialized.
Intead of trashing all GPIOs, search for the problem pins and
fix them, leaving the others alone.

This fixes the M3K's button light flickering on boot and should
stop the M3K from entering a potentially confusing "dead" state
where all the lights are off but the CPU is still on.

Change-Id: I13a6da0f0950190396bff5d6e8c343c668e8fea1
2021-04-17 20:23:47 +00: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
Solomon Peachy ec4b5c794e ibasso: Found a reliable way to determine if SD card is present at startup
Change-Id: If02788a50e141cc2e5b1a6cde2df2a5ef5713e30
2021-04-13 14:28:30 +00:00
Solomon Peachy c0a49d9bdf ibasso: Default to assuming the external SD card is inserted
Detection at startup is proving to be unreliable.  Even if card is not
present at startup, upon insertion it will sort itself out properly.

Change-Id: I9ee90b724c90c530a39264f698c200a48aa72b1d
2021-04-12 21:54:59 +00:00
Solomon Peachy b6fce99046 ibasso: Implement proper PIVOT_ROOT filesystem access
Including direct use of the external SD card mount

Known issue:  If SD card is inserted at startup, it must be
              ejected and reinserted to be registered.

Change-Id: I5f420160bda32135cbb088c1e8b04b6e3a73018e
2021-04-12 18:19:06 +00:00
Solomon Peachy 1303be3437 ibasso: Get rid of #include "settings.h" in the button code
(It mucks with paths causing the input device open to fail)

Change-Id: I1e8a63d09c229ed9bacbd599a7869e875df21fd2
2021-04-10 10:25:20 -04:00
James Buren 448f98d9c0 pp: fix adc mistake where base 10 was used instead of base 16
Change-Id: I8562af8a11a22cd9edec149b2519ac0205d2b2dc
2021-04-10 01:13:09 +00:00
Solomon Peachy 13dbcab6c0 erosq: When mucking with the clickwheel, ensure we keep the screen awake!
Change-Id: I49d39f301f4b44c2477a657e2af964b97d73cf6b
2021-04-09 19:21:02 -04:00
Solomon Peachy cd64aa2b10 xduoox3: Global volume_limit now applies to the line output as well
The X3's line out is a bit hot, at ~4.3Vpp, so allow it to be backed off.

(On my X3, backing it off to -6dB brings Vpp down to ~3.4V)

Change-Id: Iea38ef1c6a1b183d0f8fb4eaf2bf9ed6b350a532
2021-04-09 15:54:04 -04:00
Aidan MacDonald c0a823e2ab x1000: Trim unused cache functions from the SPL build
Change-Id: Ib645d8ff10cfc672de8ac2debaa17d7dd50dfafb
2021-04-09 10:53:36 +00:00
Solomon Peachy 1e2a9a651c erosq: Switch to 32-bit PCM output, and do volume scaling in driver
Should improve audio output quality, especially at lower volumes.

Change-Id: I31c38f05fe4b554b092511f0fe7aaad9f346f6c5
2021-04-08 23:58:49 -04:00
Solomon Peachy e86d90905b alsa: Fix an #ifdef typo in 54fcb907c1
HAE_ALSA_32BIT -> HAVE_ALSA_32BIT

Change-Id: Icf375d42f6b20e8393b6ffe6d23b3ac96abb571b
2021-04-08 23:10:41 -04:00
Solomon Peachy 54fcb907c1 alsa: instead of per-target tests, use HAVE_ALSA_32BIT
Affects all Sony NWZ (linux) and the fiio m3k linux targets.

Change-Id: I2fcf121bd026103d2b72332a5a52cc2b5e93949f
2021-04-08 23:02:15 -04:00
amachronic 28c89386af x1000: Improve NAND driver API
- Proper error codes are now returned from all functions. These codes will
  be used by a host-side flash tool for error reporting.

- nand_erase_block() was replaced by nand_erase_bytes(). The caller can't
  know how big an eraseblock is with the current API, so next best thing
  is to verify the correct alignment inside the call and reject the erase
  if it isn't properly aligned.

- Fixed typo in nandcmd_block_erase() which would cause an SFC error to be
  interpreted as success. Yikes.

Change-Id: Id4ac9b44fa7fc2fcb81ff19ba730df78457c0383
2021-04-06 17:27:12 +01:00
amachronic b5558c1cf9 x1000: place SPL's NAND bounce buffers in DRAM
This frees up 2 KiB in the SPL's memory map, leaving more room for code.

Change-Id: I01bbe2ab2905b2773a8b76d8c53e9f3d55bd040f
2021-04-06 17:27:09 +01:00
amachronic 1b314502c8 Remove a duplicate const
Change-Id: I0e6f4d609eb03155de4cd16aa98cab25f54a6681
2021-04-06 17:27:08 +01:00
Solomon Peachy 74ae18cc8a fiiom3k_linux: Enable HAVE_TOUCHPAD and add in missing bits
Change-Id: I78fa5fdb3648adfaa40f6d5f3c255666a85e2761
2021-04-05 13:57:01 +00:00
Solomon Peachy afec380a0d gigabeats: Fix hang on startup caused by a stack overflow
headphone ADC thread stack was slightly too small.  Bump it up a bit.

(it was _perfectly_ sized for the prior older toolchain+optimization flags...)

Change-Id: I2ca67c2b85c54f879892a31e281d7696f893389c
2021-04-01 20:24:59 -04:00
Solomon Peachy 2f785c7797 PP: More cache invalidation fixes
Take into account the size of the pointer in the loop termination
condition.

Change-Id: Ib4f7625ef143149a0d691a2109bad67aece6241c
2021-04-01 10:57:29 -04:00
Solomon Peachy 9f7f1a841a PP: Use CURRENT_CORE instead of IF_COP_CORE(CPU)
Use of IF_COP_CORE was mistakenly introduced as part of 89acde6af2,
effectively short-circuiting multiple tests resulting in the code
paths always being executed, on both cores.

Use the correct macro, so per-CPU paths are handled properly.

Change-Id: Id346cf759fc1b06b7d56694d7af1f469caf785a4
2021-04-01 08:45:43 -04:00
William Wilgus 89acde6af2 H10 PP Crash -- Fixed
This appears to finally fix the issue
turns out the status register we were writing was only for the CPU
COP cache flush wiped out the CPU cache
--

Added some defines to cut down on the magic numbers
Added some comments explaining such

Set the address to full 20 bit address
0x1FFFFF which is then left shifted 11 internally --  somewhere around 4GB?

Link explains the cache status bits
https://daniel.haxx.se/sansa/memory_controller.txt

Change-Id: I57b7187c2f71a5b54ce145bf3a21ed492a8993cb
2021-04-01 00:52:57 -04:00
Solomon Peachy 058a9ec945 Add M3K native to the simulator
Change-Id: If3e877d2df189e44076631fd571cf6aa70ce6ca8
2021-03-28 12:08:31 -04:00
Aidan MacDonald 3ec66893e3 New port: FiiO M3K on bare metal
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-03-28 00:01:37 +00:00
Solomon Peachy 83fcbedc65 rk27xx: Take advantage of STORAGE_NEEDS_BOUNCE_BUFFER
(And get rid of its custom realignment code)

Change-Id: Iff27d717b870d3db239310421776744ea6863373
2021-03-27 17:18:21 -04:00
Solomon Peachy 961ffa61dd Use STORAGE_NEEDS_BOUNCE_BUFFER instead of STORAGE_NEEDS_ALIGN
Enable its use in the jz47xx MIPS targets.

(accidently committed g#3249 before making these changes)

Change-Id: I1791946f632901f0c7a94b04b009671aa0d71717
2021-03-27 15:02:18 -04:00
Solomon Peachy c96dc1c886 xduoox3ii: Wrap the remote key detection in USE_REMOTE
Makes it straightforward to disable for debugging or defective hardware

Change-Id: Ie72786f6e9eabf396a05ef8a02e422c34c97691a
2021-03-27 14:43:17 -04:00
Solomon Peachy d5cc74ebd8 build: Get rid of suplerflous '-Os' references in linker calls
We should be using global optimization flags, and -Os is already our
default.

Change-Id: Iaba511b2b4fa2ee0f1eb1ad28024be954f4c5f03
2021-03-25 12:20:15 -04:00
Solomon Peachy 87e37a4d48 xduoo_x3ii: Improvements in the meymappings!
* PREV/NEXT now swapped so they do what is expected in most contexts
 * List and setting context retains prior behavior
 * Enable the ADC that reads the headset remote and map the keys.
 * As ADC-based remote "events" arrive as press/release pairs,
   delay the button release.

Change-Id: I22d4eac3bfe1573b50eca795cf377bdafdeb5336
2021-03-10 21:35:44 -05:00
Solomon Peachy 7201c3a685 fiiom3klinux: Fix a build warning.
Change-Id: I1355c87d17376422d54b259db2078ea5f886bedb
2021-03-10 19:01:12 -05: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 777f63d529 Move MIPS cache management functions to IRAM
Previously these were placed in DRAM, which is overwritten by RoLo
when it loads a new image, but RoLo must call commit_discard_idcache()
after loading the image.

Change-Id: I5dcc4ca711b774166f83c668695edbcabfab2604
2021-03-09 20:04:30 +00:00
Aidan MacDonald fb99d890a8 Fix typo in MIPS cache discard
Change-Id: I6a06e5f3098324d985bd59322755cd68122ec0bf
2021-03-04 19:39:28 +00:00
Solomon Peachy cbace906c6 mips: Revert to commiting the cache when we're told to discard an unaligned block.
The filesystem API often passes in unaligned receive buffers, and some
code (eg BMP reader) processes data in-place, leading to data loss when
we dropped the cache.

(And document exactly what we're doing, so we don't go through this again
 at $future_date)

Change-Id: If47a7f2148a5a1a43777f0bd3be1bdfe8239e91e
2021-03-04 12:00:15 -05:00
Aidan MacDonald de53965e3f Third try fixing MIPS cache code
Changing this to be a pure discard operation after discussion on IRC

Change-Id: I62955ae7975fdbbfd9eef376476042a36fe3d95a
2021-03-04 02:47:13 +00:00
Solomon Peachy b82298ae2c jz4740: Fix incorrect dcache flush in the USB RX DMA code.
Change-Id: I01eff581b16569bda97c55afc7adac897b29e0e3
2021-03-03 21:44:28 -05:00
Aidan MacDonald 8cb4c18310 Really fix the MIPS cache bug this time
In fixing the original bug I tried to optimize discard_dcache_range()
to minimize writeback and inadvertently introduced a second bug, which
typically ends in a TLB refill panic.

It occurs only if the range fits within one cache line, and when both
the start and end of the range are not aligned to a cache line. This
causes ptr to be incremented and end to be decremented, so ptr > end,
and the loop can't terminate.

Change-Id: Ibaac072f1369268d3327d534ad08ef9dcee3db65
2021-03-03 23:57:08 +00:00
Aidan MacDonald 74a3d1f5be Fix MIPS cache operations and enable HAVE_CPU_CACHE_ALIGN on MIPS
- The range-based cache operations on MIPS were broken and only worked
  properly when BOTH the address and size were multiples of the cache
  line size. If this was not the case, the last cache line of the range
  would not be touched!

  Fix is to align start/end pointers to cache lines before iterating.

- To my knowledge all MIPS processors have a cache, so I enabled
  HAVE_CPU_CACHE_ALIGN by default. This also allows mmu-mips.c to use
  the CACHEALIGN_UP/DOWN macros.

- Make jz4760/system-target.h define its cache line size properly.

Change-Id: I1fcd04a59791daa233b9699f04d5ac1cc6bacee7
2021-03-03 20:50:28 +00:00
Christian Soffke 7d7850368e Disable UDMA 2 on iPod4G target
ATA DMA was enabled for all PP502x targets in d118f47 after previously reported instabilities were thought to have been fixed. The iPod 4G target remains unstable when UDMA 2 is enabled. File system corruption will eventually occur even using stock hardware in normal usage, according to both my own experience and that of several other forum users. UDMA 1 appears to be stable.

Change-Id: I8526bad9e879f5dad5174cfe07cd8828d8b72406
2021-02-27 14:38:49 +00:00
Solomon Peachy 02119357dc erosq: Enable HAVE_SCROLLWHEEL for saner scroll wheel handling
Basically no longer treat SCROLL_FWD/BACK as "button" events, instead
relying on the scrollwheel hooks to handle things properly.

Change-Id: I9bf18595ab3ca68e912f6dfb1f2eac2544578e73
2020-12-16 14:54:11 -05:00
Solomon Peachy a5961c944b FS#5320: Keypad hold doesn't let go until scrolling is used (ipod 4g/5g)
Patch by Boris Gjenero

Change-Id: I7df956fb63478bbbe891104faf5ab35096da7576
2020-11-29 08:51:37 -05:00
Solomon Peachy 3027cead01 hosted: Improve buffer underrun handling in the ALSA driver
* Bump internal mix buffer size by 4x, to 1K frames (matching ALSA period)
 * Handle an underrun that occurs when filling the audio buffer
 * Log underruns and make them available in the debug info

Change-Id: I28d56dd35d88851fa167ad92368a5882937a758f
2020-11-18 14:38:12 -05:00
Solomon Peachy 03cd773051 ibasso: Hopefully hack usb into building again.
Change-Id: I6f369d60319704ab4d2c18b80ba6e78902630790
2020-11-13 20:04:04 -05:00
Solomon Peachy 610ad6f6e3 ibasso: Fix red introduced in 60f581e
Change-Id: I9095e9e9213dde252de836851b743001b9483a1b
2020-11-13 18:17:00 -05:00
Solomon Peachy 60f581e8f5 usb: Add ability to prompt user about what to do upon usb insertion
v3: Add in config option
 v4: Bugfixes
 v5: Force a redraw upon exiting
 v6: keypress-in-chargeonly mode enables mass storage (and vice versa)
 v7: Fix bootloader builds
 v8: Update manual, and have bootloader respect keypresses
 v9: Change default to mass storage (ie no change in behavior)

 todo:
  * test-build dx50/dx90
  * Switch from yes/no to proper menu?
  * prevent WPS progress bar from drawing over us

Change-Id: I82e0ccb08497b7a5aa756ce77f1332ee963703a7

...

Change-Id: I7946cf240b18a4fa8ace5e25e1eb6e97b8b12d7c
2020-11-13 16:44:01 -05:00
William Wilgus f65fb2a64a h300, Others Bugfix Bootloader backlight_init()
backlight_init needs to be called after lcd_init when using
lcd_enable()

Change-Id: Id034835c903801fea49e2b972c110c1ec5106976
2020-11-13 18:08:01 +00:00
James Buren 8ac46f844f h300: fix one long-standing bootloader bug
This was introduced in e13c600133 back
when the author was trying to optimize the LCD code with DMA. For
whatever reason this broke the bootloader for the last 10 years or so
and no one could figure out why. This is now fixed.

However the bootloader is still currently broken in HEAD due to recent
changes to the LCD code. A fix for that is not yet known.

Change-Id: I046d53f9f391f558c391f2fadb6b260fe3be4d92
2020-11-13 18:08:01 +00:00
Solomon Peachy 388adff3cc pcm: Further cleanup of unused bits of the PCM ACPI:
* pcm_get_bytes_remaining()
 * pcm_calculate_peaks()
 * pcm_get_peak_buffer()

Nothing in-tree uses these at all (except for the lua plugin wrapper)

Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
2020-11-12 15:59:09 +00:00
William Wilgus 1a68856f52 Rocker Add WPS and Tree Hotkey, button codes in debug menu
VolUp+VolDown becomes the wps and tree (file browser) hotkey

Change-Id: I0cba96927420c318506bc0c15dabcb809cd81647
2020-11-12 01:22:32 -05:00
Moshe Piekarski c4254d10fc Fuze+: Fix misplaced rectangle when lcd_flip set
Change-Id: Ic5197d8dffd66cfefdb42242869b48b33aa4d042
2020-11-08 03:19:04 +00:00
Torne Wuff 5db83c155a pp5020: use ipod firmware timings for ATA PIO.
Some mSATA adapters seem to have trouble working with Rockbox using our
normal PIO timings; the timing value we use is probably out of spec and
is different to the OF. Switch to using the OF's timings according to
which PIO mode we select. This may not completely resolve problems with
these adapters but allows Rockbox to boot and play audio.

Change-Id: If73210700eb4af01864b373709ee1d15c775fb11
2020-11-04 03:03:19 +00:00
Solomon Peachy 8029c89808 erosq: Fix scrollwheel regression introduced in 125e97b0
Change-Id: Ie1a53d7140ffb09d8e3a19a41617fdc51344a619
2020-11-03 13:23:39 +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
Amaury Pouly dd82f13fa1 nwz/alsa: various improvements
Also audiohw driver to specific device name, rewrite alsa controls code to
cache more data, thus making the code easier and use less stack. Avoid using
short/long in pcm alsa code since it's the wrong size on 64-bit (simulator
for example)

Change-Id: Ibc1ec44396e37b6cbdedbcf37300878638e5d2d3
2020-10-31 14:16:31 +00:00
Solomon Peachy ce9e7e7122 hosted: fix warning when LOGF is enabled
Change-Id: I67b4cbf8899860411869399143424a0e55d0d4ca
2020-10-31 14:10:46 +00:00
Solomon Peachy 7eee526e6a fix red introduced in the android pcm driver (rev fe2d52c)
Change-Id: I2fa160fd39842a5434cf11573b50061786e610ca
2020-10-31 01:44:48 +00:00
Solomon Peachy fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
Nothing in the core has used it for some time.  It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.

This allows us to get rid of pcm_play_dma_pause() from all audio drivers

Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-31 01:18:27 +00:00
Solomon Peachy 7dbfda6c55 iaudiom5: Fix build.
Basically we're overflowing IRAM by 48 bytes.  Shrink the stack
by 48 bytes to compensate.

Fixing this properly will require careful decisions about what
(code and/or data) to eject from IRAM.

Change-Id: Ia3054280bcbd9813b9cce83f16ba4fbd15085110
2020-10-27 14:49:19 -04:00
Solomon Peachy 61f698715d coldfire: We need -fno-delete-null-pointer-checks in flash controller code
Change-Id: I9a3e4ced2c3d41f6a31a968af72659a1a14f702e
2020-10-27 10:29:59 -04:00
William Wilgus 299c237075 'Fix RED e200 Framebuffer_viewport_rewrite
Free malloc in checkwps too

Change-Id: I2b8fcbc94beb0644b643d3b7a9cb53bc26fc8a51
2020-10-26 15:50:42 -04:00
William Wilgus ada919fc11 FIX RED framebuffer viewport rewrite
Change-Id: I4cb8f580e15440d06f8d5fabb2fbf5147c67b49c
2020-10-26 14:35:30 -04:00
William Wilgus 3237ae4a4f LCD core move buf ptr and address look up function viewport struct
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device

[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr

while remote lcds may compile (and work in the sim) its not been tested on targets

[FIXED] backdrops need work to be screen agnostic

[FIXED] screen statusbar is not being combined into the main viewport correctly yet

[FIXED] screen elements are displayed incorrectly  after switch to void*

[FIXED] core didn't restore proper viewport on splash etc.

[NEEDS TESTING] remote lcd garbled data

[FIXED] osd lib garbled screen on bmp_part

[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport

[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer

[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing

[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage

[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags

Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26 12:28:48 -04:00
James Buren bde72efa30 coldfire: make the RAM and ROM image locations configurable by macros
Change-Id: Ie27e39c34947b0391be621dafb8711c44e863a1c
2020-10-26 01:07:14 +00:00
Solomon Peachy d4a80ce94b pcm-alsa: fix red.
Change-Id: Id8d5442b0b3eb4ce3c20d1c9d24f07b5378cc22f
2020-10-25 08:38:24 -04:00
Solomon Peachy e7a492ef55 hosted: alsa: Fix two bugs when recording
Change-Id: Ib97857874676ea4aa8f04d44e048de8465a4da4f
2020-10-25 00:42:37 -04:00
Solomon Peachy 46e357f1bb ALSA: Further rework:
* Get rid of non-async (ie tick task) mode due to inherent brokenness
 * Get rid of nonblock mode; we never write if buffers aren't sufficient
 * Move driver init into pcm_open() instead of pcm_init()
 * Much better underrun handling
 * Better error handling in some situations
 * Add in recording functionality
 * Use smaller audio buffers to avoid glitching
 * Don't start audio buffer with silence
 * Allow device name to be overridden by target

Recording portions based on work done by Lorenzo Miori in g#633

Change-Id: I0197bdc1749c28109eb79def1e6a3e1d62d8cef3
2020-10-23 17:48:51 -04:00
William Wilgus 3a7a46d1c0 Hosted targets Fix timer cycle calculation overflow
at 1 GHZ the intermediate calculation for cycles overflows 32 bits
this makes timer fail even with sensible values
solution divide both sides by 100

Change-Id: I18a4054c2d06fb72531d5496bba562f71b03984f
2020-10-23 15:35:11 +00:00
Solomon Peachy 884d8922e3 hosted: Allow ALSA driver to switch output device at runtime
* Allow output device name to be specified
 * Set hw/swparams prior to actual playback start, not at init
 * If told to open a new device, cleanly close down old one.

Change-Id: Ib97310ec23588136c031466ee9c22312ab0f9f5a
2020-10-21 13:24:47 +00:00
Solomon Peachy 6b13437aff Add UI Simulator for Eros Q / K series
Change-Id: I9ffc101bd904b3f0e2d6a86a43fb1ae3fda73a19
2020-10-21 13:24:01 +00:00
Amaury Pouly 08513103c6 nwzstools: add NW-A820 nvp nodes
Change-Id: Iab79eb0c9b0bbf8fb7622f5630f385d56878507a
2020-10-18 22:34:16 +02:00
Solomon Peachy 6a94f1e995 sonynwz: Properly support multidrive, with hotswap of the SD card
Change-Id: I7eb8efb0986a395d5ffbcc06a54bb680e0b59e9d
2020-10-18 10:19:42 -04:00
Solomon Peachy edbdefa09a hosted: Drop a bootloader version string in /etc, and report it in debug menu
Change-Id: I4d72d7800dbff56619898b6bc9d0f81a6c561598
2020-10-17 21:40:40 -04:00
Solomon Peachy 6f9a157fca hosted: Fix USB mounting code to work with HAVE_MULTIDRIVE enabled
Change-Id: I48944c28903db117d3d883a5e777cafe5d055600
2020-10-17 18:38:49 -04:00
Solomon Peachy f3ec58c05b hosted: Support hot-swappable internal and external storage
Change-Id: I321e9da4d5087dbd91194e6faa35cd4a685a0495
2020-10-17 18:38:49 -04:00
Solomon Peachy d8d37ffdb8 Define a USB storage type, and hook it up for hosted targets
Change-Id: I56363c989139c7edf0b2c67b0aac9ef1adfacba2
2020-10-17 18:38:49 -04:00
Solomon Peachy 0a4a920029 hosted: ROLO: Fixes for PIVOT_ROOT targets
Change-Id: I4888bd5db6f8a419d312c6b017f676ba6c749d89
2020-10-17 18:38:46 -04:00
Solomon Peachy 012908e064 hosted: Fix HAVE_MULTIDRIVE to work properly with PIVOT_ROOT
Change-Id: Ibc97de5c345e88c19ad8ba8c05fefebbada08790
2020-10-17 17:10:52 -04:00
Solomon Peachy 13f5e123f9 samsung yp-r0/r1: use os-native opendir() in the low-level driver code
Fixes blank LCD on both R0/R1 and the PMU on the R1

Change-Id: I356907676f7a0a009897fd4895bf78c1022b71d1
2020-10-17 14:37:15 -04:00
Solomon Peachy 0e667ff5b0 sonynwz: use os-native opendir() in the low-level input driver code
instead of the rockbox opendir() wrapper.

Change-Id: I06e8c2d7997c7cc3d507f06659d46cdfd6a02ce3
2020-10-17 14:22:02 -04:00
Solomon Peachy c6d2a0358f hosted: open input device as read-only.
Change-Id: I4dcd98f45f41fe06a0a75a2a0dd45c753c2cf365
2020-10-16 14:37:01 -04:00
Solomon Peachy 2e07223690 m3k: Fixes for the M3K.
* Cannot turn off the LCD directly (have to rely on backlight)
 * Only insmod/rmmod the usb gadget modules if state changes

Change-Id: I9ea90177d496cd035ada93e04a93a7c6f2e84706
2020-10-15 14:11:41 -04:00
Solomon Peachy 0cde20fadb xduoox3: Disable the DAC's digital de-emphasis filter.
Whether or not this is correct depends on how the source material was
mastered, digitized, and/or encoded.  There is no setting appropriate
for everything.

Eventually I'd like to make this configurable, but I'd want to have it
shared with more than one target first.

Change-Id: I20a0eff4b3dc2517c33db49d4f72e85bf81d1ca6
2020-10-15 13:30:48 -04: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 1b449abf39 erosq: Add battery discharge curve and initial runtime estimation.
(playing mp3 with headphones inserted lasted just over 13 hours)

Change-Id: Id610f911811eafd914db20000ae860c75e0d8a93
2020-10-14 08:37:00 -04:00
Solomon Peachy 19d45c9257 Work around wonky inline asm issue with creativezenvm build.
The right thing here probably to just not bother at all, as this
bootloader can't launch rockbox yet anyway.

Change-Id: I62bd22353b6adc9dbe35b94f3b60a6a67348356a
2020-10-13 21:48:23 -04:00
Solomon Peachy 26bebd77ab Fix more red.
Change-Id: Id1a45b420f8eb70a25010b058822b78f80db33d8
2020-10-13 19:45:03 -04:00
Solomon Peachy 09785a8499 fix more yellow
Change-Id: I74bad58707d05ea167169d4315c05eb0cd1c8b7b
2020-10-13 17:23:56 -04:00
Solomon Peachy b94db707fb Fix more warnings.
Change-Id: Ib3a9fc622a46b1fc72e94dcbc6d29d2e430cd81b
2020-10-13 15:48:31 -04:00
Solomon Peachy 431caa4311 imx31: Work around an apparently not-quite-kosher abuse of CPP
(we were trying to foward-declare functions from within static
 initializer context.  GCC no longer accepts this)

Change-Id: I58f316ecc84c8ab45fffc054955727a55714b0a3
2020-10-13 15:48:31 -04:00
Solomon Peachy f8bd54d575 iaudiox5: Fix red, due to slightly bogus asm
Change-Id: I6ebcda3452d4244b5e2d1a9bbeb9fff9a9456388
2020-10-13 14:18:35 -04:00
Solomon Peachy 4a3d046545 Fix a pile of yellow in the bootloader
Change-Id: Ia89a33bbb13683566e421ac2a002baa20cdb07de
2020-10-13 13:37:21 -04:00
Solomon Peachy e91f89a410 xduoox3ii: Update battery curve.
Change-Id: I2cc04d696631ba887fa8943d94360f902bf12e85
2020-10-13 16:01:55 +00:00
Solomon Peachy 078c34e951 hosted: More PCM muting work
* Track mute state, only call hw if actual change is needed
 * Don't unmute in audiohw_postinit()
 * sample rate tracking fixes
 * erosq:  Don't start up muted

Change-Id: I004f787a4b7ea73c16b6ec9818ec29a12c89f46b
2020-10-12 15:33:32 +00:00
Solomon Peachy 01dc81cd94 rolo: hosted: Make display output non-glitchy
Change-Id: I63d6a28d67fa56d3541aaa121356c8ff2ce10bbe
2020-10-12 11:16:15 -04:00
Solomon Peachy 141e91ef1f Hosted PCM: Rework auto-muting code a bit
* If AUDIOHW_MUTE_ON_PAUSE, no meaningful change
     * Unconditionally unmute on playback start
     * xduoox3ii:  Mute on sample rate change
     * rocker/xduoo:  Stay muted after startup

    This avoids the nasty "pop" on startup, without doing
    the full mute-on-pause stuff that causes unacceptable
    dropouts on the X3ii.

Change-Id: I2e3ee0bb8094e288f37a0acada86a80016ce5cac
2020-10-12 13:40:37 +00:00
Solomon Peachy 135b3f6416 Fix inverted test that made SDL_APP unhappy
Change-Id: I18a51ddd0fa7fd0afda938c732fadce4cd87c262
2020-10-11 18:35:55 -04:00
Solomon Peachy e1bc36ca31 Turn on ROLO for M3K too
Change-Id: I7e1b2168a70605c5a138d83fd69e847fd02af4a4
2020-10-11 18:34:04 -04:00
Solomon Peachy db6f21e295 hosted: sanitize handling of HOME_DIR
* HOME_DIR is now either "/" or special "<HOME>"
   * target-specific "home dir path" is defined solely by PIVOT_ROOT
 * PIVOT_ROOT path is now defined in toplevel config files
 * Make Samsung YP-R0/R1 and SONY_NWZ use PIVOT_ROOT too
 * Do not prepend PIVOT_ROOT path if the path already has it!
 * Do not play these games for __PCTOOL__ builds

Change-Id: I3d51ad902a5f9cafe45ba15ba654f30f1ec6113a
2020-10-11 17:47:34 -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
Amaury Pouly 76fbb33adf nwztools: fix MW-WM1/A30 KAS, fix KAS length
Split WM1A/WM1Z because they don't have the same KAS. On newer devices, the KAS
is actually 64 bytes, not 60. The strange thing is that "get_dnk_nvp kas" returns
60 bytes whereas "get_dnk_prop kas" returns 64, not sure why.

Change-Id: I944d3d838209ba58388439af0cdf5d7c74f1f7fc
2020-10-11 13:08:03 +02:00
Solomon Peachy 5cfd3ae4e6 hosted: Use O_CLOEXEC for all open() and "e" for fopen() calls
This way we'll automatically close the files upon exec()

Change-Id: Ic0daca8fb56432830de4a2f4a86a77337121ecc7
2020-10-11 01:47:03 -04:00
Solomon Peachy 6c6642e8d5 m3k: Fix red bootloader build
Change-Id: I3a6e9e6222e6219484c6903325c985bff8af39ef
2020-10-09 19:54:49 -04: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 88b2a45b5f xduoox3ii/x20: Define a sane BUTTON_LEFT/RIGHT alias
Change-Id: If11dfa50aeb8cb8b80de730c494d81a9e87880c4
2020-10-09 12:15:43 +00:00
Solomon Peachy 7a1bf01541 Undo the hacks that allowed targets without LEFT/RIGHT (UP/DN) to build.
Replaced them with warnings until they are fixed *PROPERLY*

Change-Id: I4425200e60f8b5224262a54f105b974cec471d22
2020-10-08 20:30:08 -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
Solomon Peachy 914114fd21 FS13241: Get rid of the hacky hold switch emulation on the X3ii & X20
It doesn't work properly and interferes with the power button in the keymap.

Rework WPS keymap a bit to make single-tap power emulate lock.

Change-Id: I9d9b9b4adcea3764e6e427f484e051c9bab9d13b
2020-10-05 22:55:08 +00:00
Solomon Peachy f3ae48f552 hosted: control buttonlights along with the display backlight.
Change-Id: I03385db46e94ca1bb6a4e35c89f630145c9d40e5
2020-10-03 20:12:31 -04:00
Solomon Peachy 7642184fd9 alsa: Refactor pcm_dma_apply_settings_nolock()
Change-Id: I32190e6987afca99b24197ca7ae2853053062d30
2020-10-03 20:12:31 -04:00
Solomon Peachy c1d4bf290c coldfire: Fix iAudio M5 build
Change-Id: Iecbcfa16918be3abfaab0936a0dae9c9ed48933e
2020-10-03 16:56:19 -04:00
Solomon Peachy d5167b1221 coldfire: Allow building when 88KHz audio is disabled
Change-Id: Ieeacf591ad4233428dca99c347043e61abae1d1f
2020-10-03 15:57:38 -04:00
Solomon Peachy d4a620e85a alsa: introduce AUDIOHW_MUTE_ON_PAUSE, and have rocker use it.
Change-Id: I1edbb8e71a9c73baaeecb01b66cbee6c3f7b5f8f
2020-10-03 14:41:40 +00:00
Solomon Peachy 90c30bc7ef alsa: Explicitly mute the output when we stop playing, and unmute after playback starts
Allows us to avoid hearing the codec powering on and off.

Change-Id: Idaaff437932009952ed248be97eedf54cb4cf28e
2020-10-03 04:12:51 +00:00
Solomon Peachy c7eceea183 alsa: Handle underruns when starting a new stream
Unsure why this is happening, but now we detect and recover errors at
startup.

Also clean up the mismash of printf(), DEBUGF(), etc in favor of panicf() for the really serious stuff and logf() for everything else.

Change-Id: I9aaa620d55d556645c9a6d108541b987983b32a8
2020-10-03 01:04:53 +00:00
Solomon Peachy b0e1b245b4 alsa: Use larger playback buffers for higher bitrates
(existing ones apply up to 48KHz, scale up linearly to 192KHz)

Change-Id: Iac32d49b8073b63a5d40fd21f41437e6051cb8de
2020-10-02 09:50:38 -04:00
Solomon Peachy 90af40e90c imx233: Hardware codec supports up to 192KHz. Make it so!
Change-Id: If08a1d244f28092a5d5332d666fb9afdc78f35a9
2020-10-02 09:50:38 -04:00
Solomon Peachy 9892e468d5 hosted: Don't use O_SYNC for the framebuffer handle.
Change-Id: Iff4b1947fe053313d677b894c78250760aaef967
2020-10-02 09:48:59 -04:00
Solomon Peachy 9ee618e889 hosted: Fix overzealous spamming of backlight and lcd enable
This caused random delays in LCD activity, and also caused key inputs to go nuts

Change-Id: Ie483c86f7461455308f8c5f8999df313521c6b55
2020-10-02 02:24:42 +00:00
Solomon Peachy f4f3255edf xduoox3: Work out clocks for 176/192KHz support.
Note:  PCM mix buffer sizes are _way_ too small for these high bitrates

(We really need to make the mixer stuff use dynamic buffer sizes based
 on the bitrate.  Maybe pre-allocate a max size based on upper bitrate limit,
 but use only part of it at lower bitrates?  So we can have sane latency..)

Change-Id: Id7b4afd73dba7f1ffb84b2e1c016859fae5d6835
2020-10-01 17:30:22 -04:00
Solomon Peachy a96eb1a7f7 Fix warnings and errors introduced in b030bf5
Change-Id: I23966b6a79c0d2cbab2e01c649c1b991f460d8ad
2020-10-01 16:08:20 -04:00
Solomon Peachy b030bf5885 xduoox3ii/x20: Proper lineout detection and volume mangling.
hotplugging hp and lineout works, without blowing out eardrums.

Change-Id: I2df5c7a618bb2d1d77d416548d45dff9cfc619db
2020-10-01 15:41:30 -04:00
Solomon Peachy 6d47dc9a88 fix some of the red introduced in e43726d
Change-Id: Id1abb0dd11f8a8e79a80fc54e58a5a22706a03ad
2020-10-01 12:55:52 -04:00
Solomon Peachy e43726df2c hosted pcm-alsa improvements
* xduoo x3ii/x20:  Better line out support
 * less granular volume settings (too many steps before)
 * Better handling of swiching sample rates
 * Log actual sample rate in debug menu

Most credit goes to Roman Stolyarov
Additional integration [re]work by myself

Change-Id: I63af3740678cf2ed3170f61534e1029c81826bb6
2020-10-01 11:56:57 -04:00
Solomon Peachy 021b55735b hosted: fix shutdown crash in framebuffer code.
Change-Id: I78315b81ab8df0408abc64d5edb6af37db568ad7
2020-10-01 14:01:21 +00:00
Solomon Peachy 0a7b23097a Hosted: Improvements in the LCD code. (Roman Stolyarov)
* Kill LCD when turning off the backlight
 * Fix logic errors in lcd_enable() calls
 * Use ioctls instead of sysfs to twiddle lcd enable

Change-Id: I6864ff63d87b747ac48719b0f4ba2de00333a1d3
2020-10-01 12:49:39 +00:00
Solomon Peachy ff408fd717 Leave HOME_DIR out of default recording and playlist paths
The hosted filesystem code will automatically prepend HOME_DIR.

Change-Id: I36a76e51637ab2bb68353f8eb9ffac25ca75bad1
2020-09-30 18:56:54 +00:00
Solomon Peachy ae58b5aafe xduoox20: UI Simulator support
Change-Id: I2a03cea07fbad9fb5862ca69e4cfca2e8ca6b17f
2020-09-28 21:12:52 -04:00
Solomon Peachy 7719010ed7 hosted: Slightly cleaner shutdown; kill the display first.
Change-Id: I620d7afb2eb0556cde07c7828b134b13892e6db4
2020-09-29 00:27:49 +00:00
Solomon Peachy fd2e65e94d rocker: Increase the long-press shutdown delay a bit.
Change-Id: Ief64f3d39556efa7de7df32eb7613a29a466a02e
2020-09-29 00:27:27 +00:00
Solomon Peachy e404026308 jz4760: Implement USB DMA RX
Can be disabled at runtime by setting hold switch.

Boosts sysbench sequential write performance by 34-58%

Change-Id: I060c9d7dddc1b448f18aa46af8f8aff046e07843
2020-09-18 17:48:31 -04:00
William Wilgus 2df3a5b04c Headphone / lineout pause/resume #FS13237
Allow Lineout to behave like headphone port in regards to
plug/unplug pause/resume

Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
2020-09-18 00:22:52 +00:00
Solomon Peachy ec413f7692 jz4760: Heavily rework USB driver to add working DMA support
* DMA Bulk IN (ie our TX) results in sequential transfers 33-68% faster.
 * DMA Bulk OUT (ie RX) is mostly stripped out due to complete brokenness.
 * Interrupt and control endpoints remain PIO-driven.

Other improvements:

1) Use consistent endpoint references (no magic numbers)
2) Greatly enhanced logging
3) DMA support can be compiled out completely
4) Setting lockswitch will disable all DMA operations at runtime
5) Much more robust error checking and recovery

Change-Id: I57b82e655e55ced0dfe289e379b0b61d8fe443b4
2020-09-17 11:26:04 -04:00
William Wilgus a66b908801 Xduoo X3 add headphone and lineout status to IO Ports debug menu
Change-Id: I9caf55c1249625dff7e437158afd20a526fa7499
2020-09-17 11:22:40 -04:00
William Wilgus 3c2b6809d9 Xduoo X3 no ADC after ROLO
Speachy suggested we don't shut down the adc on ROLO
this fixes the random adc drop out on ROLO

Change-Id: Ife7d679ce51a6f767963210ee650815f1de12223
2020-09-13 13:29:00 -04:00
William Wilgus c62493e98a Xduoo X3 Add tree scrolling FS#13240, Emulate Multibutton presses
Fixes deficiencies with the button system on the X3

  The x3 has an interesting button layout.
  Multiple key presses are NOT supported unless
  [BUTTON_POWER] is one of the combined keys

  As you can imagine this causes problems as the power button takes
  precedence in the button system and initiates a shutdown if the
  key is held too long
  instead of BUTTON_POWER use BUTTON_PWRALT in combination with other keys
  IF using as a prerequsite button then BUTTON_POWER should be used

  Multiple buttons are emulated by button_read_device but there are a few
  caveats to be aware of:

  Button Order Matters!
   different keys have different priorities, higher priority keys 'overide'
   the lower priority keys
  VOLUP[7] VOLDN[6] PREV[5] NEXT[4] PLAY[3] OPTION[2] HOME[1]

  There will be no true release or repeat events, the user can let off the
   button pressed initially and it will still continue to appear to be
   pressed as long as the second key is held

Tree scrolling is PLAY+NEXT or PLAY+PREV

Change-Id: I88dfee1c70a6a99659e8227f5becacc50cc43910
2020-09-13 16:23:24 +00:00
William Wilgus e18c2f3001 XduooX3 LCD tweaks #2
Group commands for a bit more speed

bitdelay was not being inlined
lower bitdelay to 12 cycles

Clean-up magic numbers

Change-Id: Ifeb57a5532807a598f1ec5e1c55f03e4aa1e133f
2020-09-08 14:37:46 +00:00
William Wilgus af24ff1fc3 XduooX3 Gpio reconfigure button system #2
Fix issue with first battery sample taking 30 seconds

Clean up code

Change-Id: If2437d241e0ab4e3d23b141f5d853b6cf3209b07
2020-09-06 11:06:54 +00:00
Solomon Peachy 53142ae9f5 jz4760: Fix and re-enable the hardware udelay() timer
Change-Id: I591b4f023776b3501fce03e08bfc87a355f4c69b
2020-09-06 02:09:21 +00:00
Solomon Peachy 2dadb8c7d6 jz4760: Use a #define for the timer id, not a raw number
Change-Id: Ic31267a2ae82beede72100c1cc5ddf7211aa0abe
2020-09-06 00:27:07 +00:00
Solomon Peachy d015165bc5 mips: Convert 'nop' to 'ssnop' -- for future-proofing
Change-Id: I17625f4d56a1f5205887cb47668a2dcb628053f4
2020-09-05 22:18:26 +00:00
Solomon Peachy 90a4f28c27 jz47xx: Audio path tweaks:
* Increase audio buffer size to better handle IRQ latency (256->2048)
 * Ensure DMA engine is idle prior to starting transfers
 * Set AIC to repeat last sample in case of underflows

Change-Id: I9c45c20481ee072e5882b7586fb7d50bd8ef2f35
2020-09-04 15:57:00 -04:00
William Wilgus 48a2b80c77 Xduoo Gpio fix bug
Change-Id: I76eda59a391a408d1a6642497d8cc4aeb93a0da1
2020-09-03 16:06:16 -04:00
Solomon Peachy 0cb162a76b mips: Heavily rework DMA & caching code
Based on code originally written by Amaury Pouly (g#1789, g#1791, g#1527)
but rebased and heavily updated.

Change-Id: Ic794abb5e8d89feb4b88fc3abe854270fb28db70
2020-09-03 15:34:28 -04:00