Commit graph

9666 commits

Author SHA1 Message Date
Andrew Ryabinin
ddf55200dc rk27xx: Add E & F gpio ports to debug info.
Change-Id: Idafd6fe37864625f7052045a32bb374798edfe1a
2013-03-25 16:35:04 +04:00
Andrew Ryabinin
b0eb3c7eb2 hm60x: Add lcd type information to debug info.
Change-Id: I09d30f9db6ac40cc92c22c637d560e4a3dcd50de
2013-03-25 16:32:58 +04:00
Bertrik Sikken
575d00e3b7 Remove redundant assigment of variable to itself
Change-Id: Ibecd8c869280a55a0716e631f44ab556f7dbd8b5
2013-03-24 16:24:40 +01:00
Bertrik Sikken
9b8f11d94a Fix LV24020 tuner chip volume level definition (found by cppcheck)
Change-Id: I328cfbd7c9fc6295db2e62f6174f8f4405e281a8
2013-03-24 16:03:31 +01:00
Marcin Bukat
027c035a4e jz4740: a few minor fixes
This was spotted while playing with qemu-jz:
1) rockbox reads TECR and TESR which are described as write-only
   registers. Datasheet doesn't mention what happens if they are
   readed. Apparently this doesn't have fatal side effects.
   It comes down to two defines from jz4740.h
   __tcu_stop_counter(n) and __tcu_start_counter(n) which use
   read-modify-write sequence.

2) rockbox accesses out of bound offset 0xd4 in DMA memspace.
   It comes from dis_irq() in system-jz4740.c. NUM_DMA is 6 but
   DMA channels are 0-5 so (irq <= IRQ_DMA_0 + NUM_DMA)) bound
   check is wrong.

This are *NOT* tested on device.

Change-Id: I29dff6a4f828030877b7d50fbcc98866478b9e3d
Reviewed-on: http://gerrit.rockbox.org/338
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Tested-by: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-03-11 08:33:18 +01:00
Lorenzo Miori
2f9e3cae2c Samsung YP-R0 LCD improvements
This patch adds to YP-R0 (and other future targets using Linux
framebuffer) the ability to use LCD_ENABLE to save some CPU cycles
while display is powered off.
This patch also changes the way to toggle LCD power: now using
a proper ioctl call, slightly more efficient.

Change-Id: I544de77f5abd4ac1c13d3fe3a6e40a30f7c0bece
Reviewed-on: http://gerrit.rockbox.org/410
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-03-06 23:23:52 +01:00
Thomas Martitz
8ef8ea2da2 ypr0: Align to coding guidelines (no typedef) and remove unused function.
Change-Id: If61e2290f4e0e5c971ece967b7d826624df392df
2013-03-06 10:11:12 +01:00
Thomas Martitz
7ef2fe3819 ypr0: Fix erroneous if condition.
The GPIO device file wasn't closed due to this. This wasn't a big deal
because the device powers off shorty afterwards anyway.

Change-Id: I9a6b4d57d32627157323b4883e47b8812f5dcb4d
2013-03-06 10:02:48 +01:00
Lorenzo Miori
60592165ca Samsung YP-R0 hosted target code refactoring
As per title this patch aims at splitting common target
code and specific target code in a better way to
support future ports within the same environment
(e.g. Samsung YP-R1 where the Linux and the SoC
are the same, with differences in hardware devices
handling)

Change-Id: I67b4918c46403b184d3d8f42ab5aae7d01037fd0
Reviewed-on: http://gerrit.rockbox.org/409
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2013-03-06 00:21:22 +01:00
Amaury Pouly
97f1466cd4 rk27xx: fix usb logf
Change-Id: I1bae5613fd96587bcdcf179ec4132ce75224d398
2013-03-04 11:31:47 +01:00
Amaury Pouly
3875f576e8 rk27xx: add memmap to debug screen
Change-Id: I93ae961abfed567ab972bc99d43ff4c8029ee3f7
2013-03-04 11:31:47 +01:00
Andrew Ryabinin
3fd11c370e hm60x: Fix white screen bug.
Lcd should be reseted after power is supplied.

Change-Id: I2a47ffb7d9b20d9ef2ad90aee15f4ada2fdd7f2e
2013-02-16 18:21:36 +04:00
Thomas Martitz
bd67f3dc6b bitmap drawing: Support alpha blend if image over the framebuffer contents.
If DRMODE_FG now the alpha channel in bitmaps can be used to draw the bitmap
over the framebuffer, so that e.g. a line selector isn't cleared for
for transparent bitmap pixels.

