Commit graph

867 commits

Author SHA1 Message Date
David van Moolenbroek 36041198ad ahci: fix integer sign extension bug
Reported by Coverity.

Change-Id: Ie7eef9570c89c69a05ba45169a0ea838f0d8e320
2013-10-22 13:58:59 +00:00
Kees Jongenburger 02f6308a2b arm:mmc driver speedup.
Speedup the mmc driver one more time before doing a proper fix.

Change-Id: I9dbe9b1e16e71fed00c8ac3ca7fdc6c4374284c0
2013-09-26 12:11:29 +02:00
Thomas Cort cb5e2921b3 i2c: increase read/write timeout
The sht21 temperature and humidity sensor holds the i2c bus while
an ADC conversion is in progress. For example, a temperature
measurement is requested, a read operation is started, and the
sht21 doesn't respond to the read request until the result of
the measurement is ready. The conversion time isn't constant.
On rare occations (one in hundreds of samples) the timeout in the
i2c driver expires returning an error.

The example code from Sensirion, the sht21's manufacturer, suggests
a bus timeout of 1 second to accommodate the sht21. This commit
increases the bus timeout to 1 second. The timeout is only reached
when chips do not respond normally, so the change doesn't affect the
performance of any other drivers.

Change-Id: I57b0f958a5d0b69b221af380b771fe67401ff604
2013-09-18 08:10:26 -04:00
Thomas Cort 75bd3009d3 libi2cdriver: add functions for IC register access
Many i2c device drivers used similar code to access registers on
the ICs they drive. This commit implements that functionality in
libi2cdriver and updates the drivers to use the library instead of
their own register access functions. The net result is 375+ fewer
lines of code and less work for people developing new drivers.

The two exceptions were cat24c256 and parts of tda19988. They access
the bus in uncommon ways. It doesn't make sense at this time to
move their read/write functions into libi2cdriver.

Change-Id: Id8280b71af33b710a49944d7f20a7262be9f5988
2013-09-18 08:10:26 -04:00
Thomas Cort 43471c3110 bmp085: remove duplicate code
A copy and paste error caused a few lines of code to be duplicated.
This patch removes the excess code.

Change-Id: I7313efb537e2a4102fb25ce05782e82ae0c84285
2013-09-18 08:10:26 -04:00
Thomas Cort 493e4fffc5 tda19988: add missing blockdriver_announce() call
To provide EDID to fb, the TDA19988 implements the block device
protocol with libblockdriver. To properly use the library,
blockdriver_announce() should be called by the driver.

Issue reported by David van Moolenbroek

Change-Id: Id55d159d91502a9afac5c1d4de0fee1e8945b5c1
2013-09-18 08:10:26 -04:00
Aurelien Jarno f0c391e09b virtio-net: acknowledge used features
According to the virtio specifications, the host present the supported
features to the guest, and the guest should answer woth the features it
supports. This allows the host to disable support for features that the
guest is not going to use.

Minix tells to the host it doesn't support any extended features, while
it uses at least VIRTIO_NET_F_MAC and VIRTIO_NET_F_CTRL_VQ. For the
latter it seems it only allocate the queue while not using it later.
However starting with QEMU 1.4.0, with multiqueue support added, the
control queue is not allocated on the host side if the guest doesn't
tell it supports this feature. This cause virtio-net to crash on the
Minix side.

This patch fixes that by correctly telling the features that are
used by the Minix guest for more than printing a debug message. This
fixes virtio-net on QEMU 1.4.x.

