Commit graph

105 commits

Author SHA1 Message Date
Fred Bauer
e541c98a7e revert r28834 because it causes problems with uSD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28925 a1c6a512-1295-4272-9138-f99709370657
2010-12-29 16:07:15 +00:00
Fred Bauer
279dff1c21 FS#11765: Improve AMSv1 Battery Life by Lowering CPU and Peripheral clocks. Unboosted CPU and peripheral clock is now 31MHz. Boosted CPU and pclk are 186MHz and 62MHz, respectively.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28834 a1c6a512-1295-4272-9138-f99709370657
2010-12-14 22:08:43 +00:00
Fred Bauer
9b2e9472ea FS#11608: switch cpu to async operation in boosted mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28616 a1c6a512-1295-4272-9138-f99709370657
2010-11-18 16:37:56 +00:00
Rafaël Carré
c196da2cee FS#11597 : decrease FCLK frequency when unboosted
FCLK is unused because we use fastbus clocking: CPU clock = PCLK
Base PCLK off PLLA and use the lowest frqeuency for FCLK (24MHz source,
maximum divider)
Save a bit of power, adjust Clipv1/e200v2/Fuzev1 current usage accordingly

Note: the power saving (in mA) is a bit less on e200v2/Fuzev1 than on Clipv1

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28000 a1c6a512-1295-4272-9138-f99709370657
2010-09-05 15:34:34 +00:00
Rafaël Carré
b9201e3c6f include lcd.h , forgotten in r27957
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27958 a1c6a512-1295-4272-9138-f99709370657
2010-08-31 06:53:28 +00:00
Rafaël Carré
67cf859b42 AMS: update the LCD on system exception to be sure the content is up to date
Without this change the backlight would be enabled but the screen would
show the last content displayed before the screen went off

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27957 a1c6a512-1295-4272-9138-f99709370657
2010-08-31 06:49:08 +00:00
Rafaël Carré
b0e34a6a6c AMSv1: Don't modify MPMC_DYNAMIC_CONTROL
The last bootloaders already set it correctly

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27627 a1c6a512-1295-4272-9138-f99709370657
2010-07-30 12:28:14 +00:00
Bertrik Sikken
4d6c816721 Sansa Clip+: detect AMSv2 variant (just like was already done for fuze v2), this makes SD transfers work for newer clip+ players ("COMBO4E" type). Variable fuzev2_variant has been renamed to amsv2_variant.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27520 a1c6a512-1295-4272-9138-f99709370657
2010-07-22 13:47:09 +00:00
Rafaël Carré
25491980d6 as3525*: disable_irq in system_reboot()
make sure CGU_PERI write is atomic

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27493 a1c6a512-1295-4272-9138-f99709370657
2010-07-19 15:56:10 +00:00
Rafaël Carré
e44b65c806 Support new Fuzev2 revisions (fuzev2_variant == 1)
- Revert BUTTON_HOME
- Modifications to SD driver (µSD not working yet)

TODO: µSD and FM radio

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27492 a1c6a512-1295-4272-9138-f99709370657
2010-07-19 15:29:28 +00:00
Rafaël Carré
a937b8ba05 as3525*: initialize cpu_frequency correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27082 a1c6a512-1295-4272-9138-f99709370657
2010-06-23 07:06:06 +00:00
Tobias Diedrich
62622277dc With a max delay of 17 seconds before overflow happens limiting to unsigned short shouldn't be necessary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26939 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 20:04:16 +00:00
Rafaël Carré
7a9033179f as3525*: make udelay() be a simple busy loop
it achieves all the requirements, work fine on c200v2, and is much simpler

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26933 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 19:14:08 +00:00
Rafaël Carré
fd715fa95c as3525*: enable MMU in bootloader
Reserve 1MB of DRAM for loading rockbox and use the rest as BSS
Write sdram setup in assembler and move it to a separate file, together
with MMU init code

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26926 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 17:33:51 +00:00
Tobias Diedrich
68e2023184 Enable display and backlight on panic.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26917 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 13:45:24 +00:00
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