Change-Id: I09d59a09d2f3c90450a0fe2b83c6c59d757b686b
2013-02-12 10:37:13 +01:00
Thomas Martitz
68d3ce2acd bitmap drawing: use temp vars to help gcc opmize loops.
By saving current_vp fields into temp vars just before the loop gcc can
put them into registers. This yields ~15% speedup for drawing anti-aliased fonts.

Change-Id: I4c0c9f5ff7a7f084e2eb08c4ed874176b1f9832c
2013-02-12 10:34:49 +01:00
Thomas Martitz
1430b07894 bitmap drawing: Use extra bit in mask to avoid nested if() in switch-cases.
Speeds up alpha bitmap drawing by up to 10%. mono bitmap drawing is also a tiny bit faster.

Change-Id: I5a9379740c1a0091de9c621aabbe57d767ce2905
2013-02-12 10:34:48 +01:00
Thomas Martitz
ca634a0ac0 bitmap drawing: Negate alpha channel to match alpha information format of font files.
The comment about the format was actually incorrect. The alpha information
is now negated during conversion to native format, according to the
corrected comment.

Change-Id: Ifdb9ffdf9b55e39e64983eec2d9d60339e570bd9
2013-02-12 10:29:25 +01:00
Marcin Bukat
c66a66728c rk27xx: do not disable irq in commit_discard_dcache_range()
commit_discard_dcache_range() is used in sd, lcd and pcm drivers
to handle transfers form/to data buffers so this should not introduce
any problems. It is reported to fix pop noise observed on some hifimans.
We apparently don't fully understand cache handling on this platform.

Change-Id: I436d291509f91d16a13d10965a28171fb27574ab
2013-02-12 08:48:43 +01:00
Andrew Ryabinin
63859e6894 rk27xx: Increase timeout for sd card initialization. 1 sec isn't enough in some cases.
Change-Id: I8d5384b53754e71b9a057a8602854d09b1885c68
2013-02-01 11:19:22 +04:00
Amaury Pouly
80c019e737 imx233: add a missing packed attribute for dma !!
Change-Id: Iada56b34d0517851859e60f064a2e9032c2f0fe2
2013-01-26 18:24:50 +00:00
Marcin Bukat
02a9089034 PP: Do not use ATA DMA in bootloader
The build of bootloader with HAVE_ATA_DMA fails because of missing
commit_discard_dcache(). This seems to be bigger problem as
bootloader builds don't call  cache_init() also which seems wrong.
but I know too little about the PP platform to judge.
For now use ATA DMA only in regular builds.

Change-Id: I82873cb1771f5a95ebfbef91ce26744e3abd743c
2013-01-24 13:04:57 +01:00
Boris Gjenero
d118f47d24 Re-enable PP502x ATA DMA
PP502x ATA DMA was disabled in 55fab77 because it caused various
instability on all targets using it. This instability is fixed in
583c948 via FS#12391. Here, ATA DMA is enabled for all PP502x targets
except nano1g and hdd6330. For nano1g, there may be other causes of
instability and more testing is needed. ATA DMA does not work on hdd6330.

Change-Id: I786b9edb19e74e6eb957ab205ea026f0969200ac
Reviewed-on: http://gerrit.rockbox.org/340
Tested-by: David Hooper <dave@beermex.com>
Tested-by: Boris Gjenero <boris.gjenero@gmail.com>
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
Tested-by: Szymon Dziok <b0hoon@o2.pl>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-01-24 11:27:12 +01:00
Boris Gjenero
0fec8414a3 Fix FS#12391 : Memory corruption on PP502x after commit_discard_idcache()
In commit_discard_idcache(), cache lines were marked as invalid. When
some cache lines are marked as invalid, memory corruption can occur.
This caused instability when using PP502x ATA DMA because of the many
more calls to that function. Here, commit_discard_idcache() is changed
to avoid the problem. Also, the cache is filled after being enabled to
to ensure there are never any cache lines that aren't marked as valid.

Change-Id: Ia26300acef6b0573c1f40299c496ee5cbda3dac8
Reviewed-on: http://gerrit.rockbox.org/339
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
Tested-by: Szymon Dziok <b0hoon@o2.pl>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-01-24 11:26:23 +01:00
Amaury Pouly
e9f8846ce2 imx233: enable cpu frequency scaling on all targets
Change-Id: If19f51da5e4d66d7a85b3b9f50cbde115e73b6cb
2013-01-18 18:59:41 +00:00
Amaury Pouly
9b7edbf609 fix yellow on simulator + multivolume
Change-Id: Idc6d0e2e8fb06c2df4cac13ad7253b0b8628c308
2013-01-15 22:59:29 +00:00
Amaury Pouly
1a5cda9075 zenxfi2: add simulator defines and image
Change-Id: I87498ed09a952586cb84a44bc391b5a0aa149c2e
2013-01-15 21:57:26 +00:00
Amaury Pouly
224c6d68f1 stfm1000: comment static unused function
Change-Id: Ie918a07c72bf9086508731faf658d57a286d922a
2013-01-15 19:49:52 +00:00
Amaury Pouly
ba277d68f3 imx233: fix sd windowed drive
The SD driver doesn't initialised drives at the beginning but
upon request to handle removable drives. Since means that the
init should call init_drive() and not init_sd_card() otherwise
the check for WINDOW flag is bypasses. This breaks the zenxfi3
bootloader and has been overlooked for some time.

