Commit graph

41120 commits

Author SHA1 Message Date
Dan Kalowsky
522cd73e04 i2c: fix interrupt clearing
Clearing an interrupt in DesignWare is done by reading the port
not by writing to it.  Original problem found by Dmitriy@WR.

Change-Id: I1de052632ec36e2d496c563e81307169e9dabcf4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:19 -05:00
Tomasz Bursztyka
b445e06cad x86: Add an option for legacy IO ports
Those ports uses different instructions to get accessed: in/out
instructions. It differs in many ways with memory access, and it's much
slower. It's unset by default, but some arch exposing legacy UART ports
might need it.

Change-Id: I06f2a7c7812e720863957bd20d5c2b8b02c10734
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:19 -05:00
Gerardo A. Aceves
a049bf3de8 Change minor punctuation characters.
Corrected some punctuation characters to improve readability.

Change-Id: I44930a8a314f9fa5f3da216df3c7d2262c9cb1ef
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
2016-02-05 20:24:19 -05:00
Anas Nashif
a1735cfacb galileo: enable I2C driver in board defconfig
We have GPIO enabled which depends on I2C

Change-Id: I289fc4cdb440e1bc95e6848e7108a3edf6638db0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:19 -05:00
Anas Nashif
26712b6129 galileo: enable nano timers
Change-Id: I85e79877fa5951c3a731ad0898edf94f55dcb73e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:19 -05:00
Anas Nashif
d617549950 sanity: do not run footprint-min on galileo
minimal footprint disable timer and galileo requires a timer

Change-Id: I75c08775fd02bae1221ae4102bb9873060c8e85f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:19 -05:00
Anas Nashif
55bad6996a gpio: include printk.h for debugging with printk
Change-Id: I877b51e2b9a4cbe5a5b99d9cb6b611127fb83d32
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
2dab2bd255 i2c: move irq stubs to driver
Change-Id: I4d6a40d3c5343b444678a4adcd78a8e3fe9ab515
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
5e66dada51 i2c: dw: fix build error after file renames
The header file was renamed in previous commits, but the #include
referred to a non-existing file. This causes compilation error.
This uses the correct file.

Change-Id: Ibda7dbca82323d99dcff71cbee8f642f6cd611d6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
3dd4cf2fd0 galileo: rely on values from platform Kconfig
Avoid adding platform data to defconfig directly and instead
use Kconfig. This will allow overrides.

Change-Id: I95984cb691e8a796ff14b92c6985fceccb0b9cad
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
e34cd9c1cc galileo: Update Kconfig with defaults for gpio-mmio
Change-Id: I5d396fa58f9ef9f217c94d491897ec931c2efa81
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
f61a620872 galileo: set PCAL9535A gpio defaults for platform
The default values for the platform will be used when running
make *_defconfig instead of hardcoding them in the defconfig directly.

Change-Id: If2945cc11cfca787c2b93a96b502650f1dddd29d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
2ae45147a5 gpio: fix gpio Kconfig dependencies and display in menuconfig
Change-Id: I254acb070bcecffe54489e4efe659b488661c043
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
c842bdd76d galileo: add as a standalone platform
Change-Id: I8ca4856d9e6a9461208044242950fdde710c4ffd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
8f98b0d94b Kconfig: keep i/o drivers close in menuconfig
Change-Id: I5c39063b13d79e65c77015fad224e1a5e81c8951
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
dcbf8d52b5 i2c: rename config variables I2C_DW0 -> I2C_DW_0
This makes variables readable and consistent with other drivers
we have.

Change-Id: I816f133279497eafd5d5614013c8d224d5909590
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
00cf074796 gpio: Move GPIO option from platform to driver
Change-Id: I136efa8a86314137904e191957bb0922fecdb757
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
722f42c6de i2c: move i2c kconfig entries from platform to driver
Change-Id: I1f93ccce09235fef65ad06a4a246315709203cba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
18a3fcff17 i2c: Update Kconfig for i2c drivers
use menuconfig and remove circular dependency

Change-Id: I4962c9f523c5d1487f49a153e1087a72301312d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
f2241deaa4 rename i2c driver files using <type>-<driver name>
Follow the same order of <type>-<driver name>

Change-Id: Iac9f01f864c2ac76ee7aadf8cbdbb12835f39df4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Anas Nashif
6d107887c6 i2c: rename DW_I2C -> I2C_DW
This driver naming is an exception which compared with all other drivers
we have. To keep things consistent the configuration options and variables
are renamed to <type>_<name>.

Change-Id: Ib95aa09630a507848f78d8f2c28706b545eed06d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie
086430e4a0 ipi_console_receiver: fix semaphore usage
Don't give on the semaphore if the ring buffer is full.
Fix a missing newline in a debug message.

