Commit graph

3597 commits

Author SHA1 Message Date
Michael Sevakis
6ed00870ab Base scheduler queues off linked lists and do cleanup/consolidation
Abstracts threading from itself a bit, changes the way its queues are
handled and does type hiding for that as well.

Do alot here due to already required major brain surgery.

Threads may now be on a run queue and a wait queue simultaneously so
that the expired timer only has to wake the thread but not remove it
from the wait queue which simplifies the implicit wake handling.

List formats change for wait queues-- doubly-linked, not circular.
Timeout queue is now singly-linked. The run queue is still circular
as before.

Adds a better thread slot allocator that may keep the slot marked as
used regardless of the thread state. Assists in dumping special tasks
that switch_thread was tasked to perform (blocking tasks).

Deletes alot of code yet surprisingly, gets larger than expected.
Well, I'm not not minding that for the time being-- omlettes and break
a few eggs and all that.

Change-Id: I0834d7bb16b2aecb2f63b58886eeda6ae4f29d59
2014-08-16 05:15:37 -04:00
Michael Sevakis
9a3400a4a6 Fix some more straggling stuff
* HWCODEC bootloaders

* Remove references to thread structures outside the kernel. They are
private and should not be used elsewhere. The mrobe-100 is an offender
that gets squashed.

* The ata.c hack stuff for large sector disks on iPod Video gets squashed
for the same reason. I will no longer maintain it, period; please find
the real reason for its difficulties.

Change-Id: Iae1a675beac887754eb3cc59b560c941077523f5
2014-08-08 03:23:29 -04:00
Michael Sevakis
981d028c09 Do some kernel cleanup
* Seal away private thread and kernel definitions and declarations
into the internal headers in order to better hide internal structure.

* Add a thread-common.c file that keeps shared functions together.
List functions aren't messed with since that's about to be changed to
different ones.

* It is necessary to modify some ARM/PP stuff since GCC was complaining
about constant pool distance and I would rather not force dump it. Just
bl the cache calls in the startup and exit code and let it use veneers
if it must.

* Clean up redundant #includes in relevant areas and reorganize them.

* Expunge useless and dangerous stuff like remove_thread().

Change-Id: I6e22932fad61a9fac30fd1363c071074ee7ab382
2014-08-08 01:59:59 -04:00
Szymon Dziok
86fa139eac Support for remote on Samsung YH920/YH925.
Remote buttons are bound to the standard buttons in button-target.h, but they can
have a separate buttonmap, if someone wants.

Change-Id: Id8c78a3dfec0005bf588dc16416870b4c7c56836
2014-07-28 22:11:33 +02:00
Szymon Dziok
228c47be4c Samsung YH-925: Don't add anything to adc value while reading it.
OF doesn't do such thing. Values in mV are converted proportionally, so no change
 to the battery meter.

Change-Id: Ic545b0514535e7f17f0379ed02f6bdf515f69ac6
2014-07-28 22:11:33 +02:00
Szymon Dziok
f74edac8c7 Samsung YH-920: Proper values for battery monitoring, based on the OF formula.
Change-Id: I894eb6bad600bd059fe9a5ea1103737a736d4005
2014-07-28 22:11:33 +02:00
Sebastian Leonhardt
7e778c5f49 Samsung YH-820: enable battery monitoring
The "percent_to_volt_charge" values are quite arbitrary
and may need some more tweaking.

Change-Id: I9f177d46681030d615fe2c2e78cf9bd2dde026af
Reviewed-on: http://gerrit.rockbox.org/824
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
Tested: Szymon Dziok <b0hoon@o2.pl>
2014-07-27 12:09:36 +02:00
Szymon Dziok
6bbfb35560 SA9200: Implement clicker.
It's not integrated with key click option for now.

Change-Id: Ib0769b02bfebe7c55eca7b7ea61df5d6dd83cdd3
2014-07-26 15:38:49 +00:00
Marcin Bukat
e557951c94 crc-mi4: use const lookup table for crc
This doesn't touch external tools as I see no need for.