Change-Id: I7325f7164d16d7e7e54eeb4645e98517a08e0836
2013-01-15 19:10:55 +00:00
Amaury Pouly
19ca914f27 zenxfi3: remove obsolete comment
Change-Id: I9597461c2d48b7b7558c60efd309e5b34c661cbe
2013-01-15 19:10:55 +00:00
Amaury Pouly
4307f95a1f imx233: rework frequency scaling
Move to a table based approach (scales better) and distinguish
between upward changes (increase frequency) and downward changes
(decrease frequency). This provides a better ordering of
operations and in particular it allows to avoid changing the
regulator while running at low speed since it takes a long time !
This should result in a much smoother scaling.

Change-Id: Iad7e5b61277e215f31c07877fbbad07ddde1171f
2013-01-13 00:58:46 +00:00
Marcin Bukat
29e51a1777 rk27xx: slightly optimize commit_discard_dcache_range()
Change-Id: I13ce643d4ba26db5de9ffa083070d7f40b0e7b1f
2013-01-12 21:57:37 +01:00
Amaury Pouly
e2be0e75ab imx233: correctly send the LCD_EVENT_ACTIVATION on enable
For some reason it is the responsability of the driver to send
this event so do it. This might fix some non-updating screens.

Change-Id: Ib5fdc94bf266c3497a8ac4e89d0418c0e876ff9f
2013-01-12 19:08:05 +00:00
Amaury Pouly
c8d36bb994 fuze+: lcd code cleanup
The lcd kind is always set to st7783 in case we can't read the ID
so don't bother handling impossible cases

Change-Id: I352fd43b26068b460e69190d37c4cd4627e1db9a
2013-01-12 19:06:24 +00:00
Amaury Pouly
5e7bd97e04 fuze+: correctly handle settings (flip and invert) accross enable
The flip and invert settings can potentially be reset to their
value accross a disable/enable cycle, so save the value of the
impacted registers and apply it after each enable. Also avoid
poking registers when the lcd is not on.

Change-Id: Ica98f166c060aade7eb205f5628b58aae692024f
2013-01-12 19:04:20 +00:00
Amaury Pouly
0946a1e0f2 imx233: enable underflow recovery in lcdif (needed for freq scale)
When chaging the cpu and memory frequency we need to disable the
external memory interface (EMI) for a small time. This can
underflow the dma and cause some breakage. Hopefully the SSP
controller handles this gracefully by stopping the clock and the
I2C probably handles this naturally because the clock can be
streched anyway. However the LCDIF has a special setting for this
which needs to be enable, otherwise it will send garbage to the
LCD. No other block is known to suffer from this currently but
this issue might have more unexpected consequences.

Change-Id: Ide154cad87929f2bf6cc419ac1d2ff33e30eec66
2013-01-12 18:58:19 +00:00
Marcin Bukat
2ef7a549d5 rk27xx: optimize irq_handler()
Change-Id: Idd3141e57b70e9b28b91748bc71208d9afffcd57
Reviewed-on: http://gerrit.rockbox.org/381
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-01-11 15:41:11 +01:00
Marcin Bukat
efe1042759 rk27xx: substitute magic constants with meaningful names for INTC
Change-Id: Ic93114db351a9940a53d0c1df6439d82ada044e1
2013-01-10 20:23:41 +01:00
Marcin Bukat
15818bef55 rk27xx: substitute magic constants with meaningful names for peripherials reset
Change-Id: Ia411c9be65376d1c3fdf59b7e692b0590d58775e
2013-01-10 20:23:41 +01:00
Marcin Bukat
2b6dfdb34e rk27xx: substitute magic constants with meaningful names for clock gating
Change-Id: I6c66c7496db3db78e5c959414464826134dbe200
2013-01-10 20:23:41 +01:00
Amaury Pouly
1fa406dc21 imx233: modify arm cache timings on frequency switch
The manual recommands to tweak the arm cache settings on frequency
changes. The meaning of these values is undocumented but 0 seems
to be a safe value for all frequencies whereas 3 seems to be valid
only for low frequencies (<=64MHz ?)