Change-Id: Ic0030365665c32cc9f1c641f9dacffd1a1915b09
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie
9ae62b5bcc ipi_console_sender: filter out '\r'
Some platforms send over \r\n for newlines, just send over the \n.

Change-Id: Ia6072eb3719a4c7dd828457cf1634d16f4eec38a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie
7b52823f64 drivers/console: fix missing '+=' in Makefile
Change-Id: I9eaa40bed937ce2201a7b7f2b1c94c8c35b550d0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
98cc82786e x86: galileo: enable Legacy Bridge GPIOs
On Galileo, there are additional GPIO pins on the legacy bridge.
This adds the config options to enable the driver for those GPIOs,
using the MMIO-based GPIO driver.

Change-Id: I0014018238a40577631bafbdf55ed0c6c0886194
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
721bb7afb3 gpio: add driver for MMIO-based GPIO ports
This adds a simple driver for MMIO-based GPIO ports.
It does not trigger any interrupts due to pin level at this moment.

Change-Id: I0c439f221988817e4be72653c68257ef6ace5bde
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
553b8eeae2 x86: galileo: enable PCAL9535A in defconfig
There are 3x PCAL9535A GPIO chips on Galileo gen2 board.
This enables the driver for all of them.

Change-Id: Ie4d1aec9427e159a60322caac541b75e7ef973db
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
2709050112 gpio: add driver for PCAL9535A GPIO chip
This adds the driver for I2C-based PCAL9535A GPIO chip.
This currently only enables minimal set of features of the chip for
very simple input/output operations, and does not support interrupt
yet.

Change-Id: I32ea07a71a38866280a96e68cff49cb0df12b85d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
add6d78b0a gpio: add polarity and pull up/down config flags
This adds to the configuration flags for GPIO:

() Indicates the polarity of the pin, whether it should be
   normal or inversed.

() Enables pull up/pull down for the pin.

Change-Id: I2b0c57e5a539208aff7aeb4ea53050134ab404fd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
792930172a gpio/dw: Kconfig: put DW selections inside GPIO menu
This change puts the DW GPIO Kconfig selections inside GPIO menu.
This also groups all DW GPIO related selections under GPIO_DW.

Change-Id: I776f3f6b89e1a4dc366648f8290abb27de9eceb8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Daniel Leung
a5876981fe i2c: dw: fix compilation error
This was missing an include file, which caused the macro to not
be expanded correctly. Including init.h fixes the issue.

