Commit graph

272 commits

Author SHA1 Message Date
Jens Arnold
47d4c4739b ARM asm LCD and ATA driver functions: Don't save r12 as it is a scratch reg. Saves a bit of stack and execution time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21795 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 23:43:44 +00:00
Rafaël Carré
17ac0d7ff9 fix yellow : panicf() is declared in panic.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21780 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 15:26:58 +00:00
Rafaël Carré
405d12de7e Sansa AMS: panic with the PL180 controller status register in case of errors
The maximum number of errors is 10 (arbitrary)
A recovery mechanism is not in place (yet) but could be implemented in the future

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21776 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 14:27:26 +00:00
Rafaël Carré
75fa699814 Sansa AMS: handle properly SD transfer errors
clocks disabling and mutex unlocking were not made in case of errors

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21773 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 13:46:10 +00:00
Thomas Martitz
161cb164ca Adding last minutes comments to explain things is only cool if you close it also (aka fix yellow).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21745 a1c6a512-1295-4272-9138-f99709370657
2009-07-10 15:44:38 +00:00
Thomas Martitz
e7f0c3f397 Rearrange things a bit for less #ifdefs and less duplication.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21744 a1c6a512-1295-4272-9138-f99709370657
2009-07-10 15:32:02 +00:00
Rafaël Carré
c51e26a43d Sansa AMS SD driver: fix error checking in µSD insertion
If µSD init fails, rockbox will panic and give an error number
Use a maximal delay of 1 second for µSD (and internal storage) init, as
specified in the SD Specification 2.00

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21742 a1c6a512-1295-4272-9138-f99709370657
2009-07-10 12:51:50 +00:00
Rafaël Carré
03fe562a95 Sansa AMS: display the virtual led icon on disk transfers
Sansa PP: directly use led() function, remove useless sd_led()

Thanks to mc2739 (Michael Chicoine)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21693 a1c6a512-1295-4272-9138-f99709370657
2009-07-06 16:44:57 +00:00
Thomas Martitz
cabd45086a sAMSa: Turn the backlight off before rebooting to avoid irritating lcd flash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21692 a1c6a512-1295-4272-9138-f99709370657
2009-07-06 14:46:19 +00:00
Rafaël Carré
e3636a8f32 Samsa SD driver : acknowledge USB events, now reboots on USB insertion
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21690 a1c6a512-1295-4272-9138-f99709370657
2009-07-06 14:20:52 +00:00
Rafaël Carré
c1780af9fc Samsa AMS: start of an USB driver (nothing working atm)
Work based on AMD 5536 linux driver and AMD Geode CS5536 datasheet
Rockbox still doesn't reboot on USB insert

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21689 a1c6a512-1295-4272-9138-f99709370657
2009-07-06 13:54:51 +00:00
Thomas Martitz
c292a8eb1f Sansa AMS: Disable voltage scaling for now until we found a way to make it reliable for everyone, it's causing problems with storage for many people.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21687 a1c6a512-1295-4272-9138-f99709370657
2009-07-06 13:13:47 +00:00
Rafaël Carré
4368b59b09 Sansa AMS : don't reinvent adc_read(), patch by FlynDice
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21651 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 09:24:56 +00:00
Michael Giacomelli
7131ddb105 ARM922T's icache isn't coherent with its dcache, so we need to ensure that its flushed before changing codecs. Playback takes care of this for us, but only if we define cache coherency functions. Do that. Also, add a comment explaining that MMU functions need to be included so that other people don't spend hours chasing them in the future.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21647 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 01:17:25 +00:00
Rafaël Carré
293b499093 Move sd_get_info() into common sd code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21610 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 23:39:57 +00:00
Maurus Cuelenaere
ccbd8f4f31 * Move some more stuff to the general SD driver
* Ingenic SD driver: cleanup DMA part a bit (not working yet)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21606 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 22:56:14 +00:00
Rafaël Carré
c0eb9aeb9e add firmware/driver/sd.c which contains common code between SD drivers
ingenic SD driver needs more cleanup so it still doesn't use the common code
correct a comment in hotswap.c: card_extract_bits assume most significant word of register first (so, use this order)
fix debug menu which used MMC specific commands / bits positions in csd/cid
move the default block size of 512 into sd.h
move the mantissa & exponent table into a single file (sd.c) to reduce binsize. we don't need to export it anymore anyway

TODO : ingenic cleanup (will happen soon so building sd.c is not conditional)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21601 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 21:49:13 +00:00
Rafaël Carré
e0e24cbf0a Merge tCardInfo struct (MMC) and tSDCardInfo struct (SD)
Put specific members under #ifdef (CONFIG_STORAGE & STORAGE_xx) (2 members for SD and 1 for MMC)
Fix a typo: tsac doesn't exist and must be read taac
Move card_get_info functions declaration inside hotswap.h to remove mutual inclusion of ata_mmc.h and hotswap.h
Move static const data structures from SD drivers into sd.h (sd_exponent and sd_mantissa)
Fix sd_command prototypes in SD drivers (card registers are unsigned long)
Fix speed calculation in Sansa AMS driver (PP SD driver needs to be checked)
Move ata-sd-target.h to sd-pp-target.h to reflect the PP specifity. Now it only contains declaration of microsd_int()
Remove unused ata-sd-target.h for injenic