Change-Id: Iaa8db4af8191010789cf986b1139ff259d73e2ed
2013-01-10 01:02:12 +00:00
Amaury Pouly
5aa19f3eeb imx233: implement emi frequency scaling (disabled by default)
CPU frequency scaling is basically useless without scaling the
memory frequency. On the i.MX233, the EMI (external memory
interface) and DRAM blocks are responsable for the DDR settings.
This commits implements emi frequency scaling. Only some settings
are implemented and the timings values only apply to mDDR
(extracted from Sigmatel linux port) and have been checked to
work on the Fuze+ and Zen X-Fi2/3. This feature is still disabled
by default but I expected some battery life savings by boosting
higher to 454MHz and unboosting lower to 64MHz.
Note that changing the emi frequency is particularly tricky and
to avoid writing it entirely in assembly we rely on the compiler
to not use the stack except in the prolog and epilog (because
it's in dram which is disabled when doing the change) and to put
constant pools in iram which should always be true if the
compiler isn't completely dumb and since the code itself is put
in iram. If this proves to be insufficient, one can always switch
the stack to the irq stack since interrupts are disabled during
the change.

Change-Id: If6ef5357f7ff091130ca1063e48536c6028f23ba
2013-01-10 00:51:35 +00:00
Cástor Muñoz
758a3ae4bb iPod Classic/6G: PCM support for all CS42L55 rates
pcm_dma_apply_settings(): sets the configured PCM frequency,
all native CS42L55 sample rates are available.

Change-Id: I2fcd5581457a669c3044516804cb64fb972218d0
2013-01-09 22:08:28 +01:00
Cástor Muñoz
17e57e3291 iPod Classic/6G: support USB suspend mode
Actually Rockbox does not use this mode, it is supported by
other iPods, so implemented on Classic as well.

Change-Id: Ia6578506df27a95a7f7522b3034b764631a8bb3a
2013-01-09 22:08:27 +01:00
Cástor Muñoz
1d901a82fd iPod Classic/6G: fix battery voltage ADC scale
Scale battery voltage ADC readings by 1023 instead of 1000,
using ADC1 (substractor) instead of ADC0 (multiplicator) to
get better resolution.

Percent charge/discharge tables are also modified to return
a similar value than the old ones.

Change-Id: I2951c75faa02f4302599ec24f9156cfd209c36eb
2013-01-09 22:08:27 +01:00
Hayden Pearce
6803d7b10c iPod6G (Classic) - enable HAVE_DISK_STORAGE
Fixes missing Settings - General Settings - System - Disk - Spindown
setting.

Change-Id: Iae686598dfd7ad4ca1faf8db9f1271e7808de752
Reviewed-on: http://gerrit.rockbox.org/376
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Tested-by: Michael Giacomelli <giac2000@hotmail.com>
2012-12-29 21:25:57 +01:00
Amaury Pouly
935d8beab1 imx233: increase irq storm threshold
On heavy storage operations (like database update), the ssp dma
irq can be fired around ~10000/sec.

Change-Id: I0e33df6258e051abd4fe110a0f408a19671cd8ad
2012-12-29 02:53:21 +01:00
Amaury Pouly
68ff43e94b imx233: correctly restore auto slow on cpu frequency change
Change-Id: I3ba495488e20fdd19d391f84ff484c1ce305d11b
2012-12-29 01:40:35 +01:00
Amaury Pouly
2b1159dda0 imx233: move power init to system init
Do low level power init in system_init(). This can be needed
since imx233 must be able to frequecy scale atfer system_init()
and kernel_init() and this is only possible if power system was
initialised.

Change-Id: I27c66ec0dccd60bda26a45be24683c0bfe72c6da
2012-12-29 01:40:35 +01:00
Amaury Pouly
f7132e4044 Fix copyright headers
Change-Id: Ie65920b1192e9b737fcc2554d280fbcedfa39800
2012-12-29 01:40:35 +01:00
Andrew Ryabinin
97250a0156 hm60x/hm801: Add hold button support.
Change-Id: I05557ecfbf0bd821d8966862a38f7f22656b36ef
2012-12-29 00:19:23 +04:00
Amaury Pouly
8ecbcad3d1 imx233: use tick insteaf of msec to collect statistics
The current code uses the msec irq to collect statistics and
detect irq storms (debug). But this irq is triggered 1000 times
per sec and we don't need that accuracy. This commit removes the
msec irq and use the tick timer instead which is triggered only
100 times per second.

Change-Id: If14b9503c89a3af370ef322678f10e35fafb4b8a
2012-12-26 21:26:33 +01:00