Commit graph

90 commits

Author SHA1 Message Date
Rafaël Carré
7ad50c6f59 as3525: write irq/fiq handlers in C
Declare VIC registers holding function pointers as volatile pointers to
function pointers and access them directly without casting
UIRQ() is an IRQ handler too, even if it doesn't return

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26313 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 16:03:01 +00:00
Rafaël Carré
f0f5a6419a typo: 'nomasked' -> 'unmasked'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26312 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 14:45:59 +00:00
Rafaël Carré
873dd7becc as3525: find_first_set_bit() isn't built in bootloaders
We assume only one bit is set and use clz to find the most significant
set bit, if there's more than one bit set we'll see it in the panic msg

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26285 a1c6a512-1295-4272-9138-f99709370657
2010-05-25 16:20:04 +00:00
Rafaël Carré
2d40d566d7 as3525: don't destroy status when calculating IRQ number in UIRQ()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26260 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 17:41:47 +00:00
Rafaël Carré
8d1ec38a1d as3525: show unmasked interrupts on unhandled IRQ
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26250 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 14:32:38 +00:00
Rafaël Carré
6c8269bc3f fix previous commit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26166 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 14:41:56 +00:00
Rafaël Carré
8e12292e75 better preprocessor conditions for enabling GPIOA interrupt
it's only needed if we hotswap the µSD or if we build the fuzev2
scrollwheel code without irq (which we don't do anyway)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26165 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 14:30:34 +00:00
Rafaël Carré
6f2afd36bc as3525: reorder vectored interrupts
The list is ordered by priority, put the DMA and SD interrupts at
the top

This seems to fix the random freezes on heavy storage operation like
building database or pictureflow cache

The recently added audio interrupt had a priority higher than SD slot on
as3525v1, give it a lower priority

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26160 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 12:11:54 +00:00
Tobias Diedrich
0f6b5f03d9 Enable/disable second pll dynamically on usb plugin/remove.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26145 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 16:23:11 +00:00
Amaury Pouly
22cfbee274 as3525v2: add usb driver stub, enable usb phy&core init
clip+: add USBOTG_ define and enable usb stack

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26132 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 09:58:52 +00:00
Tobias Diedrich
4a8c05e92f This change wasn't supposed to be in there yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26127 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:07:10 +00:00
Tobias Diedrich
922f83e647 Not quite working yet, but almost.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26126 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:00:57 +00:00
Rafaël Carré
39e4b84e64 as3525: change SDRAM settings only in models for which there is a bootloader
c200v2 & m200v4 have no binary bootloader released yet

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26009 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 08:35:49 +00:00
Rafaël Carré
4970f98619 as3525v2: disable adjustable CPU frequency
When the rest of the code is confirmed to work properly without CPU
frequency changes, it will be possible to reliabily test set_cpu_frequency()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25924 a1c6a512-1295-4272-9138-f99709370657
2010-05-10 03:49:17 +00:00
Rafaël Carré
b269b7854f as3525*: stop MPMCCLKOUT when all SDRAMs are idle
Get a bit more battery life (between 30 minutes and 2 hours)

as3525v2: only enabled in bootloader, we need a new binary release anwyway
as3525v1: enabled in rockbox.sansa as well, so we can continue using the
current bootloaders

Flyspray: FS#11246
Author: myself

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25900 a1c6a512-1295-4272-9138-f99709370657
2010-05-08 13:59:01 +00:00
Rafaël Carré
893180d47d as3525v2: crashless cpufreq switching
delays after modifying the registers seems not to be needed
moving RAM operation (cpu_frequency variable) before modifying the
register also seems to help

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25754 a1c6a512-1295-4272-9138-f99709370657
2010-04-29 03:15:18 +00:00
Rafaël Carré
2a180e8039 as3525v2: effect of CGU_PROC on fclk is instant
We do not need any delay after modifying it in system_init(), so the
same applies in set_cpu_frequency()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25753 a1c6a512-1295-4272-9138-f99709370657
2010-04-29 00:43:24 +00:00
Thomas Martitz
249aae587a FS#11172 - Fuzev2: Read the scrollwheel scrollwheel via IRQ
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25736 a1c6a512-1295-4272-9138-f99709370657
2010-04-27 10:11:52 +00:00
Rafaël Carré
3b1c3881f0 as3525v2: only clear DIV0 bits in set_cpu_frequency() (not bit 6)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25595 a1c6a512-1295-4272-9138-f99709370657
2010-04-11 18:26:45 +00:00
Rafaël Carré
07ec3c9d69 as3525v2: extend a bit the delay after switching pclk/fclk
fix r25571 : Clipv2 would boot to a black screen

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25592 a1c6a512-1295-4272-9138-f99709370657
2010-04-11 16:22:56 +00:00
Rafaël Carré
07c08a6d89 as3525v2: set_cpu_frequency()
delay a bit after changing pclk/fclk
tiny refactoring

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25571 a1c6a512-1295-4272-9138-f99709370657
2010-04-10 20:00:15 +00:00
Tobias Diedrich
ea907b31ae Detect C200v2 variant by reading A7, use A5 or A7 to control backlight and buttonlight depending on the result.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25499 a1c6a512-1295-4272-9138-f99709370657
2010-04-06 18:32:47 +00:00
Jack Halpin
36c16ea05d Sansa AMS: Split set_cpu_frequency() into 2 separate functions for as3525v1/v2 as the code is quite different for each model.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25498 a1c6a512-1295-4272-9138-f99709370657
2010-04-06 17:22:57 +00:00
Jack Halpin
c0e416b1ff SansaAMS: Only use INT_MCIO with as3525v1, it is unused in as3525v2.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25496 a1c6a512-1295-4272-9138-f99709370657
2010-04-06 17:22:45 +00:00
Rafaël Carré
7a90aa40c6 as3525v2: set PCLK correctly
PCLK doesn't use PLLA as a source but FCLK, so when changing FCLK with
CGU_PROC register, we must change PCLK as well with CGU_PERI register

Operate with 24MHz PCLK (and unboosted FCLK) for Clipv2/Clip+
Use 60MHz on Fuzev2 to keep the display fast enough (still slower than
Fuzev1 though)

µSD seems to function correctly now

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25475 a1c6a512-1295-4272-9138-f99709370657
2010-04-05 04:48:43 +00:00
Rafaël Carré
b79ca59194 Try to fix problems on Clip+ (not sure why they appear randomly)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25421 a1c6a512-1295-4272-9138-f99709370657
2010-04-01 08:21:21 +00:00
Rafaël Carré
a28a9210d0 Fix boosting on as3525v2
the arm926-ejs doesn't have synchronous/asynchronous/fastbus modes, so
just change CGU_PROC directly

Note: we could use a lower unboosted frequency now

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25417 a1c6a512-1295-4272-9138-f99709370657
2010-04-01 04:37:17 +00:00
Rafaël Carré
49935f2fa8 as3525*: make sure fclk is 24MHz before using it as the clock source for pclk
Should fix Clip+ boot problems once for all

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25416 a1c6a512-1295-4272-9138-f99709370657
2010-04-01 03:55:49 +00:00
Rafaël Carré
f4dcc69b51 as3525*: set up CGU_COUNT register before turning on / modifying PLLs
Write the setting before enabling the PLL
Fix booting problem (black screen) with Clip+

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25415 a1c6a512-1295-4272-9138-f99709370657
2010-04-01 03:22:49 +00:00
Rafaël Carré
39e78993f3 as3525v2: adjustable CPU freq : CGU_PROC is identical to as3525 after all
Instead of modifying CGU_PROC to get 24MHz pclk, just switch to fastbus else Clip+ wouldn't boot
Tested on fuzev1/Clip+

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25413 a1c6a512-1295-4272-9138-f99709370657
2010-04-01 02:39:25 +00:00
Tobias Diedrich
47ab95904e Add handler for audio irq.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25299 a1c6a512-1295-4272-9138-f99709370657
2010-03-23 05:02:37 +00:00
Tobias Diedrich
946d3d177e Rewrite ascodec_as3514.c to use interrupts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25297 a1c6a512-1295-4272-9138-f99709370657
2010-03-23 04:40:38 +00:00
Rafaël Carré
ab7365610b as3525*: revert r25198 and inline memory_init in crt0.S
We do not need a stack pointer at this step, and we are sure to not use
memory not initialized yet (like bss)

Fixes FS#11114 (tested on Fuze)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25229 a1c6a512-1295-4272-9138-f99709370657
2010-03-17 05:02:42 +00:00
Thomas Martitz
0094b0500c Add Sansa Fuzev2 to the target tree. Bootloader builds, but is completely untested.
Compilation shows a warning for the first argument of the lcd_bitmap() call in show_logo().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24911 a1c6a512-1295-4272-9138-f99709370657
2010-02-25 13:26:46 +00:00
Rafaël Carré
e32e180244 as3525v2: share more of system_init() between the 2 SoCs
Differences remaining:
    - list of peripherals reset
    - CGU_PROC isn't modified on as3525v2
    - CGU_PLLA bits aren't known, but we use a known setting for 240MHz

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24868 a1c6a512-1295-4272-9138-f99709370657
2010-02-23 06:59:58 +00:00
Rafaël Carré
ed55520985 as3525v2: do not modify CGU_PERI in rockbox.sansa
this prevented booting, we need to figure out CGU_PROC bits

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24854 a1c6a512-1295-4272-9138-f99709370657
2010-02-22 08:29:02 +00:00
Rafaël Carré
b347245d7c as3525v2: init sdram
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24849 a1c6a512-1295-4272-9138-f99709370657
2010-02-22 07:31:37 +00:00
Rafaël Carré
31eda59720 as3525v2: build normal firmware properly (Clipv2/+)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24840 a1c6a512-1295-4272-9138-f99709370657
2010-02-22 02:42:58 +00:00
Rafaël Carré
8b4ee2cfdd as3525: make clear the CCU bit we can't reset is the IDE interface
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24738 a1c6a512-1295-4272-9138-f99709370657
2010-02-17 23:27:35 +00:00
Rafaël Carré
bd0b7363ca Sansa AMS: do not init memory for AS3525v2
(#ifdef rule was broken)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24549 a1c6a512-1295-4272-9138-f99709370657
2010-02-07 18:37:15 +00:00
Bertrik Sikken
8d234fc9a3 as3525: add a few more CGU_PERI definitions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24537 a1c6a512-1295-4272-9138-f99709370657
2010-02-06 14:33:40 +00:00
Rafaël Carré
12af2926e5 Make Clip+ bootloader build
Now making the Fuzev2 bootloader build should be pretty easy

TODO:
    - write button driver (FlynDice found all buttons already)
    - find button light
    - decide if lcd-ssd1303.c must be modified for Clip+ using SSP or forked
    - check if backlight code works (I copied Clipv2 code)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24520 a1c6a512-1295-4272-9138-f99709370657
2010-02-05 12:40:25 +00:00
Jack Halpin
fefafebed6 SansaAMS: Disable voltage scaling.
Voltage scaling seems to be causing various problems mostly related to issues with the uSD cards.
The increased runtime benefit only amounts to ~30 minutes as currently implemented so it seems prudent to disable it once again at this time.
We still don't understand why the core voltage being lowered would impact the uSD card but in fact it does.  The internal cards do not seem to have problems.
I have simply #ifdef'd the voltage scaling code with HAVE_ADJUSTABLE_CPU_VOLTAGE so if you want to use voltage scaling simply define that and the voltage scaling code should run.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24217 a1c6a512-1295-4272-9138-f99709370657
2010-01-12 23:56:59 +00:00
Bertrik Sikken
ba9040a82b Sansa AMS: allow use of PLL B for more accurate audio sample rate (0.04% instead 0.15% error)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24211 a1c6a512-1295-4272-9138-f99709370657
2010-01-10 14:24:45 +00:00
Rafaël Carré
2392bb4199 FS#10047 : Clipv2
Reuse some code from Clip (LCD) and a lot of code from AS3525
Add a new CPU type : AS3525v2, identical to AS3525 except it's an ARMv5 (arm926-ejs)
SD code still not working
For an unknown reason LCD doesn't work anymore (to be investigated)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24131 a1c6a512-1295-4272-9138-f99709370657
2009-12-31 19:15:20 +00:00
Rafaël Carré
d06aafc03a Sansa AMS: fix system_exception_wait()
If a panicf() is called while a button is still pressed, the Sansa would
reboot immediately with no chance to see the message

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23490 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 07:42:42 +00:00
Rafaël Carré
fb126d4305 Sansa AMS : reduce size of interrupt source/isr mapping table
INT_GPIOB is not used
INT_MCI0 and INT_GPIOA are only put in the table if needed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23481 a1c6a512-1295-4272-9138-f99709370657
2009-11-01 23:41:10 +00:00
Rafaël Carré
9b4057bbd4 Sansa AMS recording support (Microphone and FM)
Still disabled on all targets:
- Fuze and e200v2 see spurious interrupts with no source defined
- Clip/m200v4 deadlock instantly when starting recording (perhaps due to low memory size)

Having the code in SVN will make working on this feature easier

Also add keymaps for Fuze, and correct Frequency section of recording
options : the 22.05kHz limitation of e200v1 and c200v1 doesn't apply to
Sansa AMS (different I2S hardware, unrelated to as3514)

Flyspray: FS#10371
Authors: Fred Bauer and myself

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23476 a1c6a512-1295-4272-9138-f99709370657
2009-11-01 22:51:31 +00:00
Jack Halpin
000cff5bae AMS Sansa: Lower ADC checkvalue for voltage scaling to 1.175V as some players run slightly low.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23205 a1c6a512-1295-4272-9138-f99709370657
2009-10-16 17:44:23 +00:00
Jack Halpin
562e41bae5 AMS Sansa: FS#10669 Reimplement Voltage scaling.
Reimplement voltage scaling on AMS Sansas at 1.10v during unboosted operation to improve runtimes.  The voltage is now also boosted during disk access if a µSD is present.  This prevents the µSD problems we saw on the last implementation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23193 a1c6a512-1295-4272-9138-f99709370657
2009-10-15 19:48:26 +00:00