Change-Id: I6b190e0c75828d9b6eb42a84c213dfc174510740
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
e09e80d8e7 x86: rename ia32*/*.c files have ia32 as their base name
Rename system.c and platform_config.c files in preparation for merging the ia32
based platforms to remove code duplication.

Change-Id: I88caf5294817e06c235379e92cd8ee7472e88028
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
4210a4df18 x86: Change I2C IRQ configuration function to init system routine
Change-Id: If57b8b0166a7f78b948c65f1c702475fbcb5ed9e
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
c52e6481fe x86: Change GPIO IRQ configuration function to init system routine
Change-Id: If511362ec3f2dba5010052863fc350407f87aedc
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
cf80269f52 x86: Change CONSOLE IRQ configuration function to init system routine
Change-Id: Ie343b241009ab5b63c6dd877b7ce4505fe84fc6d
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
1ac4e50ed8 x86: Change HPET IRQ configuration function to init system routine
Change-Id: I8adc0fe190bd253202145418ab7898bb95b7d7ec
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
25c9d021a5 x86: move IOAPIC driver to device model/init system
Change the IOAPIC driver to be initialized directly from the init
system. The function signature of _ioapic_init() function is updated
accordingly.

Change-Id: I2f824ac745926966eebb23f60445a41e1df9eb8f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie
be1b1a4e35 x86: move LOAPIC driver to device model/init system
Change the LOAPIC driver to be initialized directly from the init
system. The function signature of _loapic_init() function is updated
accordingly.

Change-Id: I5ed26d53524c8526d413a05ac9a7a58dd4264c5a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie
1bcb7a339a x86: Move PIC driver to device model/init system
Change the PIC driver to be initialized by the init system. To be
initialized by the init system the function signature of the
_i8259_init() function needs to be changed to the standard *_init()
function signature specified by the device model.

Change-Id: I63bf1cd0ce78920fa20da94f5966e5aab4bf41b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie
2a1e4266e8 IPI console driver with test case
This introduces a generic driver set for console messages routed over
inter-processor interrupt (IPI) channels. These drivers bind to a
low-level IPI driver instance for the actual transport of messages.

ipi_console_sender installs printk and/or stdout hooks to forward
messages over IPI. There is currently no buffering on the sending side.

ipi_console_receiver installs an IPI callback which stashes incoming
characters into a ring buffer, which is monitored by a nanokernel
fiber. The fiber buffers the characters on a per-line basis and sends
them to either printk or stdout. Multiple instances of this driver
may be created in case you need to receive console data from multiple
CPUs.

Change-Id: Icebc110794fbe040f975101cd2ae6e78fb38645a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie
faaab4831f ipi.h: introduce low-level inter-processor interrupt API
This interface is an abstraction for sending messages between
processors with irq-context callbacks and no definition of
protocol.

We assume that for all IPC implementations, we can send over a
message identifier and a sized data payload, and that the receiving
side gets an interrupt on an incoming message. APIs exist to indicate
the max value of the message id and how much data can be sent over a
single message.

This will be a foundation to build various high-level drivers
which can be bound at runtime to this low-level interface. Some
examples:
* IPC where IPC messages are used as a doorbell to signal new data in
  a shared queue
* IPC with various kinds of message buffering and deferred message
  processing  via semaphores
* IPC for serial console debug output, either a byte or a message at
  a time
* IPC over UARTS in a non-shared memory environment where large-ish
  messages are exchanged
* Shared memory IPC where data pointers are exchanged and a protocol
  for freeing the data once the receiver is done with it

The size parameter passed to ipc_send() isn't propagated to the
receiving side. The receiver needs to infer how many bytes of
data to read in the callback function based on the protocol implemented
in the high-level driver; it can be based on message ID, or bits reserved
in the message ID for the message size, or some other mechanism.

Change-Id: I9a9529beb61cdebdfb1bafd29d037f926fab3c1b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Jesus Sanchez-Palencia
22e68cbc84 net: Remove EXPERIMENTAL label from net and bluetooth
These features set are not experimental anymore.

Change-Id: Ia9e4803982f625157e78c8002c38fed1e95c4892
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie
858decd162 misc: don't depend on serial drivers for printk()/printf()
We are introducing other kinds of drivers which support a console
that isn't over a UART.

Change-Id: I0dddbdce958437b5709c5ab26252ed47d030413d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie
6865fb658f x86: i2c: Move system binding code to dw_i2c.c
The code fragment to bind the instances of the I2C driver is not
platform specific but is driver specific.

All the information required to bind a driver instance comes from
CONFIG_ variables.  Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.

Change-Id: I9ea132c9340437ccb292bb8f3fa3d3a2b2a794db
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie
f4ded7a0c1 x86: spi: Move system binding code to intel_spi.c
The code fragment to bind the instances of the SPI driveri is not
platform specific but is driver specific.

All the information required to bind a driver instance comes from
CONFIG_ variables.  Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.

Change-Id: Iff40227e3e25d431ae870d585445971f35d934dd
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie
586776f961 x86: gpio: Move system binding code to gpio-dw.c
The code fragment to bind the instances of the GPIO driver were being
replicated in every platform_config.c  This code is not platform
specific but is driver specific.

All the information required to bind a driver instance comes from
CONFIG_ variables.  Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.

Change-Id: Ie07a3d12d25201e82ce7074455e6c036f463851b
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Jesus Sanchez-Palencia
bb91977835 Kconfig: Fix EXPERIMENTAL features dependency
Features displayed with "[EXPERIMENTAL]" should depend on
CONFIG_EXPERIMENTAL.

Change-Id: I0a86dff442014caa2fa4629138dbe29e69d5b853
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie
d5feec5c64 ram_console: driver for emitting console messages to a buffer
This buffer can be examined at runtime with a debugger to see what
is going on. Helpful if there are no other working console drivers
on the system.

Change-Id: I759467a57d16204b4b316c4f6fa8b7d5e1d1d236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Tomasz Bursztyka
8017b64dcf util: Add some helper to move integers to pointer and vice-versa
This will be useful when an implementation of a generic API requires an
int as user data when such has been defined to be a pointer.

int do_something(struct device *dev, void *user_data);

When the implementation would:

int impl_do_something(struct device *dev, void *user_data)
{
        int identifier = POINTER_TO_INT(user_data);
	...

Change-Id: Ic892927a03ac49e95527ef8e0e817d00256aa3bb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:17 -05:00
heeleyth
df0fd2c8cc ioapic: do not check for CONFIG_IOAPIC from ioapic.h
Match loapic.h and allow 'ioapic like' drivers to export same ioapic
interface.

Change-Id: Ia2e5380cf9c3fc72e27beb198013e7416daa6aca
Signed-off-by: heeleyth <thomas.heeley@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:17 -05:00