There's no reason to require callers to cast their data to uint8_t *
when the data might e.g. originate in a packed struct or some other
data type. Instead, be nice to callers and let them use any pointer
they want. Additionally, declare the TX buffer as a const pointer so
unnecessary typecasts aren't needed for that either (if the data
originates in a const location).
Change-Id: I1482ca4e350b5a7fbda6871ed9f54f255af3aa9e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This log is in spi_intel_configure, not in spi_intel_transceive.
Change-Id: I5d62dd63d0cfa2c86f2dd5f9a6d367b7ad47b355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The buffers aren't guaranteed to be aligned so that they're always
aligned for uint16_t or uint32_t data. Use the available unaligned
access macros to read/write the data.
Change-Id: Ie87c108aa370af196b9c759b59ed7fb9d1ed6183
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make this explicit to conform to the abstraction layer
defined in include/irq.h
This only worked before because the preprocessor was
substituting the function prototypes.
Change-Id: Id4d46b01f1c53c3a942772640023e23796eeb43b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When configured at a frequency of 2MHz, a transaction writing
3 bytes and reading 1 byte fails silently (last byte cannot be
read back from the device). Enabling CONFIG_SPI_DEBUG fixes the
issue.
Scope traces show that the transaction (from /CS assert to /CS
deassert) takes 14us and there is activity on the MOSI line
after /CS is deasserted. A transaction writing 2 bytes and reading
3 bytes take 22us.
The issue is due to the fact that completed() deasserts /CS after
the driver has put 3 bytes in the TXFIFO and taken 1 byte from RXFIFO.
Just because the last byte made it to the TXFIFO, it doesn't mean that
it was put on the MOSI line.
The fix:
For a transaction sending T bytes and expecting R bytes, let N=max(T,R).
Send exactly N bytes and wait for exactly N bytes (or an error). This
way, we are sure that all the bytes were sent to the target device.
Also:
Stop calling pull_data() after every byte sent, it might take a while
for a byte to show up in RXFIFO.
If RFS bit is set, stop sending bytes (will be really useful with a
bigger RFT).
Flushing RXFIFO in spi_intel_transceive() is not needed anymore.
Change-Id: Ifb06a12b03e3e20d6ace4d9f3a20fc11ec3bb010
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
Remove semicolon that triggers a build failure
when CONFIG_SPI_INTEL_PORT_1=y
Change-Id: Iea49d44059377cf9eb0b5b5e14b625cb316a65bb
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
This reverts commit bf77d902ac.
The commit is reverted because it causes hangs in packet
reception. After transferring data a while, the chip stops
packet reception.
Change-Id: Icb94e978e3ba526314afd5e80f35c877febe8740
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This reverts commit e695d43fad.
This commit allows reversal of the commit
bf77d902ac which is called
"cc2520: Rework reception logic". Original code had auto ACK
turned off so we can revert this commit too.
Change-Id: Ic4979d1caa0f4341b9642d8a83ee65cf71562994
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
setreg(CC2520_EXCFLAG0, 0) is in print_radio_status(), it should
be in print_exceptions_0().
Change-Id: I62bd366b850f0a1abef651cfa8de8939b6c30685
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The auto ack does not seem to work properly. I am seeing that
the driver claims to have sent a packet but nothing is seen
in the air. Because of this the auto ACK cannot be turned on
right now as it would break connectivity.
Change-Id: I4e71e14a2058cc4f64740a8f4b390ba21a01cb23
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Setting the highest possible threshold is bogus. It will certainly work
well when packet are small, but it will be very easy to overflow RX FIFO
when these are big (which happens when a big packet is fragmented).
Instead:
- setting the threshold to the bare minimum (len + header)
- reading is made into a loop based on RX FIFO counter
Taking the opportunity to:
- Reset exceptions once printed out
- Print out "Transmitted!" instead of unbearable status
Change-Id: I8d77b88756d5c3fb42d4d0d38dd0296569db07ad
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
cc2520 does not need to clear any gpio interruption as it does not deal
with the low level gpio hardware directly.
Change-Id: Ic568e817b23b879cdf7da791417a4a6e1f95d34a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no such thing as being out of sync.
1 - RX FIFO is always flushed before receiving anything.
2 - So whatever comes in, if it was rejected the hardware would not set
FIFOP high (we are on high threshold, see page 83).
3 - According to 802.15.4 specs, length cannot be bigger than 127, so
7th bit of the length should never be set. However, and for some reason,
it happens to be set (noise, memory glitch?). According to datasheet
page 75, masking this bit is useful then. The hardware does it for
itself when filtering, and that does not affect the buffer content, so
it's also up to the driver to mask it as well.
Change-Id: I30b878852076c0c9d3a92b490aaf37f826ab4541
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/i2c/Kconfig because 1) most of
the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig.
It also moves the interrupt priority definition from the driver's
Kconfig to the platform's Kconfig since it is a platform-specific
configuration.
Change-Id: If3c260b9a2fa095de47a99eb7fa5b947efefe9b1
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/spi/Kconfig because 1) most of
the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig.
It also moves the interrupt priority definition from the driver's
Kconfig to the platform's Kconfig since it is a platform-specific
configuration.
Change-Id: Ic992749b3210ed8a2e454edece41ceca5edbaf2e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/gpio/Kconfig because 1) most of
the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig.
It also moves the interrupt priority definition from the driver's
Kconfig to the platform's Kconfig since it is a platform-specific
configuration.
Change-Id: Id00f7907fa55025011dabce6e282a9623be23831
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Instead of returning a 'void *', the nanokernel fiber_delayed_start()
family of routines now return a handle of type nano_thread_id_t.
Consequently, the nanokernel fiber_delayed_start_cancel() family of
routines now accept a parameter of type nano_thread_id_t instead of
'void *'.
The complete list of affected nanokernel routines is:
fiber_delayed_start() fiber_delayed_start_cancel()
fiber_fiber_delayed_start() fiber_fiber_delayed_start_cancel()
task_fiber_delayed_start() task_fiber_delayed_start_cancel()
Change-Id: Ibd4658df3ef07e79a81b7643a8be9ea5ffe08ba0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Since the return value of these callbacks is a number of bytes ssize_t
is more appropriate than int.
Change-Id: I3406fb382975d62f51e7a195666d0ae88364fd2c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Though it's an ARC core, Quark SE SS does not follow the same registers
mapping as the official DesignWare document. Some parts are common, some
not.
Instead of bloating spi_dw.c with a lot of #ifdef or rewriting a whole
new driver though the logic is 99% the same, it's then better to:
- centralize common macros and definitions into spi_dw.h
- have a specific spi_dw_quark_se_ss_reg.h for register map, clock
gating and register helpers dedicated to Quark SE SS.
- have a spi_dw_regs.h for the common case, i.e. not Quark SE SS.
GPIO CS emulation and interrupt masking ends up then in spi_dw.h.
Clock gating is specific thus found in respective *_regs.h header.
Adding proper interrupt masks to quark_se_ss soc.h file as well.
One of the main difference is also the interrupt management: through one
line or multiple lines (one for each interrupt: rx, tx and error). On
Quark SE Sensor Sub-System it has been set to use multiple lines, thus
introducing relevant Kconfig options and managing those when configuring
the IRQs.
Quark SE SS SPI controller is also working on a lower level, i.e. it
requires a tiny bit more logic from the driver. Main example is the data
register which needs to be told what is happening from the driver.
Taking the opportunity to fix minor logic issues:
- ICR register should be cleared by reading, only on error in the ISR
handler, but it does not harm doing it anyway and because Quark SE SS
requires to clear up interrupt as soon as they have been handled,
introducing a clear_interrupts() function called at the and of the ISR
handler.
- TXFTLR should be set after each spi_transceive() since last pull_data
might set it to 0.
- Enable the clock (i.e. open the clock gate) at initialization.
- No need to mask interrupts at spi_configure() since these are already
masked at initialization and at the end of a transaction.
- Let's use BIT() macro when relevant.
Change-Id: I24344aaf8bff3390383a84436f516951c1a2d2a4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This patch fixes the QMSI SPI shim driver so we are able to use it in
Quark D2000 based platforms. The only change required to enable this
driver is an #if guard in spi_qmsi_init() because the macro QM_SPI_MST_1
and the function qm_spi_master_1_isr are not defined in QMSI headers
from Quark D2000.
Since this drivers is now properly working on Quark D2000, this patch
also sets the QMSI driver default options in arch/x86/soc/quark_d2000/
Kconfig.
Change-Id: Ic6e2f7f5a2c3f350ddf360b23ffab6b812948572
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/watchdog/Kconfig because 1) most
of the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig (e.g. arch/x86/soc/quark_d2000/Kconfig).
For Quark D2000, the IRQ priority options (WDT_DW_IRQ_PRI and WDT_QMSI_
IRQ_PRI) values are set to '0' since the priority information is ignored
by the interrupt registering system (the interrupt vectors are fixed in
this SoC).
Change-Id: I8f36c0f0e56211cdee3f2c6fc90c7dcac0a1b5aa
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/rtc/Kconfig because 1) most of
the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig (e.g. arch/x86/soc/quark_d2000/Kconfig).
For Quark D2000, the RTC_IRQ_PRI default value is set to '0' since the
priority information is ignored by the interrupt registering system
(the interrupt vectors are fixed in this SoC).
Change-Id: I70de889cfd22e65f0e7acf7e57ddc6439f028394
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch fixes the GPIO QMSI shim driver so we are able to use it in
Quark D2000 based platforms. To enable this driver we have to add a few
#if guards because some macros and functions (e.g. QM_AON_GPIO_0 and
qm_aon_gpio_isr_0) are not defined in QMSI headers from Quark D2000
(this SoC doesn't support the Always-On GPIO controller).
This patch also adds the QMSI driver default options to arch/x86/soc/
quark_d2000/Kconfig.
Change-Id: Ia16a345e1de3008f167ed66f891834607c05f4a2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This handling is already done by QMSI, so no need for it to be done in
Zephyr side as well.
Change-Id: Ia5c6206d3d7f04702e0be0e76f2130df8d60b31c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This adds support to the AON GPIO controller using the QMSI driver.
In order to enable it, the following configuration options must be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="PATH TO LIBQMSI"
CONFIG_GPIO_QMSI=y
CONFIG_GPIO_QMSI_AON=y
Change-Id: I5a1a232d97741ad7fdbf40d8aea5a835e5b4e724
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This patch fixes the QMSI I2C shim driver so we are able to use it in
Quark D2000 based platforms. The only change required to enable this
driver is an #if guard in i2c_qmsi_init() because the macro QM_I2C_1
is not defined in QMSI headers from Quark D2000.
Since this drivers is now properly tested with Quark D2000, this patch
sets the QMSI driver default options in arch/x86/soc/quark_d2000/Kconfig.
It also adds the wiring information required to test the i2c_lsm9ds0
sample app in the Quark D2000 CRB.
Change-Id: I4be03c09304da5a66ac663e48b1d72225eb5651d
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
bt_conn_lookup_handle() would be used in gatt.c to access conn's
discovery parameters.
Change-Id: Ibb494cf8af90ccab478fa7463a41942b06029539
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Store GATT discover parameters in bt_conn due to lack support from
NBLE RPC.
Change-Id: I47ade89b4861c9f1260ce3a3dc158d6344de334e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
It was hard to see where the condition ended and the code block started.
Change-Id: If966b0a404beb1c783a1c8dd89e6049a6600cadf
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Always use braces, even on one-line code blocks.
Change-Id: Ic9e60db7f851d2fbee5bfd79cd810df23c0c5db0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Cancel ongoing connect request when we receive disconnect command.
Change-Id: I12f1c1326c4b13672879b8f2dbe457cae395b486
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_conn_disconnect() API function.
Change-Id: I08979d35400cf947d7ec646bad72f625141f95e0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Introduce BT_GATT_ERR macro to make it possible for application
callbacks to return exact ATT error codes.
Change-Id: I971536508e75036fbddc40b3f33e5201e11940bc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Connection state helps to keep make right choice when connecting /
disconnecting.
Change-Id: Ifea620c05f869a633f578bf5d5c8ba603a58a46a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The 100ms wait was too short. After some debugging, the
packets were successfully sent after 250ms wait.
Change-Id: Ib367f8df81ed3039b041f1e7b46d8f562a0adcac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This debug option enables debug of Nordic RPC.
Change-Id: I2e963f10ed6407b836e1572673244cb0187227d2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Use NBLE_DEBUG_GAP to enabled / disable GAP NBLE
debug.
Change-Id: Iefbb18e697d523137a101df00b02d46e209e7f14
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement Bluetooth LE scan start/stop API for Nordic.
Change-Id: I3dc153346d0135501091a4b952a3c60c081802db
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_conn_create_le() and copy bt_le_conn_params_valid() from
net/bluetooth.
Change-Id: I6b3fff5027a82b8040c0c724eac1251945415f43
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Structure has changed in firmware headers.
Change-Id: I0df1549ce5353a2c7807f7839ee9270e833fbbf2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove empty function declaration using weak autogenerated method.
This solves API to NBLE constantly changing problem.
Change-Id: I2ff90559dfbf78e9c34e602195d8a76ab9750a47
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The bt_conn_get_info() API also needs the local address. For now
simply use an extern declaration to get access to the variable that
resides in gap.c.
Change-Id: I3ddb598785cfb6a5d07fc10621f6d20a610536be
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The bt_conn_get_info() API requires that we track the role and the
various connection parameters.
Change-Id: I732eace1e45173f94962df3f11dbe5ad520a75cf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of return 0 if there is an error, return
a value < 0 so that caller caller of cc2520_read()
can reject packet right away.
Change-Id: I99808db6aa692cf4415f630193d35e51d4bc3144
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If current packet is being rejected, it will print some more cc2520
internal insights in debug mode.
Change-Id: If63225e7dd025fb239a7bac5638624accfcc7f4f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These are mostly cosmetic changes, shall work with firmwares
niko-0214 and niko-0215.
Change-Id: Id39c6b9cee6e759f77a05259632e453492ffe498
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Due to firmware update of NBLE starting from 02/12 revisions onwards
there is a need to sync RPC headers and functions.
Only to be used with above mentioned NBLE firmware!
Change-Id: Ifc2ce28f81e819bb517ef3891610d78089a00428
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
We should just discard the data if the received table index goes
beyond the actual table size.
Change-Id: I267621f098e349abab5a1f37f485a28448a9396b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The data is in a net_buf already so we can just pass this to the
deserialization code. The net_buf context and API helps simplify the
code quite a lot.
Change-Id: Iecb62d3151d229a09538ad652508f1eb9c6c3ffc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Applications may want to fine-tune the stack size of the fiber that's
used to make callbacks into the application.
Change-Id: I2cd3e79283fe85359389528e84d9bcc21e3e19f6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Don't require being able to read the full header in a single ISR call.
Instead track the number of received header bytes. Also check for IPC
length before allocating buffer to avoid unnecessary buffer
allocations.
Change-Id: I1678c3ac3aaf35a1b9bbe930cc2e942fce3f458a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This reverts commit 3c66686a43.
That commit fixed announcing ticks before the microkernel was up, but
prevented devices initializing before the MICROKERNEL level from having
access to the hi-res part of the system clock, which they could not poll
anymore.
Change-Id: Ia1c55d482e63d295160942f97ebc8e8afd1e8315
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Currently we have devices named "dw_spi_0" and "intel_spi_0" etc, which makes
it difficult for an application to look up. Or worse, forcing a 3rd party IP
to hardcode in support for only one specific IP block.
Change-Id: Ie485e2350b171b66b22cd7ab39e0fcd196f38af8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Modifications to timer drivers and interrupt setup, to manage
the tickless idle for the x86 architecture
Change-Id: Ie02d484b7e5636de6ea382ba2eeed57e704c8498
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This is needed because in the microkernel, the system clock
is not yet running and the cc2520 driver needs that. By moving
the device initialization later, the clock gets to run and
the cc2520 driver works both in nanokernel and microkernel.
See also related commit 3c66686a43
for details.
Change-Id: Idc5530398b4cff2bb3e0955c8ab57c5f03344079
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This allows to decrease number debug messages using config option.
Change-Id: I987d25c6d4b18503d6beb7feab97e9207100323d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
We can take advantage of the net_buf headroom. At the same time move
the necessary definition straight into uart.c and remove any unused
definitions.
Change-Id: I932bba2cfb11808aabce7bad09e41f94d073bb5b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Using net_buf helps us remove a lot of the pointer & data length
book-keeping variables and in general makes the code more readable.
Change-Id: Iec870a3bacbb63b55329ef5214b0ee0a757f5b1e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This will prevent debug output to be printed if in case
CONFIG_BLUETOOTH_DEBUG_GATT is not defined.
Change-Id: I93be7ccbcf0a8eae5ecb54b174d6ed2d892673dd
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This option can be used to enable debug for GATT using the same option
as with HCI driver.
Change-Id: Ie2f2692422bc1e1f2a5504c60d90961261b53d17
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add printing local bdaddr to help with discovery.
...
on_ble_gap_read_bda_rsp (0xa80089a4): Local bdaddr: C3:40:54:C7:DE:B4
(random)
...
Change-Id: I19f8000b1029fdc839303203d6bac91ee76231ed
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Read and store local bdaddr, serialize command sequence.
Change-Id: Iea6a0e9d7dab3bbba04c26f47f07bc5d2527e9d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Using rsp instead of par makes code more intuitive.
Change-Id: Ib6594e78f4c6d0088e66e9023a696ea42a2e1f4f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The buf pointer in cc2520_read() points to memory that will
hold the received data. It must not be used to set RSSI and
link quality values. Very difficult to find memory corruption
was seen as we were overwriting memory in other part of the
system. The fix was to set the RSSI and link quality variables
in read_packet() where the buf pointer points to proper memory.
Change-Id: I49bfe37f4c7ccc0f582f3aecdf73d5b3ea6bb4e5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove not used code and decrease number of log messages
Change-Id: I3a41fcc15d7f7b7e8802a13f6eb871794437a87c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Following changes in NBLE firmware update our RPC, shall be compatible
with firmware images building from 02/10.
Change-Id: Ifeb1193a241e9fea39c52a6c0f5bbd6c21041c08
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
BLUETOOTH_MAX_CONN option is maximum number of simultaneous Bluetooth
connections supported.
Change-Id: If9629f919ba76fbd2803852c325b357c742edd9a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For example when writing to CCC descriptor it may give the impression
that a handle is being written twice when in fact it is just calling
a callback.
Change-Id: I7aca87a1678789547224ef8d64f1f6c55af8022d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Default cc2520/802.15.4 channel number is 26. Using Kconfig option
user will have chance to set different channel number between
11 and 26.
Change-Id: Id8f47ab5e328adae56e00adc6437c8ca8601a658
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The definition is not in sync with firmware which cause the following
error:
bt: rpc_deserialize (0xa8008a24): on_ble_gatts_send_notif_ind_rsp
panic: errcode -1
Change-Id: Iddaa1eece7c43b5707c01db6e053d104a2a846e6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add read parameters to read callabck
Merge bt_gatt_read_multiple functionality into bt_gatt_read.
This makes it easier for application to handle all types of reads
as same sematics is kept for them.
Instead of destroy callback, call read_func with NULL data to
indicated that read has completed. This makes it clear when
read is completed and parameters used for it are no longer needed.
Thanks to this application doesn't need to abuse user data destroy
callback for detecting if read has completed. Since destroy callback
is no longer needed it is removed.
Also note that bt_gatt_read doesn't take any user data parameter
and that destroy callback was acctually called with read parameters.
If application would require to pass user data along with parameters
it may use CONTAINER_OF macro along with bt_gatt_read_params.
Change-Id: I8d6ea136b1e61c1dae73cca868b53c48c45a5492
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
With peripheral application there is at least 6 commands sent in a row
which will lead to 6 responses which might cause the driver to run out
of buffers so this increases it to 8 to align with HCI driver.
Change-Id: I7ecbc2cfbaf754c35466c57124ff87d27766a07b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Some terminals (e.g. screen) don't seem to propagate carriage returns
through, creating the following kind of results when pressing enter in
a shell:
btshell>
btshell>
btshell>
btshell>
Fix this by always printing out '\r' when receiving a carriage return.
Change-Id: Ia5ce5612c9b830edc84619538dc17a654b6e805b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Part of making the device model work, is using a more generic name for
the devices. Currently the ADC uses 2 possible solutions, when it should
be using just one name for them all.
Change-Id: Id9b78b3edf234391819847bb9b8534747d7d4409
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
There can only be one instance of an ADC, but we have code setup for
multiple.
Change-Id: I94eae2450bdc6b138ebad66f80a7c451cefe32a9
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
The ADC for DesignWare is currently setup to handle multiple dev entries,
but there only ever exists one. No reason to add to complexity for multiple
if there is only going to be one.
Change-Id: I0b77ef91160776dcf0aea1a50b144fff2b2be9e2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Looking at all structs as to where we can pack them a little better, and
calling out the padding/stride at the end for future expansion.
Change-Id: I4a651092e950dd3d915af9fa0ee0d7d59803e58f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The ticker was always initialized in the NANOKERNEL init level. In a
microkernel, this can cause problems if for the some reason the
initialization of the microkernel server is delayed, such as devices
initialization in the NANOKERNEL level taking non-insignificant time to
complete. What happens in that case is the ticker ISR will start firing
and piling up events in the microkernel server stack, and quite quickly
overrun it, since it has a finite size, causing random crashes.
So, in the microkernel, initialize the ticker once the microkernel
server is available. There is no point in sending ticker event before
anyway.
Change-Id: Ie9e13184f6ad35954023faf3bbff26242284b7be
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Interrupt handler needs to finish all the handler work before
returning to the sync call.
Before this fix, a call to the API read() method could unexpectedly
fail because a second read() call could start before the previous
read() call had not completely finished.
Change-Id: I74249a52b403e2a589d970fae05b9325b20fbe38
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Per Curie documentation, the first sample from the Quark SE ADC
hardware after reset needs to be dropped.
This commits changes the location and the trigger event to do
a dummy read that drops the first sample.
Originally the driver did the dummy read on the API call enable()
and it was triggered if the ADC had awakened from suspend mode.
Because the SoC is not in suspend mode on power on and the API
enable() call has no information on the channels to be read the
dummy read could be missed.
Now the dummy read is done on the API call to read()
and triggered if it is the first time read() is called
since power on.
Change-Id: I1e1ad5f7f44d71ca88572ae242ad629471a9ab9b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Having priority levels 0 and 1 reserved on x86 due to implementation
details on how the CPU uses the vector table is confusing to users,
and makes it unnecessarily difficult to share drivers between arches.
Now on x86, priority levels 0 and 1 are available. Semantically, all
priority levels have had 2 subtracted from them.
It is no longer necessary to specify a priority level when the
vector itself is specified. If an IDT entry has a specific vector
associated with it, any priority argument is simply ignored.
In gen_idt, some simplifications have been made:
- The printed representation of a generated entry now fits on one line
- Some checks being done in validate_priority() were redundant, as
generate_interrupt_vector_bitmap() also ensures that there are
sufficient free vectors within a priority level.
Change-Id: I26669d8ee0a53f48fbc2283490a8c42d8b1daf8e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Available only when CONFIG_SPI_DEBUG is set:
- Print out all exported functions with relevant infos
- Remove superfluous messages
- Make counter in push/pull not being instanciated when not debugging
Change-Id: Iaa96a897008d360a14bc83da54152c264f42c60d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It's a bug that did not happen, but is a valid one:
if there is an error, we should not care at all about current stage of
transmission, thus it will stop right away.
Change-Id: Iec2b519d8118233f570ded18d6c6eb4084371e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This helps saving stack but also fixes an error when unrelevant packet
detection is made and thus calls read_packet recursively.
Change-Id: I5c1130a369b573f204f30230417e5bcbb97257bc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Original mechanism was useless, but it was due to the fact prototype
code was purely polling-based. Now that we are back to interrupt mode
only, it's actually required. It's done a different way than original
though as it was really redundant, and sometimes bogus (no release).
Change-Id: I36b55b072564ee2f9d331f49c69751d9d274bab2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Adds the driver to utilize the I2C/TWI interface on Atmel SAM3
family processors for I2C communication.
Note that this currently only supports master mode. Limited
testing has been done using the Fujitsu FRAM sample app.
Change-Id: Ibdb8277e47dd9450b49a66a95421eb1ffb1c4eb4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
As the GPIO callback is ran into ISR context, it's thus impossible to
start SPI transactions as these are interrupt based as well. Thus
forwarding the packet reading to an internal fiber.
If CONFIG_INIT_STACKS is set as well as debug mode, it will print out
the usage of the stack after each loop in read_packet().
CC2520 internal fiber stack size is set via Kconfig option, where the
default is set to 640 bytes. At this stage, this value cannot be fixed
so it's more flexible to be able to tweak it from a Kconfig option
rather than tweaking the source code.
Change-Id: I54138c4d1e66f6775b1ae0248574ac8eb5e44f3d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since application callbacks happen from the rx thread we cannot have
the stack as small as just 256 bytes. Make it 2kB for now, but later
this needs to be adjusted to some reasonable minimum with the help of
the stack analysis code, and then probably accompanied by a Kconfig
option for apps to increase if if needed.
Change-Id: Ie8e2ac41701101b874378ded1435a6fb06bae497
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Fixes some styles and removes p_buf from debug log.
Change-Id: I861c2c250d8478353f8272e9c59c06f9fc211036
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Make code consistent and make one line less then 80 chars.
Change-Id: I4aff3542dfa150ec08ec878303011e44319b238c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update RPC headers to sync with NBLE firmware.
Change-Id: I3231fe16372f2a6a38868edfa543689f631d8b98
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Registering CEP attributes was not possible because
bt_gatt_attr_read_cep was not implemented causing the following error:
bt: bt_gatt_register: Failed to read attr: -71
Change-Id: Ib0860cf657d6a6001c1fd4dd2712ac7361edee1c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Applications should be able to update the connection parameters.
Change-Id: I446f64fcd0b27b605e636e566fb35a362a92de96
Signed-off-by: Louis Caron <louis.caron@intel.com>
Fix assigning negative error code to unsigned int and then compare it
against zero.
Change-Id: Idedaf91dda20a38806ee81d5c488ae8b46c8feff
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For size_t it is hard to be negative in the following check
...
if (!data || len < 0)
...
Change-Id: Ib995d568e10aa1e3cbaf28f46d267addb876f073
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since RPC to the NBLE is designed in a such a way that it is nearly
impossible to find out which packet received, create debug tables in
debug configuration. The tables store strings of function names
referenced by function index in a table, created the same way as RPC.
Sample output is:
...
bt: rpc_deserialize (0xa80082c4): on_nble_up
...
Change-Id: Ic91fcf73753aa9b78bdbacd5c8a0279823a4679e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This is the MTU supported by the firmware and is necessary in order to
register bigger services such as vendor specific in the peripheral
sample.
Change-Id: I24b2f9e983d8e2da22d41a40f538f0daf7d526d0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
There could be commands that depend on the firmware version the stack
needs to wait until version is complete.
Change-Id: If8ded19c4cd4eb3c33df64b3cde29da11b0de8df
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
For non-interrupt transfers poll_out should be used, This fixes data
lost issues on a real UART hardware like Arduino 101 and Galileo
boards.
Change-Id: Ic7a5d055941d83f9d62cbea9e911ce25730ed7b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Following change in NBLE firmware update interfaces and structures.
Change-Id: I47df2374961d13fabc54ee8e446a155a65999072
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Currently the nble implementation doesn't support advertising with an
NRPA.
Change-Id: I80e3e2a72d73d23f37966eb429a8ffb8d8c50bf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In anticipation of supporting a local static random address in the
future it makes more sense to call BT_LE_ADV_ADDR_PUBLIC
BT_LE_ADV_ADDR_IDENTITY.
Change-Id: I4826f1dfb50b54e13a35cbe7ee74e28641c81ad1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Enabling BLUETOOTH_DEBUG enables also serial console conflicting with
tester reusing the same UART.
Change-Id: I8058a019e61146ff05cc44ab543cf6ec9ff418ef
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Use pointers instead of potentially unused var.
Change-Id: I07bcb788b0f9e5e100c913c48d7d38464565157a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
got the following compilation error when trying
to compile the Synopsys DesignWare Ethernet driver:
In file included from drivers/ethernet/eth_dw.c:25:0:
drivers/ethernet/eth_dw_priv.h:27:28:
fatal error: contiki/ip/uip.h: No such file or directory
Fixed by adding correct include path in ethernet
Makefile
Change-Id: I8ea50e3ffb89e54349140de124f68d196a412f8e
Signed-off-by: Jean-Paul Etienne <jean-paul.etienne@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
There are situations when the transfer starts before we have the time to
enable the CS line, so to be sure, we active it before even attempting
to start the transfer.
This fixes an CC2520 driver initialization issue using the QMSI SPI driver.
Change-Id: Ib9b324b77260ac537f714376c8056b1543e7e3b3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
For QMSI drivers with combined interrupts, we need to use level
triggered interrupts. This is the case of the GPIO controller.
If we keep it configured as EDGE, the user will never be able to
get a pin configured as LEVEL to fire more than 1 interrupt.
Change-Id: I36bffc79183ca97f431c4f5811ed5d56e2fd82e8
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
config_info data comes after driver_data (though the first one is
usually the one you use first, but anyway).
Fixes a bug introduced by my commit id
3eade319e878c7e11faf4cd93a99d33737e16e6c
Change-Id: I3f58b7fd9605270bb6edf24ae0d129313ac9ab2f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Because of the necessity of using a GPIO pin as Chip Select, we need to
set the initialization priority of the SPI driver so it occurs after the
GPIO driver.
Change-Id: I02d675d8267ee07b267155a3806be85fbf57378c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
There are cases that it is needed to use a GPIO pin as chip
select (frames would be too long, for example), so using a GPIO pin as
chip select to keep the line active while the transfer is ongoing is the
usual solution.
This implements that solution for the QMSI shim driver.
Change-Id: Ia6b8f0f17161e20f87ad3def1468fe0abea65fdc
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This driver uses the QMSI library and mostly translates calls from the
Zephyr API to QMSI ones.
This driver conflicts with the native driver implemenation. In order to
enable it, you must set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="PATH_TO_QMSI"
CONFIG_SPI_QMSI=y
CONFIG_SPI_QMSI_PORT_0=y
CONFIG_SPI_QMSI_PORT_1=y
Missing:
- Support for using a GPIO pin as Chip Select;
Change-Id: I0d8eca88a2a803b6b3604f396f874313fe90753c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
The PIO controllers on Atmel SAM3 family processors can be
used for GPIOs, so this is the driver.
Change-Id: I3d5712f3a0a71025b820ca1c08dd767ee1e136d8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Due to an issue with the interrupt-based transfer API from QMSI driver,
the 'transfer' callback from the shim driver (i2c_qmsi_transfer) is
implemented with polling APIs. This is not ideal because we are not able
to sleep the current thread (so another task can be scheduled in) while
the i2c operation is carried out.
The interrupt issue with the QMSI driver has been solved then this patch
fixes the shim driver so it uses the interrupt-based API and adds extra
code to handle the thread synchronization.
Finally, this patch also moves all 'struct device' related definitions
from the bottom to the top of the i2c_qmsi.c file so the DEVICE_GET
macro can be used in transfer_complete() and removes the init.h include
since it is not needed anymore.
Change-Id: I7ef7ce4cea6fcc939e310e5fe12c406645f6a16e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Currently, the I2C QMSI shim driver supports only the "I2C 0"
controller instance. This patch extends the driver so it supports
the "I2C 1" instance as well.
The controller instances can be enabled independently.
Change-Id: Ieb64df46816026f3f4fb262a1682c98ee36bedd5
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
IRQAGENT3 is initialized explicitly, but IRQAGENT0 isn't and its value
is based on the value the BIOS or bootloader had set before. Fix this by
explicitly initializing IRQAGENT0, and swizzle the IRQs to reduce
conflicts.
Update the pci_pin2irq function to accommodate for these changes.
Also remove pci_irq2pin function since it is unused.
Change-Id: I7b1dfc7659ab227fe66711a3af5a1f34fd4a7972
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Adds a Kconfig for setting IRQ priority, and set the default to 3.
This fixes an issue where the interrupt vector as placed in wrong
slot in the IDT table since the priority was zero, and thus
no interrupts from the comparator was received by ISR.
Change-Id: Ief2100c1d79e42f8cedc4e0ca21ed5f6970d62e2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This makes the aio_dw_comparator driver to follow others by using Kconfig
to define device name. This makes using the device in apps a bit easier.
Change-Id: I4fbcb0c009c863a2216a15a78a8aa6324d95690b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Implementing on_ble_get_version_rsp() allows to check firmware version
of Nordic BLE chip.
Current output is (stripped):
...
bt: on_ble_get_version_rsp: VERSION: 0.0.0 ATP1BLE000-1604C5546
...
Change-Id: I98d3cd659cbed86b31eb90aac0e3ae876daf616a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
!BLUETOOTH is almost always when not using BLE, so depend
on NBLE being configured as well to set various options.
Change-Id: Idc61cee277fe0f09086a9f2ed6eb419aee5fd69c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This reuses the existing code since that is not driver specific, with
this samples such as tester can be build using nble driver.
Change-Id: I6d9f3edf8deb2e84fce233ef02d1cd0ad6f52526
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
There are situations when nble_read() might stuck reading from UART when
there is no data. Limit number of tries to 10.
Change-Id: I23380b622439ce9fa72b05f4eb527f03c749fce8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement using printf(), to make correct stack use define check.
Change-Id: I81894ccb511f921a5fcff37d85790191251d683f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since the headers defining RPC with Nordic chip changes frequently
define weak functions printing BT_WARN("Not implemented") if
function is not defined.
Weak function symbol is marked with "W" as viewed by nm.
Change-Id: Ia39b64c6e89fdddc65683711fd192a235fe754d4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This lowers the chance of running out of buffers when sending or
receiving a lot of data.
Change-Id: Ifedc5652f993fa54f7aded87aef545ffb49e7581
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The RPC code is not net_buf aware so it will not update the net_buf
length when encoding data into it. We have to therefore do it
ourselves.
Change-Id: I7d7d3c09007a2a9bce822625607dbf7470a7ea0b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make code readable removing extra spaces.
Change-Id: I61e3486e1d301ff7d36fd2e34243ff6e9111e54d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove extra spaces and make code readable
Change-Id: I3e57a5440476eb0143d19ce9865d3a76c58b90d1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Include all functions using previously defined stubs.
Change-Id: If9ab3f02d2e3e1f27c09b0d666fcf531cf76898d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move receiving logic to fiber rx_fiber(). rx_queue is registered with
uart driver and all data is sent there for processing. Clean up old
ipc_channel interface since there will be only one interface to uart
driver.
Change-Id: I292863b1f38e5adb8ca4e6ac63aed09c83de56bf
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Refactored Johan Hedberg's code adding callback to be called when NBLE
is up.
Change-Id: I2a8a2238942c0adae2a5c47cfe94d8f2b1112810
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Refactored Johan Hedberg's code adding writing to NBLE_BTWAKE_PIN one
to drive it high, needed to wake up NBLE chip.
Change-Id: I63b9583281db897f2326e4570716c25ce181128f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Port RPC deserialization to Zephyr upstream.
Change-Id: Icc9e055565185e907f51832443386f929a752586
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Port RPC Serialization to Zephyr upstream
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Change-Id: I315d52dc6576254a6928520d1353856d41a25c69
Resets Nordic BLE chip and opens communication channel to UART.
Change-Id: Ie516869a4d978fc1622361ebc42894430fdf9ea6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Adds basic support for communication with Nordic BLE (NBLE) chip
connected to UART.
Change-Id: I3651e291ec18805a63ecd3d240dce62273e3c498
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fix a build issue, as DEVICE_INIT() is the only macro used now and
others have been removed.
Change-Id: I69f7df168f5c4284104068b79ba9097d9a1904c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It's not a function and requires all its arguments to be build-time
constants. Make this more obvious to the end user to ease confusion.
Change-Id: I64107cf4d9db9f0e853026ce78e477060570fe6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.
Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().
Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Rename them to DEVICE_NAME_GET and DEVICE_GET to fit in the 'device'
namespace.
Change-Id: I407a7f284ed4d1c071961b46615eea859c2e825f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.
Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.
Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
In the initial version of the I2C shim driver, the i2c clock gate was
enabled within i2c_qmsi_configure(). After some review rounds we decided
to move it to i2c_qmsi_init() but missed to remove the clk_periph_disable
call within i2c_qmsi_configure(). So this patch removes it.
Change-Id: Id45dba2e00a5649846d305399bc1b2b275063cb6
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Rename them to device_sync_ to fit in the device_ namespace.
Change-Id: I1088dda958584ed90b97137298050fee44c20ee4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
SPI, to control the CC2520 chip, is the only generic feature and thus
the only one configurable through Kconfig. GPIO on the other end depends
a lot on the SoC/Board. Adding a slave select option as well.
Change-Id: I63068fab476ed8d5b26103e4ad20e5be253c9932
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
FIFOP setting is a wrong assumption to know if radio is on.
Transmission runs on clock basis instead of pre-set loop counter. Thus
removing useless config option relevantly as well.
Opmitizing a bit the code as well, and making cc2520_on() public for
testing purpose.
Change-Id: I4495d1d6c19d10dcbc18f7e2fd5041720ec1f438
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
CC2520 drivers as a singleton:
Current driver can only handle a single instance. This is due to the
gpio callback which cannot provide the concerned device (not the gpio
device, the cc2520 one). Setting a singleton instance for now, as the
network stack cannot handle more net devices anyway. This will be fixed
in the future.
In the mean time: improving a bit the usage of spi and gpio by accessing
the cc2520 instance directly.
Also: simplifying SPI usage, useless internal locking removed, better
debugging routines, better busy wait macro and use Zephyr's BIT() macro
instead of internal one.
Change-Id: I92b849135a92f77ee6a4374c9f662dcad8347814
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Integrating it into network stack. Centralizing all in drivers/802.15.4
Change-Id: Ia2916ff652afe5fe736f6560c2ed4a911a5f0679
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Reading: As when setting up the transfer, Rx has to adapt to current
left Tx lenght.
Writing: If nothing will be transmitted anymore, downsizing the level to
0. This fixes a hanging issue while making the controller being busy for
nothing. Another hack found to fix the same issue was to test the SR
Busy flag bit in the ISR handler. As the threshold level makes more
sense, kepping this one.
Change-Id: I87ba393d507c9418295f188d866d9979f423536c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The numeric code to configure sample width in ADC needs correction.
Change-Id: I6d73db674852650f70178322d949f9b2b49f97af
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.
Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Introduce the GPIO QMSI-based implementation. This is basically a
shim layer that implement's Zephyr's GPIO APIs on top of QMSI drivers.
This is an alternative driver that conflicts with the previous
GPIO_DW implementation. In order to enable it you must set:
- CONFIG_GPIO=n
- CONFIG_GPIO_QMSI=y
- CONFIG_GPIO_0=y
- CONFIG_QMSI_DRIVERS=y
- CONFIG_QMSI_INTALL_PATH="PATH_TO_QMSI"
Note that this driver currently only supports one controller instance,
GPIO_0. It is implemented this way due to a limitation from the current
version of QMSI. QMSI versions later than 1.0 doesn't have this
limitation.
Missing:
- support multiple controller instances (gpio_0, gpio_1, etc);
- enable level triggered interrupts in sync with system clock,
through setting INT_CLOCK_SYNC properly.
Change-Id: Ib61b153dae9741806a9a31d7dc1f82b96d000fbe
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This commit changes the behavior of the driver when it reports
buffer results back through the callback.
Originally, the driver reported a callback after each sequence
table round signaled by an interrupt. If in repetitive mode,
each reported result was put in the next buffer element,
which was considered circular, and reported back with callback.
Now the behavior changes. If in repetitive mode, each sequence table
round reported by an interruption puts the data in next element of
the reception buffer. The callback reports back once the buffer is
fulled and stops the sampling process.
Change-Id: I3707574cfaf5dfc874473f38c5dfa88dd392133d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
On Curie SoC the ADC must always be configured in single ended mode.
Change-Id: Ie59b4180358153865c961b66f98321db60d4269f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
After exiting a deep power down mode a dummy conversion is required.
Change-Id: I98dad19e168984efe7af6ad360d0cc46e6603736
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Curie specs states that the ADC_PWR_MODE_STS bit in the
IO_CREG_SLV0_OBSR register must be polled to check if
the requested power mode equals the current power mode.
The bit is set to 1 when requested and current modes match
and the bit is located as the bit 0.
Change-Id: I030d7693d36fb96f09a9cbdd404118674fcb089a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
ADC DW IP requires a calibration process each time the
IP recovers from a deep power down mode.
Change-Id: I2e02d1987af9addd9cb08a4e4e8d3848ad5b623c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
On NANOKERNEL level only of course. Some devices, initialized at this
level, may require to get the clock running already.
Change-Id: Id2dd830d915474aac6c080068c2cf356cf841e0c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Controller should not be enabled while configuring or setting up a
transfer call. It's enabled once the transfer call is ready to proceed,
and disabled once the last interrupt has be raised.
Change-Id: Ib9125a3600971b57e642730682f2b3bfb91b1e02
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
On Quark SE, SPI might require GPIO to be ready before hand, to emulate
CS, thus providing an option to tweak the intialization priority for SPI
DW driver.
Change-Id: Ifa373948ac8227bf6e4ed1113bcb4dc9139b6663
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It might be necessary to emulate CS through a GPIO pin depending on
these 2 conditions:
- the controller's CS pin is not wired, and thus a GPIO pin is the only
option
- The controller is unstable at a certain frequency and cannot set/unset
CS reliably. This is actually a possible issue on DesignWare's SPI
controller in Quark SE or Quarks D2000 where it has been found
unstable at 1Mhz and above.
Change-Id: Ib6a06577906c005ddd347070d476a367a9c3da8a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Refine how DFS is calulated now that it is strictely used to
manipulate buffer lengths.
- Fix threshold limit
- Tune RX threshold relevantly (reduce it if rx_len is lower than actual)
- Don't push more than available left space in FIFO
- Tune the private structure to lower memory space occupation
Change-Id: I65b1b48b996b2104cebcb24cc366fb4dcbf7d53b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
IMR and ISR bits are same, but it stil better to differentiate them
properly. Also fixing naming where all ISR ends with an 'S'.
Change-Id: I2fc1e1d8d2743c3d98f5da40a5f4720a85c4f9a7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
On ARC, the SPI IP block might be accessible only via user extended
auxiliary registers, which requires different instructions to read from
and write to.
Change-Id: I3aa5f223938a9aed7795de4aedc64bd529d62942
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Registers offsets are hopefully all the same, but size differs.
On x86, thus 32bits support, CTRL0 or DR for instance are 32 bits r/w.
And DFS on 32 bits support is placed differently as well.
Change-Id: I5115d5c3c9bba71ece4a6f4a1d3d2fdc203c8da1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Only 8 bit frames were supported. Added support for bigger data frames
which can go up to 32 bits (on 32bits version of the controller, 16 bits
otherwise). Store the frame size in bytes during configure, and use it
during pull/push to read/write correct frame size.
Change-Id: Iae8c55442e0a205403aa3febd1811b36aaf4c5b6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If SPI_INTEL is not requested, no need to instanciate specific value.
Change-Id: I5f41d919e258e420f2bd099db88ed2259f9cd27e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no such thing as "IA" in Quark SE SS as it is an ARC core. Plus
for this very specific feature it does not require the ARC aux regs
instruction to read/write in the given mask address.
And fixing also the CONFIG_ option to check.
Change-Id: I1f63348ec85f6e006795f7641c912a30fc003709
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is valid only for Quark SE and Quark SE SS, where it requires to
unmask the interrupt for each specific controller. Thus making the
function generic, using the parameter as the specific mask base address.
Change-Id: Iea0a412b8d94a1ab5e1f3e339eaf632eacee5797
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This adds driver for the UART controller on Atmel SAM3X8E.
This UART controller only has two wires for RX and TX, and
does not have flow control (e.g. CTS, RTS) or FIFO.
Currently, the driver does not support any interrupt driven
operations.
Change-Id: I63720bccfb70a89888353b8ee3dfc4b80793dc01
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Introduced by commit 01d6f9f5ee0867f6ee8dc1506c2ebe62d9f296bb
Reported by Gustavo Lima Chaves
Change-Id: Ic29c33f4339c83a55ca45e93000cbc07b8dadbd2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Introduced by commit a6873a00d816daf303b0380dda91accd28df6497
Reordering the irq config function, and removing useless parameter.
Change-Id: I2d22cfe81153b104044d8672dd57115138437ed9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This patch introduces the QMSI I2C driver which is simply a shim driver
based on I2C driver provided by QMSI BSP.
This initial version supports only I2C_0 controller in 'master' mode.
Due to some issues with qm_i2c_master_irq_transfer API, the driver uses
the polling APIs from QMSI. This means that the current thread doesn't
sleep (i.e. is not scheduled out) while the I2C transfer is carried out.
The qm_i2c_master_irq_transfer() issue is under investigation.
Below follows the missing features which will be addressed by a new
version of this patch or by upcoming patches.
* Block the current thread until the I2C operation has actually
completed.
* Add support for multiple controllers.
* Add support for slave mode.
* Add support for suspend() and resume() APIs.
In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_I2C=y
CONFIG_I2C_QMSI=y
Finally, due to the lack of proper support for Quark SE in QMSI 1.0.0,
this driver requires QMSI version greater than 1.0.0.
This driver has been tested only with Quark SE based boards.
Change-Id: I369992c7b5fe37f7e0b45be7f19e667ad1fca9ac
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
NBLE defaults (eg for BLUETOOTH_MAX_PAIRED) were not limited to
!BLUETOOTH and resulted in overwriting BLUETOOTH defaults.
Change-Id: I1e4a90c00c15252bb3db927b42641f9a479f4aa6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Select cannot be used for int type of variable. This will stil work
correctly as default value is provided. Fix following:
drivers/nble/Kconfig:50:warning: 'BLUETOOTH_MAX_PAIRED' has wrong type.
'select' only accept arguments of boolean and tristate type
Change-Id: I15951a3ba9efa11e1c18a1e90eb708ced08ad357
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This converts the i2c_quark_se_ss to use the static IRQ API.
Note that, even with separate config functions for each instance of
the driver, it is still saving both RAM and ROM space.
Change-Id: Ieb555ff281b384d87d8e69f6914878bbee0e2ee9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
An application will not care about the implementation and will want
to only reference a well define name for the IP, the configuration
system will take care of the rest.
And application will bing to the drivers this way for example:
dev = device_get_binding("WATCHDOG");
Change-Id: I8a0fde34602320de643a0ad911d19c9985600e7e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This makes it easier to port samples which may use
CONFIG_BLUETOOTH_MAX_PAIRED.
Change-Id: I3e37df7cae63a4ac2219ce26408ae4d4f987645d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This make more sense since the handles are normally self allocated by
the stack.
Change-Id: I198dd9c3ef6259cff8a0e528514918ec18990dea
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add API definition and stubs for directed advertising.
Change-Id: Ib22d3acb6d2e76b0c638b26b8e07860cd189f640
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
All of the authentication APIs deal with bt_conn objects. For
consistency it makes therefore sense to use the proper bt_conn name
space with them.
Change-Id: I47912d542373df511524cc6ad2532d6c9a76ca68
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To have some proper split of conn.h and bluetooth.h APIs make sure all
bt_conn related ones are in conn.h. This also helps avoid forward
declarations for some upcoming patches where we need bluetooth.h
defines from within conn.h.
Change-Id: Ief3d32118a6749fb5785dab6cb3fee4ebb86ddb4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The authentication APIs may fail, so it's fair to give the application
a chance to catch these errors.
Change-Id: I323df86b94a823b201fe22d412e6bbcaa9029550
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Update the advertising API according to what has recently been
discussed and agreed upon.
Naming-wise the most important change is the removal of "EIR" which
was confusing since this is mainly used with LE at the moment. The
Core Specification Supplement consistently uses the generic terms data
and data type to describe what we're dealing with here, so the new
names are bt_data and BT_DATA.
Another change is to detach the actual data from the struct by
converting it from an array to a pointer. This is not only essential
for supporting BR/EDR (which has a different length) but to also
minimize memory usage.
Another change is to require the caller of bt_le_adv_start() to
provide the array lengths of the ad and sd paramters. This way we
don't have to have the empty (8-byte) element at the end of each
array.
Lastly, the bt_le_adv_start() logic is slightly modified so that it
will always clear the respective data if necessary. Previously the
user might have been left with a previous callers data if it passed
NULL to the API.
Change-Id: I318026ceb1b52bb688edf4dcfed82613bd15c3e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Introduce the basic skeleton for NBLE, which is the Bluetooth LE API
implementation targeting a custom firmware running on Nordic
Semiconductor nRF51 chips.
Change-Id: I1ce69d6ee0205e71f6bd8d256d9233c93d2cde41
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In ISR context we receive NULL when there is no free buffers available.
Add handling similar to H4.
Change-Id: I9c1c2784ceaf31a1b2f9433b142a342e8dcdbc3e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move rx state to the h5 struct and use a commmon h5_reset_rx() helper
to reset it.
Change-Id: I92af740ae26b443460531b7200dbb0e64fb11d64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The handling of SIGNAL and PAYLOAD states is exactly the same. Just
remove the other one.
Change-Id: Id82524812919658c6b1df76a7081c826aaf3df34
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When packet is retransmitted we need to recalculate sequence number
since it is not stored in the packet buffer.
Change-Id: Id389fa814e82cfd5e39afba1eaeaa79fc9e337f1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
In a case of unexpected SLIP_DELIMETER we need to discard remaining
bytes in UART and start from beginning.
Change-Id: Ib13a885cc1a4a188057c587e9974aff1d90594c3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The driver has to implement the logic in an interrupt based manner.
Applying the changes to the existing drivers.
Changing ADC's API and implementation as well to follow those changes.
Change-Id: Ie0c3e3e318f619ade6be935adb064a25446cc29c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The casting was wrong, resulting in setting only on of 2 slots.
Taking the opportunity to make thing a bit cleaner on the header side.
Change-Id: I3aa90b5f251f3c5aa756681425bb8ab07e3da1b5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The interrupt API has been redesigned:
- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
It will be used in situations where the new static irq_connect()
won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
exactly the same way as its dynamic counterpart. The old static irq
macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
generated inline with irq_connect()
ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.
Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This patch moves the config options I2C_STATUS_DELAY, I2C_CLOCK_SPEED
and I2C_DEBUG to the top of the Kconfig file. These options are
independent of the device driver and should be placed together with
option I2C_INIT_PRIORITY which is also independent.
Change-Id: I2297f4c31c0106a0d80fbaa9b4e5be0488b84732
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This was never implemented on ARC/ARM and has been superseded
by irq_offload().
Some checks that were only done with CONFIG_LOAPIC_DEBUG fall
under the category of 'shouldn't ever happen' and have been
converted into assertions, instead of propagating return values
which are largely never checked.
Change-Id: I4eedca05bb7b384c4f3aa41a4f037f221f4a9cfe
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This patch introduces the 'QMSI RTC device driver' which is simply a shim
driver based on RTC driver provided by QMSI BSP.
Some config options are independent of the driver implementation used,
so use a consistent name for them. In this case RTC Interrupt number and
Priority use the same config options for both the QMSI and DesignWare
drivers.
In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_RTC=y
CONFIG_RTC_QMSI=y
Change-Id: I48292406e5472e5786f3b9abbeb71016a273bfec
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This patch introduces the QMSI watchdog driver which is simply a shim
driver based on watchdog driver provided by QMSI BSP. This driver has
been tested with the latest version of QMSI BSP (1.0.0).
In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_WATCHDOG=y
CONFIG_WDT_QMSI=y
Change-Id: Id910fa7f8a0559bcd4746747d8ce4588a0c48589
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This enables the driver to process the transmit abort signal
during send.
Change-Id: I3ad1f25669bee214b5e1a04cd858ccb4a8442333
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This actually makes the code to bail out when transmit is aborted
during send operation.
Change-Id: I3dda7ec4a6e15d1483738bb90d63d674a994903d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This changes to request bytes that will fill the RX FIFO
instead of requesting byte one-by-one.
Change-Id: I87c6577dc5fcc476284cd3ed0039a178a5221d24
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This changes to request bytes that will fill the RX FIFO
instead of requesting byte one-by-one.
Change-Id: I30696c624c9f828818f6df9f1ee744a5bc515f27
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This API is not being used for anything, the interrupts for UART
drivers are all being configured statically. Saves code space as
gc-sections can't tell that these APIs are unused.
Some instances where IRQ/priority information was being saved in
data structures and never used fixed.
Change-Id: If56b4fdc251b80be9094ffcbac6f61e265ac2ffd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
() Rolls the transfer initialization function into the setup function,
as it is logical to have just one function (not to mention there
was duplicate code).
() The setup function returns early if there is any error.
Change-Id: Ie9d3057f2963a0ba5b74ac66e058ff4fee31f099
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Make the i2c_transfer() to transact messages through the I2C bus.
It is useful for I2C storage devices, as now we can send one message
containing the destination byte/block address, then send the data
in another message. There is no need to construct one continuous
data buffer to send both address and data anymore.
The drivers and sample apps have been updated to utilize updated
API when appropriate. For i2c_dw, only master mode has been updated.
Slave mode will be updated once we can adequately test it.
Change-Id: I0a811d60567367817fcc8d15f5454e5c933722e2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixes a build issue when CONFIG_I2C_DEBUG is turned on.
Change-Id: I8df72e41d0809f99c9c3855cbfcbc5abc60cbca1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There are a few bits missing on enabling I2C controller on
quark_d2000_crb. This adds the missing bits.
Change-Id: I05bbe8367a9e69962db573d496f1f9f0167ba597
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This patch introduces the infrastructure required to enable QMSI drivers.
QMSI drivers are shim drivers based on drivers provided by QMSI BSP. The
BSP provides a static library (libqmsi) which implements several drivers
for peripherals from Intel MCUs.
Next patch will introduce the first QMSI driver (watchdog driver) which
will rely on the infrastructure introduced by this patch.
Change-Id: Ic7da5d0249af0629eef8c91d124a153f84d4a76e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
These symbols have the same name as the symbols from lib QMSI, which
causes a compilation failure, when lib QMSI is used.
This replaces the offending symbols with names which are more consistent
with the rest of the file (rtc_ prefix).
Change-Id: I288a1a229bf0b40f3b6fc8ffb35c502f998054b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Simplifies the nanokernel timer API so that the timeout parameter must be
specified when invoking nano_isr_timer_test(), nano_fiber_timer_test(),
nano_task_timer_test() and nano_timer_test().
This obsoletes the following APIs:
nano_fiber_timer_wait()
nano_task_timer_wait()
nano_timer_wait()
Note that even the though the new API requires that the timeout parameter
be specified, there are currentl only two acceptable values:
TICKS_NONE and TICKS_UNLIMITED
Theoretically, the current implementation would allow one to supply a
finite positive value for the timeout and the system would wait up to
that many ticks for the timer to expire. However, it is thought that
that unnecessarily complicates the nanokernel timer model and so it is
left as an unsupported option. Should that change, then that feature
could be enabled by updating the documentation.
Change-Id: I8835c5342ab5025d6f70fdfbed54a50add7568d7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Changes the nanokernel semaphore API so that the timeout parameter must be
specified when invoking nano_isr_sem_take(), nano_fiber_sem_take(),
nano_task_sem_take() and nano_sem_take().
This obsoletes the following APIs:
nano_fiber_sem_take_wait()
nano_fiber_sem_take_wait_timeout()
nano_task_sem_take_wait()
nano_task_sem_take_wait_timeout()
nano_sem_take_wait()
nano_sem_take_wait_timeout()
Change-Id: If7a4bce1bd8ec8d6410d04f3c16ff1922ff0910e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Changes the nanokernel FIFO API so that the timeout parameter must be
specified when invoking nano_isr_fifo_get(), nano_fiber_fifo_get(),
nano_task_fifo_get() and nano_fifo_get().
This obsoletes the following APIs:
nano_fiber_fifo_get_wait()
nano_fiber_fifo_get_wait_timeout()
nano_task_fifo_get_wait()
nano_task_fifo_get_wait_timeout()
nano_fifo_get_wait()
nano_fifo_get_wait_timeout()
Change-Id: Icbd2909292f1ced0bad8a70a075478536a141ef2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
If the remote handler tries to send a message back with wait enabled
it can lead to a deadlock.
Change-Id: Ife6eae29c10e8937abd1b6511ee605f7786c6a7a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The while loop on the status bit was unnecessary as we will get
a separate invocation of the ISR for every message. We also ensure
that the global status register bits for the channel being serviced
are cleared before exiting. Fixes an issue where some messages
would be dropped or repeated.
Some runtime checks that shouldn't happen in practice have been moved
to assertions.
Change-Id: Iedd28ae15522c7b9f59ef34fa9fa8b4e24e6be14
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's unclear why the carriage returns were moved to the begnning and
not the end.
Change-Id: Ic6bda55c7537538c47477e6c44f5e4c1534573d4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This implements the newly introduced APIs to manipulate line controls
for UART.
This also implements the driver command API as setting baud rate
may require setting the DLF.
Change-Id: I80634aa3fbd4a3223c46edb61417123e36f439dd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds 2 new APIs to the serial/uart drivers:
() One is to control the serial line, such as RTS and CTS.
() Another one is to allow driver to expose hardware specific functions
to apps. This is needed as some hardware may have extra registers to
set for baud rate.
To keep the code size small, these features are disabled by default.
Change-Id: I15c000ce68a0a490dcfd3493b2fe9bc51fa974fa
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This moves the baud rate and options fields out of the UART driver
config struct and into the driver data struct. This will allow
changing baud rate and options at runtime in the future.
Change-Id: I62ddea2f95e634f2d60eeb9537f960799fc9301f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The UART on Quark SE and D2000 supports fractional clock divider.
It is used to limit frequency error for supported baud rates.
Change-Id: I1f39a95db09f4a5a4116edc700a10e4b9ecfa2bd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change-Id: Id2ee328458c5a1be944e90c34bbc2158464be325
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Rename class in pci_dev_info struct to allow to use C++ compilers.
Updated drivers to use new struct.
Change-Id: I17b94cb7bc094bccd615c8389a28589bfa90cab8
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Even though the OS is 32-bit, 64-bit BARs can still be mapped into
32-bit address space.
64-bit BARs occupy two entries instead of one, so the offset of a BAR
isn't necessarily its index multiplied by 4. To cope with that, hold an
extra offset field in the lookup structure.
Only 3 bits are required for index as well as the offset since the there
are up to 6 BARs.
Change-Id: I0d4955a3aca70b7fc81a1df06ab5f9f45793c70f
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
The PCI device information for both i2c ports is missing, resulting in
broken PCI enumeration.
Fix this by adding the missing PCI device information.
Change-Id: I5d1739cc994491c34a2a938166a9e56a082ed32e
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
The current scan loop does not re-initialize the device number, so only
the first bus is scanned.
Change-Id: I9dc97cecd5652c353b09ab5692f59f562436f902
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Only the first port is currently enumerated on the PCI bus. As a result,
the second port configuration will be set based on the default options,
that may be invalid on some platforms.
Fix this by enumerating the second port as well.
Change-Id: I63733a1f13f7cb35cae1dba3b6192dcd61c9f644
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
ADC allows to program repetitives sampling after a read request.
User should be able to provide buffers for each table entry that can
hold subsequente repetitive samples.
Change-Id: I75da4a480a0e3f241d9276cf4fe3999a9cfbba2c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Buffer management on dw driver was too complex.
New buffer management follows the following behavior.
- Each sequence entry have one sample at a time.
- Each sequence entry have a buffer to store that sample.
- If ADC have repetitive sampling configuration, the buffer value
is overwritten with the new value.
New buffer management allow us to remove Synposys'
files and license headers as well.
Change-Id: I75bbbee59bea400839bb34ca1fcb2111073f99d0
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Fixes interruption connection parameters, ISR parameter is not null anymore.
Removes irq_connect call that is a dynamic irq api that should not be
used along static irq api: IRQ_CONNECT_STATIC and IRQ_CONFIG.
Change-Id: I232c8562d2dcda3229776b561e2c1f4608a31cdd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
The current gpio_dw_initialize implementation masks the interruptions in the line
dw_write(base_addr, INTMASK, ~(0)) to assign api functions and initialize
interrupt vectors and handlers safely. Immediately after this, the driver expects
that gpio_dw_unmask_int(port) unmasks the interrupts. Without this patch that
implementation is empty for the quark se ss board.
Change-Id: Iac84c8807fcadad8c256c3fcaa4ff624b6337bf3
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Use a default priority to avoid Kconfig blocking when priority
is not set in SoC or Board.
Change-Id: I4edda47b955a7ee834f04dc40d0decbd8dee6305
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds a driver to utilize the DesignWare timer IP block
to do PWM.
Change-Id: I11ba689350b664209ad2440e3001e57eb38fd982
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change terminology and use SoC instead of platform. An SoC provides
features and default configurations available with an SoC. A board
implements the SoC and adds more features and IP block specific to the
board to extend the SoC functionality such as sensors and debugging
features.
Change-Id: I15e8d78a6d4ecd5cfb3bc25ced9ba77e5ea1122f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use a real board name that can run this kernel instead of a generic
name. Basic functionality exits on this board with Zephyr.
Setup of the board is mostly similar to what we have in galileo (EFI
based)
Change-Id: Ic8554f26dcac0dbbbb6d35d863482f6207dc63c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The Galileo board is based on the X1000 SoC, so move galileo to
boards and create this SoC instead, inheriting all SoC related code
and configuration items.
Change-Id: I9b39f1b44644775ee48acae284b82bae7876fffb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Using number_removed to find out how many packets from unack queue we
need to clear.
Change-Id: Icad948892f3ab1febc939e9ba6d6b3431973633e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
We might get out of sync packet because of race collision, drop it.
Change-Id: Ic84a760199df1520dc7a95383972f9ec428c7fde
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Analyze stack when sending single ACK packet.
Change-Id: Ifd3a54f0d1ad9a644363563fa9b8bea05b895fa9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
If there is no packet to be sent after timeout we have to send ACK for
last received packet.
Change-Id: I30bbc4ae1a257f9a7351dc5a5d2f1269740ce447
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add initial code for three-wire (H5) Bluetooth uart driver.
At the moment the driver is EXPERIMENTAL. To test use following
method with qemu:
Run btproxy with three-wire emulation patches:
$ sudo tools/btproxy -d --pty -3
Opening pseudoterminal
New pts created: /dev/pts/21
Opening user channel for hci0
Notice that new device created: /dev/pts/21, use it with qemu -serial
parameter.
Run qemu target with following parameters:
$ make qemu 'QEMU_EXTRA_FLAGS=-serial /dev/pts/21'
Change-Id: I51579ffd8088583df9106689a03b2a0b4aa9e4cb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove extra line and correct style according to common style.
Change-Id: I5fc9434edce44e52b51fc40866638c0899985b1b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Needed headroom depends on type of the UART driver, change it
accordingly.
Change-Id: Ic9bf5f08a49be6823fce5eff8139d5f949b313ca
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The LCD display is an add-on, not a feature of the platform or the
board.
Set the defaults and remove the definition from Galileo Kconfig.
Change-Id: Ic319cd765d2dc1fe08cc65615680821fe9bc6a83
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1. Need to unmask interrupts for the sensor subsystem.
2. The GPIO controllers need their clock enabled before they can
start sending out interrupts.
3. Setting up ISR on ARC requires usage of irq_connect().
Change-Id: I633b07292f11e5c5e768fc51fabb70769d407609
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add an option to specify to which I2C master the Grove LCD
is connected, instead of already using the i2c_dw driver
port #0.
Change-Id: I4e61ef8e31c75ae912e2d16f8939369c0b8bbc2c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The code to poke the system integration module to disable clock gating
for UARTs only works for UART0-3 since all the bits are in the same
register. However, clocks for UART4 and UART5 are controlled by
another register. This means that we have been writing to the wrong
bit for enabling UART4.
This patch fixes this issue, and moves the clock gating clock into
board initialization. The incorrect code has also been removed to
prevent accidental mis-use. The dev_data struct is no longer needed
for uart_k20, so that is removed as well.
Change-Id: I67845a417e43647bf0ffcbdbda34ce68fa887713
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
ANSI sequences may have a numbered prefix which means that the action
needs to be taken the number amount of times, e.g. "Esc[ValueA" (move
cursor forward Value number of characters). Some ANSI commands also
have two preceding values, such as Esc[Line;ColumnH (move cursor to
Line & Column).
To support these ANSI sequences we need to track a bit of extra state,
most conveniently done using a bit field. Since the ANSI parsing logic
gets a bit long at this point it's refactored into its own handle_ansi()
function.
Change-Id: I0711f869d5324f9f827915fde468fe470e7689ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of keeping track how many characters we need to move back to
get to the original position, take advantage of the save/restore
escape sequences. This allows us to drop the extra 'i' variable from
both insert_char() as well as del_char().
Change-Id: I69a2b5ea12ec2a7a2e4d519b55e4c737b5d5d25a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
MVIC has only one local interrupt: the timer IRQ. What IRQ line
to use is not fixed, instead it is programmed into the LVTTIMER
register. This is unlike LOAPIC which has a fixed IRQ for the timer
and instead the *vector* to use for it is programmed into LVTTIMER.
We don't want _loapic_int_vec_set() to do anything as the relationship
between IRQ lines and vectors is fixed and we do not want to be
programming vector numbers into bits 0-3 of LVTTIMER.
The IRQ line to use for timer interrupts is programmed into LVTTIMER
when the MVIC is initialized.
Change-Id: Icba0429f65ece7541fa8542814a8fdc39ad43936
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Quark SE Lakemont core has a hardware bug where the LOAPIC does
not properly notify the IOAPIC to clear the IRR bit for level-
triggered interrupts.
This patch introduces a workaround where the vector ID of the
in-service interrupt is manually written to the IOAPIC_EOI
register, resulting in the bit being cleared.
Unfortunately, in the context where EOI happens it's very difficult
to identify which IRQ line is being serviced, so this is done
unconditionally for all interrupts vectors whether they are registered
in the IOAPIC RTE table or not.
Change-Id: I639cd258dec4f50934e17eadbb821e6a7112e636
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Instead of having two config options to specify interrupt triggering
conditions, merge them into one option and clarify. This is now
similar to other drivers which have interrupt triggers.
Change-Id: I4e60c8c45a08d005dcc8256cb89e4c5be7c94307
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: I89090181acb5f48dd797e7773ab65c5f3d46c42a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: Ie7262b69226ebffa7e1b9e35725fda24b3fe089f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: I2d50457a45fae62ff085f7239712d580243253bb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: Ia0a069464392714f38037841de52e8d265fa4f49
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
A special situation may occur when a processor raises its task
priority to be greater than or equal to the level of the
interrupt for which the processor INTR signal is currently
being asserted. If at the time the INTA cycle is issued, the
interrupt that was to be dispensed has become masked (programmed
by software), the local APIC will deliver a spurious-interrupt
vector. Dispensing the spurious-interrupt vector does not affect
the ISR, so the handler for this vector should return without an EOI.
Change-Id: I4cf4744bd6efd68b72e2c380269de4181dc80bd9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This was only needed for an older implementation of software interrupts,
now superseded by the irq_offload() API (which doesn't interact with
the interrupt controller at all)
Change-Id: I8aa696d370ae1799872f6d70de69f3cb5b47456a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
To many people, IPI connotes inter-processor interrupts on SMP
systems. Rename this to IPM, or Inter-Processor Mailboxes.
Change-Id: I032815e23c69a8297c0a43992132441c240fb71e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
PROJECTINCLUDE is not required in app makefiles.
Change-Id: I3751b7c51c453dfe47d207bb11d171138668c4e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add null definitions for the interrupt latency measurement API so we
can remove compile fences in C code.
Change-Id: If86eedf79afcb49002108814dd4fb864956eb667
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Now that i2c is fully synchronous on top of an interrupt based
implementation, polling mode can be removed. Applying the API change
into the existing drivers.
Change-Id: I05d2a6089743b6b69f7c9da6312057134578e2f7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The i2c_set_callback() does not check for NULL pointers
in driver's API struct. So create an empty set_callback()
function to avoid runtime exceptions, if it is called.
Change-Id: Iad8fed62228d10d42b8189e76873eb4c2ad12eb3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Those empty C files are there because the current Kbuild
requires Makefile to be present at those directories,
(due to arch/x86/Kbuild), which requires building some object
files. So the empty source files are there to produce empty
object files to satisfy this.
Change-Id: I14056347ea14cff227d9e8960192e8673c0019b8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Change-Id: I1d379068f64855d5d4595838040ec50f97f638a0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Change-Id: I1af8b2888779b2b58367feaff9ee1a6d97b4873c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for forward/backward ANSI sequences and the ability to
enter new text while the cursor is somewhere in the middle of the line
rather than at the end of it. printk is introduced into the game
rather than the old write_uart() since we need to make use of the
%u format string support for creating the ANSI sequence to move
backward/forward the right number of characters.
Change-Id: I41f880fc5de773573147c5a291e2cbe94d5370a4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
By default, since we don't have special support for control characters
we should simply ignore them. This includes both pure (single) control
characters as well as ANSI escape sequences. The most important
control character to support for basic editing is Backspace.
The terminal creates a Delete (DEL) character by default when
Backspace is pressed. It also treats the Backspace character ('\b') as
a non-destructive backspace. To create the effect of destructive
backspace we have to send the sequence "\b \b".
Change-Id: Idc942d09be2a84b8dd0a60ace8429102c6c7e355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To clean up the logic and prepare for more control character support,
change the behavior so that instead of treating end of buffer as a
forced line break simply stop incrementing the position variable until
getting a carriage return.
Change-Id: Ie3970cb779dac3c826a3d21cf0b9ae57a43eddb2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The terminal doesn't generate line feed ('\n') when pressing return,
rather only a carriage return, so we can simplify the condition for
handling end of line.
Change-Id: I3eef8c6af19c43ef98ccdd9a5e3662d280834425
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that the HCI driver is called H:4 use the shorter driver-specific
prefix h4_* for its internal symbols.
Change-Id: Icdab1147e5ec31f84e0a3d810192ddd462f4dfdd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll in the future also have a three-wire UART (H:5) HCI driver, so
the current H:4 driver cannot have a generic name.
Change-Id: Id326ae63d6f4d273d0d0c6120143e2f8d62968d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make newline part of log macros so that caller doesn't have to
append '\n' every time logs are used. This make sure that no
log will be missing new line which results in concatenated log
messages.
Change-Id: I3231ae747c790816dbc1608e0a3bd56467ba0a1b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
() Fix compilation errors due to variable ordering.
() Fix the default config for Quark/SE SS as
the kconfig options were renamed in previous
patches.
Change-Id: I1004ae332fb857b60ed90df59831e7bd9c490cb8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The 'pos' variable is only used within a very limited scope inside the
uart_console_isr() function. Move it's declaration there to avoid
having it exposed to the entire c-file.
Change-Id: I45ff0090ea4e0aabe77db2549d0194e26ebb63ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Most of the uart_console_isr() function is heavily indented. We can
remove one level by converting:
if (uart_irq_rx_ready(uart_console_dev)) {
...
...
}
to:
if (!uart_irq_rx_ready(uart_console_dev)) {
continue;
}
Change-Id: Ib2fe150490a8391de4001f29e4727431668853c4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Shell applications may want to have a dynamic prompt rather than a
fixed string. Add a new API to let the application specify a custom
callback instead of using the fixed string given to shell_init().
Change-Id: I9844481057fc8e164530a677e7cb1bfb6d02cfc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Clock gating is platform specific and not mandatory. Thus making it
Kconfig based as well as generic.
Change-Id: I4ea10eadb077ac3d57c9337b43b1a9fb14763302
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Clock gating is platform specific and not mandatory. Thus making in
Kconfig based as well as generic.
Change-Id: I01b7831536efd87cc66a95060fcf1faf4a340073
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's apply the interruption unmasking if only the mask is defined.
Which definition should be done in board.h thus applying the change to
quark_se and quark_d2000 platforms
Change-Id: I9c273e2e7e33dd077a54e8f9205fa949a5e3707a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's apply the interruption unmasking if only the mask is defined.
Which definition should be done in board.h thus applying the change to
quark_se and quark_d2000 platforms
Change-Id: Ie0a4912f0dfbd97f2273efed963f7810a985c0bd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Base address, IRQ, interrupt priority as well as the instance name: all
are now Kconfig based. Thus Applying the change to quark_se and
quark_d2000 platforms. Sample code is updated as well.
Change-Id: I1c225c1b68d94b22ca10423b50a78a0ba09a27a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Base address, IRQ, interrupt priority as well as the instance name: all
are now Kconfig based. Thus Applying the change to quark_se and
quark_d2000 platforms. Sample code is updated as well.
Change-Id: Idcc89e6e9f4acc337fafc7d42f8de3061a5ece04
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A platform might provide multiple RTC, either internally or externally.
Applying the changes to the DesignWare driver relevantly as well as
to the sample code.
Change-Id: Ia70e791a6c45e186cbc4dc900a268fa882331af5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A platform might provide multiple watchdogs, either internally or
externally. Applying the changes to the DesignWare driver relevantly as
well as into the sample application.
Taking the opportunity to apply propre style when need (80 chars limit
for instance).
Change-Id: Iad020c697846db483a70a748cfc8fe7147ec3c04
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Removed old style file description and documnetation and apply
doxygen synatx.
Change-Id: I3ac9f06d4f574bf3c79c6f6044cec3a7e2f6e4c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The kernel event logger requires this function to obtain
the irq that is being processed, but this was not implemented
for mvic. This patch add this function to mvic.
Change-Id: I5e1b4a6e2758b69ec713c18ac9f78aebad18a93f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Some systems are configured with CONFIG_MVIC which uses the same
call to create the stub.
Change-Id: I92f6657806159624dee9c271554a78bc76935613
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds CONFIG_UART_NSIM to enable the uart/nsim driver.
This fixes compilation issue where the base address parameter
is not defined due to CONFIG_NSIM=y but CONFIG_SERIAL=n.
Change-Id: I1dc1c15b22ad174d4db514d89551780f0dfcae66
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Now that i2c_transfer/i2c_read/i2c_write are fully synchronous, no need
to use the polling based function.
Change-Id: Ib578cf4a6d72ad0817e1aaeebc7e4dab9f9d293f
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add a semaphore. Each task or a fiber that initiates
a transmission waits on this semaphore for it to complete.
Change-Id: Ia6cf961397614ead252ebea3949c016056289311
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Removes the 'priority' parameter from the IRQ_CONFIG macro.
This parameter was not used anymore in any architecture.
The priority is handled in the IRQ_CONNECT macro.
The documentation is updated as well.
Change-Id: I24a293c5e41bd729d5e759113e0c4a8a6a61e0dd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Function irq_connect() needs an extra parameter, so
add it in.
Change-Id: I4c7458e67ae57124228eeb486c8daf3b66a97f8f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds io/aux register support for IP configuration.
x86 and ARM configure IP through MMIO register access.
ARC architecture configure IP through io/aux register access.
Change-Id: I4d07b91af09d88b7eb6ac1aa02e875dcd626bd26
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
The Grove LCD driver requires running clock for delay. Since the clock
is only initialized in NANOKERNEL, so change the LCD driver init level
so that it starts after clock is initialized.
Change-Id: I6a2cadac1b34f95557f99c78615b1bd4aee541f5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The content of include/drivers/hpet.h is really private to
the driver and does not need to be exposed in public include
directory. So move the content into driver code.
Change-Id: Ica442e43c480a6b079b8d3c4e75e67adcfd0ba6b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Static irq api expect to have an isr with signature
void isr(void *arg).
This fixes the warning messages due the difference on
the isr parameter.
Change-Id: I64099ce47ba481b40446d5fb7e35fce0e46a9624
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Adapts IRQ macro calls for the new IRQ static support convention
on ARC.
The new IRQ_CONNECT macro requires to receive the irq numbers without
parenthesis around. This is needed to execute preprocesor substitution
correctly.
Change-Id: I318cb7916b6c3ff3a92b4d2e5a13379f8eed0b4e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Since all the necessary bits utilizing UART by index have moved to
use device name instead, the uart_devs[] can finally be removed.
Change-Id: Idbae6b46c0af9eef6c22c59e121e9d6a6b52426a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for uart_pipe usage,
instead of relying on an arbitrary index.
Change-Id: I36aaa4ed8f0b4905e4e741ca1464947e59f30869
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for Bluetooth usage,
instead of relying on an arbitrary index.
The default device names being used are derived from the original
board.h for each platform. Some of them point to the same device
as UART console. Since this is a Kconfig option, the default
can be overridden so this is not a serious issue.
Change-Id: Ibe82f3968e72ba60f9c033aa3dfcb2fb3c41dc75
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for console usage, instead of
relying on an arbitrary index.
Change-Id: Iebe01c9bf392dfee6d8284367f67647f7d47561a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove unused code after refactoring all the serial/UART drivers.
() Since device initialization is done by the drivers themselves,
there is no need to have config_func(), port_init() and uart_init()
to perform configuration external to driver. So remove the related
bits.
() The IRQ priority is only being used when doing IRQ_CONNECT_STATIC().
So there is no need to send it over during uart_init().
Change-Id: I72eb3402036b53cbc01c1eb968de0ddfa0096ee2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: Ibe22c6d1dc9525c845acc094fa2066c922439ec3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: Iba7aeb056edd63ef3f9b47d3801a3e0eeb9b34d5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: I4e0d0a6802ddda4a6671c6d246233eaa5074d4ff
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.
Change-Id: Id3e46135ab993cb6596b1fb5339ab1664c65ab40
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.
Change-Id: Ibeca65b3fe64feb7a203a793c01c525ff5e6afda
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Rename nsim_uart.c to uart_nsim.c. This is to follow
the driver naming convention.
() Rename functions nsim_uart_*() to uart_nsim_*(),
following driver naming convention.
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: If015f39a6f6b4fcc65625e6e5f973b4469202f54
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Renames stellarisUartDrv.c to uart_stellaris.c. This is to follow
the driver naming convention.
() Renames functions stellaris_uart_*() to uart_stellaris_*(),
following driver naming convention.
() Renames CONFIG_STELLARIS_UART* to CONFIG_UART_STELLARIS*
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: I0eadc3878d69ff24d1637f8df5220fd2f161d24f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Rename k20UartDrv.c to uart_k20.c. This is to follow the driver
naming convention.
() Move driver/serial/k20_uart.h to drivers/serial/uart_k20_priv.h
as this contains definitions private to the driver, and
should not be exposed in public include directory.
() Rename functions k20_uart_*() to uart_k20_*(), following
driver naming convention.
() Renames CONFIG_K20_UART_* to CONFIG_UART_K20_*
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: If1be1fde083aba6ff68062db2059aef08617a286
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Renames ns16550.c to uart_ns16550.c. This is to follow
the driver naming convention.
() Renames functions ns16550_uart_*() to uart_ns16550_*(),
following driver naming convention.
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
() Renames CONFIG_NS16550_* to CONFIG_UART_NS16550_*
() Disable NS16550 for ARC as no port is defined anyway.
Change-Id: I76bbe25b9bc75eb62df81e533f84f4f63a5257b7
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Quark D2000 which uses MVIC does not define CONFIG_IOAPIC,
so make the stubs work with MVIC.
Change-Id: If0ef53f16592a7a8a467629cffe976e37b258901
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
BIT() is already defined as a generic utility macro in misc/util.h
Change-Id: Ie74bbfe657de5de980439e30b2dcbb9168b69257
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is currently valid for quark_se platform. It's used internally to
suspend and/or resume the gpio controller.
Change-Id: I5147568ba6b0450363566b5f9fd2e8aa7e41df49
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change-Id: Ie58e8611a8fe9edec9ebcb123532a97f396098f4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no such feature per-pin. LS_SYNC is set or unset for the whole
controller.
Change-Id: Ic67048e29a9cc25a19e6a7bcc11d21dd1e65be61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Move btshell.h out of samples into include/misc and rename to shell.h
Move btshell.c into driver/console and rename to console_handler_shell.c
as an shell implementation based on new config
CONFIG_CONSOLE_HANDLER_SHELL.
Add shell_register_app_cmd_handler for an to app to optionally call so
that it can receive cmdlines not handled by the cmds registered with
shell_init
Change-Id: I5c1585e62ff7a0ee923c6c92833cc762cf912bad
Signed-off-by: Thomas Heeley <thomas.heeley@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The calls have been renamed and some drivers and documentation
are still using the old function name.
Change-Id: Ib7505fca6aadd68e3ea3a22bb445914c3eb6ed7f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Simplify driver by using sys_io functions and implement
wdt_read_config
Change-Id: I119615f1c391daae43a3b8db30319c51167ae05b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removes the following deprecated routines:
nano_cycle_get_32()
task_cycle_get_32()
fiber_cycle_get_32()
isr_cycle_get_32()
Those routines have all been replaced by sys_cycle_get_32().
Change-Id: I8709952633bb87c8963e88caffe1036fb9add527
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Renames _sys_clock_cycle_get() (provided by the timer driver)
to sys_cycle_get_32(). It is the preferred method to read the
hardware clock.
Change-Id: Ifea5213d8c04a8bf7b9114b048c5db0ccee61549
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This platform if actually a subsystem of the Quark SE SoC and is
not standalone. Use a more descriptive name and remove the architecture
from the platform name.
Change-Id: I16b1ab8dd668441683b07fc4512c219924463441
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Put initialization priorities as device driver Kconfig
parameter.
Initialization priority value for each platform is defined
in the platform Kconfig file.
Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.
Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
IRQ_CONNECT_STATIC now has the IRQ flags as the sixth parameter.
Change-Id: I680b21c92471e6bcb793598adcd286a73d539ddf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Avoid having to remove quotes wherever the platform name is used
by exporting the variable only once.
Change-Id: I4cb51901e4ac19d70d0310fe6bbacd157f586661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
IRQ_CONNECT_STATIC now has the IRQ flags as the sixth parameter.
Change-Id: Ib3efe15a128d74b84d83df3f8aeb39cdcea5ee41
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
uart_pipe when enabled was overriding all previous objects.
Change-Id: I5620b56dc7e42f887a7b78e07470e729a266d5f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The HPET reads its frequency at runtime, and thus must set all relevant
global constant values at runtime as well.
Change-Id: I965102bbdcea370297d5a2bbe14177ec0d0d3794
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Some timer devices, such as the HPET, read their frequencies at runtime.
All global constant values must be set at runtime in that case.
Change-Id: I408babce6deb857748a87691132d7e27e88f0bb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Do not depend on environment variables and use a kconfig variable
for defining the architecture.
In addition, remove the X86_32 variable, it just duplicates X86 for
not good reason, at least until start supporting MCUs with 64bit.
Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
- Provide the irq flags to IRQ_CONNECT_STATIC
- Provide the actual IRQ for that controller
Change-Id: If660baca7e92065cfdb588a2ae86ff13da0918eb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Build the actual driver when relevant
- Provide the IOAPIC stub
- Provide the IRQ flags for IRQ_CONNECT_STATIC
- Set the default IRQ priorities
Change-Id: Iea20ef67c92cf7f48791fba5a8021448b7059950
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
SYS_GET_DEVICE() needs the name set in DECLARE_DEVICE_INIT_CONFIG() not
the one in IRQ_CONNECT_STATIC().
Change-Id: Id1ed66953c863531411b34594ffed669ad524ef5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
That fixes a build error. Platfom's board.h have to provide such flags
if they enable dw gpio 1 controller.
Take the opportunity to provide the right isr to IRQ_CONNECT_STATIC.
Change-Id: I16900ea04f7f7c5d3c99b93a92b00c1f651494de
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Original name was too generic and confusing. This patch renames
driver to pipe UART and moves it to console drivers folder. Kconfig
destription is also improved.
Change-Id: I716fdbf7d636bbdc03b0fce27a59fd866f473246
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This module is based on the standard Local APIC and IO APIC source modules.
This modules combines these modules into one source module that exports the
same APIs defined by the Local APIC and IO APIC header modules. These
routine have been adapted for the Quark D2000 Interrupt Controller which has
a cutdown implementation of the Local APIC & IO APIC register sets.
Change-Id: Ic80aa78918483663d76054ebadefa08d8a3f188a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds the register definition for the DW GPIO hardware block.
This set of registers and offsets are specific for the SS
GPIO hardware block in the Quark SE platform.
In particular, the register BOTHEDGE (offset 0x68 in the
main GPIO block) does not exist on the SS GPIO block.
Change-Id: I4e16ec7c8e89015be1fc8bcdb1b7fa5377890b9d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This adds the I2C driver for the Sensor Subsystem on Quark SE.
This provides minimal support for the I2C controller, and does
only synchronous transfer at the moment.
Change-Id: I400b8ff3390d4b641bed5b8c617830c4217de3ff
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit adds the Synopsys source code for the arc ADC driver.
Change-Id: I140a63505685cda8ec9d3174b7cf4fc1e2e91b06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This adds the driver to support DesignWare AIO/Comparator
under drivers/aio.
Change-Id: Id6cb1b507c0526098f163f74c188e990590797c2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Such controller is found on Quark SE Lakemont and ARC cores. This
driver currently supports the Lakemont core (x86).
Change-Id: Iefebd6ce9dbe81aa3902e7c2d801b07c027c548a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Implements a low-level IPI driver for Quark SE mailboxes.
Configures the Quark SE platform to initialize it and
configure an IPI console from ARC->LMT on channel 4.
Change-Id: I30123771d04c2e06ea6fcca585fd4ef74c0717a7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Quark SE provides various clock controllers through its SCSS block.
Peripheral, external, sensor, and others.
This current drivers provides only the clock gating capability, for
peripheral, external and sensor. But it could support divider and more
other features once defined in the generic API.
Note: such clock has _nothing_ to do with a Real Time Clock (RTC).
An RTC provide clock timing like a watch would do. Here the clock
controller is about circuit clocking.
Change-Id: I1a365ae730dfc6be7686271f7fbb693e64a6ff6f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Adding DW real time clock support. This driver is used by the Quark SE
and Quark D2000 SoCs.
Change-Id: Iba8ddee1b1b5fee298db95b63418e152774662a4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The driver should handle the initialization instead of relying on
platform initialization. This is to conform to the driver model.
Change-Id: Idc95d59bce2470b5118e416ee05f07548991a15c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
since we are in the same directory, include the file directly.
Change-Id: I21c959538e4a3d9e3fba99eaa9b09697fffe25b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
since we are in the same directory, include the file directly.
Change-Id: I8c676e1e5acd7dbab2c283d914a3ef62c2d36cdc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Changing the ROM struct's interrupt_vector to reflect
what the value is properly referencing.
Change-Id: Ifb284821e82e01123c51a848d694da19e442c1e8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Due to a quirk of the k20 UART, when checking if either a Tx or Rx
irq is ready, one must first check whether the UART has enabled the
Tx and/or Rx interrupts. If this is not done, then all one is doing
is testing the UART to determine if it is ready to Tx and/or Rx.
Change-Id: I08a8280ed9fb0faef586f3c7d7befb3bfdec1e2d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
There's no need to do manual minumum calculation when there's the
min() helper available.
Change-Id: I4d5cfb088d9e6499750664680419ab4beb56e0d5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We can remove the need for the extra 1-byte headroom by simply
directly writing the H:4 header with uart_poll_out(). Also the
separate uart_out() function can be removed by taking advantage of the
counters already present in the net_buf.
Change-Id: I54bd852e28f416b3de250cd9f8a126269cccfc14
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We know the needed values at build-time, so there's no point in having
a runtime mechanism of accessing them in the code. Having the values
as defines makes it e.g. possible to use them as input for defining
the size of buffer pools.
Change-Id: Ib7556644719bfb631e638fa5bf29f3d1747a5072
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It is more intuitive to assume that the driver send() consumes (takes
ownership) of the buffer given to it.
Change-Id: I53d9cbebc0564d1d11110fc78a62ce0bbb3cdfd2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Flags allow passing IRQ triggering option for x86 architecture.
Each platform defines flags for a particular device and then
device driver uses them when registers the interrupt handler.
The change in API means that device drivers and sample
applications need to use the new API.
IRQ triggering configuration is now handled by device drivers
by using flags passed to interrupt registering API:
IRQ_CONNECT_STATIC() or irq_connect()
Change-Id: Ibc4312ea2b4032a2efc5b913c6389f780a2a11d1
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Somehow through the process of enabling Galileo, we have partially lost
the functionality needed to enable I2C1. Bringing back the I2C
configuration options for I2C1 to the DW IP block.
Change-Id: I296bd9c3d167969df5b2fe17627633f5ec4b1ba4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Such controller is found in legacy bridge on Intel's platforms. Such as
Poulsbo or Quark x1000.
Change-Id: I30f205f1e73aaa680092e92717fdacbb74046fa3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now make use of sys_io_clear_bit and sys_io_set_bit
Change-Id: I11ebcd8c31d2a4c6d3dac37a0eca0ffcfacead61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A tiny fix where the pin is the bit position, not its mask.
Change-Id: I4ed8c4b2968ff28b407cab88903351bafe6501ba
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fixes the logic in the routine k20_uart_fifo_read() so that it reads the
data from UART if the status register 1 indicates that data is available.
Change-Id: I1722b013e05c7477587c07f5a0b90c753ba34aab
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The ADC implementation requires that the kconfig option NANO_TIMEOUTS be
enabled as it uses the routine fiber_delayed_start().
Change-Id: Iec49fec4badd3fcf173a2d2cc9d2924299190150
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
- Changed behavior of duty cycle to have the signal ON time as the
duty percentage instead off the off time. Note however, this requires
that the off time is controlled. The behavior seems to be inverse of
what the user will expect on the header IO.
Change-Id: I1e7abf0324509de375d545a0215fd1edf2283814
Work-by: Johan Kruger <johan.kruger@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Rename them to SYSTEM_CLOCK_DISABLE and sys_clock_disable to put
the symbols in the proper namespace and to align with the rest of
the timer APIs.
Change-Id: I341cdb1bd6cc01e5662d8526c293d4e0acd6ec24
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
ioapic_mkstub applies only when an IOAPIC is available in the platform.
Change-Id: I40294e4c11ef04739a1ce2146d125f3c5478013d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This patch updates the ISR initialization code to reflect recent
changes in the underlying Zephyr ISR infrastructure. It also adds
assertions to detect failures to lookup device bindings during
initialization.
Change-Id: I4bf1955da44a97f8c2652b96a390804c5cea73e3
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
- ROR interrupt needs to be acked by resetting the bit to 0
- Rx threshold seems buggy on that controller and setting it above 1
generates unreliable transmission as sometimes it does not trigger any
interrupt though the rx fifo is just full.
Change-Id: I4949c1fe7b42c70973efd4e0dafd14c6171f13f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
We generally call this in interrupt code, and since it's just a register
write, get rid of all the function call overhead.
Change-Id: I251fa3cee0841fcdd8eecc7941d4d3782d112e66
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We are interested in supporting some XIP x86 platforms which are
unable to fetch CPU instructions from system RAM. This requires
refactoring our dynamic IRQ/exc code which currently synthesizes
assembly language instructions to create IRQ stubs on-the-fly.
Instead, a new approach is taken. Given that the configuration at
build time specifies the number of required stubs, use this
to generate a build time a set of tiny stub functions which simply
push a 'stub id' and then call common dynamic interrupt code.
The handler function and handler argument is saved in a table keyed by
this stub id.
CONFIG_EOI_HANDLER_SUPPORTED removed, the code hasn't been conditionally
compiled for some time and in all cases we call _loapic_eoi() when
finished with an interrupt.
Some other out-of-date verbiage in comments related to supporting
non-APIC removed.
Previously, when dynamic exceptions were created a pointer would
be passed in by the caller reserving ram for the stub code. Since
this is no longer feasible, two new Kconfig options have been added.
CONFIG_NUM_DYNAMIC_EXC_STUBS and CONFIG_NUM_DYNAMIC_EXC_NO_ERR_STUBS
control how many stubs are created for exceptions that push
an error code, and no error code, respectively.
SW Interrupts are no longer triggered by "int <vector>" hard-coded
assembly instructions. Instead this is done by sending a self-directed
inter-processor interrupt from the LOAPIC, using a new API
loapic_int_vect_trigger(). In this way we get rid of dynamically
generated code in irq_test_common.h.
All interrupts call _loapic_eoi() when finished, since this is now
the right thing to do for all IRQs, including SW interrupts.
_irq_handler_set() for x86 no longer requires the old function pointer
to be supplied.
Change-Id: I78993d3d00dd153c9051c518b417cce8d3acee9e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
use gpio_dw instead of gpio_<function>_dw to be consistent in the
driver itself and with other drivers.
Change-Id: Ifb0e50c230f142197eb4b01c1bb4ce1c16e4753f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We now have BIT defined in a header file globally, so lets use it.
Change-Id: Ie7b87478cb5a9e977ec045efa072d28fab86e78b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to have a name according to the functionality of the feature.
This commit rename any text, function and variable related with the
Profiler name to Event logger.
Change-Id: I4f612cbc7c37965c35a64f06cc3ce5e3249d90e5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Adds an input hook to be used by the interrupt handler uart_console_isr().
This hook permits the console input to detect a character escape sequence
that can be used to override the console's default input behavior.
This input hook can be set using the following API:
void uart_irq_input_hook_set(struct device *dev,
int (*hook)(struct device *, uint8_t));
The hook returns 1 if the handler should stop processing the character,
and 0 if it should not stop.
Change-Id: I95e7da75e07fb6caaca2d45e80bfc4334a43c0ac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The simple uart drivers expects configuration options to be defined in
board.h and fails on platforms that do not provide such options.
Throw an error if needed configuration options are not provided.
Change-Id: I8c938868171eb8c1382075275ad96379cfc05a5a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Allows to remove the both edges support from the DW GPIO driver.
Change-Id: I9e39cca320aeac5d10aafe7a83641917ad004fe6
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Removing many of the typedefs that are only used once to lessen the
checkpatch warning about creating new typedefs. A handful have been
behind as they would require a more invasive change to the code. It
has yet to be determined if this is a worthwhile endavour.
Change-Id: Ibeb29e0a1d37e8121218fccf0d986cbebd226e85
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Even if a buffer can't hold the needed amount of data we should still
cleanly discard the bytes so that the driver doesn't loose sync of the
next packet boundary. This way we also get to remove the now
unnecesary 'failed' label.
Change-Id: Ic921fbf6c0ddef4a7721cee7fa3e01a31b127778
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The space that the HCI driver needs to reserve for its own use is not
necessarily symmetrical. E.g. even with the current H4 driver we only
need to reserve space for sending data but not for receiving it.
Keeping track of these values independently enables more efficient use
of the buffers.
Change-Id: I64917b545c5cd77356ed038d09afe76422334661
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that we have the buffer type enum as part of the HCI driver API we
can take advantage of it to pass the buffer type information and not
have to have two separate callbacks.
Change-Id: Ib2ee5b1540e532c9b27903e97660a276c1293fbc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This way we avoid dealing with the specific buffer type value and to
make it clear that these are for drivers onle.
Change-Id: I8aef7ec6a767b2fa68cbe374eb371e2a6192f675
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a necessary step in preparation for removing the buffer type
information from the buffers.
Change-Id: I29d8fae32aa660416a1c12e87840499c711e659f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's invalid to try to send HCI events to the controller so we should
treat such buffer types as invalid in bt_uart_send().
Change-Id: I4108a158d5b91f364a9f3c56e3037f03755daa19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To avoid unnecessary stack variables and to simplify code, add helper
macros to access the Bluetooth specific ACL and HCI user data that's
part of the buffers.
Change-Id: Idc337537721115c4091982c04f8a05bbbf0d5a19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I8df37d214e1f93ee472cde82c4198d667709ff5a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch performs the minimal necessary conversion to the net_buf
API. It uses a temporary "#define bt_buf net_buf" to make it possible
to convert the code in smaller increments. Most old bt_buf function
also serve as one-line wrappers to the matching net_buf APIs. Once
everything is converted these helpers will be removed.
Change-Id: Ie31433d33576022c9c193a35d2389267005545d6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch adds a driver for a Synopsys DesignWare Ethernet MAC. The
driver uses interrupts to handle received frames, but it uses a
spinloop when transmitting to wait for the transmit descriptor to
become available. Transmission is coordinated by a fiber, so this
should not result in the system execution being blocked. Only a
single descriptor is allocated for each of the transmit and receive
directions to save memory and simplify the code. Another
simplification is that none of the offload capabilities of the
Ethernet device are used. The driver currently only supports a single
instance of the Ethernet MAC, which is consistent with the limitation
in the network stack that only a single network device is supported.
Change-Id: I013b3d439a76e8ff91a775516f7035841b040870
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch adds the pci_enable_bus_master function that enables bus
master access for a PCI device.
Change-Id: I317daac1a613ccfc5a3894332c1a7dbbff05991f
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
There's no point in having a return value for uart_out() if it always
returns the same length that was passed to it. Just make it return
void and remove the error handling code from the caller (which would
never have been run).
Change-Id: I88dab7499a5f526ca65058640021f84e1b3486ca
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The reason why fifo_fill works in qemu but not on real hardware is
that qemu serializes all byte transmission 1 by 1. There is no
real hardware fifo emulated, and "fifo" depth is 1. On real
hardware, the controller owns an internal fifo, with a depth like
8 bytes on Quark x1000. And because of execution flow, how fast is
the controller etc etc... a fifo_fill call might fill in the
internal fifo of 8 bytes and then controller says "I am full"
(which means: "wait for the fifo to have space again"). That's
why poll_out() works: it does the same as fifo_fill and wait
that the internal fifo gets some space again before continuing.
And only when all bytes have been pushed in, it returns.
Change-Id: I452a6ebb2913c5e52ed01d999185e250aa3ed474
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Catch cases where index is set to negative or wrong values.
Change-Id: Ieab73e0fb12cecfc6c3c3d74c7d41f640bc88f01
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The galileo board no longer needs an extern of the initalize
routine once we've moved the process to the actual file.
Change-Id: I21a0748729b2435a368e28b3a2744b2089ed1e13
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Adding in dependency of GROVE_DEBUG to the GROVE configuration
option being set
Change-Id: I4108e619254ca3cde2b96de595e1b8300fe6a752
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
XIOAPIC_DIRECT_ADDRESSING and IOAPIC_MSI_REDIRECT are never
set and not tied to any config options.
Change-Id: Ib64cd198c99fe670eb5bcd946ce93f616c03d12a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The \NOMANUAL tag is a remnant from days of yore and is no longer
needed or useful. Cleaning up the code references to this.
Change-Id: I1b8cc9c9560d1dbb711f05fa63fd23386789875c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
This was only needed for the older 8259A style PICs which are no
longer supported.
Since we now just support APIC, we always just call loapic_eoi which
no longer requires an argument and informs the IOAPIC that the interrupt
is complete if necessary.
Change-Id: I15c9b7b4f03b872656220af32220b62e043bfa6b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
SPI port 1 needs the pinmuxer to be initialized first. Or then, all
modifications required from the CS GPIO logic won't apply.
Change-Id: Ibe4b2d4096065a9add23373075090d5e8a014650
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
As for the SPI port 0, SPI port 1 needs a GPIO pin to emulate the CS.
Change-Id: I00911cd25c3fa0ae17a02ee6f43cbea7f4fbcca2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Obviously it's '&' and not '&&'.
Change-Id: I9bb9fee80a67697e8ea62bb001af1b72f5a356e6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The I2C1 device is currently using the older device initialization
method, and thus will not work.
Change-Id: If193f20275262abc3b08edd3a26679ae9ad39d94
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Convering the intel_spi to use the updated device model
Change-Id: I016822aeecaf707ffa31b57b4e51e99262fce0e5
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The kernel configuration option SHARED_IRQ_1_PRI is dependent upon
SHARED_IRQ_1, not SHARED_IRQ_0.
Change-Id: I018cd8e860c362572cdde8586e50aed990d350bc
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Changes the default IRQ priority level from 0 to 2 for the following
kernel configuration options as priorities 0 and 1 are reserved for the
first 32 IDT entries.
SHARED_IRQ_0_PRI
SHARED_IRQ_1_PRI
I2C_DW_0_INT_PRIORITY
GPIO_DW_0_PRI
GPIO_DW_1_PRI
SPI_INTEL_PORT_0_PRI
SPI_INTEL_PORT_1_PRI
Change-Id: I0fc821c68156eb1e1fe776b2bd4ff5890bba40e8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This patch corrects gpio_dw_setup to use the MMIO base address
determined by PCI enumeration when that enumeration feature is enabled
instead of always using the default base address specified at compile
time.
Change-Id: If139c40ce30275694e01196a4a4aa529cd714f06
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Change-Id: I7e920e6de8f4b7a726c03c05edea3cbac69eb374
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I2276676142deea21cf8079449ce153f2fb887a8e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I34a54230bc4a63c8a4391d03ff530835910c3705
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I819d13f0d7a23e3a61dcda6a3ced18810b192158
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I6e3dc44be7bb6d01a7181d8c8e90cdb72120c3db
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I2298add2399559d95c75a90c045286046372b7e0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Moving many of the functions from the old format of inline comments to
the newer doxygen format.
Change-Id: Ib0fe0d8627d7cd90219385a3ab627da8f9637d98
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
If console handler is defined uart console should also be defined.
Change-Id: I3efcc6c837f8f1621340f7f13bf0603d7dc42fb2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Only driver specific public headers should be found in include/drivers.
All generic API are found in include/ directory.
Change-Id: Ic50931987bb9460fd4a3843abc6f5de107faf045
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
With ioapic_mkstub now taking a context value we can have a single isr
routine and move away from the isr trampolines we have now
Change-Id: Ibbb0f627ac515b12c0590a71da6a3267c952dd30
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Add a context value to the ioapic and loapic mkstub macros to allow
the developer to specify a context value that will be passed on the
stack to the interrupt service routines.
All the invocations for the loapic_mkstub and ioapic_mkstub macros
have been changed to pass in 0 so there is no functional difference
ATM. This change removes the need for drivers to have trampoline ISR
routines to pass a context vaule to their generic ISR routine.
This is the first step in getting rid of the hack where the driver
needs to look into the __initconfig_* linker objects.
Change-Id: I2c5eaa20d8cb5a42ef445762c426854be32c8452
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
In order to have drivers that are usable cross architecture the
signature for IRQ_CONFIG needs to be the same to avoid #ifdef hell in
the driver code based on architecture.
Update the macro and it usage for existing drivers
Change-Id: I22e142b21d4e984add231d1dbd97020e4823985f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I8f51f861e2250c87c296b697ef5b6610ce644b34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
checkpatch currently reports several files failing the C99 comment
verification. Cleaning these up now.
Change-Id: I35766c1f6c88a280c5e844b3f02668d6e1ad11d2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention of the OS requires the use of underscores (_) for
filenames instead of dashes (-).
Change-Id: I62b615f1f336e839cbbef2c3721c1926afe76457
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention states we should be using an underscore (_) for
filenames not a dash (-).
Change-Id: I51a6ae02957bfc556b8718aae713636bd14c8b2c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
The naming convention is to use underscores (_) and not dashes (-)
within the filename.
Change-Id: I678cf01306d72a905ed7b161af116c6e4a2cd39c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
The naming convention used in the source is for there to be an
_ and not a - in the file. Fixing GPIO to be consistent with
the os naming conventions.
Change-Id: Ifc4356c14b52e2cc2411a7445b44c7cb57d2765c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention uses the _ not - in the file names. In a recent
commit for I2C this for some reason changed. Making the names now
more consistent with other files.
Change-Id: I1e363c0c09ae0c8b2ac3def3beeaaeafcc01eb74
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Change the new files from Intel in BSD-3 to Apache 2.0
Change-Id: Ica4b455e9cb8134889f2a88e2d96094ce7093734
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Gets rid of the trailing initialization level character from the
name of the device variable generated by the macro, since it serves
no useful purpose. (The linker scripts place the various initialization
sections in ascending order based on the name of the section, so there
is no need to embed the initialization level in the variable name itself.)
Change-Id: I56bb79a513b8f77fb1f3fbaccec14454c2520772
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Initial import of the Grove LCD I2C controller. Data sheet can
be found at:
http://www.seeedstudio.com/wiki/images/0/03/JHD1214Y_YG_1.0.pdf
[DL: Updated command sequence according to datasheet.]
Change-Id: Id1b491f8dce346769dc42c41fac0ea3aabe3950a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
GPIO driver is initialized at pre-kernel-late level, if SPI does it too,
it will happen before GPIO (depends on the ordered list of
initialization). In order to ensure it gets GPIO initialized always
before SPI, let's set SPI to initalize at the next level: nano-early.
Change-Id: I6e34168c88fca0187a809bf5c7971492bd5acb5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change all the Intel and Wind River code license from BSD-3 to Apache 2.
Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
It's an SPI driven chip and proposes up to 8 channels for input
conversion. It's found on Galileo board.
Change-Id: I916367e9be0849812c6a509082a501730a01ce60
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It might be needed sometime to get some private data forwarded to the
callback, thus such user_data pointer is the easiest way to proceed.
Adding a macro to set the word size as well.
Change-Id: I68cbe2d480120253ccb13f13c656a38c27e21604
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If those are not set it means the controller has nothing to request
anymore from the driver.
Change-Id: Ie7e834e82b931e4b02ded3f9f619735b31b0a121
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since the driver is the only one needing those, no need to expose them
anywhere.
Change-Id: Iac4eaa65a9dbdaa8e72c70ea0de35cd2b3d836d1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
At this points the slave is ready to deal with the master.
Change-Id: I815d3c577bd0b73100cbf585cc8ca78f180ec713
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This was failing, the documentationg provides numbers only telling at
one places these are hexadecimal values. So switching to hexadecimal.
Then DDS rate retrieving macro was bogus, so fixing it.
And adding debug output about the DDS rate and the clock ratio.
Change-Id: I9cc414796fbd7f7123f1f406c6bce7ffacf641e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
With the introduction of generic transfer function, it is no longer
needed to specify read or write functions explicitly in drivers.
All read/write functions can now thus call the generic transfer
function to achieve the same result.
With this change, the transfer function becomes mandatory, and
should always be available.
Change-Id: Ia6fb98e58b84330a56a5d44ed3df9db42c3a5e88
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The newly introduced i2c_poll_transfer() is now used for register
read for PCAL9535A GPIO driver. The old write then read does not
work because every read or write ends with STOP. However,
the chip requires RESTART after writing the register address.
So the new generic transfer function is perfect for this.
Change-Id: I56d7ebe08f68cb04731c72138d60645ef124f65e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() For interrupt driven transfer, the driver already has
a generic transfer function, so this simply exposes it
for public consumption.
() The polling write is extended to support generic
transfer.
Change-Id: I657db8a6376282c723728b7a875813d389cf7d27
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Re-organize the steps involved in data transfer, according to
the datasheet's flowchart.
() Extract the common code for transfer initialization and put
it into its own function.
() i2c_write() and i2c_polling_write() are now using the common
data sending function.
Change-Id: Ieb90253ee10ddceb3b5d05b258e7fc6253d18729
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Both poll_in and poll_out are supposed to be implemented
in each driver, as these are basic function.
Change-Id: If1b6b11834f57934fe7e776bfcf818e088abdd0a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
PCI legacy bridge is a device connected to PCI bus and
allowing to program the routes from interrupt pins to IRQ
numbers.
Change-Id: I129719d71f958bbf5ad8c5c9949dcea93d94b89d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
PCI enumeration is not mandatory to enable as static information can be
provided. Plus, it does not integrate yet properly with shared IRQ as
well as setting dedicated IOAPIC paremeter for certain drivers.
Change-Id: I221b2a8a2179993a264e5f3eb93cda0e121d9abe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Providing the right settings through Galileo's Kconfig.
Change-Id: Ia5339eb90cb98d7dde3be0493bcfd9a6b6db60ed
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add Kconfig option to specify how interrupt is triggered for SPI.
Also enabling such support for Galileo platform.
Change-Id: Id3112d100089197940f826b827493174d0f22669
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is specific to Galileo board where its SPI port 0 needs to setup
the CS pin through a GPIO pin.
Change-Id: I9df6f7144a96bcd10f61fc7d057f89caa0e599d1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fix previous rebasing errors (before merging) where deleted code
was reintroduced back. This causes the default configuration
in Kconfig to be ignored.
Change-Id: I29b246b1459136521d764127bf02e6d8e5aff30c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This expands the Galileo pinmux driver to configure the GPIOs
on the DesignWare IP block, and the core/resume wells on
the legacy bridge.
Change-Id: Ia1df4b6fd3b104f08563fe9eab93f01efbb53b66
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If using with shared IRQ, this function will be called by
the shared IRQ driver. So we need to check and bail out
early if the interrupt is not coming from the GPIO
controller.
Change-Id: I4ae925f5fb9a5c32d03a180edc8460e978ec0aac
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If using with shared IRQ, this function will be called by
the shared IRQ driver. So we need to check and bail out
early if the interrupt is not coming from the I2C controller.
Change-Id: I3c3ae3c22aa5cf312de5c22b35765749d6c5929d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Such settings belong to Galileo and thus are set in Galileo Kconfig.
Change-Id: Ib9ec721fcc68e92521f8b7690c2640eeb82b2f4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Call the callback when relevant:
- When STOP_DET if received
- On error
Change-Id: Id60190c6ac5c0b15a0a6cd3fb30b9cc41f2333e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Handle only the pins which have been configured to be present on this
controller. Removing an unused #define as well.
Change-Id: I66d3638333f1fcd49b1b4f70a5c9d11dbc538fd0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
On some platforms (e.g. Galileo), the I2C controller is on PCI bus,
which shares IRQ with other devices (GPIO on Galileo). This patch
adds support for utilizing shared IRQ.
Change-Id: Id4e4714aed37c2893d0ffe9ed1e4edaabb338121
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
On some platforms (e.g. Galileo), the GPIO controller is on PCI bus,
which shares IRQ with other devices (I2C on Galileo). This patch
adds support for utilizing shared IRQ.
Change-Id: I4b44bae15356e4710d54f0343fed1bd27f35e484
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds options to the shared IRQ driver so the interrupt
triggering condition can be specified.
For example, the GPIO and I2C controllers are under same
interrupt line through PCI bus. The triggering condition
is level, active-low. So this option can be used by
the Galileo platform to program the IO-APIC correctly.
Change-Id: I1c3af98442e775b4987ab36a644c856052d85ec4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This driver allows multiple drivers to share a common interrupt
line. This functionality is required on system that conform to the PC
interrupt structure. In the context of Zephyr this is needed for
SOC's that have their I/O IP blocks behind a PCI interface. Due to the
limited number of interrupt lines provided by the PCI interface
multiple IP blocks may be configured to share an interrupt line.
Drivers that share interrupts must be modified to *not* register their
own interrupt service routine as part of their configuration/initialization
but instead bind to the correct instance of this driver by name, then
register their interrupt service routine with this driver.
Change-Id: I57b517b97ebeabce484ba53c8f940da993cb391d
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
The polling I2C write function guarantees the write operation
is completed. It is to make sure each write has been commited.
Change-Id: I37cd3b8a65c605837b1fae3ccd1c2b0235c07a37
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The polling I2C write function guarantees the write operation
is completed. Given that the initialization routine goes through
I2C write consecutively, we want to make sure each write
has been committed.
Also adds code to configure the I2C controller before transfer.
Change-Id: I2c8888e940edd1cb9fb01f03234a731ac991dfcf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This implementation will wait to write, and wait for transfer
to complete before returning from the function. Currently has
a default timeout of 100ms to prevent being stuck in the loop
waiting for hardware to be ready.
Change-Id: I0340fc6fed100f1d31c0306c5b0ab09689364f63
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add I/O port access to MMIO-based GPIO driver, in addition to
the existing direct memory access. This extends the driver,
so that it can address the registers through I/O read/write.
Change-Id: I53c74ad76472ac043764e33bfbb77a2bedc427fe
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The interrupt selectionss are no longer specific to a particular
controller (e.g. I2C_DW_0), but apply to all controllers on
the platform.
[DL: Extracted these changes into their own patch, instead of
being squashed with others. Also modified the Kconfig
options to move them into proper position.]
Change-Id: Idc7ac9769e947447b868dccf772a95dbb5fc8021
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Add a Kconfig option to enable NANO_TIMERS for PCAL9535A.
Without enabling nano timers, compilation may fail.
Change-Id: If96358a17b9522f9323f3480b4716c3dfd82a3de
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The I2C controller should have been already setup before this driver.
Since the only use right now is on Gelileo and I2C_DW driver. it is
safe to remove the i2c_configure() call now as the driver has default
configuration at boot.
Change-Id: Ia384e28871bf76dcfec899860f93da4bf0948ba6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the Kconfig option to specify default configuration
for the I2C controller during driver initialization.
During boot, the controller needs to be configured before
communication to slave devices can start. After boot,
an app can re-configure the controller if needed.
Change-Id: I7bf252f75a31943ae444e4d914f3a9a1a3f3d91f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There are devices that need are part of the architecture core the need
to be initialized prior to devices that are integrated around a core
to make up a complete SOC. Namely the interrupt controller in the SOC
must be configured in order to allow the integrated IP blocks drivers
to initialize correctly.
Change-Id: I0a91e08f98516a7b7dd402ffc6494a071f1326b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This macro is legacy from an early implementation of the init system
before the pure level was split into early and late phases remove it
now to avoid confusion going forward.
Change-Id: I6720874c840c9e14888fd6f411a8182e7420ca29
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This provides the API to manipulte the pin muxing, where
a single pin may provide different functions depending on
settings.
[DL: changed commit message.]
Change-Id: Ifd161137c062dff184024b5aa34737604911d09c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the driver for PCA9685 I2C-based PWM chip, and provides
basic PWM functionality.
Change-Id: I8c711d9b703fdaf5ccb23657e07495a95cbe16ee
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixes a build failure in designware gpio driver.
Change-Id: I90a540f56bff17ff56d0315356fde6d6c4d02407
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Register values are now being cached in memory, and are being used in
subsequent writes. This is to avoid reading from registers, as
we know what needs to be written to those registers all the time.
Change-Id: I9b344303c0cb9f28e974514ab674135004f68ea0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The _has_i2c_master() should return 1 if there is an I2C master.
The logic was incorrectly inverted. So fix it now.
Change-Id: Ic4bf44efc1f68644530a275f0c4e454740a2950a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the public APIs for PWM drivers. Also, this adds a Kconfig
and an empty makefile for drivers to extend.
Change-Id: I1cc0c908b6f5aeeb678b6368640d5b9a1cc9751d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Following the naming convention established, private functions
should be prefixed with an _
Change-Id: Ib6006ba3a928da88b8b8c3324f7d4b833f736270
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Many of the i2c functions continue to exist in a format of
<IP>_<interface> and will now follow the <interface>_<IP>_
naming convention.
Change-Id: Ic7ec879105f5c06f0213f8d771b3811253c49658
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
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>
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>
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>
This makes variables readable and consistent with other drivers
we have.
Change-Id: I816f133279497eafd5d5614013c8d224d5909590
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
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>
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>
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>
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 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>
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>
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>
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>
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>
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>
Rewrites the LOAPIC timer tickless idle implementation to cover all edge cases.
Change-Id: Ide0a235f298dfc5c75a090a45d1bf8275d81e248
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes tickless idle skew calculation as it is not particularly useful.
The actual "skew" may vary wildly depending upon whether cache is involved
or not.
Change-Id: Ie5c966eba5cdc3cff2610d4c1f3bb673c83ec8b7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Fixes two missed replacements of
_SysIdleElapsedTicks -> _sys_idle_elapsed_ticks
in the timer drivers.
Both were previously missed due to typos.
Change-Id: If55c9624df6f3bd7188e249f74d3ee3de61a68e4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Make config variable name match the function. The PIC is never turned
on in the zephyr code so there is nothing to shut off.
Change-Id: I1627e5a35cc37ef7959f36758c1e1aec03e22782
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
These x86 drivers are the last users of the PLB_* macros change to use
the sys_{in,out} functions.
Change-Id: Iebd0ad1bf5e74379498f86b24d835a0430db1311
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Or then the controller will spin around requesting to get its fifo
filled-in though it's unnecessary.
Change-Id: I81e7c483345236dee7691c3e780b1b06d6b2d0f8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Handle the new error callback type, a ROR interrupt is irrecoverable.
- Removing the fifo pre-fill: this should never be done that way. It's
up to the controller to request via an interrupt to get its fifo
filled-in. (TFS bit on SSSR register is the one requesting such
filling)
- Disabling the controller once completed (following transfer will
re-enable it)
- Removing useless debugging info
Change-Id: I466a8efb65a41f3315a6a36e10ea519d0c4b01e9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change DEBUG option into something more specific.
Change-Id: If1f421fbf7d234ad6bfac410697205d5d74548c0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Menu depends on X86, however some options are available
for all architectures.
Change-Id: I09cad39811319022d0323a4ff87d415346b5630a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will let us getting rid of old outByte/inByte functions.
Change-Id: I3344151c54f99e5e281ac8d3d027e0b810796111
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Only 1 port is available on Quark through the PCI bus.
Change-Id: Ie0e0173686947134d2553dd0fd0230ffa5a1d456
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since such controller is found on Quark x1000 (Galileo, ...), it will
need to get configured and/or enabled through PCI.
Change-Id: I16d00364edcb17653eaaf073e87b4e5850de7299
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using the OS provided sys-io functions for access to the registers
and lower level devices.
Change-Id: I1a88786189cbed0965f84146ffad9988a3b68a7b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Initial import of Synopsis DesignWare I2C driver functionality
for the Zephyr Project. This import has been tested for host
master control. While it does contain the code to work as a host
slave, this code has not yet been completely tested and validated.
Change-Id: I3df0214f6e3b6798f7dad4819d09c3ec5998e508
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Adds the necessary changes to Kbuild and Makefiles to enable I2C
driver support to build.
Change-Id: I3113ccbbbbb4e06ef134ca73f509d2755a2abb59
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
- Device ID was wrong
- Setting default class id
Change-Id: I9fd1df284eca4067c21beffa7599307a40be5144
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A fix for a mistake introduced in commit 1a7357.
Change-Id: I411937c85f29abb934ae5385f4858950f5d76887
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to keep track of PCI class's bus and dev. First, there might be
more than 1 bus and/or 1 device which would hold the same class.
Secondly, with the new PCI_ENUMERATION option, enumeration PCI device is
now optional and it's advised to unset such option and statically
configure the PCI information of the devices (to gain in booting time
and code size). So finally removing all of this.
Change-Id: I395d08c8f6f5e76431af59aa6fc9b30d703f2e75
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change-Id: I151b3c6516b9b5a38ab0da2948c951eb69d57498
Signed-off-by: Adrian Pochiu <adrianx.pochiu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The _ARC_V2_IRQ_VECT_BASE register must be set to the vector table in
flash.
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Change-Id: Ied5451c98222f545cd669967023aef26c3d8e48e
Only one wrong is sufficient to fail the test: the found device is not
the one we are looking up to.
Change-Id: I2a54b5683fedf7d54de1e1553aecba40b6b6b2e1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will help when debugging, since there might be different bus and
device on the same target.
Change-Id: I886a256f14a960d2faed71561416ee3bee20af1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Updates the documentation as the quark platform configuration had been
previously renamed to 'galileo'.
Change-Id: I31e1920f30f57b243b07215fe92be08b5e5c9d59
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This will enable the possibility to use this driver with Quark X1000.
Change-Id: Ic40b750d608488e97cc7662cad6c6d66dbf428ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Just to align the code to generic memory mapped registers and bit
operations functions.
Change-Id: I0fe8b3b6687670d0ed0daffe52645ec2c6b4c674
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit fixes the set bit function.
If the value to set is different from zero, then
the indicated bit will be set.
Change-Id: I9c42f683d108b371ca821f446ac5a10541b89b9f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
[DL: captilize commit message title; fixed some whitespaces;
changed the __initconfig_gpio_* from level 0 to level 1,
which is the level of pure_init; and added include path
to board.h; ]
Change-Id: I7eea6a6ca9e4b7cf8d1ccabb57f07f786da93ef0
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
- Makes the code simpler in driver side
- Configuration is done on platform's config.c file and not the driver
- Handles CONFIG_PCI_ENUMERATION setting
Change-Id: I9b8376cebd7e0b62279251da132a2c4ee7b2e148
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Without it, it won't go through a pci scan, and will just trust the
pre-set information for the bus/dev/function to enable the memory
mapped registers.
Change-Id: Ica9156be541619dce9684dd45f70e05b69782a7c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will make code that use it not too crowded with #ifdef #endif
Change-Id: Iec0fa662445b1cefdc7c64d9483e1ae483106a90
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This option will be used to disable PCI enumeration (not PCI bus) to
gain in code size and execution as long as driver will be properly
configured statically. Thus setting this option as set by default.
Change-Id: I7da5d154c8ee89e44fc2bad8e85a5a20f498927e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Such controllers are found in Quark's X1000 series, and thus are found
on Galileo boards v1 and v2.
Change-Id: Ib71486c9f27de1b6c48ce3cb3dd138d69833c2ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will be useful to enable memory mapped registers for PCI based
drivers that requires it. Removing redundant setting as well.
Change-Id: I52e47d01263a2de31c0c9f52ff65cc7e2734cf08
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will be useful for PCI based drivers to integrate fully within
the device driver model, where they will have to provide the function
they are found.
Change-Id: I7d64a4c6727cee52cbcb743c859cda43ac1a853b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add the interrupt profile points for x86 and ARM arquitectures. This
gives information regarding the time when interrupts occur.
Change-Id: Ic876c0e7f9e8819d53e0578416f09146f4456d3d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
The uart_devs in platform config files have been converted to pointers
to struct device. This change is missing in the simple UART driver.
Change-Id: I8107f9e78daeeb3878140506f51bbd0025fde05b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The drivers provide _sys_clock_cycle_get(): moving the public APIs to
the drivers allow them to be aliases of it.
Change-Id: Ic5975a048f2b51f94510f0c3cd5e6ab3a8907718
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines.
Change-Id: I3866843a31e30e1dd464b27cafc830900d8dce4f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding style.
Also align the function argument list.
Change-Id: I49eff429bfa369c8a544d8171e35a41523995aa3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, updates
the comments for function, and adds missing comments.
Change-Id: I7610e8667cd85feb0c4c853b44880f7e29b6c05a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.
Note that this only changes the parts related to UART.
Change-Id: I84a6ba88963784f6ddc77d5bda653a7d2de6a72b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, and updates
the comments for function.
Change-Id: I97672996510fec1c92a30f78d6f088f02279fb44
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.
Change-Id: I0787558abe899e9376ede0ee5c5ac5728c42254d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix the option that enables level triggered interrupts usage.
It depends on CONFIG_HPET_TIMER_LEVEL_HIGH and CONFIG_HPET_TIMER_LEVEL_LOW
configuration parameters.
Change-Id: I3529b1e57b1625e6f0f4b05d9c15eb563e9c4f83
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
The initialization procedures need to be called in the
following order:
- basic hardware initialization;
- devices initialization;
- hardware clock initialization, that the kernel needs to
run the kernel server.
This way, the board initialization routines is placed
to the pure_early_init level to make sure it runs first,
all device initialization procedures run at pure_init level,
so they are initialized early enough to be used for debugging
if needed. Hardware clock initialization is placed on
nano_early_init level to make sure hardware clock is initialized
just before the kernel server starts.
Change-Id: Ieecf9f0252c47c621b7208969687dc1113fc2ad0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This is just a cosmetic change to unify anything interrupt related
under 'irq'.
Change-Id: Ib8804d194e11eb49526fda952d9efc0f2ffac2df
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the baud rate selection for uart_console into Kconfig.
This allows apps to specify custom speed. Default is 115200
which should be supported by almost all RS232 and USB adapters
out in the past few years.
Change-Id: I78649bf2a1b2ddfc90a20d611a6454e3ad3b1b3a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is the final step to convert serial to the new driver model.
The dev->driver_api is now being used by individual drivers.
As a side effect, it is now possible to build multiple serial
drivers in the final image (though it won't make much sense).
Change-Id: I5d864e6503a5431b29006c311320155adf81cf5b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces the config option CONFIG_UART_CONSOLE,
and also CONFIG_CONSOLE. The UART console can finally
be disabled if desired.
The defconfigs are also being updated.
Change-Id: I5ebaf6471986deca105971e67fcddb43374de94a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
With this, the UART console has its own initialization which is not
dependent on UART init routines.
This will allow the app to utilize all UARTs for other purposes,
instead of always reserving one for console. Future patch
will enable this choice.
Note that the console init is effectively demoted to pure_init
from pure_early_init. The UART console depends on UART being
initialized, but there is no deferred init at this point.
So this initializes the console a bit later than UARTs,
simply to make sure the UART is initialized before using it.
Once there is a mechanism for some type of deferred initialization,
the UART console init can be promoted back to pure_early.
Change-Id: Iba95197b13384cb1a46e34c78638348b7a0bec8c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This restructures the device structs and now utilizes the new
driver initialization model. This is another step towards
converting the serial driver to the new driver model.
Note that the serial driver does not initialize the hardware
unless it is being used by another driver. The configuration
of the serial port needs to be done by the driver utilizing
the port (e.g. baud rate, interrupt priority, etc.).
Therefore, some serial ports are declared but not exactly
configured.
Also note that the UART console is being initialized at
the same time as the serial port. This will be removed
in future patch, so the UART console driver will do
its own initialization.
Change-Id: Idd89954b2d0649a557ba8c869ee96512fec898e4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This encapsulates the whole serial drivers Kconfig sections, and
allows the whole section to be deactivated.
Change-Id: I84f8d35da74f3c00a44d8c17786ea2297422d68b
Signed-off-by: Daniel Leung <danielcp@gmail.com>
This moves the static device definition from the driver file,
drivers/bluetooth/uart.c, into the platform config files for
each platform.
This is another step towards converting UART drivers to
the new driver model. Also, platform config files are a more
logical place for the definition.
Change-Id: I668a52de5a38005b8b2bcb67d74437ead377cb16
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
... instead of an array index to a global array. This is
an intermediate step to make the drivers conform to
the new driver model.
This only changes from using a direct array index to using
device structs. The UARTs are still staticlly defined.
Later patches will make the drivers utilize the driver
initialization procedure specified by the driver model.
Change-Id: I18041bbb4b0efdf8ae87088fd000b391d0827e9b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The new names reflect better what the functions do: they find the first
bit set starting from the least or most significant bit, i.e. they find
the least or most significant bit set, in a 32-bit word.
Change-Id: I6f0ee4b543f6f37c2f08f7067e14e039c92a6f6a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Standardize on using the find_[first|last]_set (non-inline) symbols
everywhere.
The non-inline versions provide absolutely no benefits, so they will be
removed in a subsequent commit, and the inline versions will have their
_inline suffix removed.
Change-Id: I5b3dee33ffe3878a05e1bb3c6400a8d8c1640ad4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Use doxygen format for file documentation and move
parameters to be part of the function comments.
Change-Id: I01c0614e7cd3ef4c689d2aec3aa3e52e0d21ffcd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removes the non-PIC disabling PIC code as the PIC is not a supported interrupt
controller. The PIC disabling code remains as it is needed to prevent the
generation of spurious interrupts from the PIC (see CONFIG_SHUTOFF_PIC).
Change-Id: Ic59aa17ab96f34685a5d7b5f24cab391de47edca
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The PIT is an unsupported device. On x86 based platforms, the LOAPIC_TIMER and
HPET_TIMER are the only supported timers.
Change-Id: Ic890838c811b7eb62008aef0c8a92786f1579217
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the LOAPIC and IOAPIC macros from board.h as they are no longer
appropriate since Kconfig options exist to use in their stead.
Change-Id: I2ce41a7a08d1859682389f35cd5a97c0e2cd5bf7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Creating the IOAPIC and LOAPIC Kconfig options permits future commits to remove
those settings from the relevant board.h files.
Change-Id: Ie33c703f39c68d6e251d67b1c7cf75a0dd56a7e6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the LOAPIC timer macros from board.h as they are no longer required
since appropriate Kconfig options exist to use in their stead.
Change-Id: Id0b509eba7cce1839b400f95b989bf886322e1a8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Creating the LOAPIC timer Kconfig options permits future commits to remove
those settings from the relevant board.h files.
NOTE: No defconfig files have been modified as the LOAPIC_TIMER configuration
option is not enabled in any of them.
Change-Id: I7d97ed089cd4b734566b698183be95d3a166d71f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Fixes a copy-paste error that inadvertently had the LOAPIC timer being
referred to as the PIT.
Change-Id: I4760d150cd6feb76b7d7384845898c6276bace83
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
For as long as the IOAPIC and LOAPIC code is coupled (as it currently is),
enabling LOAPIC must select IOAPIC to be enabled as well. If future commits
separate the two, then the "select IOAPIC" can be dropped.
Change-Id: Ibe7e6b86e5add19b8b3cc68ebecce760d8914c86
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the HPET timer macros from board.h and uses the HPET timer Kconfig
options in their stead.
Change-Id: Ia0b3cd87716277ac25f12deb31d5c5934f355050
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Adds additional Kconfig options to the HPET timer for setting its base address,
IRQ, IRQ priority and condition for triggering an interrupt.
Change-Id: I80349c60237380129da9ef41ccf6850c6b874c3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
All driver Makefiles are adding the same cflags and they
have been done inconsistenly, make all drivers inherit
from the top level Makefile and remove unused includes.
Change-Id: Ie66d0ba7a418ac26f7eb709f50c887dc682e935c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The name of the device is SYSTICK. The device name should be part of the
file name, like all other timer drivers we support. The name
'cortex_m_timer' said nothing about which device the driver is for, since
it's way too generic: it could be for any timer present on any Cortex-M
board.
Change-Id: I39b4f79c32516ec9aff82c55c0ca639fad1b52bb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The Zephyr kernel must always be built as a monolithic image, not as
separate nanokernel and microkernel images.
Change-Id: I44fdd2349b32f409c84710f58bc4b3fe96fd79b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Removes references to obsolete BSP terminology. Where appropriate, replaces it
with platform terminology.
Change-Id: Ifb17f98bc12d3a28198810351629a109abdc18a5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Qemu implements HPET so that it is connected to IRQ 2, which makes
necessary to use it in legacy emulation mode.
Add legacy emulation mode to HPET driver.
Change the way the HPET driver is initialized. QEMU requires that
the mode (one shot or periodic) gets set prior loading comparator
value.
Add debugging mode to HPET driver to ease the next port.
Change-Id: I668325d5968451585519a08b6c41863cf6e37f88
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Disable the PIC upon initialization to prevent it from
generating spurious interrupts.
Change-Id: I08ba1d00e269e1fd1d32960dcb844e9fa1ccc195
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Fixes the SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig option dependencies such that
it can be overridden by a modified platform configuration file. This is
particularly important for the LOAPIC timer driver as
SYS_CLOCK_HW_CYCLES_PER_SEC is dependent upon the target's CPU/bus frequency.
Change-Id: I0fb49b4c540888cb1988c76e2a711a85e756f82c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Updates the timer driver dependencies to simplify the selection of a timer
driver. The timer driver menu only lists those drivers that are compatible
with the previously selected interrupt controller.
Change-Id: I5deea315f7c373c6660bacc411c6374e7b0ae84d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Selection of the IOAPIC requires that the LOAPIC be previously selected.
Change-Id: I13d95d4bb4ff02c1aebb0b5e573cb2b89dbe530b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The LOAPIC_TIMER_FREQ Kconfig option is not used.
Change-Id: I919fd2128f667e0b91467cb542041449738dd992
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Changes the the names of the x86 platforms so that they are more generic.
generic_pc -> ia32
quark -> ia32_pci
NOTE: it is expected that the two platforms will eventually be merged into one.
one. At present, the two platforms support different hardware. For example,
the ia32 supports bluetooth whereas the ia32_pci does not, and the ia32_pci
supports both PCI and HPET whereas the ia32 does not.
Change-Id: I8a980aaef55be8c59f7d19ddeb7fafbf11253408
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Improves code consistency by abstracting the architecture directory in the
set of assembly include paths.
Change-Id: I4b3638419a1242cb0628f128c5e3b82c3357d83c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Change the function signature of _InitHarware() function and rename
the function to a platform specific name now that it will be called
via a function pointer and not by name.
Call the platform *_init() function at PURE_INIT time.
Change-Id: I5168dfea81f406da135d491a2b4a24e8255f418a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Update microkernel systems to use the new driver initialization model on the
timer driver.
Change-Id: Ida9ef2a395d0dddf4104d490d78b13b11ea3c347
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Update nanokernel systems to use the new driver initialization model on the
timer driver.
Change-Id: I22d8619f56052f094482d73ab34c9d610492d8c0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Prepares the _sys_clock_driver_init() routine to interface with the new driver
model. To this end, it must accept a pointer to a device structure and return
an integer.
Change-Id: I3c600ce1efb49c0864aae7b09663ca40d6289372
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The revised name conforms to Zephyr OS naming conventions.
Change-Id: I5bcdaf1df7da9d8ce5787a08b29ead91dd8f24ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removing the parameter to timer_driver() as it is not used.
Change-Id: I09275287eeb541be0dd315056b4f2bc6cbc2573c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Remove function name from comment and add @brief instead.
Also capitilize first letter.
Change-Id: Ib708b49bf02e5bc89b0066637a55874e659637e0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Previous comment style used RETRURNS:, use @return to comply
with javadoc style.
Change-Id: Ib1dffd92da1d97d60063ec5309b08049828f6661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The change replaces multiple asterisks to ** at
the beginning of comments and adds a space before
the asterisks at the beginning of lines.
Change-Id: I7656bde3bf4d9a31e38941e43b580520432dabc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use Kconfig to define this variable and remove its
previous definitions from board.h. This will simplify
creation of different variants from a single platform.
Change-Id: I0aaa5aa81dedf096c6d8c1ea2d509c71817336d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Moves the Cortex-M timer driver so that it resides with the other timer
drivers.
Change-Id: I3324c53356efd9f5fd88752a98e4ae301ea38d47
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Adds the Kconfig option for selecting the Cortex-M systick timer. This helps
pave the way for moving the Cortex-M systick timer into the drivers/ directory.
Change-Id: Iee040083a425c9c1dbc5973991b89239e0a72eee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.
Note that despite the renaming, the usage of the config option remains
unchanged.
Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
We had those options defined per BSP. Moving them
to a more generic place makes more sense. In this case
they are moved under serial drivers.
Change-Id: I8faf31321fc433eaa168bf36f2b590a6b8402f9e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The revised name better reflects the fact that the file defines
macros in addition to declaring variables. In addition, most of
these APIs use the "sys_clock_" prefix, which aligns well with
the new file name.
Change-Id: Ib33517d4b19ec2455303b87200c677e87640fcbc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Make device drivers use static interrupt registration procedure.
DYNAMIC_INT_STUBS configuration parameter was used only by device
drivers to switch between static and dynamic interrupt registration
procedures. Now it is obsolete and is removed.
uart_int_connect() function is removed. If UART device driver still
needs to register interrupt dynamically, it should use
irq_connect(uart_irq_get()).
Change-Id: I80c695f337456e9b0c1b0fd56716e35794f7bdb7
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
In order to provide the same irq_connect() on all platforms
on x86, irq_connect() now uses a static array of interrupt
stubs. Device driver does not need to provide interrupt stub
to irq_connect() function.
Add NUM_DYNAMIC_STUBS configuration parameter, the number
of interrupt stubs used for dynamic interrupt registration.
Modify tests for unified interrupt register API
Tests that deal with interrupts are modified to work
with the new interrupt registration API.
Add CONFIG_NUM_DYNAMIC_STUBS option to dynamic interrupt projects
Projects that use dynamic interrupt handler registration on x86
have to include CONFIG_NUM_DYNAMIC_STUBS parameter in the
configuration.
Change-Id: Ic90c726485521a57cf695fd3edc8cac85d0b827d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
In order to simplify x86 interrupt stub creation, each interrupt
controller implements an interrupt stub definition macro.
Add IRQ_CONNECT_STATIC() for static interrupt registration, and
construct the interrupt stubs name from device and interrupt
handler names.
Add IRQ_CONFIG() macro for the interrupt controller configuration.
On x86 platform it programs APIC to associate an IRQ number with
the interupt vector.
Add HPET_TIMER0_INT_PRI parameter to Quark platform header to
make it build correctly.
Change-Id: I24ad25e1aa807ffa63733a27ad882877fcad72af
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This makes it clearer that this is a specialized API not intended for
general app usage (unlike most other things in bluetooth.h).
Change-Id: I0ce1d5903610a9b3a99cf0be9f0e1462b04bf45a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To make it clearer that these helpers are intended only for
Bluetooth-subsystem internal code, move them to a separate file.
Change-Id: Iea64780f5c61c1c96e12c9df378676bc49498fe4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated."
Change-Id: Iec6121b6b79a6a8c58ac26b8b08a542eac575c22
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Since the system generator pre-registers K_ticker as the handler
for the system tick event, there is no need for the timer driver
to re-register it at run time.
Change-Id: I7f20c19e5c6ccc7dfb6117aa2d2647b9dec0e549
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
The BLUETOOTH_DEBUG_UART config option should depend on BLUETOOTH_UART
and also be sorted after it in the hierarchy.
Change-Id: I3e049e52c2e353cd0c6f1a99ca8934a289e0cce8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Buffers returned by bt_uart_evt_recv() and bt_uart_acl_recv() may be
NULL in theory. This makes code consistent by checking return value.
Change-Id: Id39def39c8b1c4c6eefc7b2bf01702c54b3e565c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This driver is a very simple UART driver that can be used to implement
a protocol in application. It has no protocol logic and just allow
application to receive and send data over UART in platform independent
manner.
API is designed to minimize number of required memory copies.
Application is able to provide new buffer every time it decides to
consume received data. It is also able to just alter offset and
reuse current buffer eg if data was corrupted or otherwise invalid.
Change-Id: I8d3827fe2e242196e986d0419bc5487357481558
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Eliminates references to the obsolete OS name. In most cases the
name is simply removed, as it isn't necessary.
Change-Id: I32f9e7390e436aec008a9454b72657e129d65152
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Gets rid of places where there is no need to include these files
at all, or places where these files are being indirectly included
due to the inclusion of nanokernel.h.
Change-Id: I7b58148af454b977830c00a6b519a78d0595603b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Gets rid of single-line comments required by a previous set of
coding conventions. These comments provide no value to readers
and just clutter things up.
Change-Id: I2a08b12cf5026253de56979efdfc510e7e68defe
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Closing comments to two CONFIG_MICROKERNEL ifdef blocks incorrectly identified
the ifdef block as NOT belonging to the microkernel.
Change-Id: Iee415e33d7f8a88c41009c5783b37da3a431461b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
build. This patch converts to them to the newer ccflags-y which also
fixes the problem.
Change-Id: I6309439599d4c9cc184f9ecd941bde841982ef07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The atomic APIs are not really tied to nanokernel-specific
capabilities, and can be used by anyone at anytime -- even
during system initialization!
Change-Id: I427954029b4b465127cb5b4b642c2f9968c17d5a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Since the kernel now provides a minimal string library, there is
no longer any reason not to use the standard memset() and memcpy()
APIs.
Change-Id: Iad587ace6f41fd94c9c961d13d9322495a7da1be
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Renaming the directory include/nanokernel to be include/arch, which
better reflects the real nature of the directory and the contents
inside.
Change-Id: I2bc33ebc6715e2f0403227a558279fdf52398ade
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Renaming the CONFIGRUE_UART_PORT macro to UART_PORT_CONFIGURE.
Done to better align with the current naming process, but also to
remove some possible confusion over the macros source now that
the tree has moved over to Kconfig/Kbuild options.
Change-Id: I1a7691d09818c3d529de346e7fa347ce5ac19aed
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Convert the existing non-public random number generation APIs
into public APIs (i.e. sys_rand32_init and sys_rand32_get).
Change-Id: Id93e81e351a66d02c08cf3f5d2dd54a3b4b213c5
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
The timer based pseudo random number generator returns the
number of system clock ticks. If the random number function is
called subsequently in a time less than a system clock tick, it
leads to getting same number.
To prevent this the counter is introduced. Counter gets changed
each call, so it ensures the caller gets different numbers each time
the random number function gets called.
Change-Id: Ibe57e1e7a23909b185623af8dbb7e80647c7ee08
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Remove ARM specific driver that duplicates the platform
independent one.
Rename x86 specific driver to make it unique.
Added configuration options for random and non-random
number generators.
Change-Id: Ie1b277d2927cdfe877650ae09134db7c86becb76
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
UART on Quark platfor, according to Quark BSP Programmer's
Reference Manual, is located in the following order on PCI bus:
COM2 BAR0: 16550 registers
BAR1: DMA registers
COM1 BAR0: 16550 registers
BAR1: DMA registers
So, the driver on Quark platform has to specify BAR (Base
Address Registers) number, the pci_bus_scan() function looks for.
As long as UART is a concole device, calling pci_show() during
it's initialization does not make any output.
Change-Id: I2261fbcc8f9e3ebc22d5307fdcbb18cb649c1224
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Added BAR (Base Address Registers) as a parameter for PCI scan.
Some devices (as UART in Quark) use two set of BARs for different
purposes. A driver may require only one of them.
BARs are numbered from 0 to PCI_MAX_BARS.
PCI_BAR_ANY means ignore the BAR number. Constants are defined
in drivers/pci.h
If device class is not specified as a scanning parameter, and
set to 0, ignore it.
Change-Id: I6b7116c5c6cf9c470ab22bec9eb74842f15b5d99
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This commit removes the UART_INTERRUPT_DRIVEN kconfig symbol from
the console section.
The symbols is already covered as a serial driver symbol and it
is a serial feature releated configuration option.
Change-Id: I4b9438d79eb7850b1293d5d963a75ce00733dbf7
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit standardize the Kconfig inclusion.
Selective sourcing of Kconfig files create conflict when merging
different configuration files (.config files).
Instead, now each kconfig symbols is dependant of its specific
DRV_* driver ksymbol.
Change-Id: I3d20d108a83f00d34067dc334758fd57e51feecf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit add license headers to Kconfig files.
Change-Id: I79e60263b8c7b696463ecc84b8ad411af5415117
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit organizes the bluetooth Ksymbols in:
- Driver symbols at drivers/bluetooth/Kconfig
- Stack symbols at net/bluetooth/Kconfig
Change-Id: I8ebadeb8ac7f8a769d7620e4e44077a05915dc86
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit adds the Makefile and Kconfig files
to support the bluetooth driver in the Kbuild system.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I1f72b13aca8fb098eece04c4f0e1b680639b520f
This commit changes the dependency schemme for DRV_RANDOM.
This fix an issue that prevented the merge of this symbol
as a config overlay.
Change-Id: I734a5814af90b9c57355b78cc43f96f05c1afa96
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit fixes an issue with the inclusion path for the
board.h file for the pentium BSP.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I28172f8071b907aa61660ec8b8009e83cb2aa5ea
This commit adaptes the Kbuild system to the change of location of
the header files for drivers.
Old location: driver/
New location: include/driver/
Change-Id: Ic49d373149ee44d781419c5c68e59408c8ef1c11
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit fixes issues to allow build on ARM architecture.
- It fixes the include paths in Makefiles.
- It fixes the include path for the offsets.c compilation.
- It fixes the linker command. This changes is needed because gcc
ARM cross-compiler does not accept an AT() command without
specifing an address explicitly. This corner case appears
on ARM architectures when XIP is disabled.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ief8b53c4cc154abba7b7827121ec5a56f62b7b26
This commit fixes the include path for quark BSP.
Change-Id: Idb9b5124476c0bec2d16a143407cd9d0c42e0801
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit adds the Makefiles that describe the object-bundles
for the drivers directory and every subdirectory below.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id77cff9cf0ab51827acc2aef32cbed3ec3ad586b
This commit adds the Kconfig files that describe the CONFIG
symbols that belongs to the drivers directory and subdirectories.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I924835ece11a3d597e77a55ace21d724dd5ddbe5
Now that UART drivers are configured internally when it comes to
hardware specific information such as IRQ and registers (or mmaped
registers), bluetooth UART driver no longer needs to do it by itself. It
only requires to select the port it wants to use.
Change-Id: I5a30500f4b6f4155292609d0ed4a758f91930817
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
UART is configured statically into the driver directly and not anymore
in the board's system.c. Thus limiting the information to be scattered
into 2 files instead of 3. Then in future, it will also be possible to
remove driver specific informations from the generic UART API structure.
Change-Id: I001f2a6834df9a41ab395a80e4e39b347d545db3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now for x86 platforms, UART is configured statically or dynamically into
the driver and not anymore in the board's system.c. Thus limiting the
information to be scattered into 2 files instead of 3. Then in future,
it will also be possible to remove driver specific informations from the
generic UART API structure.
Change-Id: I7b7fa37f10f88316a4d375c99de3bbacf152a3e3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Remove camel case style on baseAddr, changing it into base.
Change-Id: Iea1e2d204a38912f4157cc6776a88640e29a04f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using "which" is somehow awkward to use when 'port', on the contrary, is
blatantly more readable.
Change-Id: I355c6e09d7c27b4b07ab6cd10b772a632855516b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using "which" is somehow awkward to use when 'port', on the contrary, is
blatantly more readable.
Change-Id: Id4d3786a192a650ca042024521b94e557a3ec7e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This fixes many issues around PCI enumeration from old API:
- a static internal table was fed with scanning results, thus eating
memory, and worse: due to the limit of its size, scanning for new
classes was impossible unless growing statically the size of this
table --> more memory eaten! Not to mention PCI enumeration is done
once at boot time for driver initialization and that's all, so this
table is hanging around for nothing afterwards.
- one needs first to scan a class, then maybe he will be able to find
his device via pci_dev_find. Where all could be done at once.
- pci_dev_find was not trustworthy due again to the internal table. Now
if the device is not found, one will know it really went through all
the possbilities.
- still let the possibility for hard-coded BARs value on driver side
(thus no PCI scan required). However this is greatly advised not to do
so as BARs might change over a firmware/BIOS update.
Comparison:
old pci_dev_scan: could only filter out via class mask.
new pci_dev_scan: can filter out via a class, a vendor and device ID
(it could easily do the same for Function and BAR index as these are
usually fixed and informed through datasheet)
old pci_dev_scan: was limited in its findings by the size of the
internal result table.
new pci_dev_scan: can proceed through all the buses and devices every
time (there are optimizations to avoid useless work of course)
old results did not tell about the function or BAR index.
new one tells, and the structure has not bloated.
old internal code: was storing a big table of results
new internal code: is only storing a small lookup structure and an
array of Bus:Dev pairs for each PCI class for optimizations purpose.
(though, if needed, we could disable this through some #ifdef)
Usage:
- Have a local struct dev_info
- Fill it with what you want to look for, currently: only class and
vendor_id/device_id. Function and BAR index could be added if needed.
- Call pci_bus_scan_init(): this will reset the internal lookup
structure.
- Call pci_dev_scan(<a pointer to your dev_info>): at first call, the
internal lookup structure will pick up the informations from dev_info
and will try to find out what has been requested. It will return 1 on
success, or 0. On 1, your dev_info structure will be updated with the
found informations. If more devices can be found against the same
lookup informations, just call again pci_dev_scan(<a pointer to your
dev_info>) as long as it returns 1. When 0 is hit, it will mean you
found all.
Change-Id: Ibc2a16c4485ee3fed7ef4946af0ece032ae406e4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Some checkpatch issues were solved by scripts leaving other problems
such as alignment and indentation issues. In order to comply with the
defined coding style the following fixes were made:
- Fixed the function declaration moving the parameters' comments above
the function in accordance to the doxygen format.
- Fixed functions' opening and closing brackets. These brackets should
not be indented.
- Fixed the 'if', 'for' and 'while' statements adding the brackets
around the sentence.
- Fixed comments' alignment.
- Fixed indentation.
The work was done manually and submitted as one commit. I didn't
separate these changes in different commits because they were fixed all
at once. Basically, all errors were fixed in every file at once.
Change-Id: Icc94a10bfd2cff82007ce60df23b2ccd4c30268d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Replace duplicate code and will allow for further cleanup by possibly
consolidating micro/nano code that is currently guarded by preprocessor
conditionals.
Change-Id: I9aa9966c581244646b6ea317ef8b51fef9054dd4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The correct call is nano_isr_lifo_put, but they are aliases of each
other, so that never caused an issue at runtime.
Change-Id: Ibec8e6d3377133e5e67589c5a3ad1b8fb3cc652c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Make serial console interface more robust. Enables interrupts only
when registering input, all memory is managed inside application.
Interface to application is changed to have two fifo queues. One
queue is a free line slots and another queue is keeping entered
lines. This way memory for lines is managed inside application which
provides free lines queue. It is also simpler to manage entered
lines by sleeping on fifo_get on app layer.
Change-Id: I4776c03eddd1e7d880df3b902bd48f5f2c901cad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The coding guidelines make an exception to the Linux kernel style
where all branches, even one-liners, should use braces.
Change-Id: I368930af3033eac15f0152a6671909e401d332e6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ifadb978e31770eb9f4987a3205483aad9a525b86
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ib426dad55e318bb8176c4e7660711db1484cc245
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I6098649b507dae09d4d0f19e712bc0fe3686dfc0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ie0770bd9ff872a9ed2b567baca1514d15fe6c90a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Iee0936e2c92f2979b7e38f33a950108bdaf6f2c1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I1f95ae3c2fd44ae3bd366cd33208551cf5ea6d10
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I5681dc0c33cc42ee48270eab418c99cc923f96b1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Id7391e40bb709f03c58f552d6b783cad834bbdcc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I28cbf0d02600d31548393870e712e6da062048da
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ic28658f68d473b3a163fe5d97f611bfd572f140e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I31e267c1479dfaeeb0fba8c6ba0da45a3c011c0f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I80ccb884f1ffd8f3740cd9298787462485b08024
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
In order to have a better compiler support consolidate
inline assembler code in a set of header files.
If another compiler is used, that supports a different
inline assembler format, asm_inline_<compiler name>.h
heder files have to be provided.
Change-Id: Iecc7d96419efd767a8463933badd4db4a557de5b
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Configuration option BLUETOOTH_DEBUG_UART enables debug support for
Bluetooth UART driver.
Change-Id: I192f380be492df1a52ad212239447b6ee4b50aac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When the 'len' and 'min' parameters passed to bt_uart_read() are equal
the function is guaranteed to always return 'len' (it will keep
looping until that). This patch removes bt_uart_read() error checks
which would never occur in practice.
Change-Id: Icd879f1e15c6d33acc549155aabd24490098ffc5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are some places where it's forgivable if bt_uart_read() wasn't
able to read as many bytes as requested. In other places it's not
acceptable (e.g. when reading ACL or event header). To avoid failing
in situations where we can handle receiving less data than requested
this patch adds a new parameter to bt_uart_read() to specify the
minimum required data amount.
Change-Id: I372e3af7aaa6bfabe14896eb10cc71c3deff94f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If we're out of buffers the UART driver would previously loose sync of
where the packet boundaries go, because it was using the buffer itself
to store and parse the HCI packet headers. This patch modifies the
UART driver to use stack variable for initial header parsing, thereby
being able to always determine how many remaining bytes there are and
cleanly discard the bytes until the beginning of the next packet.
Change-Id: I278f3fc0c983e6a2a6904356ef1af1d25c9f06e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If we get an invalid packet type here the buf pointer will be NULL.
Going to the cleanup section at the end of the function would trigger
a bt_but_put() call which would cause a NULL pointer access. Directly
returning from the function is the right thing to do instead.
Change-Id: I0c18646e0820cf829ef8aa3f77835ba0a14375b5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We may soon want to have a _wait() variant of bt_buf_get, so to avoid
the number of 'get' function growing too large consolidate the
existing get() and get_reserve() functions into a single one. The new
consolidated function also takes the type as input parameter so that
we know this from the very start and thereby plan for the split into
multiple buffer pools.
Change-Id: Ia09448565349def2be9bc08d9510fedd029480b4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll soon want to have dedicated pools for outgoing and incoming ACL
data. To know from which pool to get and put the buffers each buffer
should contain enough information to distinguish the two types. This
patch splits the old BT_ACL type into two new BT_ACL_IN & BT_ACL_OUT
types.
Change-Id: I7d3c05c26d2a70f80fb1229e245aa21673ec378b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of drivers/pci/, the public API headers will be found in
include/drivers/pci.
Change-Id: I577036660383e6bd9c015d6bbbcbc14bf8fb67ec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Only moving the header from drivers/console/uart_console.h to
include/drivers/console/uart_console.h so source file did not need to be
changed, only the defs.objs files to look into include/drivers/console.
Change-Id: I585e16b50d9ffecf01ca9225e80f0e101f62ee4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rename camelCase uartConsoleInit function for consistency with the
rest of the code in serial console.
Change-Id: I519737070538e9c0f52a8d110a3eff68e0185ce2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Following comments received during review rename console_uart_isr to
uart_console_isr for consistency reason.
Change-Id: Ibee1dec40ee19a9095f78969a07ffb73518fffbb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch adds a simple HCI UART (H4) driver that currently maps to
the second UART in the system. The main intention is to use this
together with qemu for accessing the Bluetooth controller available on
the host OS side.
The H4 HCI transport protocol is perhaps the simplest of the standard
HCI transports. It consists of a single byte in the beginning of each
packet which indicates the type of the packet: HCI event, HCI command,
ACL data, or SCO data (which we don't use at the moment).
Change-Id: I225a2a2361fbd7cd4ba82ea1f81ddc1271e9e7c2
Co-authored-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I4e5c9419fe0ccbc4b2990b96fc95c697decc18e0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I5e249e34ee9666666e31db6b9f71fe2abcc22400
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I2e501394b7fa4264d9854659e2dd008e5c94b540
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Iebefec0e02cbb838564dd71fd4424c1adbff31f5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Rename UART_HOSTDRV_INTERRUPT_DRIVEN option to
UART_INTERRUPT_DRIVEN removing old definition.
Change-Id: Id48288db42e97a1ecbd809e259f33359d5a7c9d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Serial console handler when registered allows to interact with serial
line. It can either execute callback from ISR or defer execution to
fiber or task. This will be used in Bluetooth development for tests and
simple interaction with Bluetooth stack.
Change-Id: Ia960b456a75062d614baea324608058d979aa11b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Adding a line after variable declaration in order to comply with
the defined coding style.
Change-Id: Id41af88404bd37227bfd59a2d71ce08d0d6ce005
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>