TODO:
- check if CSD register bits are extracted correctly in PP driver
- correctly define read_timeout and write_timeout unit for MMC & SD, and use timeouts in Sansa AMS driver

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21586 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 10:07:22 +00:00
Jack Halpin
c929310e55 AMSSansa: Corrects bug introduced with r21577 causing random lockups on AMSSansas.
The input to the ADC is now set to CVDD inside the while loop.  If the input gets changed while waiting for the voltage to be read it will now be reset to CVDD before the next read is attempted.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21584 a1c6a512-1295-4272-9138-f99709370657
2009-07-01 04:47:36 +00:00
Jack Halpin
e905ca61d4 FS#10344 - AMSSansa Dynamically adjust core voltage to extend playtime.
Lower CVDD core voltage to 1.10 volts when the frequency is less than 200 MHz.

 

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21577 a1c6a512-1295-4272-9138-f99709370657
2009-06-30 17:56:21 +00:00
Rafaël Carré
ed75cc09f1 Sansa AMS : use the aligned buffer in bss for all DMA transfers
This was only used for data transfers, now use it also for card data
transfers in sd_select_bank, to save runtime alignement and stack usage.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21564 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 18:14:26 +00:00
Rafaël Carré
ffefe0c08b Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h
Note : SH has TIMER_FREQ defined to CPU_FREQ, so any code wanting it must include #config.h before #cpu.h

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21560 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:30:12 +00:00
Rafaël Carré
c5dedd7d76 Remove the TIMER_* macros and declare target-specific functions in timer.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21559 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:57 +00:00
Rafaël Carré
89ccd5c145 Remove int_prio argument from timer_register, and move the only use for it into alpine_cdc plugin, since this plugin is only built on SH7034
Also remove it from TIMER_START()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21558 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:46 +00:00
Rafaël Carré
b3ed33d04a Move SH7034 timer code in the target tree
Add an argument int_prio to TIMER_START() macro because SH7034 needs it
Leaves a target specific code in timer_register (could be given to target code through timer_set and __timer_set() )

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21556 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:29:14 +00:00
Rafaël Carré
e0640c3c4b Rename TIMER_REGISTER macro to TIMER_START and TIMER_UNREGISTER to TIMER_STOP to reflect what they does exactly.
registering and unregistering are handled by the non target-specific functions of timer.c
Remove arguments from the new TIMER_START since they are unused by targets

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21553 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:28:56 +00:00
Rafaël Carré
15e40dd3a6 Move Sansa AMS timer code in the target tree
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21552 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 14:28:49 +00:00
Rafaël Carré
529855e79b Sansa AMS: correct sd_select_bank() in SD driver
Put the card data sent by DMA aligned on cache line size, and in uncached memory

Since sd_select_bank() is not used very often, still allocate the DMA buffer on the stack.

If you still experience any problems with this commit please report them after having formatted your player and reinstalled rockbox

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21550 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 11:56:49 +00:00
Maurus Cuelenaere
e59c4ffc82 Fix some forgotten OR's in some button-target.h files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21501 a1c6a512-1295-4272-9138-f99709370657
2009-06-24 22:13:37 +00:00
Rafaël Carré
d86cf998e8 Sansa AMS debug: small fixes
- Indentation fix
- Put braces around _DEBUG_PRINTF macro
- read_cp15() is only 1 instruction so inline it, and it doesn't access memory

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21477 a1c6a512-1295-4272-9138-f99709370657
2009-06-23 13:54:05 +00:00
Thomas Martitz
8fb4aea702 FS#10284 - "Sansa e200v2 & Fuze: Merge the button driver into 1 file" by Dustin Skoracki
Those two drivers were so similar, merging them is worth a few more #ifdefs.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21474 a1c6a512-1295-4272-9138-f99709370657
2009-06-22 22:24:58 +00:00
Bertrik Sikken
fa4135e43d Fix delays in generic i2c driver, reduce delays in ams sansa fmradio i2c driver (tested on m200v4, clip, e200v2, fuze).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21421 a1c6a512-1295-4272-9138-f99709370657
2009-06-20 21:45:04 +00:00
Bertrik Sikken
f81ce592e5 Enable charging on the Sansa Fuze (charging/discharging curves are still uncalibrated)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21394 a1c6a512-1295-4272-9138-f99709370657
2009-06-20 14:29:21 +00:00
Rafaël Carré
753064fccf Sansa AMS: fix yellow for models with buttonlight & without multivolume
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21343 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 23:03:10 +00:00
Rafaël Carré
e2ec2fe391 Apply FS#10306 to Sansa c200v2 (fix build in the same time)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21341 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 22:45:30 +00:00
Rafaël Carré
1e787a9911 FS#10306 by Thomas Martitz : button light doesn't change on SD transfers on Sansa AMS (Fuze & e200v2)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21340 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 22:33:02 +00:00
Rafaël Carré
0181bc42c9 Sansa c200v2 : support more hardware
Don't read the buttons from GPIOC but from DBOP_DIN (all directional buttons + select)
Still missing hold, rec, volume up and volume down
Read microsd
Tuner is a si4700 but seems to suffer from the same problem than e200v2
Sound works

