Commit graph

612 commits

Author SHA1 Message Date
Rafaël Carré
ddecf431e0 fuzev2: charging curve and voltage limits
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26190 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 12:53:20 +00:00
Rafaël Carré
29e70dfcb8 sd-as3525v2: masked interrupts and block size won't change, and DMA won't be disabled, so we can just set these in the controller init once for all
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26179 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 20:41:47 +00:00
Rafaël Carré
6b46cc08ed as3525: hide our UNCACHED_ADDR from usb_storage.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26178 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 18:13:06 +00:00
Rafaël Carré
2e188a4dad revert part of r26176 to avoid large static allocation
we still need to convert uncached addresses to physical addresses

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26177 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 18:08:32 +00:00
Rafaël Carré
bae0756acf as3525: don't use IRAM for usb, and avoid usb storage using uncached addresses behind our back
No need for special address handling, all addresses are equal to their physical address

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26176 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 17:56:47 +00:00
Thomas Martitz
0b28594036 Revert r26060. A better fix was found. The acceleration should be fixed once for all now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26175 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 17:34:12 +00:00
Tobias Diedrich
12af4986b9 Handshake still grinds to a halt at some point, but it works better now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26167 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 15:43:53 +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é
627baea953 sd-as3525: wait 100µs before disabling SD clocks
test_disk doesn't freeze anymore when closing the file between writing & reading

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26164 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 14:06:13 +00:00
Rafaël Carré
b3a8170afe sd-as3525: avoid division when calculating current bank, we only deal with 1 or 2 banks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26161 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 12:11:57 +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
Rafaël Carré
a53785911a sd-as3525: give timeout in HZ units, not in ticks
remove a TODO fixed in r26029

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26159 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 12:11:50 +00:00
Amaury Pouly
cc61f03915 as3525v2: add partial usb init code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26157 a1c6a512-1295-4272-9138-f99709370657
2010-05-19 08:33:50 +00:00
Rafaël Carré
8fe22bd4b8 as3525v2: show adc channels in the debug menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26150 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 20:01:49 +00:00
Rafaël Carré
4f61e455a2 Fuzev1: calibrated charging curve
Show all the adc channels in the IO ports debug menu (not for as3525v2
since the channels are different)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26149 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 19:44:40 +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
Rafaël Carré
f8f3fab62c as3525 usb: build as3525v2 file based on CONFIG_USBOTG, and fix warnings
build it on fuzev2 and clipv2 too, it should be the same controller
as3525v1 file is only build for CONFIG_USBOTG == USBOTG_AS3525, no need
to check for it in the .c file

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26142 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 12:56:14 +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
ed96c935ec Ok, this time I double-checked for warnings...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26131 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:27:04 +00:00
Tobias Diedrich
3bb2afc741 And don't forget the return values...
Note to self: Next time don't forget to check a AMSv2 build before committing...


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26130 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:24:54 +00:00
Tobias Diedrich
e36cfed9bf And of course the stubs still need to be there...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26129 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:20:12 +00:00
Tobias Diedrich
ecdbab95f4 Obviously this should not be built on AS353x...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26128 a1c6a512-1295-4272-9138-f99709370657
2010-05-18 07:08:55 +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é
7dd0297a4d as3525: correctly detect usb status if we boot with USB plugged
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26118 a1c6a512-1295-4272-9138-f99709370657
2010-05-17 21:17:46 +00:00
Rafaël Carré
88c55d7290 as3514/as3543 fixes
- Enable end of charge monitoring once, it doesn't need to be disabled
- Acknowledge the first (wrong) end of charge interrupt on charger enable
  (this had been broken in r25299)
- Centralize reads to ENRD* registers and cache the results when needed
    - on PP it is not needed because reads are atomic, we only check for
      end of charge when the charging, and for charger presence when
      discharging

as3525v2 (using as3543) specifics
- I got the datasheet today from AMS, thanks to them for being so fast
  and not require me to sign tons of papers!
- USB detection now works on as3525v2 using the as3543. Clip+ won't
  reboot to OF yet, it needs mkamsboot support first (usbstack disabled)
- Charging should work, the CHARGER register is at a different place, it
  is an extended PMU register -> use ascodec_read/write_charger() to
  access it
- real interrupts are not used yet for ENRD, we get thousands of
  interrupts per second, apparently only limited by the i2c clock.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26116 a1c6a512-1295-4272-9138-f99709370657