Change-Id: I8bbf757c09d24e0f5fe5835531a1c9203b714bd7
2013-09-11 18:34:11 +02:00
Thomas Cort 0a9eab0bb6 gpio: port to am335x
* port libgpio to am335x.
 * increase NR_IRQ to 16 to avoid too many IRQs requested error.
 * move gpio binary to /sbin (that's where mount looks for drivers).
 * fix bug that re-enabled banks that were disabled due to bad revision.
 * fix padconf masks for dm37xx in gpio driver (should be 16-bit).
 * fix a few typos in README.txt and comments.

Change-Id: I32374415a97135174c5224f76374a870909fa90c
2013-09-03 08:14:18 -04:00
Thomas Cort 4593804bf0 kernel: add padconf kernel call
On the AM335X, writes to the padconf registers must be done in privileged
mode. To allow userspace drivers to dynamically change the padconf at
runtime, a kernel call has been added.

Change-Id: I4b25d2879399b1785a360912faa0e90b5c258533
2013-08-28 12:53:05 -04:00
Ben Gras c8f3b10909 fix a few more minix specific warnings
. also disable stack protection feature for gcc,
	  causes build errors for pkgsrc gcc on minix

Change-Id: I1c6e2bcb4d948098d642543d7b2711284ee55c72
2013-08-27 16:16:03 +00:00
Thomas Cort 471dc65ada bmp085: driver for the BMP085 temp&pressure sensor
Change-Id: I5c297a7f4f8cea2549e537df30a5c7bf5b9d8b51
2013-08-22 16:54:03 -04:00
Thomas Cort 3bdd1ae659 sht21: driver for the SHT21 humidity & temp sensor
Change-Id: Ia71168e394a7b260019e74973db6c9d75d3d4482
2013-08-22 16:53:57 -04:00
Thomas Cort 845aabfe65 tsl2550: driver for the TSL2550 light sensor
Change-Id: I9e1c87132404509ffec8bf22a8c6cc993df1aa73
2013-08-22 16:53:49 -04:00
Arne Welzel b026d9f946 sb16: Don't confuse pv_set()
Change-Id: Ib7b528aa3a369b54dda3bbceb498db4a600c4cb4
2013-08-20 19:42:30 +02:00
Ben Gras 6e5a113837 a bit more -Werror compatability
for clang, fix warnings in drivers/, lib/, servers/, sys/, common/.
by turning off fatal warnings (takes effect if the default is on),
fixing warnings or reducing the warning level.

Change-Id: Ia1b4bc877c879ba783158081b59aa6ebb021a50f
2013-08-20 11:37:40 +02:00
Michal Maka 0c044c6b02 beaglebone ethernet improvements
. added enable interrupts routine at the HW init stage
	. remove workaround, obsoleted by libnetdriver change
	. change netconf.sh to allow configuring this driver,
	  changed README.txt to reflect this

Change-Id: Ib659d5a55be96022b5e9013caa556dca5092ce89
2013-08-19 13:47:10 +00:00
Thomas Cort 228e84ad2a i2c: general clean-up
Implement changes based on Kees comments on the code review:
	http://gerrit-minix.few.vu.nl/#/c/676/

Changes:
 - use spin API instead of micro_delay() for busy-wait loops.
 - use read16/write16/set16 from mmio.h to access I2C registers.
 - reduce the timeout for soft reset.
 - in read/write, don't mix variable declaration and initialization.
 - after transfer, wait for access ready instead of blindly delaying.
 - rename constants am335x, dm37xx to AM335X_I2C_BUS, DM37XX_I2C_BUS.
 - rename ADDRESS_MASK to MAX_I2C_SA_MASK for clairity.
 - rename omap_i2c_claim_bus() to omap_i2c_bus_is_free().

Change-Id: Ic221e6134e024ea0a6690f21cff208a728286948
2013-08-13 16:29:22 -04:00
Thomas Cort 26f14d6b5d fb: auto-configure with EDID
Use EDID when available to configure the frame buffer driver with
good settings for the attached display.

Change-Id: I69a78155a93e55ffa1ca3ff6621a879a56cdbceb
2013-08-11 20:37:16 +02:00
Thomas Cort 6405d78182 readclock/tda19988: fix compiler/cppcheck warnings
readclock:
 - the setup function for readclock on i386 was missing a return.
 - the message field for RTCDEV_GRANT wasn't the right type.

tda19988:
 - position variable was used without being initialized.

Change-Id: I3f78dd0a9d44f35eb38cb7da0974909f066b7007
2013-08-10 14:36:10 -04:00
Thomas Cort 039c8db774 readclock.drv: add support for the TPS65950 RTC
On the BeagleBoard-xM, the RTC is located on the Power Management IC
(PMIC). To keep things consistent, access to the PMIC's RTC is done
through the readclock driver. The readclock driver forwards the request
on to the TPS65950 driver which does the work of manipulating the
registers on the chip.

Change-Id: I53cefbb59c5a9ab87fab90df3cc1a75a6e430f58
2013-08-09 12:41:58 +02:00
Thomas Cort bab2a34e1b tps65950: driver for the TPS65950 PMIC
Change-Id: I6b6163e59233d1f823f03550b949d53e1738a7f4
2013-08-09 12:41:43 +02:00
David van Moolenbroek 0f07506951 ahci: make 64-bit native 2013-08-08 17:36:41 +02:00
Lukasz Hryniuk 06154a34a4 Some more 64bit function eradication.
. Replace 64bit funcions with operators in arch_clock.c
  . Replace 64bit funcions with operators in proc.c
  . Replace 64bit funcions with operators in vbox.c
  . Replace 64bit funcions with operators in driver.c
  . Eradicates is_zero64, make_zero64, neg64

Change-Id: Ie4e1242a73534f114725271b2e2365b2004cb7b9
2013-08-07 12:35:53 +00:00
Antoine Leca 530c9fa61a Audio drivers: use correct build receipt 2013-08-06 11:46:28 +02:00
Antoine Leca 96ffd57540 dec21140A: remove ACK option in Makefile 2013-08-06 11:46:22 +02:00
Thomas Cort d9b62047f1 tps65217: driver for the TPS65217 PMIC
Change-Id: Ic2259c15645816627d757c9c45560cb4c5c0156c
2013-08-05 10:22:59 -04:00
Thomas Cort 09db2a8c67 readclock: add support for am335x RTC
Add support for getting/setting the am335x SoC's internal real
time clock. Also, allow the power off alarm to be set.

Make readclock an "always on" driver. This is needed for setting
power-off alarms whenever the power button is pressed on the BBB.

Replace the readclock.sh script & single run driver with a
readclock program that takes the same arguments and forwards
the requests on to the always up readclock driver.

Change-Id: Ifd6c2acd80ae4b5e79d83df510df445c24e24a71
2013-08-05 08:37:51 -04:00
Gregg Hernandez 1939870c2e removed some 64-bit functions
Change-Id: Idbafdbf13714f984f03770bd3b39521cb1014cdb
2013-08-05 10:40:26 +02:00
Michal Maka 29ecfde5ef Lan8710 driver initial version, after first review
Change-Id: If00cf1e098da5875eb040f8765273a6fa5e43e33
2013-08-04 21:31:05 +00:00
James T. Sprinkle 2343037ba2 fxp: Add code for PCI_REV 0x83
Change-Id: I44456c72ebc041ed31327d7c4a8cb77dacaee990
2013-08-04 20:32:31 +00:00
Thomas Cort 1b78e86fb8 tda19988: driver for the TDA19988 HDMI Transmitter
Change-Id: Ia7750df3dd4ec4bd68624c800a0241c70eea7ca4
2013-07-29 12:38:01 -04:00
Thomas Cort 437177b028 i2c: increase BUFLEN/CMDLEN to 128, add page flag.
128 byte reads are much more common than 32 byte reads. The message
passing + setup/teardown for a read is much more expensive, in terms
of time, than the reading itself. A slightly bigger struct is well
worth the time savings. This reduces read times for /dev/eeprom
from 57 seconds per 4KB to 14 seconds.

Additionally, make sending the page address in the eeprom driver
and utility optional. This can save a little time when reading
within the same page and allows support for smaller devices that
don't support pages (example: chips containing EDID).

Change-Id: Ie48087caee40c11fa241d1555fce9309ddd27b43
2013-07-27 08:21:37 -04:00
Lionel Sambuc 003ff52ebb Revert "drivers/fbd/action.c: removed some 64-bit functions"
This reverts commit 85e7d849c8.

This introduce a bug in position computing for disk bigger than 4GB.

Change-Id: I281e60e9644d995cc4643006b50c05693f939b44
2013-07-23 19:19:53 +02:00
Lukasz Hryniuk 63d39b995c Replace 64bit funcions with operators in at_wini.c
Change-Id: I5d4f85a55f9f9d4c2a26daca6957be8f57ba9164
2013-07-23 13:44:54 +02:00
Gregg Hernandez 85e7d849c8 drivers/fbd/action.c: removed some 64-bit functions
Change-Id: I6a041f7dabad3e849d868c94c4fbd0edb7fc88b7
2013-07-23 11:35:41 +02:00
Thomas Cort 526eb34144 cat24c256: driver for the cat24c256 i2c eeprom
Change-Id: I682d136c80fc868d3f0a5edb0cf6c33c0f3a28ea
2013-07-15 17:03:18 -04:00
Thomas Cort 550fdfb443 i2c: initial bus drivers for am335x and dm37xx
Change-Id: I478704fbf30dbf6d3382bcbfb11e75b512c032a1
2013-07-15 11:11:13 -04:00
Ben Gras 456359aa72 retire 64-bit conversion functions
Change-Id: Ib6b81403f877c363a286c654e0524fa1cb781b80
2013-06-24 16:50:57 +02:00
Kees Jongenburger 964e313c94 arm:use the 4 bit mmc data bus if supported by the card.
Change-Id: I55de05db23ad1766e5faec93252e8410cbf59001
2013-06-24 09:12:11 +02:00
Kees Jongenburger 061fed753e arm:mmc driver refactor and timeout fix for BeagleBoneBlack.
When we send MMC commads that contain data the controller provides no
description of the order of events and we need to be able to send data
from and to the controller "when needed". Changed the code to react
on buffer read and buffer write ready based on interrupts.

Change-Id: I60c9140bf0e45b74be6475054564d4e1bd89f21e
2013-06-24 09:12:10 +02:00
Kees Jongenburger 718114d9b0 arm:mmc driver refactor.
Generalize the usage of mmc_send_cmd function to allow
it to transfer data and remove direct invocations to
mmchs_send_cmd.

Change-Id: Iabb9a7d3f4ec57536407b369531ded2b8b649cce
2013-06-18 14:35:44 +02:00
Anton Kuijsten 2e3046757a LLVM bitcode for almost the whole source tree
Change-Id: Ibc6f89de112e0649c3a3bfe49c2baa2ed0746212
2013-06-18 10:49:53 +02:00
Thomas Cort ba92d5219d clkconf: move clkconf from libgpio to it's own lib
Clock configuration will be needed by other/future subsystems such as i2c.
Extract the functionality from libgpio and put it into it's own library.

Change-Id: I6f6de0b3fb4d305ddfeac74123b78c983d1318dd
2013-06-18 09:09:23 +02:00
Ben Gras 71ac8a3a8a some arm uart fixes
. always keep reading data from uart so the interrupt is
	  not continually asserted if data is sent but no process
	  reads it
	. increase tx & rx fifo trigger levels -> reduces the number
	  of interrupts necessary
	. bigger rx/tx buffers

Change-Id: I3cf7c73b22ae2fc091b845d516ba4aa53e892cda
2013-06-14 23:58:44 +02:00
Ben Gras 93d9caa2d6 tty: i386: rs232 fix
. ignore interrupt (stop interrupt check loop) if
	  interrupt bit not set; limit loop too
	. mask off other bits when testing bits in the status register
	. this fixes rs232 output that would otherwise never get re-triggered
	  as too many bits were set in the status byte to match the
	  possibilities.

Change-Id: I311c93377fa8fb477ee9a756455fdeda780e6ba1
2013-06-12 07:04:52 +00:00
Kees Jongenburger b1e0ada171 arm:tty enable FIFO
Change-Id: Iaaa7c0bcb40c2cce2423c1defc14809ed6c70e9c
2013-06-05 19:19:38 +02:00
Ben Gras 2d2a1a077d panic: declare as printf-style-checked
. and related fixes

Change-Id: I5131ac57dc53d8aec8d421a34c5ceea383404d7a
2013-05-31 13:35:25 +00:00
Kees Jongenburger 758c8eaf41 arm:adapt MMC driver to also work on the AM335X platform.
Change-Id: I30e69b7bfd377d1dd2b0b458dd00ee411b060285
2013-05-24 15:47:04 +02:00
Kees Jongenburger 0748a95f88 arm:mmc only compile mmchs when targeting arm.
Change-Id: Ie8d0b6461b58c2a7becda98401dece81be607a01
2013-05-24 15:46:59 +02:00
Kees Jongenburger 742cf53aa9 arm:adapt tty driver for AM335X.
Change-Id: Ic861d68d0576c2abcdcb265a450c013ea2b28499
2013-05-24 14:03:14 +02:00