Change-Id: Ia69248c4b6a033c3772916525257e3540bddcffa
Reviewed-on: http://gerrit.rockbox.org/891
Tested: Sebastian Leonhardt <sebastian.leonhardt@web.de>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-07-07 12:54:50 +02:00
Amaury Pouly
8d754c0997 Sony NWZ: calibrate discharge curves
The charging curve also need to be calibrated but that will be part of another
commit.

Change-Id: Ie4c5995123e4059ae4f3c9d86c11fc1257314d39
2014-07-01 17:26:29 +02:00
Marcin Bukat
314516e228 rolo: fix crc calculation for mi4
crc32gentab() which initilizes crc table was called in bootloader
but not in main binary. Fix this temporary by always calling it in
load_mi4(). The proper fix probably to switch to const table and
drop runtime initialization.

Change-Id: I8b0c2c791642f56ed56189d156647661935a815d
2014-07-01 09:16:03 +02:00
Amaury Pouly
6e575b6c70 sonynwz: fix backlight
Apparently the backlight driver is leaking current even when the PWM set to 0.
This patch should greatly improve the battery life of the device.

Change-Id: I76bbc8a87cae452e599b37de17e91f373cee58bc
2014-06-30 20:57:37 +02:00
Amaury Pouly
761f59c9e3 zen/zenxfi: don't switch emi on cpu change to avoid screen flicker
On those targets, since the LCDIF cannot recover from underflow, changing the
EMI frequency kills one frame and cause flicker.

Change-Id: Id3c130636bcfddcc6c54896602699fbaa1636ab4
2014-06-24 18:07:56 +02:00
Amaury Pouly
55c5c7ea66 imx233/emi: cleanup and don't change emi freq if not needed
Change-Id: I19f633a85bb12f880215905482934e34da549a13
2014-06-24 18:07:56 +02:00
Amaury Pouly
32219513aa fix whitespace
Change-Id: I12664528fdb0920430557739501367d1ed68346e
2014-06-24 18:07:56 +02:00
Amaury Pouly
d5591a2b28 zen/zenxfi: switch lcd driver to 24-bit mode
Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
2014-06-24 18:07:55 +02:00
Szymon Dziok
eacd76cb80 Radio and radio recording for Samsung YH-920.
There is no simple method to detect radio through the 3-wire interface, so it's
not implemented for the YH-925 for now. YH-920 always has a radio.

Change-Id: Iea484d752915fcd40dbbbd7dbbf13e81aaf548db
2014-06-18 18:06:17 +00:00
Szymon Dziok
6363294591 YH92x: Implement ATA power off.
Change-Id: If1f48df42ea7a150365c4ddbd3f9f7a85ae4b7dc
2014-06-18 18:06:17 +00:00
Szymon Dziok
701eaa647b Samsung YH-820: implement an inverting of colours on the lcd.
Change-Id: Ibddf444b35402f8d2a9ad8b6af9d897a6618da18
2014-06-09 01:15:17 +00:00
Szymon Dziok
8326f173f9 Samsung YH-920: properly implement and enable lcd flipping.
Change-Id: I0a8609c9b4849332a97a125d186f339a61e4d584
2014-06-09 01:15:17 +00:00
Sebastian Leonhardt
7f7aee3f24 Separate keymaps for YH-820 and YH-920/925
Although both players basically have the same keys, the
differences in the layout is rather big, so I think both
deserve their own keymaps.

(On the yh820 the FFWD/PLAY/REW buttons are located above the
direction keys, on the yh920 at the side of the player.
Furthermore the yh920/925 has a REC switch, whereas
yh820 has a push button.)

Change-Id: I0e62a1b101c387646c0bdb07ea142d9d2430ca15
Reviewed-on: http://gerrit.rockbox.org/814
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
2014-05-24 00:50:11 +02:00
Amaury Pouly
85390865b5 sansaview: fix lcd code
The lcd driver now works but is awfully slow. The trick is to put it in system
mode instead of RGB and setup 16bpp. The GRAM data can then be sent directly
with the SPI but since it's bit-banged and the CPU running at slow speed,
full screen refresh takes over a second, even with a slightly optmised version.
The OF uses a DMA mechanism with a proper LCD controller but the setup is much
more complicated and doesn't work at the moment.

