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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
These features set are not experimental anymore.
Change-Id: Ia9e4803982f625157e78c8002c38fed1e95c4892
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
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>
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>
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>
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>
Features displayed with "[EXPERIMENTAL]" should depend on
CONFIG_EXPERIMENTAL.
Change-Id: I0a86dff442014caa2fa4629138dbe29e69d5b853
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
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>
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>
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>
The c files actually check for the Kconfig variables, so there is no
need to do the checking in the Makefile again adding double logic.
Change-Id: I8521047bd575c8f9d64f7d8e5abfb5eee8a40cb3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not enable the feature by default when EXPERIMENTAL features
are enabled.
Change-Id: I0538f9f94bb47a4bc870c8974e80faf273070f91
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When configured as GPIO_ACCESS_BY_PIN, the callback should
be called only if the pin is enabled and received an interrupt.
Change-Id: I7addeb57c8d46dddc027e9b82a92654cd210ade1
Signed-off-by: Ricardo de Almeida Gonzaga <ricardo.gonzaga@intel.com>
if printk is disabled, the variables will be unused and we will
get compiler warning.
Change-Id: I5dad791ae89d7a8c98f9e4660da472ef0caacc92
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This enables passing the value to be used when writing to CCC so it can
be configure for indications in adition to notifications.
Change-Id: Ied89faed422e5c5ec60618d512dbd3f250f50b46
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enables bt_gatt_subscribe to subscribe using indication value in
addition to notification.
Change-Id: I25f3b057e36b023a79fb66b11b70716ecc299ba9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The correct code is 0x1e not 0x1f.
Change-Id: Icee68ebd01d76a4b3ed31a54e18b1115172f5b71
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Some controllers are broken in that they may send a completed packets
event after a disconnection has already occurred and the handle is
invalid:
> HCI Event: Disconnect Complete (0x05) plen 4
Status: Success (0x00)
Handle: 64
Reason: Remote User Terminated Connection (0x13)
< HCI Command: LE Set Advert.. (0x08|0x000a) plen 1
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> HCI Event: Number of Completed Pa.. (0x13) plen 5
Num handles: 1
Handle: 64
Count: 1
Since the disconnection code already takes care of updating the
le_pkts_sem semaphore appropriately there is no need to do anything
for this kind of events (except log a warning of a misbehaving
controller).
Change-Id: I67b35aa50f7297d6bcdeeeab62f1f1d224b1a372
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is in preparation for being able to compile out SMP support.
Change-Id: Idb3597dd16e457d19d592a9b7dce954b950b174e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Separate connection master role related parts in single block making
it simpler to split. This is a preparation for being able to compile
in only central or peripheral role support.
Change-Id: I27dc9b32048bf4e682149d5f1d5edbd994155e2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
The HCI driver send() callback may fail and in such a case require
different handling on the core stack side. This patch introduces the
missing error handling to the places calling drv->send().
Change-Id: Ia0e4f05aedd88c268cf0da98b11924eb3c5c4c0b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The core specification says the following about the treatment of
unacknowledged packets when a disconnection occurs (page 773 in core
spec 4.2):
"When the Host receives a Disconnection Complete, Disconnection Physical
Link Complete or Disconnection Logical Link Complete event, the Host shall
assume that all unacknowledged HCI Data Packets that have been sent to the
Controller for the returned Handle have been flushed, and that the
corresponding data buffers have been freed. A Primary Controller does not
have to notify the Host about this in a Number Of Completed Packets event"
This patch adds tracking of unacknowledged packets on a per-connection
basis and makes sure the semaphore that counts controller buffers is
given back the appropriate amount when a disconnection occurs.
Change-Id: I2ff4d12ffa50d4dda5b3e8c75fc75b4c0927e609
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The send() callback of HCI drivers should be returning 0 on success
and a negative value on error. The uart_fifo_fill() function returns
the number of transmitted bytes so it can not be directly mapped to
the send() return value.
Change-Id: I59be478c1985f44a46f2a9613f61471423b0e63a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Separate connection related parts in single block making it
simpler to split. This is a preparation for being able to compile
out connection support.
Change-Id: I992e604cae848ed2dfe821a6971248e53ae23498
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This patch factors setting up controller to host data flow control
to separate function. This is a preparation for being able to compile
out connection support.
Change-Id: Ibcce0b740534331a6365c2370b7b637877d71560
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
All required includes should be placed in source file that includes
internal header.
Change-Id: I161e7ebe2e62377ea4cf03f759d48f5900103076
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Writes to GATT attribute that has no write permission set, should
return write not permitted (BT_ATT_ERR_WRITE_NOT_PERMITTED)
in check permission routine.
Change-Id: I95f0988e171294cd98b79d3e7b518383ac47567d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Move parts of the API that are not usable for applications to
an internal header.
Change-Id: Idbcd3db8acda74375ea9deec2bf3d7eddc8a4ddb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If no attribute with given handle is found in database then invalid
handle error should be set and returned. If attribute is found then
pre-set invalid handle error will be cleared.
Change-Id: I4119877bb72693e18003399f9b6764666f801fe4
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This makes menu cleaner and easier to follow what options
are Bluetooth specific. It is now similar to IP configuration.
Change-Id: Ic2f6002ab30093bed62e71fe268a576d69a9cd0d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Tinydtls had its own .gitignore file that masked away two
include files that are needed in compilation. Removed
the files from ignore file and added those two files.
Change-Id: Ibcfcf4e18ca8f56eef97d41464c4233148e9db9e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the remote response with encryption/authentication error attempt to
elevate the security and retry sending the request:
bt: bt_att_recv (0x00112e0c): Received ATT code 0x01 len 5
bt: att_error_rsp (0x00112e0c): request 0x0a handle 0x0018 error 0x0f
bt: security_changed (0x00112e0c): conn 0x0010f5ac level 1
bt: security_changed (0x00112e0c): Retrying
bt: bt_att_recv (0x00112e0c): Received ATT code 0x0b len 1
bt: att_handle_read_rsp (0x00112e0c):
bt: att_read_rsp (0x00112e0c): err 0x00
Change-Id: I9d74fb50385c39b2092357f4fd6912a3eb041442
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>