2010-05-17 20:53:25 +00:00
Rafaël Carré
7ae53d860c Clipv2/+ : ascodec register 0x25 is not related to backlight
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26093 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 18:11:27 +00:00
Rafaël Carré
31caef4ad6 as3525: don't use incomplete USB code when charging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26083 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 11:48:43 +00:00
Rafaël Carré
c785722fec as3525: make sure we don't use a negative number of sectors
Better be safe than sorry, don't try to read/write outside our storage,
because we might overwrite the OF on the internal storage

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26077 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 10:24:31 +00:00
Rafaël Carré
b9beeccbcf as3525v1 use an as3515 audio codec/PMU, not an as3517 as previously thought
-> Change references to as3517 into as3515

there is a reference to the as3515 in the public as3525 datasheet to
support this fact

as3517 is used in the as3527 SoC, the (public) as3527 datasheet has
detailed information on its registers
the audio codec/PMU used in as3525v2 (thought to be as3543) appears to be
compatible (identical?) with as3517

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26075 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 09:22:02 +00:00
Rafaël Carré
d10bf7ab46 fuzev2: leave at least 3ms between scrollwheel events
fix insane acceleration

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26060 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 16:34:14 +00:00
Rafaël Carré
79cfc221a5 fuzev2: fix buttonlight flashing on µSD access (2nd try)
it would still flash when the light was off
it turns out that if B5 is set to input the light can't be turned on
but we can still select between µSD slot and internal storage

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26059 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 16:21:47 +00:00
Rafaël Carré
0f77db7346 as3525: fix capacity sanity check
adjust logical starting sector to physical starting sector after the check
number of blocks is already adjusted from physical to logical
don't panic anymore when accessing the last part of storage

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26050 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 12:01:53 +00:00
Rafaël Carré
7036a10126 fuzev2: prevent button light flickering when accessing µSD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26031 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 22:01:40 +00:00
Rafaël Carré
84b7747069 as3525v1: detect correctly internal storage capacity
check if SD transfers fit with the card capacity

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26029 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 21:41:29 +00:00
Rafaël Carré
e72d2daad8 as3525v2: check if SD transfers fit with the card capacity
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26028 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 19:37:10 +00:00
Rafaël Carré
685209d907 as3525: add some comments in the microphone channel copy loop
Indent the asm constraints at the same level than instructions

Also add a trick to reduce the number of instructions outputted by gcc
in the commented C version of the loop

The difference between C and asm is now 1 instruction

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26027 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 16:47:58 +00:00
Rafaël Carré
ac43fd367a as3525v1: duplicate the right channel into the left channel when recording microphone
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26023 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 12:59:54 +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é
90963dcc0b as3525: retain & release DMA engine when starting and stopping recording
This fixes the error introduced in r25989, where it would release the
DMA engine when uninitializing recording.
The real bug has been fixed instead (in pitch_detector)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26003 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 21:32:10 +00:00
Tobias Diedrich
990179e1aa Correct register defines. I had to look at the disassembly to spot this bug. orz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25996 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 14:07:59 +00:00
Rafaël Carré
cd8ed00dfe as3525: use the correct uncached address for rec peak buffer
also avoid disabling completely the DMA engine in pitch_detector

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25989 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 08:21:04 +00:00
Rafaël Carré
bc0434d63a as3525: use a table for mclk dividers, get rid of a division
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25981 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 05:58:52 +00:00
Rafaël Carré
d556f26820 as3525: use DMA for recording
Flyspray: FS#11257

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25980 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 05:26:12 +00:00
Michael Sevakis
4d04132c76 PCM bottom layer simplification. pcm_rec_peak_addr variable no longer has to be handled there. Driver can just return current pointer for recording peaks. A new define, HAVE_PCM_REC_DMA_ADDRESS, specifies that physical addresses are being used for recording and translation is needed before starting a new block. The drivers need not worry about aligning start and size nor should care if either will be zero. All this will be checked in the logical layer first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25970 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 14:05:36 +00:00
Jack Halpin
ed704825d2 sd-as3525v2: Set LP bits in MCI_CLKENA for cards after they have been initialized.
The OF does this and while we don't have the documentation to be sure I think it's highly likely this is a low power mode referred to in one of the product "briefs".

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25936 a1c6a512-1295-4272-9138-f99709370657
2010-05-10 17:35:00 +00:00
Jack Halpin
56457934c6 sd-as3525v2: Add delay after SD_SWITCH_FUNC to while switching to high speed timings and wait until after this switch to bring the card clock back up to full speed.
This seems to make switching the uSD card to high speed timing much more reliable.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25935 a1c6a512-1295-4272-9138-f99709370657
2010-05-10 17:34:54 +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é
a1b26db98f Sansa Cliv2: calibrated discharge curve
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25901 a1c6a512-1295-4272-9138-f99709370657
2010-05-08 14:53:41 +00:00