Change-Id: I6c95d91de31bff97d0a5848b8e2078c21deb5895
2014-05-11 19:56:43 +02:00
Amaury Pouly
46cd8ea824 sansaview: cleanup backlight code
Change-Id: I0a844931fa2f7f247c8c5e28673241f79902f9be
2014-05-11 19:56:34 +02:00
Amaury Pouly
fcb835f61a regtools: normalise description files, and remove obsolete file. No logical change.
Files were generated using utils/regtools/tester in "write" mode.

Change-Id: Ib391b8dbb5ec84eb821e0d0a3699d306414f2aa1
2014-05-01 19:35:05 +02:00
Amaury Pouly
c8461c5152 imx233: fix comments
Change-Id: I2e907feaec39e6ec1614ed19676b13a1d4f7f6b2
2014-04-24 14:12:25 +02:00
Amaury Pouly
25ecbc5432 imx233: fix typos and sdmmc bug regarding write buffer
The write buffer should not be modified but the current code does and then
forget to restore it to its original content. I'm not sure if any code relies
to the write buffer to not be modifies by the write function but this seems like
a reasonable assumption in general so it's better not to break it.

Change-Id: I449a01db2ec51d2273e59b69c59db0e7d2eed3db
2014-04-23 23:44:11 +02:00
Amaury Pouly
54dd77a5f8 imx233: fix sdmmc driver bug when sector count is 0
Since the driver will read count-1 sectors, this will stuck the card.

Change-Id: Ib80484044acd1fad2914d3ffeb3940a13d2480c4
2014-04-23 23:43:27 +02:00
David Jilke
d489444119 Complete Plugin Keymaps for Creative Zen X-Fi3
This patch completes the plugin keymaps for the Zen X-Fi3 and enables those plugins for compilation.
One key was changed in "button-target.h" for compatibility with Rockboy.
This also caused the changes to "keymap-zenxfi3.c", to keep the stock functionality (no further changes in here).

Change-Id: Ic222faf89e9a9a2332a49d6e532cedb6eb16d3d7
Reviewed-on: http://gerrit.rockbox.org/762
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-04-06 20:51:12 +02:00
Sebastian Leonhardt
580104db4d Vibe500: change scrollstrip and button sensitivity to defines
Apart from the fact that the original settings were much
to sensitive for my taste, they are now easier configurable.

Change-Id: If1772367fc1f34fa1255f57b1831d1f33dc34558
Reviewed-on: http://gerrit.rockbox.org/772
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-04-03 07:35:47 +02:00
Szymon Dziok
7b015f8681 Sansa View: implement proper backlight and buttonlight switching.
Change-Id: Iab05c1fa5356efa28a4ee774bfd994b22c5661da
2014-03-27 23:23:38 +00:00
Szymon Dziok
62ac0c78c3 Sansa View: adjust two things (define fake codec, missing header file) in order
to compile the bootloader (now it should).

Change-Id: Iba6aa2f118670d66e10451eaf43dd4d83176b06a
2014-03-27 22:35:04 +00:00
Szymon Dziok
938aa8eefe Sansa View: define a GPIO bit for USB detection in order to compile the bootloader.
Change-Id: I748a49f4b48385f328946e861d1f9a026b1efd7d
2014-03-27 22:29:34 +00:00
Amaury Pouly
5abe98dada zenxfi3: fix horrible bug which prevented the power button to work
Change-Id: Ic8e86762f84ca41e931801c1aee08007129eef20
2014-03-22 22:36:32 +01:00
Amaury Pouly
2a71c08533 zenxfi: enable speaker
Change-Id: I603112d2a348abf92d5c8975ea76d3a57fda7cfc
2014-03-09 01:25:51 +01:00
Amaury Pouly
9637f4486b imx233: rewrite frequency scaling to use the new function
Change-Id: I0f9968de76ce17710d31f7bc609440654e68b6f1
2014-03-08 18:51:54 +01:00
Amaury Pouly
1f3979821c imx233: add function to change cpu/hbus frequency safely
Change-Id: I88e9ad54ba65846ae4d94ae03009b3656f2489f2
2014-03-08 18:51:54 +01:00
Amaury Pouly
3e2f3efd89 imx233: prepare frequency scaling for stmp3700
Add entry for stmp3700 maximum frequency which is 320MHz.