TODO: missing buttons, lcd yuv, test lcd performance (the c200v1 lcd performance has decreased since r21321 : needs to be investigated)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21330 a1c6a512-1295-4272-9138-f99709370657
2009-06-18 15:05:59 +00:00
Rafaël Carré
3520d8e90e Sansa c200v2 : lcd & backlight support, using the c200v1 lcd driver
The LCD driver is unified and lcd_send_command now takes 2 arguments : the command and its argument.
    If there is no argument, it's set to 0 and a NOP command is issued
    If there is more than one argument (set X/Y address), the 2nd argument is sent as a 2nd command, and a NOP command is issued after it.
    Benefit : c200v2 transfers the command and the argument in one 16 bits transfer
    Performance should not be affected since commands without argument are only used in lcd_init() and lcd_enable()

lcd_send_data() now transfers whole lines (or columns) instead of single pixels
yuv is disabled for c200v2 for now

Some buttons can be read, including left button (bit 6 of DBOP_DIN), but for some reason they have no effect in rockbox: to be investigated

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21321 a1c6a512-1295-4272-9138-f99709370657
2009-06-17 19:55:27 +00:00
Rafaël Carré
02a53fd809 Sansa AMS: add a comment in sdram_init(), and use inline asm to set the SDRAM mode register
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21282 a1c6a512-1295-4272-9138-f99709370657
2009-06-13 23:52:13 +00:00
Bertrik Sikken
d1faf8b39c FS#10317 - Sansa AMS 32-bit timers. Configure the timers for 32-bit mode instead of the default 16-bit mode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21266 a1c6a512-1295-4272-9138-f99709370657
2009-06-12 21:11:45 +00:00
Bertrik Sikken
426cdb1284 Commit FS#10285 - Sansa Clip alternative button driver. This driver alternates one row in the button matrix per kernel tick, avoiding the need for explicit delays between selecting a button row and reading colums.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21253 a1c6a512-1295-4272-9138-f99709370657
2009-06-11 22:17:47 +00:00
Bertrik Sikken
79f348a178 Minor nitpick: don't do |= on the write-only GPIOA_IC register
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21251 a1c6a512-1295-4272-9138-f99709370657
2009-06-11 20:43:53 +00:00
Rafaël Carré
460a1c4497 Sansa AMS storage driver: restart bank selection if data transfer failed, and precise a comment about retry variable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21248 a1c6a512-1295-4272-9138-f99709370657
2009-06-11 17:28:24 +00:00
Rafaël Carré
7572141d42 FS#10309 : Sets reasonable timeouts for data access in the SD driver
Those are the recommended maximal timeouts in §4.6.2
Despite that, some people still experiment problems with the SD driver since MMU and data cache were enabled

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21247 a1c6a512-1295-4272-9138-f99709370657
2009-06-11 17:17:12 +00:00
Rafaël Carré
e2f165c088 Sansa AMS: make the UNCACHED_ADDR macro work for any type of pointer, and only use pointers with it, not arrays
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21230 a1c6a512-1295-4272-9138-f99709370657
2009-06-09 00:51:30 +00:00
Rafaël Carré
f504153857 FS#10048 : enable MMU and data cache on Sansa AMS to give a major speed up
- cache IRAM and DRAM
- map IRAM just next to DRAM to remove the need for -mlong-calls and reduce binsize
- tweak delays in Fuze button code
- tweak delays in Clip button code (down button sometimes doesn't respond anyway : an alternate driver is being worked on)

Before reporting any problem, please check your filesystem or format your player from the OF

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21228 a1c6a512-1295-4272-9138-f99709370657
2009-06-08 23:05:33 +00:00
Bertrik Sikken
5631bf7343 Sansa fuze: don't configure GPIO A7 in the LCD driver, this pin is used for fm radio
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21225 a1c6a512-1295-4272-9138-f99709370657
2009-06-08 19:54:58 +00:00
Bertrik Sikken
3589be4bdd Sansa e200v2: use = instead of |= when setting GPIO level
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21224 a1c6a512-1295-4272-9138-f99709370657
2009-06-08 19:48:30 +00:00
Rafaël Carré
f8a8619615 FS#10273 : Power Sansa Clip screen for some models needing as3514's DCDC15
No battery life loss for models not needing it

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21207 a1c6a512-1295-4272-9138-f99709370657
2009-06-07 23:33:43 +00:00
Rafaël Carré
1d97a380e2 Sansa Clip: apply r21190 to asm lcd_greydata : 2% speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21199 a1c6a512-1295-4272-9138-f99709370657
2009-06-06 14:13:48 +00:00