Change-Id: I6db4aad4efa0a7c1347a1ceb262a0295f63057ae
2014-03-08 18:51:54 +01:00
Amaury Pouly
9fe3687923 imx233: fix regulator code on stmp3700
For some reason the power subsystem needs to know the relationship between
the VDD{D,A,IO} and uses a weird register to do so.

Change-Id: I7fcc75f6cc0460b4997914986deda7ca544a4940
2014-03-08 18:51:54 +01:00
Amaury Pouly
4b2f59b3db zen: handle lcd underflow by hand
Contrary to the imx233, the stmp37xx lcdif doesn't know how to properly
recover from underflow and things are worse because of the errata which
makes the lcdif not clear the fifo. Workaround this by detecting underflow
and taking action: stop dotclk mode (will clear fifo) and schedule next frame.
The dma transfers now write the ctrl register as part of the PIO writes,
making the code simpler.

Change-Id: I15abc24567f322cd03bf2ef7903094f7f0178427
2014-03-08 18:51:54 +01:00
Amaury Pouly
b0940b1dd3 imx233: add lcdif underflow irq support
Change-Id: Ie3fe223ff40abff38bb9b09f398eb5411fa0be4c
2014-03-08 18:51:53 +01:00
Michael Sevakis
669fa9a130 Gigabeat S: Improve headphone thread implementation.
Implement scanning as binary tree in array.

Make the ADC calls fewer without compromising read quality.

Declare the thread function as 'noreturn' to save some stack. Reduce
stack size (regardless, % use is now a bit lower).

Change-Id: I239792fd2a0a2c019d1ec4af1d6d4b466cdf0ef5
2014-03-06 17:28:26 -05:00
Thomas Martitz
c35e1db832 Fix last warnings.
Change-Id: If0a7e11c3e107cb7756c0d70ed5b17fda92b166e
2014-03-03 20:34:46 +01:00
Thomas Martitz
68768260e8 Fix more reds.
Change-Id: I4b58dda0953b7f9799238c32b78037b0a5403c04
2014-03-03 20:26:08 +01:00
Thomas Martitz
c245de029d Fix various reds. Some includes needed fixup.
Change-Id: I4327740bae17054131feb917abdd58846c451988
2014-03-03 19:10:48 +01:00
Amaury Pouly
e5ce28ca09 zen/zenxfi: correctly implement lcdif errata
Change-Id: Ib2a6000035d70d687025a78bbea416d77af562fe
2014-03-03 18:33:04 +01:00
Thomas Martitz
382d1861af kernel: Break out kernel primitives into separate files and move to separate dir.
No code changed, just shuffling stuff around. This should make it easier to
build only select parts kernel and use different implementations.

Change-Id: Ie1f00f93008833ce38419d760afd70062c5e22b5
2014-03-03 18:11:57 +01:00
Amaury Pouly
3f116769fd zenxfi3: fix yellow
Change-Id: Id7eca51aa1c19cbb1798a0c8eeb5105ee4dc4769
2014-02-22 21:22:45 +01:00
Amaury Pouly
666f8fe7e3 zenmozaic: enable speaker support
Change-Id: I5f90a9816e9b7ca817fcb3195b63891fda5236f5
2014-02-22 20:40:45 +01:00
Amaury Pouly
1450f2658a stmp3700: implement speaker support by mean of lineout
Change-Id: Ic4c8b536fde7a840d3f3f295531cc1253de6320d
2014-02-22 20:38:40 +01:00
Amaury Pouly
b9db3d3743 imx233: remove nested irq check from debug menu
Change-Id: Ic16c6bf988d21c849488489d1b4a3477f2762afb
2014-02-22 20:38:10 +01:00