Fix compilation error when CONFIG_USB_UART_CONSOLE is not enabled:
drivers/console/uart_console.c: In function 'uart_console_init':
drivers/console/uart_console.c:497:12: error: unused variable 'dtr' [-Werror=unused-variable]
uint32_t dtr = 0;
Change-Id: I592724150f86199f6a57354c3246197db2ac7a01
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add support for console output via the USB UART.
Note that console input via the USB UART doesnt work.
Adds a simulated poll method for UART interface exposed by USB.
Jira : ZEP-775
Change-Id: I357827ea52c027eb000baed80225f422df1f3358
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Add spi flash erase boundary check. The erase boundary must be
4K-aligned. So, the flash chip will round down an non-4K aligned
address to the nearest 4K boundary automatically. As a result of
this, the erase area will start from a different address (if the
API caller specifies an non-4K alighed address), even though the
size of the erased area is the same as what is specified by the
API caller. Let's add a boundary check to make sure the starting
address (from the API caller) is 4K aligned.
Correct an error in the highest address check. Because of the
error, the erase api call will fail if the flash's highest
address byte is involved.
Jira: ZEP-1277 ZEP-1278
Change-Id: I8b6be57cc8f636f94e5fe67d5a492841a8555005
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Add the device_ctrl hook to the ADC driver of the Sensor Subsystem,
using the QMSI APIs to save and restore the driver's context.
Jira: ZEP-667
Change-Id: I8b89a875d8185cc4db3c4bfc30ef0f39c6589df1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
This commit updates the spi_qmsi_ss driver by adding save/restore
context functionality for power management, using the corresponsing
QMSI APIs.
Jira: ZEP-664
Change-Id: I9e62729f91c4808eb557d8a64c0f10955f5456f3
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
This commit updates the i2c_qmsi_ss driver by adding save/restore
context functionality for power management, using the corresponsing
QMSI APIs.
Jira: ZEP-666
Change-Id: I36fb18b52edd4dac4c4b6cb98162adbca74800cb
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
This commit updates the gpio_qmsi_ss driver by adding save/restore
context functionality for power management, using the corresponsing
QMSI APIs.
Jira: ZEP-665
Change-Id: I5d8b6050f5b099678b7e6d9144907ea2ce2dda4b
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
convert all sensor drivers to use threads and the unified kernel API and
remove all legacy APIs.
Change-Id: Ica43ea74ecbbf85273f718f182c413a9dcd8abc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move both semaphores and nano_work objects to unified kernel APIs.
Change-Id: Icca8a091063544c451e47201cd8e956b95010513
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add driver for CMSDK APB UART ports. The driver implements RX and TX
functionalities. Data transmission is implemented using polling and
interrupts. The driver default configuration for the port is to use
8bit data transmission, 1 stop bit, no parity control.
The driver exposes a public uart driver API and allows to register up
to five UART devices: from 'UART_0' to 'UART_4'. The driver performs
the required pinmux, the clock control configuration is left to the
platform.
The driver has been verified to work with the Hello World sample
application on a Beetle Board.
Jira: ZEP-1245
Change-Id: I5baf78b7659aae2a574d8e66205e6fd5eb579133
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch adds the support for "runtime" pinmux on ARM V2M Beetle.
The GPIO controllers 2 and 3 are reserved and therefore not exposed
by this driver.
Jira: ZEP-1245
Change-Id: I9637f1a0d2bf6a757e1942160fb170165ffe6a0c
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch adds the support for the board pinmux initialization on
ARM V2M Beetle.
The GPIO controllers 2 and 3 are reserved and therefore neither exposed
nor configured by this driver.
Jira: ZEP-1245
Change-Id: Id5499c5dd887c319730408eeb30f02eeed1c3699
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The driver is currently used only by the ARM Beetle platform.
Jira: ZEP-1245
Change-Id: I6611edd7486a3c6d82d66a9a96c5d4860dad1539
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This fixes the warnings related to the use of deprecated APIs
converting them to use the unified version.
Change-Id: I76d076de27ecdae4af46abf4baac68e2cc1313c0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Start using the k_work and k_delayed_work APIs.
Change-Id: Iac0525a444c5c4e0f28db08844d7b28e17e905fc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Switch to using k_work and k_delayed_work APIs.
Change-Id: I3be18132cc417607adaec0ad711256b94e314c38
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Don't use the deprecated NANOKERNEL init level. The only requirement
for Bluetooth drivers is for them to be registered before the
application main() runs, so POST_KERNEL should be good enough.
Change-Id: I02a8609bf63e9d608b802576214a2e76211b3965
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use the unified kernel API k_sleep() instead of the deprecated
fiber_sleep().
Change-Id: I587d72ca5b53aacc02647b32c3ebceb1d7fe067e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Switch to using the unified kernel k_thread_spawn() API instead of
nano_fiber_start().
Change-Id: I325cf467ae2a52c6aec8fc166397c323929e3013
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use the unified kernel API k_yield() instead of fiber_yield().
Change-Id: I8f52031f52f7ac8783033a51751dc22decdfa59a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use defines from k_fifo intead of legacy API.
Change-Id: Ib8cf0d88240ef145da550b8cf83d2580e7140521
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
All boolean options default to 'n' without the need to explicitly
state this. It's only the cases where we want 'default y' where we
need to state this.
Change-Id: I47dbda62462ea437a2423b8508ea2cc640a22e41
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Restructure the Bluetooth options more logically.
- Both host and controller are now behind the same high level
CONFIG_BLUETOOTH.
- Selecting controller support disables other HCI driver selection, so
the controller isn't in the same list as HCI drivers any more.
- Under the top-level there's a "Custom stack" option, which when
enabled opens up the option of choosing CONFIG_NBLE.
There are various other cleanups and simplifications in this patch as
well, since splitting these up would have been fairly tricky while
making sure all test cases still build.
Change-Id: I5bb715cb9d20201cb8b72fbd149c8a09a4b2d7d2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add Low Power States support to the power shim layer
and show the usage in the quark_se sample.
States are defined as follow:
- SYS_POWER_STATE_CPU_LPS: SS2 with LPSS enabled
- SYS_POWER_STATE_CPU_LPS_1: SS2 with LPSS disabled
- SYS_POWER_STATE_CPU_LPS_2: SS1 with LPSS disabled
Jira: ZEP-994
Change-Id: Ie4b93f6e539cb53fc035be00280b66b2cb0d9fea
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
Change the included kernel header file from nanokernel.h to
kernel.h
Change-Id: Ie58174524880ec933191ee1fd46e6c1ba4cd0cc9
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Change the included kernel header file from nanokernel.h
to kernel.h
Change-Id: I754b883d1769517e908e88096e7704666ec12275
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Change the included kernel header file from nanokernel.h
to kernel.h
Change-Id: I76cc952316430d618ea3ecb526d9bc2a99f04cef
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.
New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.
Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.
Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This suppresses warnings for platforms where SERIAL can't be provided.
All the platforms that these drivers are interesting for already
default to SERIAL=y.
Change-Id: Id692f99e018009b30903db8a2c046a6086be01c2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
USB class drivers may need to offload some work from
upcall interrupt context to a background fiber. This
requires some way to defer taking more data from host
till the offloaded work completes. Two APIs are added to
achieve this.
Further USB class drivers sometimes need to set STALL condition
on end-points to signal errors to host.These too are
added.
Change-Id: Ic973522c3394e23d7f9c4c67affc0cd050afc20f
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Add type cast to prevent overflow.
In the pwm driver function pwm_qmsi_get_cycles_per_sec(),
there is a multiplication which takes ticks_per_us (32 bit
unsigned integer) and USEC_PER_SEC. Practically, overflow
will not happen, since the sys clock is not that high. But,
it can trigger an overflow alarm by automatic tools.
Change-Id: I67e6f6a4763e62f6674fcdd364880d93829e739e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Add delay to wait for new configuration to take effect before
returning to API caller. It takes time for any change to rtc
configuration to take effect since rtc runs under a much slower
clock.
Of course, we do not have an equation for best wait time.
The value is based on the test results on arduino 101, minfield
and quark se c1000 devboard(some margin added).
Jira: ZEP-991
Change-Id: I0dcee3c5809963dcd418186b85e3473427a4d526
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This KSDK flash shim driver supports the device in the FRDM K64F
platform (enabled with this commit).
WARNING: the driver disables the system interrupts for potentially
long periods of time. This is required to avoid Read-While-Write
issues since most platforms run in XIP mode.
For more detailed information see the link below:
http://cache.freescale.com/files/32bit/doc/app_note/AN4695.pdf
Change-Id: I70f8d09080251033ce2f45be0c2eb95c19fded08
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
It's unused anywhere and unlikely to be in the future.
Change-Id: I57926e91da7d31ef6ddda4f86e6dac103dbfa176
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Update to QMSI 1.3.1 release.
The only build fix needed was due to the split of the I2C ISR on
qm_isr.h .
Change-Id: Ide7a1537572c72981ec3283dc5cf0d543d9ac7d1
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
The uart_k20 serial driver incorrectly assumed that all instances of the
UART peripheral are driven by the system clock, when actually some
instances are driven by the bus clock (which usually runs at half the
system clock). This caused incorrect baud rate calculations for UART
instances driven by the bus clock (UART2-4).
Change-Id: I38041781cdee146912bb5167e7c71d6416b966b5
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
These pins are routed to the arduino header, and configuring them for
UART signals allows us to use the frdm_k64f with a frdm_kw40z shield
board for bluetooth.
Change-Id: Ie30916409844b1dc1c6e1280d5a755a6dc42e418
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Making a reference to the common work queue code should not necessarily
drag in the system workqueue, since it is possible to use a workqueue
that is not the system workqueue. This is done by moving the system
workqueue into its own code module.
Moving the system workqueue to its own code module allows removing the
NANO_WORKQUEUE and SYSTEM_WORKQUEUE kconfig options, and compiling the
common workqueue code and system workqueue all the time. They are only
linked in the final image if a reference to them exist, same as the
other kernel modules.
Change-Id: I6f48d2542bda24f4702e7c2e317818dd082b3c11
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Move controller code from drivers/controller to
subsys/bluetooth/controller.
Change-Id: I73f675188485aa3267507bad7647796e593a3da0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Move the Bluetooth host stack from net/bluetooth to
subsys/bluetooth/host. This is preparation for having both host and
controller under the same root, i.e. subsys/bluetooth/.
Change-Id: I3bc796f7e331fca0c485f3890d62b9c03e027b96
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The pinmux configuration is done during board initialization.
This was validated using the following Zephyr apps:
- samples/hello_world
- samples/philosophers
- samples/drivers/uart
- samples/shell
UARTA0 is currently supported.
Change-Id: I85727c622d4d42183cc9f2f8b43d653e245dd17e
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
The shell is not a kernel feature, it is more of a subsystem.
Change-Id: Iaba60b2086ddfe77af427d70b8fc8d06a8bebe14
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add kernel functions to kernel module and make it part
of the shell sample.
Change-Id: If5e8ff8ce7b8edbbb8d62509964700b007eaf88b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add the definition required to change the pinmux of port H.
Change-Id: I3cc107f9151db4d38fe2cace90cd02d5955a2717
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some STM32 have more than 32 EXTI lines. Add support for them.
Change-Id: I9a2561664d0d81664acf268bb2257dd99b596a44
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Update the suspend and resume hook after changes in QMSI and the resume
from sleep flow.
Change-Id: I14637b5a29b1942740012243fb8217803cf27e9b
Jira: ZEP-1004
Signed-off-by: Iván Briano <ivan.briano@intel.com>
This commit updates the i2c_qmsi driver by removing the temporary Zephyr
save/restore context implementation and using the new QMSI APIs.
Jira: ZEP-996
Change-Id: I9fbd563f214b757f3435037b3e24da4bcf08da14
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
This commit updates the gpio_qmsi driver by removing the temporary
Zephyr save/restore context implementation and using the new QMSI APIs.
Jira: ZEP-999
Change-Id: Ic7b80a8f86baa7a6be11c93bbdebb18a102b0221
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
This commit updates the rtc_qmsi driver by modifying the temporary
Zephyr save/restore context implementation and using the new QMSI APIs.
Jira: ZEP-1000
Change-Id: I6f77fe086ea6415a5bc2b2b21874c8a573fd7b44
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
Signed-off-by: Iván Briano <ivan.briano@intel.com>
This commit updates the spi_qmsi driver by removing the temporary Zephyr
save/restore context implementation and using the new QMSI APIs.
Jira: ZEP-997
Change-Id: I70c6838025253d13d6ebe690ec90dfc1b18bfcea
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
This commit updates the pwm_qmsi driver by removing the temporary Zephyr
save/restore context implementation and using the new QMSI APIs.
Jira: ZEP-1008
Change-Id: Ic92feeb906539f506eb521b7302f8cf5af3edc64
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
Remove the Zephyr implementation and
update the uart_qmsi driver to use new QMSI PM APIs.
Jira: ZEP-998
Change-Id: I418e6384c16e374e9062820e12648a2d524a312d
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
Remove the Zephyr implementation and
update the wdt_qmsi driver to use new QMSI PM APIs.
Jira: ZEP-1001
Change-Id: I4d0a2e3b8cf402b457ee0454650080d406eb6d0a
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
For AON peripherals on Quark SE C1000, an API is needed
to retrieve the interrupt status after wake up.
This enables the application to know the wake source before
enabling again the interrupts.
Add this API to the rtc as this is a wake event
on Quark SE C1000.
Jira: ZEP-1188
Change-Id: Id850ce405eb3f4857be720201e462ea8e24a334f
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
For AON peripherals on Quark SE C1000, an API is needed
to retrieve the interrupt status after wake up.
This enables the application to know the wake source before
enabling again the interrupts.
Add this API to the gpio as this is a wake event
on Quark SE C1000.
Jira: ZEP-1188
Change-Id: Icc4aa6617bf18402b7e5dc3aab779ec2964e1c5b
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
For AON peripherals on Quark SE C1000, an API is needed
to retrieve the interrupt status after wake up.
This enables the application to know the wake source before
enabling again the interrupts.
Add this API to the aio comparator as this is a wake event
on Quark SE C1000.
Jira: ZEP-1188
Change-Id: Ifa08353270910a363c15a4203770ff3e7857572b
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
For AON peripherals on Quark SE C1000, an API is needed
to retrieve the interrupt status after wake up.
This enables the application to know the wake source before
enabling again the interrupts.
Add this API to the periodic timer as this is a wake event
on Quark SE C1000.
Jira: ZEP-1188
Change-Id: I79976230bccb1f970b6856d28bf7428175167828
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
In ST CMSIS files, FLASH_BASE does not mean base address of FLASH register
Instead FLASH_R_BASE is used.
stm32f1 clock control driver is updated to be compatible with this naming.
Change-Id: Ic4fb49c60c392e15fd12c69266baf4c686bd343b
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
There is no need for copying command string to temporary variable on
the stack.
Change-Id: I41fd2582600908ac523b87c83a426eef27d1c454
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This fix commands tab completion and make it similar to Linux shell
completion:
- single match complets command and add space at the end
- multi match lists matched commands and complete common part
- no match does nothing
Change-Id: Ib2d90889c79e8d35a78b8847d2b9e124cdc00a6c
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add the necessary infrstructure to support power management for the
QMSI Flash driver. If deep sleep is supported, this driver supports
saving its context to be restored on resume.
Jira: ZEP-1006
Change-Id: Ied88e86d13ef9e4e62bd6ac9d8454d9a9a3d2962
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Add the necessary infrastructure to support power management for the
QMSI DMA driver. If deep sleep is supported, this driver supports
saving its context to be restored on resume.
Jira: ZEP-1005
Change-Id: I49f1f985eb0f250c777c6950178715fb794db537
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The GPIO and AON GPIO ports are available to both the x86 and ARC
cores, but the driver always assumed only the x86 at the time of
configuring interrupts.
Use the available macros to set the correct values independently of
which core it's being built for.
Jira: ZEP-1030
Change-Id: I310afcc48780fbe1cac9dc3368a6de11bd797fda
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The SoC level peripherals are accesible by both cores, while the SS
ones are only available to the sensor subsystem. Since the ARC core can
make use of both drivers at the same time, we need to be able to
differentiate their configuration values somehow.
Also disable the SoC GPIO for the ARC by default, as it still needs
more changes to be usable.
Jira: ZEP-1030
Change-Id: Ic5415c404ecd32a3e560467b6f5eaa873a515d72
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Use the macros provided by QMSI (or by ourselves, when QMSI doesn't
have them yet) to register interrupts independently of which core it's
building for.
Change-Id: I83fd7e42598b45aef8132316906a3bff291dfe92
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The callback from the QMSI driver now can take a data pointer to pass
to the given function, so use that to pass the device to our callback
instead of defining one function for each supported port.
Change-Id: I82d863314e0443b7c4a12d4a9ad763b9634ca8e2
Signed-off-by: Iván Briano <ivan.briano@intel.com>
If application prompt handler returns NULL curently selected module
prompt should also be checked before of printing default shell prompt.
Change-Id: Iba9c191041951c31036766b1cc8070b040655445
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.
Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.
Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In the unified kernel legacy layer, both these functions are
implemented as #defines which can't be put in a struct.
Eventually this driver should be updated to use new APIs, but
this will get it to at least build which is the priority.
Change-Id: Ic5dfb5b85ff3bd0d1646f542340642549a2b2e05
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This allows to delete character after cursor.
Change-Id: I9acc5e1edeb688ea4ec36e91aef69ecb5f5f6354
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to navigate to begining and end of the line easily.
Change-Id: I3a839a0499961d55574a310c65811dd2fe048703
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
In 3 of our UART driver implementations the ISR is exclusively
used and enabled for the RX path. The existing logic was
susceptible to a stall situation where a polled out transmission
would be interrupted by a reception and then the ISR code
would loop forever due to the TX event being signalled (although
the interrupt itself was disabled) causing the ISR to keep
looping for an RX interrupt.
Change-Id: Ic379e58b1c974aca3cee37d2d81f12c3726fb160
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
These options were only needed for a MyNewt-based nRF51 firmware on
these boards (the MyNewt BLE stack is called Nimble, hence the
prj_nimble.conf sample config files). With a Zephyr-based nRF51
firmware these options are no-longer needed, so it's not appropriate
to have them default to enabled. Instead, if they are needed, require
the app-specific configuration to enable them.
Change-Id: Iefbee4d97590af4e11bcedea05fe61f32a147b83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
qm_interrupt.h is not needed.
Change-Id: Ia9e62db9fc39ee7a8a36e087eb447cbc4a419817
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Implement qmsi shim driver based on the new API interfaces.
Recently, a RFC was sent and discussed on the re-design of
PWM interfaces. A API change was already posted.
The API new design will deprecate all existing APIs and three
new APIs will be added. The new APIs are pwm_pin_set_cycles,
pwm_pin_set_usec and pwm_get_cycles_per_sec. Pwm_pin_set_cycles
and pwm_pin_set_usec will rely on two driver functions to set
the period and pulse width. This change is to implement the
driver functions pwm_qmsi_pin_set and pwm_qmsi_get_cycles_per_
sec.
Jira: ZEP-745
Change-Id: I39bb973f8c5b19cb7dbd496d10e7f0b6735efc12
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:
- QM_SCSS_INT is renamed to QM_INTERRUPT_ROUTER;
- every member of QM_INTERRUPT_ROUTER was renamed as well;
- QM_IRQ_* renamed too, mostly added _INT at the end;
- some isr functions were renamed to keep their names consistent;
- build for x86 needs to define QM_LAKEMONT, as QM_SENSOR was for ARC.
Change-Id: I459029ca0d373f6c831e2bb8ebd52402a55994d1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Add support for the STM32F401 chip on the board
Change-Id: I96c0799f3658ecea096fa5971bce9faf21919ee1
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Change the clock accessors to a tuple of bus ID of the subsystem and enable
bits for the device - it is clearer to read than the opaque pointers.
Change-Id: I9ae73c222c04adac4cf2bc06e97f4ec199bdac3c
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
STM32F401 allows for upto 16 alternate functions on each pin.
Change-Id: Ib1c14fd31abaa2b05a5ab0f7bd1b4a4748f10f84
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Implements MCU-specific GPIO input interrupt integration. Added
definition of System configuration controller as well as its needed by
the GPIO code.
The SYSCFG controller is used for system-specific configuration such as:
- remap the type of memory accessible at address 0x00000000
- manage the external interrupt line connection to GPIOs
- configure the I/O compensation cell
Change-Id: Id2ebfbd1b21e77be76406d1cd6cd5d4989e9e2fa
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Based on the STM32F10x driver. Removing old code as we need to use the
bus number when dealing with 4 possible peripherals.
Change-Id: Id0263aa008e9b039ff9a00339e5622e289ffdf99
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch adds support for the STMicroelectronics STM32F4x family in the
STM32 MCU line. Configuration is included for the STM32F401RE MCU.
Acknowledgements to Pawel Wodnicki's earlier submission from February that
was used as a starting point for this port. In the end, we rewrote all of it.
Change-Id: I9797c282ac3c0cc66a63b9d34821de95df537ef6
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
The correct layout for help text is <TAB><SPACE><SPACE>.
Change-Id: Ief4167e75709e358089f701041ac06386351f423
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Fix issues with tab vs space as well as missing license/copyright
header in hci/Kconfig.
Change-Id: Id766308dc8eda2d598ea749e5e0d2166014db929
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The bt_driver API was created when Zephyr only had a Bluetooth host
stack, but no controller-side functionality. The only "driver" that
was needed for the host was the HCI driver, and hence "HCI" was
omitted from the name.
With support both for host and controller Zephyr will be getting more
Bluetooth driver types, in particular radio drivers. To prepare for
this, move all HCI drivers to drivers/bluetooth/hci/ and rename the
bt_driver API bt_hci_driver.
Change-Id: I82829da80aa61f26c2bb2005380f1e88d069ac7d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Since RSSI events trigger interrupts and signal the RX path
semaphore with a resulting event lenght of 0. Due to this
fact the Controller HCI driver was leaking (i.e. not freeing)
those events, grinding the recv_fiber to a halt.
Issue identified by Szymon Janc.
Change-Id: I3e259b2823717b523ac331f8f787252414fb9290
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Report the HCI version supported by the Controller as 4.2,
since it was set as 0 (1.0b) and this confused certain Host
implementations, such as BlueZ.
Change-Id: I809721ee9c2b55e77e6a3ca63688c802a9ffa0ba
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The grove sensors use the sensor interface, so make them depend
on it just like the other sensors.
Change-Id: I9b62a3fa26f54dd683c65ca154c1af7c7c92772f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Set DMA transfer to QM_DMA_TYPE_SINGLE for all channels.
This keeps the previous behavior as of QMSI 1.1.
In the future, we may consider adding support for using other DMA
transfer types. This, however, will demand adding new API to Zephyr's
dma.h .
Change-Id: I8071555190662a72279069ff9fce3d4b9e861629
Signed-off-by: Maciej Kuc <maciejx.kuc@intel.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
STM32F4 requires the alternative function config to be set, so just
initialize that as part of the gpio configure call.
Change-Id: I33a4a8efec59c5ebe7dc3f3580f0dd2bf7ded7f4
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Adds basic sensor driver support for the NXP FXOS8700 6-axis
accelerometer/magnetometer. Currently this driver supports
accelerometer-only, magnetometer-only, and hybrid (accelerometer +
magnetometer) modes, as well as 2g, 4g, and 8g accelerometer full scale
ranges.
This driver does not yet support any sensor triggers such as the data
ready trigger, or runtime changing of sensor attributes.
Datasheet:
http://cache.nxp.com/files/sensors/doc/data_sheet/FXOS8700CQ.pdf
Origin: Original
Jira: ZEP-721
Change-Id: Iff0f751c737196f60d5c5d3448631b57093ece34
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Change-Id: I6e3c7e4e420d9b9c55bbb49cf6f13b6e09ec4bb7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Correct the text of the SYS_CLOCK_TICKS_PER_SEC #error diagnostic to
reflect the actual logic of the gate.
Change-Id: I28ad324b0b246e4a8de29b64483a97577a1b6fb7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The config variable WDT_0_IRQ_PRI is intended to be generic across a
range of watchdog drivers, however it has no default value which means
that if CONFIG_WATCHDOG is enabled, but no driver is provided for a
specific board the the configuration will fail. For now, make
WDT_0_IRQ_PRI depend on the only driver that uses it.
Change-Id: I54708d66ac8fbc2ef657a1ef4510eb5e7a2cff28
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The Ready To Send (RTS) hardware flow control signal in the nRF5
UART was being configured as an output with a pull-up on it.
This was seemingly causing certain issues with btattach on Linux
and it's not done anywhere else.
Change-Id: Id792d967b043ea7a796d6598500a733c092dbc2c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The various other KSDK shim drivers follow the name pattern
<DEVICE>_KSDK, renaming the RANDOM driver to follow the pattern.
Change-Id: I89409083f94c0990129726e70a964b02e0dc2802
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The baudrate calculation present in set_baudrate() is
causing the UART to emit inital bytes incorrectly, for a
reason currently unknown, but directly related to the fact
that __aeabi_uldivmod is being invoked.
Since the nRF5x Product Specifications do not provide a
standard formula to calculate baudrates and instead list
a predefined set of divisor values, we opt here to use the
official values and remove the attempt at calculating them
manually.
Change-Id: Ic3ff42ea6d065e9a1d26a5350ce5bf5ad661160a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When user wants to set all the PWM ports in one call,
pwm_qmsi_set_values() should call __set_one_port() for
each PWM port. The current pwm_qmsi_set_values() will
return after setting the first PWM port. It's illogical.
Change-Id: I5776bf636c2dc58683c629e26f72fca335e781db
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
This refactor is in preparation for making driver API structures
const.
The console driver provides a mechanism to install an input and an
output hook function. These are primarily used by the onboard
gdb-server. The output hook is entirely implemented within the
console driver.
The input hook is partially implemented in the top of the uart driver
and within the console driver. The hook function itself is installed
in the uart API structure, but is invoked only by the console driver.
Installing the hook function directly into the uart API structure
prevents the API structure being const. There are two approaches to
fixing this:
1) Implement setting of the input hook in the same way as
uart_irq_callback_set().
2) Move the input hook entirely to the console driver.
We implement the latter. This approach has two benefits, first it
removes the need for every uart driver to implement the behaviour and
second, the current placement of the callback function in the uart API
seems odd given that the callback is only invoked by the console
driver, never by a uart driver.
Change-Id: I258b312d3055df1c2bdeb896bd4f4f39c40838f7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The variable is defined as SYS_LOG_GROVE_LEVEL in Kconfig..
Change-Id: I0f77336df2293694ece71f4f5fccb5283f6dc58c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The name read16() collides with other definitions within Zephyr. We
don't actually use this function here, so remove the definition. Fix
various other unnecessary name exports while we are here by adding
'static'.
Change-Id: I7eee8c527a62fea4e6e1bdae8a4874d8ce66596c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The read16() name collides with other definitions within zephyr. Make
it static and fix a few other unnecessary name exports while we are
here.
Change-Id: Id72d44a6b84b8d72c7ba2d0f34b29dbc1d02f2b6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The exact pin numbers for the nRF5 UART configuration is
board-specific, so the Kconfig default values should be in a
board-specific file.
Change-Id: Ibaacde292db191221e32b3626c68bf972dd26016
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In order to avoid type conflicts make sure that ISR_HANDLED
is defined. This makes the ISR the correct type.
Make sure that the pointer for the unused argument for ISR
is of the proper type (NULL).
Change-Id: Ia1873f32d2e2174085f929e318a780a1b2574785
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Make default value compatible with both nRF51 and nRF52.
Change-Id: I65dafbdf8518103becdd7388e9c0195ef1c4460d
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Default IRQ priority changed to 1 to so it can also be compatible with
nRF51 (Cortex-M0 allows up to 4 priority levels but Zephyr needs the
first two for the OS).
Change-Id: Ie57a729f5d932f020a7d1d7e55cf3741f1ecfbab
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Integrating the IRQ definitions for both nRF51 and nRF52, and defining
the set of IRQ values that are common to both.
Also switch the controller, uart and clock drivers to use the common
header definitions.
Change-Id: Id6816d7a97720896cfe4df83656fb8b1f8fb01fa
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
It's not FMSTAT<0/1> but FSMSTAT<0/1>
Change-Id: I836cf001b7baefe86df67f13a8759ea4e697a28e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Put the clk_perih_enable() call outside of the switch statement so it
actually runs.
Jira: ZEP-1048
Change-Id: Iee8efb4430d37dc74ce48f249bbf58d53125b520
Signed-off-by: Iván Briano <ivan.briano@intel.com>
As part of an effort to closely integrate with Zephyr OS,
removed the custom implementation of clock control
interfaces used in controller code and use the driver model
in Zephyr OS.
Jira: ZEP-897
Change-id: I03efbff471e42b9bd9832818dd20dd5998a60227
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This way the application can reuse the same callback for multiple CCC
since it can track what CCC is affect by checking the attribute pointer.
Change-Id: I608da643aea07de26b65d67e6db3268d717d0f53
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
nRF51x SoC is based on ARM Cortex-M0 and running at 16MHz clock.
Due to Radio ISR latency restriction, the CPU utilization within
BLE tIFS of 150 us should not be more than the time radio h/w
takes to get ready. In order to keep short CPU utilization
inside tIFS encryption procedure has been spread over several
connection intervals. In comparison to possible encryption setup
in 3 connection intervals, this commit introduces a encryption
setup being done in 5 connection intervals so that max. CPU time
is well within the permissible limits by nRF51 h/w and tIFS.
Change-Id: I8971d69675836b9e18bea59d95951e0dfe8a7d2d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Move to utilizing an inline function for getting the base addr of the
external interrupt register region. This is in prep for support more
than 32 external interrupts.
Change-Id: Ifdaad67703068395a7749543ef68435435e7c9ba
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The HDC1008_I2C_ADDR config option should be available only if HDC1008
is enabled.
Change-Id: I0d1813512396faefb609527ba5df2a0c4ea159a9
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Change e4b89571aa renamed the variable
to an undeclared one, without breaking verify but daly breaks.
A local variable of type spi_intel_data was missing on this
function.
Jira: ZEP-1095
Change-Id: Ie410933c2472378d4a6f24d6ca932ac203e3b08c
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Mutable driver state relocated from config_info to driver_info.
This driver is unused by any board, nor can it be compiled for any
board. Hence this patch reflects the mechanical change that should be
made to the driver in order to support a const config_info, but the
patch has been neither compiled, nor tested.
Change-Id: I28597962e81d6e02f1f4befe48c3a3324691cfeb
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Mutable driver state relocated from config_info to driver_info. This
driver supports PCI enumeration. We drop code that attempts to update
irq_num based on PCI enumeration because the interrupt found by PCI
enumeration must always be the same as the statically configured IRQ
number.
Change-Id: I5580b0ba95635696a825fe66dbf16259c54d5ba8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
PCI enumeration modifies pci_dev and base_addr at driver
initialization therefore these objects move from config_info to
driver_data in preparation for config_info becoming const.
We drop code that attempts to update irq_num based on PCI enumeration
because the interrupt found by PCI enumeration must always be the same
as the statically configured IRQ number.
Change-Id: Ibfefa851d2836d524b8151ed0108ecf9de2cd3a3
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
PCI enumeration modifies pci_dev, base_addaress at driver
initialization therefore this objects move from config_info to
driver_data in preparation for config_info becoming const..
We drop code that attempts to update irq_num based on PCI enumeration
because the interrupt found by PCI enumeration must always be the same
as the statically configured IRQ number.
Change-Id: Id5af682dac112ec6dc6e4aa14b655e0047972d38
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Mutable driver state relocated from config_info to driver_info. This
driver supports PCI enumeration. We drop code that attempts to update
irq_num based on PCI enumeration because the interrupt found by PCI
enumeration must always be the same as the statically configured IRQ
number.
Change-Id: I97198ae9603505606a872b07824d6c61688f0ced
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Pending bit gets cleared by writing 1 into it, so don't use the previous
value and just write the line bit offset instead.
Change-Id: I4c88016bf53327b2670a144d3b994945f26fc002
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>¬
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Since dd5e90ec the device_get_binding call returns NULL unless the
driver_api is set by the driver. Since the exti driver only uses an
internal struct to store the callbacks, remove the need for the device
binding call from other drivers (e.g. gpio).
Change-Id: If0b733c27754108118d87ef02640311f0535ab57
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
The field is "NF: Noise detect flag". Given that every other field name is
faithful to the manual, do the same for NF.
Change-Id: I300663e6d5016bf28071d2a1926ec73682ae3d01
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
In QMSI 1.2 API, the RTC divider value for the prescaler can now be set
on runtime. This is done through a config parameter for the qm_rtc
driver.
Fix the rtc shim driver by using the value defined in rtc.h as
RTC_DIVIDER.
Change-Id: I5ab61a5a1a3debca103f2782e0ac584938dc91e1
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:
- QM_USB_BASE is renamed to QM_USB_0_BASE;
- parameter int_en from qm_uart cfg struct was removed;
- driver's folder now has a new structure, fix makefiles accordingly;
- QM_WDT_MODE and related renamed to QM_WDT_CR_RMOD;
- QM_SCSS_AON renamed to QM_AONC.
Change-Id: Iffe9c66b7a3f2fe64418326e20ff0894149b3044
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
The hexiwear board has a k64 SoC, so we can reuse the k64 pinmux driver
and just add a new pinmux table for the board.
Jira: ZEP-716
Change-Id: I936691b3578db298014f44fe18433d7943b431f3
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The k64 pinmux driver can be used for any k64 board, not just frdm_k64f,
therefore renaming the driver accordingly.
Change-Id: I45e96d4a5ff6aa859d0f57fe098e44a8ae5283d1
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Those options are not being used anywhere, so remove them and avoid some
confusion.
Change-Id: Ia3767dbd2432851dfae4b1e996f02ed1b2450505
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The Atmel SAM3 serial driver poll in function checked
for new characters incorrectly.
Change-Id: I9024a991404bf949226634c9f6c6ea507577cff1
Signed-off-by: Justin Watson <jwatson5@gmail.com>
In the Nordic Semiconductor's nRF5x series SoC clock control
system can source the system clocks from a range of internal or
external high and low frequency oscillators and distribute them
to modules based upon a module’s individual requirements.
In this commit the implementation adds support for 16MHz
peripheral clock, 32.768 kHz RC oscillator, and 32.768 kHz
crystal oscillator clock sources.
16MHz peripheral clock is required to use the 2.4GHz Radio
peripheral. 32.768 kHz RC or crystal oscillator clock source
is required to use the real time counter peripheral.
Jira: ZEP-896
Change-id: I1a1e22322a5a26b587f3e27bb979e6296987ac1c
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Provide a network driver wrapped around the KSDK ENET and PHY
drivers.
The driver performs one shot PHY setup. There is no support for PHY
disconnect, reconnect or configuration change. The PHY setup,
implement via KSDK contains polled code that can block the
initialization thread for a few seconds.
There is no statistics collection for either normal operation or error
behaviour.
Origin: Original
Change-Id: Ia0f2e89a61348ed949976070353e823c178fcb24
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The bt_storage_clear() function doesn't modify the data behind the
addr parameter, so the pointer should be decared const.
Change-Id: Icce676f9df80bac26ba4877bb63752559a43339f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
PCI enumeration modifies pci_dev and port at driver initialization,
these objects move from config_info to driver_data in preparation for
config_info becoming const.
This driver shares a unified uart configuration structure with other
uart device drivers. The structure uses 'union' and the preprocessor
to customize the structure to the drivers specific requirement. There
appears to be no compelling reason why all the uart drivers should
share the same (customized) config_info structure. In order to
re-organize the structure for this driver to get config_info const, an
ns16550 specific config structure is defined and the driver switched
over from the generic uart_config.
Change-Id: I31932d811f623a9370b69903114ae97b15d65886
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Move the RW channel_period object from the driver config structure to
the driver context. Remove the now empty driver config structure.
Change-Id: I38df7877f1bfb9bb55bcd61e7f35cebb6e4916bd
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The callback list within the driver config is updated dynamically
hence the list itself cannot be const. Create a runtime context
driver data structure and relocate the callback list to the new
structure.
Change-Id: Ied20846e6a78e43967239afa7797456a9abd8548
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I1ca9e999840a6ad81dc369b56b1da554f3c1cb49
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I0257e242a2d3bc4e353a3477364a4d9a7fb72b82
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I71bcfa48b31934bc683a344d40bb03f5247bbbec
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Using AON for GPIO kconfigs is very specifc to quark se, there
is no need to make this special for this platform. Use the
existing scheme instead.
Change-Id: I946431490380dc0f537d6056277a94c9c9c80fed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
zephyr.h includes nanokernel.h which includes cpu.h, so make it
simple and just include nanokernel.h. zephyr.h should only be
included in applications.
Change-Id: I11a9ad8608d23af4f2a40a97eb71c09516c3399b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I2256c0f0bff5100e756709c9f99887af70bac661
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I977979bc86830768101ab9a2ca1928823ae994df
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
The drivers config structure initializer sets sys_clk_freq statically.
The runtime repeated setup of sys_clk_freq is superfluous, and
inconsitent with const driver config structures.
Change-Id: I115e2b70b193b567de83132f3984e48b2dded0a2
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I8ecc10b50e23d2dbe987e3318bac09e235b1e1da
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: Ia2203f134c8d11f52a91e6245e7bdbb26f5a9e92
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Make pointers to struct config_info const in prepration for a const
config_info.
Change-Id: I28789a7f1f26e4a0d499f5a89a567ae8c61eae51
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Change the Kconfig parameter type for the I2C slave address from
string to hex. The code that consumes this configuration parameter
expects an integer and fails to compile when presented with a string.
Change-Id: I493002ea6f1266344cac863ac305e59e93a5b1fe
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Don't use the previous reg value when setting up just one specific pin,
as it can have a side effect on other gpio pins.
Change-Id: I60e69950a72446a6fa7087b13dbcecf6ae4b15e4
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Set the value for the I2C address directly and use only
one per sensor.
Change-Id: I24d06a964e8e372eddf262b70fe5d9854a04563c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make sure we are connected to the right device.
Change-Id: I09e696563191392d23a316ad065bb7e320df76bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
NRF_GPIO_BASE can be used by both the nrf51 and nrf52 families, as it
gets defined by the nrf5x.h header files.
Change-Id: I8e6b265d9ce94551389ca170f105a53c88d58c68
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Sensors are end-devices and usually nothing depends on them,
so set a global priority for all sensors and use it instead of
individual values per sensor.
Change-Id: I5847411e783ef8a8517f0ab1d8234810513707b4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Generalize the LOG_ETHERNET_LEVEL configuration parameter for use with
multiple ethernet drivers.
Change-Id: I26bc2189c8cf79db19f59e8082caec03b0d9c7b8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
i2c_quark_se_ss driver is deprecated and replaced
by i2c_qmsi_ss. So remove i2c_quark_se_ss definition.
Change-Id: Idcc6a7f01ffae626ae7d5f9966eac67be78599af
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
The new device control API added a 'device_power_state' variable to the
driver's data structure to keep track of the current power state set
for a device. This member variable is conditionally built into the
runtime data structure of each driver, but in some cases the whole data
structure is conditional on its respective API_REENTRANCY config
variable.
In those cases where the runtime data was previously used only for
reentrancy protection, the runtime data pointer used for device
initialization is NULL, and when power management is enabled, this
invalid pointer ends up dereferenced to get the device_power_state
member.
Make the declaration of the runtime data dependent on any of its
conditional members, and NULL only when all of those settings are
disabled.
Change-Id: I4f41e00ad8551a096db639e31d33f43752b6672f
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Add typecasting in dma QMSI shim to avoid compilation error.
The DMA API and QMSI have their own definitions for the
dma configuration parameters, such as handshake_interface,
handshake_polarity, source/destination_transfer_width,
channel_direction, and source/destination_burst_length.
When a API is called, the shim driver will assign values
for the above-mentioned parameters to the configuration
variable(based on QMSI's definiton) from the values in the
variable provided by the caller based on API's definition.
Even though all these parameters have similiar definition
and values in both the generic API and QMSI, QMSI uses
its own names which are different from those definied in
the generic API. Without typecasting, the parameter value
assignment will cause compilation error(even though error
only happens for some compiler).
Jira: ZEP-1031
Change-Id: I147c690799514bd611cd9f88316f44346e095359
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
As part of an effort to closely integrate with Zephyr OS,
removed the custom implementation of IRQ interfaces used
in controller code.
Jira: ZEP-841
Change-id: Ie427f45aeecad51053112371526cb7dc4817248f
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Code under SCHED_ADVANCED macro in ctrl.c is used to
disable advanced radio time space scheduling calculations
used for placing non-overlapping observer and master roles;
to populate connection parameter request/response PDU
fields, and autonomous generation of slave initiated
connection parameter requests.
This macro shall always be enabled for optimal and correct
operation of the controller, It shall only be disabled to
debug failures in other part of the controller, to rule out
this code's influence, if any, on the failure being
debugged.
Change-id: I04e5f837ef0a5658361bd3668f583f1e13504570
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Place __packed at the end of the structure definition in line
with the rest of the Zephyr codebase.
Jira: ZEP-732
Change-Id: I25aa731cbd188a6e23ca2035eb22fa919295bb25
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Leftover from previous commits, this macro is not used anymore in
the HCI implementation.
Change-Id: I376c92a6b68432d2ff818ea25e68f087131e8479
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use the net_buf structure directly when populating incoming
ACL data or asynchronous events. This ensures that no additional
memcpy() operations are required and removes completely the
statically allocated buffers in hci.c.
Jira: ZEP-726
Change-Id: I6ac8bd0becb7037ce8ecfac109f44832d23fcfd2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Preallocate a response event net_buf buffer before processing an
incoming command and provide it to hci.c so that it populates
the event directly, instead of using a temporary buffer than
must then be copied into the return net_buf.
This applies exclusively to Command Complete and Command
Status, since those are the only events that are sent in
direct respone to an incoming command.
Jira: ZEP-726
Change-Id: Ia3ea71ac497690af929c44308760f68491ea829e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Instead of copying the net_buf contents into a temporary
buffer byte-by-byte, the Controller HCI code now handles
incoming commands and ACL packets from the Host directly
in the net_buf containers, to avoid unnecessary memory
copying and to align with the rest of the Bluetooth stack.
Jira: ZEP-726
Change-Id: I9802607d84ee6206218b711e7e6e23dafb70581a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
As part of the effort to consolidate the BLE Controller's
HCI layer, the functions in hci_driver.c now use the "hci_driver_"
prefix when it is sensible to do so, and prefixes have been
removed altogether when they are not required.
Jira: ZEP-726
Change-Id: Icd3e56e0170f15636245ea12a389a5a9e86c166c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add PTB22, PTE26, and PTB21 to the frdm_k64f pinmux table, and helper
macros to board.h to map them to red, green, and blue LEDs respectively.
Change-Id: I257621467e71dfd9bdc5d97d6da444dfb5c58b2b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Add PTC6 and PTA4 to the frdm_k64f pinmux table, and helper macros in
board.h to map them to SW2 and SW3 respectively.
Change-Id: Ia30df9015d6d3c09131b4fbb2f2009ee745f7268
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Statically compute the number of elements in the pinmux table rather
than keep a manual entry in step with the table.
Change-Id: I99634aa460a39bb8a9a10fe37d28aaae792aa641
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
MVIC does not have _REG_TIMER_CFG defined because it does
not have a timer config register. Add checks for MVIC at
places where it is used.
Jira: ZEP-1015
Change-Id: I59f5c43cc2d1b17cf9e88b940631c2542e9729ab
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Interrupt stubs now just push the ISR and parameter onto the stack
and jump to the common interrupt code, never to return.
Change-Id: I82543d8148b5c7dfe116c43f41791f852614bb28
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
In some cases we can either assume they are already masked
at boot and save some cycles, or the IOAPIC has configuration
from a prior boot stage that needs to be preserved.
Change-Id: I0c71ff0f01a6ee13a3b9c9e239d5a933d6cb6542
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This reverts commit 581e15ced2.
The commit was marked RFC and should not have been merged yet.
Change-Id: Iafd3587f8840e64670c32fa5726ea20ac9c9962a
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Provide a network driver wrapped around the KSDK ENET and PHY
drivers.
This driver is functional, just. It is not in a fit state to be merged to master yet.
Origin: Original
Change-Id: Id29e756f33c6c0263926139188c49f9a9c3d5e09
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Updated CONFIG_SOC_QUARK_SE_SS to CONFIG_SOC_QUARK_SE_C1000_SS
Change-Id: I7dc02d91a4d739f6cd3f84001d1dd29759317163
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
No need to create new Kconfig that do exactly the same, just
reuse those from the main QMSI driver.
Change-Id: I965055f36845ac0464e4a383b0d05c3ae35c0015
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Update the power sample and drivers with the new device driver power
management API using the existing logic
Jira: ZEP-954
Change-Id: Idd94232e458767635973e94e9fc673c01612c1e2
Signed-off-by: Amir Kaplan <amir.kaplan@intel.com>
Removed CONFIG_INT_LATENCY_BENCHMARK dead code.
CONFIG_INT_LATENCY_BENCHMARK depends on ARCH="x86", it will never
be true for ARM code.
Change-Id: Ia5779a69b1bf670ebb140c2923c9fe0af6b781d4
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
Removed unused workaround in loapic. There are no references
of usage.
Change-Id: I8700b4b7ce8efef5e7b95e6cdd2b201eae3f1f37
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
During USB device reset, the controller must have its device address
cleared (set to 0). This is not really taken into account by most host
side stacks, which is the reason why this bug didn't show up before.
It was found when we were trying to run the USB20CV [1] compliance test
suite on Windows.
Without this fix the device doesn't show up on the targets list, which
means device enumeration failed. With this patch in place the bug is
fixed and the device gets listed.
Tested with the CDC ACM sample application.
Jira: ZEP-950
[1] http://www.usb.org/developers/tools/usb20_tools/
Change-Id: I0b78f7ce043fa29dde0fb7f3b3aecee9844f4d11
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
The driver originally gets the full-duplex configuration
from the PHCON1 register and PDPXMD bit as stated by the
ENC298J60 specification document section 2.6 "LED Configuration".
This section trust the board to LEDB connection to signal the
full-duplex configuration.
This commit gets the full-duplex configuration from Kconfig
symbols to allow a proper functionality even when the board
is not connecting LEDB apropriately.
Change-Id: I803958409a611e23e2c3e03f40b412f1695947af
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
There is a tx semaphore that controls a single access to the
transmission service. The device is capable to manage a single
transmission call at a time. Multiple requests need to wait
for the resource to be free.
This commit adds the initial release to the tx semaphore.
Jira: ZEP-895
Change-Id: Ic9879cfd15bb1494644b2cf0f4565f7e6a2c1c22
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
ENCC28J60 specs section 6.5 "MAC Initialization settings"
state that MACON3(7:5) register configure automatic padding and CRC.
It also states that the configuration 111 and 011 both configure as
all short frames to be zero padded with a valid CRC appended.
Nevertheless, experimentally, there are ocassions when configuring as 111
frames does not have a CRC appended. This frames could be rejected
by the receiver if it is configured to do so.
This commit changes configuration from 111 to 011, which is not
presenting that behavior.
Jira: ZEP-842
Change-Id: I302bb99f7a1f23b298fe0db0245963b640644040
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
As part of the effort to consolidate the BLE Controller's
HCI layer, the following files have been renamed:
* hci.h -> hci_internal.h: contains the HCI API to be used
by the driver
* main.c -> hci_driver.c: Implement bt_driver and includes
initialization and glue code
Jira: ZEP-726
Change-Id: Ica8b3e114da42a766a1b14ce59558cacd899a1a7
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use the sys_ macros from byteorder.h to access all HCI
structure members that are endianness-dependent.
Jira: ZEP-726
Change-Id: I950f8eaca7048bf7972c2c4c347cfd5bbba17eb6
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Bug was introduced by a6cf6038e3
Change-Id: I91ceab2ca20c4d2f70a953b56d895152a471125a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Provide a random driver wrapped around the KSDK RNGA driver.
Origin: Original
Change-Id: I43feeb37d8d5173c7b95af8e80434fb7dc77a83e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
In 1.0 you could set only one callback on the whole gpio controller. It
was impossible for another sub-system to add another callback, without
overwritting an existing one.
Such API has been obsolete for a long time and no one is using it
anymore. Thus removing it entirely.
Change-Id: I6a17fd99373dc6cef1fa2ebb421e992412d5015e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The LE_RAND HCI command was not filling in the rand array
with 8 random numbers as required by the spec.
Please note that the while() loop inside the command's
implementation can take up to hundreds of ms to execute.
Jira: ZEP-726
Change-Id: If27ff861ee5fa7842cd469e99d5bfa8ac47ac2fa
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Clean up, document and remove the macros used in hci.c
to access the different parameters and calculate lengths
of events and data structures.
Jira: ZEP-726
Change-Id: I476aa9e061dfe429b5181265167bffa203ed151b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Switch to using the definitions in include/bluetooth/hci.h
for ACL data handling, both in RX and TX.
Jira: ZEP-726
Change-Id: I6b5f6de4ff568c4e73432df3edfa7d0a57f22fff
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Delete all event definitions from hci.c since the code now
uses the ones in include/bluetooth/hci.h exclusively.
This is the fourth and last commit in a series that transitions
from the event structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I625c2aecf759823a1cc73a3ea096564284fe8c52
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use Zephyr's include/bluetooth/hci.h for the HCI event
Number of Completed Packets.
This is the third commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I179bceb2f9dc07d7a1a524c3a80f0886f712ec2b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use Zephyr's include/bluetooth/hci.h for HCI event
handling in data-related events.
This is the second commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I0e9e6f709091859af47d90b26f5e7baa830a2838
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use Zephyr's include/bluetooth/hci.h for HCI event
handling in control events.
This is the first commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I6f131675add18e2ae061f0fb2cf220ea7057f852
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This changes the way that aysnchronous events are handled
in the BLE controller's HCI layer. It performs all common
operations in a single place to avoid code repetition of the
same memory accesses over and over.
Jira: ZEP-726
Change-Id: Id9e8395944e8800f32dd9749da2b4f5c901c8682
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Continue using Zephyr's include/bluetooth/hci.h for HCI command
handling in more of the commands.
This commit deletes all command and command complete and
command status event definitions and structures present in
hci.c.
This is the sixth commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I34635a1f55f3aef124fd5ff005c99cedb40b8a49
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Continue using Zephyr's include/bluetooth/hci.h for HCI command
handling in more of the commands.
This commit cleans up hci_cmd_handle() to use the new macros
added in previous commits.
This is the fifth commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I152e02ed15042d367e95432bdd07ae5c74935be8
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Continue using Zephyr's include/bluetooth/hci.h for HCI command
handling in more of the commands.
This commit removes Nordic Semiconductor Vendor-Specific
commands, since they are currently unused and
manufacturer-specific.
This is the fourth commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: If0141072489777bfecc06e4aaa5f569898a5c449
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Continue using Zephyr's include/bluetooth/hci.h for HCI command
handling in more of the commands.
This commit ports the LE controller commands to hci.h.
This is the third commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I3f11cca1da4aa6a20cce9706362818f8f6c87b0a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
As part of closer integration into Zephyr, remove the use
of custom assert mechanism and use BT_ASSERT instead.
Jira: ZEP-761
Change-id: I27f37d697b0a84bc001754a8d0b4dbb6ddb54298
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Continue using Zephyr's include/bluetooth/hci.h for HCI command
handling in more of the commands, including the informational ones.
This is the second commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: Iecbc7ae5ba2c8435a51d62d59e8095aa25e6dc0e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
They must provide the k_cycles_get_32() API and must not refer to
command packets: the latter do not exist on unified kernels.
Change-Id: Ia354dc060e5ad2595850f97da82d8feb590d16b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This is a better choice of default; on Mint Valley using IRQ 0
for the timer collides with the DMA Error IRQ line.
Issue: ZEP-849
Change-Id: I14cb60fbe548488198813b2351e0ed1f07c2d07d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Changed help message to be in compliance with the rest of sensors.
Change-Id: Ia18f7623eda5f86fe6f7d99ac934f1a9beda55a8
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
This patch implements suspend/resume routines which
preserve SPI master 0 and 1 context in SYS_PM_DEEP_SLEEP.
The following parameters are suspended/resumed:
- All non-sticky RW registers for the SPI device which
are not related to a transfer.
- The SPI MASK registers (interrupt routing register).
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: Ib60317ca41013a3e794820e9c3ef34f35d108209
Signed-off-by: Dragan Cvetic <dragan.cvetic@intel.com>
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
CONFIG_PINMUX_DEV_QUARK_MCU is deprecated and QUARK MCU support
is replaced by CONFIG_PINMUX_DEV_QMSI. So delete this deprecated
CONFIG option.
Change-Id: I2cad6cfd4344386a00d45a579e8cc586935b041f
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
CONFIG_PINMUX_DEV_NAME should depends on CONFIG_PINMUX_DEV, not
CONFIG_PINMUX. In current situation, user will be able to access
pinmux dev driver without enabling CONFIG_PINMUX_DEV. This isn't
excepted to happen.
Change-Id: I75bcfff5a51e1dc93e002c0c6a65876f93cde5b8
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
In order to restore aonpt context after entering
SYS_PM_DEEP_SLEEP, suspend and resume functions
are called.
Only the interrupt mask is restored as it is reset by
the QMSI ROM and other registers are sticky.
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: I0dcd4552cd8c60ecb4eb650fc3ad85566b726a38
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
In order to restore i2c context after entering
SYS_PM_DEEP_SLEEP, suspend and resume functions
are called.
The following parameters are restored:
- All registers for the I2C device.
- I2C clocks.
I2C depends on the DMA which is enabled separately.
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: I22ca2fb9884109f7b5ca75af572811187a531403
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
In order to restore watchdog context after entering
SYS_PM_DEEP_SLEEP, suspend and resume functions
are called.
The following parameters are restored:
- All registers for the WDT device.
- Watchdog interrupt mask.
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: I6e4e30a797b0ca38ce727d50fa51d1b2f8330405
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
DEFINE_DEVICE_PM macro was not defining device_pm_ops
as 'static'. Fixes the issue and impacted areas.
Jira: ZEP-639
Change-Id: I5e1de6af97bf7b2b690af0c81034ce167e655e43
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Fix a compilation warning. Compilation of the i2c driver
requires QMSI dma object file. As a solution, the current
code has "selects DMA_QMSI" in i2c Kconfig. This results
in a compilation warning since "select DMA" is also
required. Adding "select DMA" and "select DMA_QMSI"
together in i2c Kconfig can solve the compilation issue.
But, this will cause the dma driver be unnecessarily
enabled. So, the solution is to fix the issue in the QMSI
part instead of in the shim driver.
Jira: ZEP-777 ZEP-778
Change-Id: Id4c1f749bf71eece1e70583bd586a69b596768b2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
The Sensor Subsystem has different IRQ numbers for the same device
across CPUs. QMSI declares these, but doesn't do anything to try to
map it automatically, so we have to do it in the driver.
Similarly the SCSS interrupt routing (the SoC-wide "APIC", which is
distinct from the per-CPU interrupt masking hardware) needs to know
which CPU we're trying to unmask an interrupt for.
Change-Id: I27e5ec44f324f869e16a92e7ef40a22a305d98a2
Jira: ZEP-546
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Overwhelming industry practice when using two-byte line termination is
to end the line with "\r\n" and not "\n\r".
Also remove needless casts. GCC does not warn on int-to-char
conversions.
Change-Id: If01a2e5ca327aacebcbcaf384af9c7131119689b
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
You can't query the LOAPIC for every kind of interrupt that fires,
it has no idea about IRQs that were generated by an 'int' instruction
for example. Extend the semantics of _irq_controller_isr_vector_get()
to return -1 if the vector can't be identified.
Issue: ZEP-602
Change-Id: I1174aa62fbedffdcd329d60da8ef14fabb042dc3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Change the signal ramp up/down config parameters in i2c driver
module to SoC specific.
Jira: ZEP-753
Change-Id: Ie01f1d890a7133d30ea53eee07f60354734a8571
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Add a shim layer around the ksdk I2C driver to adapt it to the Zephyr
I2C interface. Currently only supports master mode.
Jira: ZEP-717
Change-Id: I704b8c38e22e456bb9fa4325682b2a354a27a7ba
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Paranoid with older compare set logic, the changes in this
commit is better in avoiding compares being set to stale
count values (values in past). Compares shall always be set
in future w.r.t to current count value in the counter h/w.
No longer using fp_worker_sched() to explicitly run the
worker because there may be no ticks elapsed when worker
runs, which leads to ticker job running thereafter not to
update the compare to a new value, probably leading to a
stalled controller roles.
Change-id: If07f648357585ebb80c35d1320210eac3137781c
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Start using Zephyr's include/bluetooth/hci.h for HCI command
handling.
This is the first commit in a series that transitions from
the structures in hci.c to the ones in hci.h.
Jira: ZEP-726
Change-Id: I1d79586b85d25c8ef707b8a2b19a27a77b08b819
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Place common code in hci_evt_handle() so as to avoid code
duplication in the handling of command complete and
command status events.
Jira: ZEP-726
Change-Id: I35ffcb63518b52a2b209f83ef6b8bbb1d1b4a849
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Handle all instances of an unknown OCF in a common place
instead of it being spread in multiple functions.
Jira: ZEP-726
Change-Id: Ibd9ebe429754980b243cb8772702cfeb59b0a18b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Controller implementation supports all Bluetooth Spec. v4.2 LE
states. Include the LE Read Supported States Command in Read
Local Supported Commands HCI command complete returned by the
Controller.
Change-id: I399f7c0326b058577e97e6d8a2676afbeb73b6fe
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Use stack_analyse in the recv fiber to print actual stack
usage, use this as default in Kconfig option, and declare a
rx fiber stack of Kconfig supplied stack size.
Change-id: Id97ad2de4f7be3069f93271d60544f760abbf575
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
GCC requires __builtin_offsetof() to be used whenever
sizing arrays with its help. Now that stddef.h
includes conditional compilation, use the macro instead
of hardcoding the GCC usage.
Jira: ZEP-732
Change-Id: Ieb5c694e1dc8323bd1fa2d18711a893f8824c5b1
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Rename nrf51_enable() to nrf51_wakeup()
and nrf51_disable() to nrf51_allow_sleep().
Change-Id: Ie8e8fa2dde281f212e231e0c4b751d3e0021b6b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Controller's fiber is expected to read all enqueued events
and data, hence wait on semaphore only after all events and
data are read.
Change-id: I0150f042b0ba91efa712b38903752b20198e5e6e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
For power consumption matter, UART between quark and BLE chip shall
be disabled in absence of messages. GPIO NBLE_BTWAKE_PIN is used
from Quark to notify BLE chip payload is coming and so enabling UART.
The UART will be disabled by deasserted NBLE_BTWAKE_PIN signal, once
a message has been transmitted.
Change-Id: If538909784363f415f4266f62be57d8d9ff48b09
Signed-off-by: Jonathan Gelie <jonathanx.gelie@intel.com>
Using the shell application, starting advertisement while
the scanner is already running caused the controller to
assert.
The work which is supposed to set the radio active state to
active is not executed before the radio ISR resets the radio
active state, causing the assert. This can happen when a
newly started role is initialized to setup the radio trx and
the radio start code then detects that its hard realtime
instant has passed (as time was spent setting up the ticker
and ticker then firing thereafter) and hence cancels radio
trx.
Optionally (without this commit), dynamic calculation of
preparation time can be disabled by setting a constant time
in the define RADIO_TICKER_PREEMPT_PART_US in ctrl.c to
avoid the assert.
Change-id: Ib4415ec4b1bfdcc89aa0f3912e5a8fdd2e817fde
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Remove use of (void) before unused functions return values.
Replace use of (void) with ARG_UNUSED for unused parameters.
Change-id: I9ffea666f10dbdc01710df723e0df253a1cdd6e6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Initial sweep of controller code to fix the coding style.
Change-Id: Ib71c5a4657a1f162273f2dcd485fe70fff934928
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This adds queueing support for requests that requires a response making
it simpler to use the API. The storage is keep in the parameters of the
request so it is up to the application to define how many can be queued
but in case the application don't want a request to block waiting for
a buffer it can use BLUETOOTH_ATT_REQ_COUNT to control the available
buffers which is recommended in case the requests will be sent from the
RX fiber.
Change-Id: I407c3982a7ecdc4a9eff7172d9d0addd46949783
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The main.c source file in drivers/bluetooth/controller acts as
the necessary glue between the Link Layer and Zephyr's
Bluetooth subsystem. It instantiates the required RX fiber and
marshalls the control and data traffic between the BLE radio
and the BLE stack.
Jira: ZEP-702
Origin: Original
Change-Id: Ia62baedcd6e3ea83bd16306779357930f9a6c5f7
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The ll/ folder contains a full implementation of a BLE Link Layer
interfacing with a baseband and a radio through radio.h. The
current code implements most Bluetooth 4.2 features and is
currently functional and tested with nRF5x ICs from Nordic
Semiconductor.
Jira: ZEP-702
Origin: Original
Change-Id: Ib79cd97142d1a72c99dcf2a88116ac97ddd90a2b
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
For the Link Layer to be able to communicate with the rest of
the BLE stack in Zephyr, this barebones HCI controller
implementation includes an initial version of the fundamental
commands and events required.
Jira: ZEP-702
Origin: Original
Change-Id: I38bc9dae34e7075ab8b8178fd6b6659e2dec53b0
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The util folder contains memory management, queue management
and misc utilities used by the Link Layer implementation.
This will be in time replaced by Zephyr's native functionality.
Jira: ZEP-702
Origin: Original
Change-Id: Id8602ea41ec44811801dfc582bab244c339eabe3
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The drivers/bluetooth/controller path adds a native BLE Link
Layer (controller and HCI) to the Bluetooth subsystem. This first
implementation adds support for the nRF5x series of devices
from Nordic Semiconductor. The hal/ folder inside the controller
contains all IC-specific code to interface with the radio and
baseband.
Jira: ZEP-702
Origin: Original
Change-Id: I4ed61d5f67af6b4735d746a38a5b55f054521075
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
HCI RAW channel API is intended to expose HCI interface to the remote
entity. The local Bluetooth controller gets owned by the remote entity
and host Bluetooth stack is not used. RAW API provides direct access
to packets which are sent and received by Bluetooth HCI drivers.
Change-Id: I4ba2b7ca2c2b0d6c5de6ef1f231d1c5b82125e09
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The W25QXXDV_PAGE_SIZE is not a valid erase size supported by
the flash component (section 7.2.23 - 7.2.26 of datasheet
https://www.winbond.com/resource-files/w25q16dv_revi_nov1714_web.pdf)
and it is not used by any code so remove it.
Jira: ZEP-615
Change-Id: I4315fa082d5cbceda65ae8567e0a77e2d4066ef1
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Originally, x86 just supported APIC. Then later support
for the Mint Valley Interrupt Controller was added. This
controller is mostly similar to the APIC with some differences,
but was integrated in a somewhat hacked-up fashion.
Now we define irq_controller.h, which is a layer of abstraction
between the core arch code and the interrupt controller
implementation.
Contents of the API:
- Controllers with a fixed irq-to-vector mapping define
_IRQ_CONTROLLER_VECTOR_MAPPING(irq) to obtain a compile-time
map between the two.
- _irq_controller_program() notifies the interrupt controller
what vector will be used for a particular IRQ along with triggering
flags
- _irq_controller_isr_vector_get() reports the vector number of
the IRQ currently being serviced
- In assembly language domain, _irq_controller_eoi implements
EOI handling.
- Since triggering options can vary, some common defines for
triggering IRQ_TRIGGER_EDGE, IRQ_TRIGGER_LEVEL, IRQ_POLARITY_HIGH,
IRQ_POLARITY_LOW introduced.
Specific changes made:
- New Kconfig X86_FIXED_IRQ_MAPPING for those interrupt controllers
that have a fixed relationship between IRQ lines and IDT vectors.
- MVIC driver rewritten per the HAS instead of the tortuous methods
used to get it to behave like LOAPIC. We are no longer writing values
to reserved registers. Additional assertions added.
- Some cleanup in the loapic_timer driver to make the MVIC differences
clearer.
- Unused APIs removed, or folded into calling code when used just once.
- MVIC doesn't bother to write a -1 to the intList priority field since
it gets ignored anyway
Issue: ZEP-48
Change-Id: I071a477ea68c36e00c3d0653ce74b3583454154d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
According to commit 2055b06e ("quark: move pinmux files to board"),
drivers/pinmux/quark_mcu/ was deleted, so remove it from the Makefile.
According to commit 0ae2e895 ("remove custom pinmux for quark and use qmsi"),
pinmux_dev_quark_mcu.c is no longer compiled into image, so delete
this unused file.
Change-Id: Ied63cd3b06e8225205c5f1b3e5a675c387acb5ad
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Also, SPI 0 isn't specific to Intel, make it a generic message. This patch
only fixes the cosmetics w/o changing undering Kconfig option names.
Change-Id: Ia58f9537c594004a1b5fb8b4af21d7e8b729efb7
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Fix i2c failure seen on fast plus mode. With higher data
rate, signal ramp time becomes longer. The ramp time
required by the controller needs to be loosened.
Jira: ZEP-711
Change-Id: Icffa334ec3f059564e333d3b0759a11d1bebc5e4
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Defined in all SoCs, but never referenced anywhere. That definition has
been replaced by CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC.
Change-Id: I1801f72a03925717ded6fbfdef22b1993f843461
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Correct the argument definition inconsistency for the set
value API. To be consistent with other pwm sub drivers, the
on and off arguments for the set value api are re-defined.
On: how far (number of timer count) from the beginning of a PWM
cycle the PWM pin will be asserted.
Off:how far (number of timer count) from the beginning of a PWM
cycle the PWM pin will be de-asserted.
Jira: ZEP-642
Change-Id: I7b39f98f1935fc3499fb36dd813abed62b86c1e7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This will lead to conflicts and warning coming from Kconfig, so just
whitelist the board in the samples where this hardware is supported
Jira: ZEP-739
Change-Id: I4a2f3bdcfdb44fc75df0e272c237789ee16e0de1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Kconfig allows selecting NETWORKING_WITH_15_4_TI_CC2520 even if the
current board doesn't support it, and also selects it by default. This
breaks building the 15.4 sample with qemu_x86. Add a config option for
having CC2520 support and enable the choise only if it is available.
In addition, remove unused function from iee802154 code, as it now
fails the tests.
Jira: ZEP-697
Change-Id: Ib082f82acdd0f86d3306bbd3bb827f61b0fd0be1
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Completing the terminology change started with change 4008
by updating the Kconfig files processed to produce the
online documentation, plus header files processed by
doxygen. References to 'platform' are change to 'board'
Change-Id: Id0ed3dc1439a0ea0a4bd19d4904889cf79bec33e
Jira: ZEP-534
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
A previous re-work of IRQ priorities was led astray by an incorrect
comment. Priority level 1 is not a non-maskable interrupt priority.
In addition, zero latency IRQs are not implemented on ARC.
Timer driver now doesn't specify IRQ_ZERO_LATENCY (as that wouldn't be
correct) and its IRQ priority is now tunable in Kconfig. The default is 0.
IPM driver on both ARC and x86 side were being configured with hard-coded
priority of 2, which wasn't valid for ARC and caused an assertion failure.
The priority level is now tunable with Kconfig and defaults to 1 for ARC.
Issue: ZEP-693
Change-Id: If76dbfee214be7630d787be0bce4549a1ecbcb5b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Per spec document, RXEN bit corresponds to bit 2
of the ECON1 register instead of bit 1.
Change-Id: I1bbfd048be248575a558679985ba9daadc43df0e
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
The rx fiber call contiki IP stack functions to register
received frames. This interaction requires more stack memory
in the rx fiber stack to avoid memory corruption.
Change-Id: I106339e7dd1ca9282426adfb54590e34297755b3
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
SPI bus is a shared resource between tx and rx processes.
The access to it must be synchronized to allow a rx process to
happen even when a tx process is taking place.
ECON1 register must be saved by the rx process and recovered
at the end to ensure that the tx process will continue operating
in the same register bank.
Change-Id: Ie9358bf02bef8ddb5bdf76c8847e998a627e5395
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
Transmision status is polled. Remove rx interruption enabling and
clearance.
Change-Id: I2893f89533adef5f77c711a36b5c1bbe21c48a23
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
Even values in ERXRDPT register may corrupt the receive buffer.
Set ERXRDPT value one address behind the next value.
If it is zero, set the value to the reception buffer end address.
Change-Id: I7150e5190c5bfb7bfafbff598eea1c26959643d0
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
These console messages are for debugging and if sent too
rapidly, could be discarded. This was causing false positives on
test cases which rely on console output to determine success or
failure.
Issue: ZEP-704
Change-Id: I5a86c761311cde90f295cd2e65f2e70608f875fa
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The Receive Packet Pending Interrupt Flag (EIR.PKTIF) does not
reliably/accurately report the status of pending packets.
Reception fails intermittently. The EPKTCNT register is used instead.
Change-Id: I599c3b4df1b74d769dd7104e5c6e253d9cf63bd4
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
The (currently) unused ipm_device field wasn't initialized.
Issue: ZEP-704
Change-Id: Icbeb50031c52d2513a1417f83a844e25b43429a7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Fix i2c failure while multiple slaves are connected to the
same i2c interface. Higher load on the i2c bus makes i2c
signal less nice. The requirement for signal ramp up and
ramp down time needs to be loosened.
Jira: ZEP-646
Change-Id: If698d7ba741788857694f166ecc602c2a94cb12e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
The data sample registers are ordered as X, Z, Y (not X, Y, Z), so the
driver also needs to extract the sample components in this order.
Jira: ZEP-679
Change-Id: I317994bb545539b049e2ebf3d2af94e63c7d2511
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Correct an error in ADC Kconfig. The # in the beginning of
the code lines unintentionally commented out the "if" condition.
Jira: ZEP-645
Change-Id: Ieee1bdbf4865fc39aef9a0986036fd81a75e5b58
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Adds the ENC28J60 Ethernet module driver.
Origin: Original
JIRA: ZEP-291
Change-Id: I2b5790ecb251f9059f172bcaafadef24bd27207a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
Fix several issues which are causing the BMI160 app hang.
For SPI duplex transfer, QMSI only supports equal length.
For SPI freq, divider is used. Actual freq is no longer used.
Jira: ZEP-461
Change-Id: I1a1bcc12c6514c3797686dfdad1ce1b852f7dc78
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
One remaining reference to uart_qmsi_pm_save_config
was missed by patch bc60506d3e.
This reference is removed.
This fixes the following error:
...
drivers/built-in.o: In function `uart_qmsi_line_ctrl_set':
/drivers/serial/uart_qmsi.c:439:
undefined reference to `uart_qmsi_pm_save_config'
collect2: error: ld returned 1 exit status
...
Change-Id: I1ceda0e152db5a1c7f70d67c04b931416687031a
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
Implement saving and restoring context of the PWM controller when the
application goes to SYS_PM_DEEP_SLEEP. No action is taken for other
states at the moment.
This functionality is implemented in the shim driver first to enable
the feature, but will later be moved into QMSI.
Change-Id: I5784f6a2c63caaea5785ca5d92bb6cc3bc9fa4cc
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Removed dead code inside sensor_lsm6ds0.h. There is no kconfig option
CONFIG_LSM6DS0_I2C_ADDR_6A neither 6B.
Also the #define LSM6DS0_I2C_ADDR is not in use.
Change-Id: Ib5a7f40d0d61542ed81687227df3795ba52ec725
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
In order to restore uart context after entering
SYS_PM_DEEP_SLEEP, suspend and resume functions
are called.
The following parameters are restored:
- All registers for the UART device.
- UART clocks.
The FIFO control register cannot be read back and is
not stored in the device configuration.
The default parameters are applied for them.
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: I4be9246f6aa5a6e0d91df54c1c69574060136607
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
ieee802154 driver is now using new system log macros, update the
Kconfig variable to be a level rather than a bool and the .conf
files at samples.
JIRA: ZEP-311
Change-Id: I640e973d880c3a222cd7c13a72d35edf49ada3a8
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
DesignWare USB driver is now using new system log macros, updated
the Kconfig variable to be a level rather than a bool and the .conf
files at samples.
JIRA: ZEP-311
Change-Id: Ief46cadd954ca4b30a3a1cf2eba6e44ccbc9bc9f
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Freescale K64 PWM driver is now using new system log macros, updated
the Kconfig variable to be a level rather than a bool.
JIRA: ZEP-311
Change-Id: I80d01ba75e8b186ef32861b372af4e2d15dd4131
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Calls to flash write or erase operations can get preempted
in the middle of the API call if a concurrent call (from
other fiber or task) to the same API is made. The patch ensures
concurrent API calls from other fiber/task is put on hold until
the current operation is completed.
The mechanism is by default not activated. To enable
it, the following flag needs to be defined:
CONFIG_SOC_FLASH_QMSI_API_REENTRANCY
Jira: ZEP-414
Change-Id: I39429e40cb6ed446123dd1a1d7c7acc1b12417aa
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
pcal9535a driver is now using new system log macros and updated the
Kconfig variable to be a level rather than a bool.
JIRA: ZEP-311
Change-Id: Ic3d6c72630e66ac116c1e8954c32254677c51566
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
GPIO drivers are now using new system log macros also updated the
Kconfig variable to be a level rather than a bool.
JIRA: ZEP-311
Change-Id: I9a49626d816080cb8081c2dd445bae31f5dbf409
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Drivers that implement power management should use the preferred
device_pm_ops method instead.
Change-Id: I9ae06e26b77325265bbe46bdee82ba39dedb6b79
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Drivers that implement power management should use the preferred
device_pm_ops method instead.
Change-Id: I337722b1e06afe8508b5c84c00c3542571232e07
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The suspend and resume hooks in the spi_driver_api struct are relics
from before the current power management infrastructure was in place.
The correct way to implement this now is through the device_pm_ops
struct, by way of the DEFINE_DEVICE_PM_OPS and DEVICE_AND_API_INIT_PM
macros, which make the hooks available through a generic mechanism for
all devices, rather than using per-type APIs.
Since the existing spi_suspend() and spi_resume() functions don't check
if the driver_api hooks are NULL, there's now a place holder function
to prevent breaking functionality until the hooks are removed.
Change-Id: I48287c58e9a8649d3e1be7547e3d0d293c84327a
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The suspend and resume hooks in the spi_driver_api struct are relics
from before the current power management infrastructure was in place.
The correct way to implement this now is through the device_pm_ops
struct, by way of the DEFINE_DEVICE_PM_OPS and DEVICE_AND_API_INIT_PM
macros, which make the hooks available through a generic mechanism for
all devices, rather than using per-type APIs.
Since the existing spi_suspend() and spi_resume() functions don't check
if the driver_api hooks are NULL, there's now a place holder function
to prevent breaking functionality until the hooks are removed.
Change-Id: I6a3e3db370860ad46f428d287943b1ca58a80ae1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Drivers that implement power management should use the preferred
device_pm_ops method instead.
Change-Id: Ice9e0469a1fcb50eb64dcb240dddea56755b6e84
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The suspend and resume hooks in the pwm_driver_api struct are relics
from before the current power management infrastructure was in place.
The correct way to implement this now is through the device_pm_ops
struct, by way of the DEFINE_DEVICE_PM_OPS and DEVICE_AND_API_INIT_PM
macros, which make the hooks available through a generic mechanism for
all devices, rather than using per-type APIs.
Since the existing pwm_suspend() and pwm_resume() functions don't check
if the driver_api hooks are NULL, there's now a place holder function
to prevent breaking functionality until the hooks are removed.
Change-Id: Ib6b03053b483f97a1f7441af5ba51503270b8674
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Added CONFIG_SYS_LOG_I2C_LEVEL define, so that DW I2C driver will
not print traces unless requested with CONFIG_SYS_LOG_I2C_LEVEL.
Currently it doesn't obey it, so DW I2C spams DBG traces when
logging is enabled.
Change-Id: I87dc1d922ba61d39f26945627602864c75d9bf33
Signed-off-by: Jani Pajarinen <jani.pajarinen@intel.com>
Fixed undefined CONFIG_ISL29035_LUX_RANGE_4 in #elif
Change-Id: I2a7a6e46ffa0236da126d4e2c321e59302e54527
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
Guard critical section of the driver API, so that multiple
simultaneous calls from tasks/fibers won't corrupt the driver
state.
The locking mechanism is by default disabled. To enable it,
the following flag needs to be defined:
CONFIG_PWM_QMSI_API_REENTRANCY
Jira: ZEP-430
Change-Id: Ia3eb2a962f4176a3ac94163b9843ab068abe4b4e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
In order to restore GPIO context after entering
SYS_PM_DEEP_SLEEP, the suspend and resume
functions for GPIO and GPOIO_AON are called. The
following parameters are restored:
- All non-sticky RW registers for the GPIO device.
- The MASK register (interrupt routing register).
Note: No need to sve/resume AON_GPIO registers as
they all are sticky registers.
The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.
Change-Id: I68e25c9da4bb8ea65f312e3686d9ef090cb775ff
Signed-off-by: Dragan Cvetic <dragan.cvetic@intel.com>
Code was using CONFIG_MAX44009_I2C_MASTER_DEV_NAME which doesn't exist.
Use CONFIG_MAX44009_I2C_DEV_NAME instead.
Change-Id: I6bf6eedd2229bb91f64264dc5b32e4a3c00921b6
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
CONFIG_UART_INTERRUPT_DRIVE should be CONFIG_UART_INTERRUPT_DRIVEN
CONFIG_UART_LINE_CTR should be CONFIG_UART_LINE_CTRL
Change-Id: I11fba5b387e3d36711cd3c813fc8a297ae23af05
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We don't currently have a SOC_NRF5 Kconfig symbol. Utilize the
SOC_FAMILY_NRF5 Kconfig symbol instead.
Change-Id: I062ecab230e9e7814fad19517d28ddbbae66bccb
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
__ASSERT was being used when __ASSERT_NO_MSG was appropriate.
This problem was previously only visible if CONFIG_ASSERT=y,
but a recent change to the assert macros fixed them so they
can't be improperly used with assertions disabled either.
Change-Id: I1e13c796873d79826d177a01246d2ca0e8f0a107
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Guard critical section of the driver API, so that
multiple simultaneous calls from tasks/fibers wont
corrupt the driver state.
The locking mechanism is by default disabled in the
build. To enable it, the following flag needs to be defined:
CONFIG_RTC_QMSI_API_REENTRANCY
Jira: ZEP-412
Change-Id: I430ebc07bf3277e5a5961cb6278c5500cd1e139b
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Uses locking in an API and removes a global variable
for improved safety/correctness in the face of concurrent
threads and fibers.
The locking mechanism is by default disabled in the
build. To enable it, the following flag needs to be defined:
CONFIG_WDT_QMSI_API_REENTRANCY
Jira: ZEP-440
Change-Id: Ibcd1501a4af628017b20d7e7ce20b988c8e4e4e2
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
The macro defining the device_pm_ops structs is located inside an
ifdef for CONFIG_UART_QMSI_0, so when the UART_0 is disabled at build
time, but UART_1 is still used, it references a struct not defined.
Fix it by placing the DEFINE_DEVICE_PM_OPS line outside the ifdef block.
Change-Id: I7dafda162741201ee47b5b480c07ec8c1f373d64
Signed-off-by: Iván Briano <ivan.briano@intel.com>
The slip driver revert (3e63a74) was incomplete, missing the Kconfig and
Makefile changes, causing 'make clean' to fail.
Change-Id: I9d944148e6be3756b62d2371a5ab5528365e1ec1
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
The idle status check before a i2c transfer is not a reliable
way to check whether i2c master is ready to transfer data. If
the data transfer for the previous API call is done, but, a
stop condition is not sent by the previous API, the i2c master
is not idle, but, it can start new data transfer.
Change-Id: I93dbf46cef6272f3da69a0d67fb737c9b480791f
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
We have already done this on x86 and ARM. The policy is as follows:
* IRQ priority levels starting at 0 all have the same semantics and
do not have special properties. The priority level is either ignored
on arches which do not support programmable priority levels, or lower
priority levels take precedence over higher ones.
* Special-case priorty levels are specified via flags, in which case
the supplied priority level is ignored.
Issue: ZEP-60
Change-Id: Ic603f49299ee1426fb9350ca29d0b8ef96a1d53a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This will guard the driver API to be safe for concurrent
invocation from fibers or tasks.
The machanism is by default disabled. To enable it, the
following flag needs to be defined:
CONFIG_GPIO_QMSI_API_REENTRANCY
Jira: ZEP-441
Change-Id: Ia3ee738aff2f8e70e4f9a7ec76346138ff6f5031
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
This will allow the driver API to be safe for concurrent invocation
from fibers and task.
The machanism is by default disabled. To enable it, the following
flag needs to be defined:
CONFIG_GPIO_QMSI_SS_API_REENTRANCY
Jira: ZEP-411
Change-Id: I5b738532f2eefec6d5d78ab6a668790dfe9faaff
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
At the moment firmware reads everything we send to it over UART and
when an application tries to send too much notifications we are stuck.
The proper approach would be forcing firmware to read from UART only
when there is available memory. In this case we would block on UART
FIFO and everything handles gracefully.
This workaround mimics solution used by firmware project by allowing
to send next notification only after previous was sent correctly.
Change-Id: I56dd5abc4d13735d285415da04db75e7bb8bc459
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Depending on advertising options this can be non-connectable address.
NFC pairing application document also allows broadcaster/observer
roles.
Change-Id: I9b104ac8fb9752a083a7a31fc20598c66f23f608
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Follow up to TSC decission for further discussion in the networking
WIG.
Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This adds some basic suspend/resume support in the uart_qmsi
driver. This is part of a change to enable device suspend/resume
and deep sleep support in sample PM application.
Jira: ZEP-512
Change-Id: I38cfbfb352d0027b7beaadebedbc10002dade50a
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
This adds some basic suspend/resume support in the rtc qmsi
driver. This is part of a change to enable device suspend/resume
and Deep Sleep support in sample application.
Jira: ZEP-512
Change-Id: I79ccfb56de5b3cbfb5bc91e9cacca68554aa46ee
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
This is part of a change to enable device suspend/resume and
Deep Sleep support in applications. Adds suspend/resume handling
in loapic timer.
Jira: ZEP-512
Change-Id: I9da2c8419bd9109fb71ef5a6caf736de7c7de9e1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
This will guard critical regions in the driver API so that the API
operation called from one thread (task or fiber) can complete
without the context being over-written by any simultaneous call
of the API from other thread (task or fiber).
The locking mechanism is by default disabled in the build. To enable it,
the following flag needs to be defined:
CONFIG_AON_API_REENTRANCY
Jira: ZEP-424
Change-Id: I1b0eae70a4ab97229931033153662874d7c4a68e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This allows to query information needed for Out Of Band pairing
or connection creation. Currently supports only BT addresses.
Change-Id: I60bf9344baee552e7743fa8fc1b3cfb3a4765334
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This lets the callback take advantage of the powerful net_buf API for
parsing the advertising data content.
Change-Id: Id65e6e83efd60c0f36c47bc5446a2e8ec2833d7c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This makes bt_gatt_write consistent with the rest of the API where the
parameters are passed back to its callback.
Change-Id: Ie94208aa661d3620d0cbc5be4a4fb5b3c3ef061c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fixes SEC/AUT/BV-11 PTS test case at least in GUI mode.
Change-Id: I60e7013f1c66027dabc1b94df87f2da991a5718c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
QMSI provides more than just peripheral drivers, and it may be used
from the SOC or by applications that need finer grained control of the
platform.
This also makes the QMSI HAL consistent with the others.
Change-Id: I27490c98ccf1c1afcc090ce1e65f0e066eddc777
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Correct that handle is attribute one, print flag to notice cancel
prepared write requests.
Change-Id: I46d747f0466a44460e92fcbaef4e436066c09f4a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The latest NBLE firmware includes a new version
exchange mechanism that is independent from the
RPC function definition. It also allows using
firmwares that are automatically generated by
the official builders without needing a local
build.
The upgrade of the softdevice fixes several
issues in PTS tests. The major change in
term of API introduced by this upgrade is that
upon write requests, the offset and data of the
write request must be sent back to the softdevice.
Change-Id: Ie574047a09a4e6fdcbf775bc98d8a61f981cee0c
Signed-off-by: Louis Caron <louis.caron@intel.com>
The comments state that higher-numbered vectors have priority,
but the function was doing the opposite. The code now agrees
with the comments.
Change-Id: I1a689fc22c8355458bdd734d95ff637da0655533
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Created menu for Ethernet driver and moved driver + debugging setting
under it. Changed prompt from "Grove log level" to more describing and
fixed typos.
Change-Id: If2f79fee1a002a42e89e2493a2294332abec05ee
Signed-off-by: Jani Pajarinen <jani.pajarinen@intel.com>
As there is a L2 in the middle, there is no need for a net_if to provide
such information.
Change-Id: I58a35d4d124cd8a67026f32e71713ef06f43b7c5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Net core then does not know anything about l2 related logic.
For instance ARP is used in ethernet l2 API and nowhere else.
This will be helpful when adding different technologies altogether.
Currently, only SLIP driver is enabled to use relevant l2 layer.
Change-Id: I03c93326321028d04222733ca4083e3c6b785202
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2 warnings happens when CONFIG_SLIP_DEBUG is set, thus fixing it.
Change-Id: I032d7481942e86911764da35cdd6f7b8e05cdeaa
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If CONFIG_SLIP_TAP is defined, then ethernet link layer header is
used before the packet.
Change-Id: I3d266017f85683999d3c67de49b75b60686d7ba7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use IOAPIC_EDGE instead of IOAPIC_LEVEL to fix missing interrupts.
During tests it was found that using IOAPIC_LEVEL interrupts for UART at
some points are lost.
Proposed by Calando, Antoine <antoine.calando@intel.com>
Change-Id: I18b20217c4d73fdeaa424bf59d00f6be1ec6ef1b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Renamed net_recv() to net_recv_data() so that the more generic
name can be used by applications. The net_recv_data() is only
meant to be used when L2 layer feeds data into L3 (IP) layer.
Change-Id: Iba155d51f81e3b99964fa916fe87a05a8bf8766a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Check if we have received IPv4 packet and call a handler
function to process it.
Change-Id: I9f9e5f0888d2c3b91401c98f4925647ddce09962
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The SLIP driver is using UART pipe driver to communicate with
host when Zephyr is running in Qemu. Currently this is only
used by networking sub-system when testing the networking
stack.
Change-Id: I432b4136670766a7fc190f146057924c266f9bea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Debug macro definition at this file was repetitive and has been
superseded by new system logging API. Furthermore it was not being
used on this .c file.
JIRA: ZEP-311
Change-Id: Id5828d1144fa03cc24f100ae94ecc596502c1131
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Clock control drivers are now using new system log macros. also update
the Kconfig variable to be a level rather than a bool.
JIRA: ZEP-311
Change-Id: Ia64e79e4e083df580861f64c661f8dbaa8a3985d
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Protect FIFO writes against other USB register accesses.
According to "DesignWare Cores USB 1.1/2.0 Device Subsystem-AHB/VCI Databook":
"During FIFO access, the application must not access the UDC/Subsystem
registers or vendor registers (for ULPI mode). After starting to access a
FIFO, the application must complete the transaction before accessing the
register."
Change-Id: I2aed833acaa2970310b6fd48f41a95bee2182ec1
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Designware, Amtel and Quark SE i2c drivers are now using new system
log macros. also update the Kconfig variable to be a level rather than
a bool.
JIRA: ZEP-311
Change-Id: Iac009b20fb74deb8ce72098378651bbec3b2ef17
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
This replaces the use of delayed fiber with delayed work which doesn't
require extra stacks.
Change-Id: I3db0c168baabea2503163e26020bf5e4971ce584
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Correct ADC resolution definition and default value in Kconfig.
QMSI uses different definition for sensor. But, Kconfig did not
reflect the difference.
Change-Id: I8e57aa5670bff0e5b29bf0772159834e4b902d88
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Use the function provided in misc/util.h to do the sample
conversion.
Change-Id: I21179982b6001bf79448e4eb289e9cffaf97f3fb
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
This allow the PWM QMSI shim driver to implement the set duty cycle
API, and correct the behavior of Set Value
Jira: ZEP-69 ZEP-156 ZEP-158
Change-Id: I47744958fed889116fbb5024343ea00f76ed7706
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Fix a bug in i2c_qmsi_transfer function in the shim driver.
The function did not wait for the completion of a msg transfer
before starting another msg transfer. Similar issue exists in
the i2c sensor shim driver. It is also fixed.
Change-Id: I1f8ad2281fa185d85db25a4682ed596c02ea322e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Revert patch fixing Bluetooth application with Debug enabled crashing.
This reverts commit 029d3beb57.
Change-Id: I0004dae656ca5a0b44da9f12542088d47c38b837
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
QMSI 1.1 Beta is available on Github:
https://github.com/01org/qmsi/releases/tag/v1.1.0-beta
Update the QMSI drop we maintain in Zephyr and
keep the modification to qm_soc_regs.h introduced on commit
6b88a6b945 "ext qmsi: Add USB base and interrupt defines" since
that patch hasn't made into the QMSI 1.1-Beta release in time.
Also, fix the build where needed:
- add hard dependency from qm_i2c to qm_dma
- fix spi_qmsi_ss.c due to new parameter naming
- fix adc_qmsi.c and adc_qmsi_ss.c due to a new parameter
Change-Id: I01388c787f5ee6ee97fece2e42b24a717522207f
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
SPI drivers for K64 is now using system log.
Change-Id: Ifd0d321e2ff84c581261b7cb3a7a4485afbd67f6
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
JIRA: ZEP-311
ADC driver is now using new system log macros, also update the Kconfig
variable to be a level rather than a bool.
JIRA: ZEP-311
Change-Id: Iac96c37989e44484808ded515397d457186240e0
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Fix bug that caused negative temperature values to be computed incorrectly.
The sign bit needs to be perserved, when extracting the data sample from
the TMP007_REG_TOBJ register.
Jira: ZEP-499
Change-Id: Idbebd48b3164d7d4883352ef7128ef73be70e1b2
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Add hyphens so that the .rst file is formatted properly
Change-Id: Ic798590d4a892f4f4d5312e86949db23a3b3abe0
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
Quark SE USB device (Designware IP) controller driver implements
the low level control routines to deal directly with the hardware.
Only FIFO mode supported.
Change-Id: I086186df017734579f0363ed79effc1481ff32c2
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Command Status, Command Complete and Number of Complete Packets are
used for driving TX fibers (HCI and connection). Missing any of
those event will lead to HCI traffic stall.
Priority pool will be used when critical HCI event is received
or normal pool runs out of buffers. The difference with priority
pool is that buffer from it must not be passed to RX fiber and
must be freed from bt_recv.
If driver knows HCI event opcode before requesting buffer for event
it may hint HCI core about preferred pool selection.
Change-Id: Iad14724945bb59721c5ffb6b62d5a8a3e3f70be7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Add device driver for the TMP112 I2C temperature sensor
Datasheet:
http://www.ti.com/lit/ds/slos887d/slos887d.pdf
Change-Id: I08208204cd8f377dc65378aaf2b92c7cdefe8d2b
Origin: Original
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
QMSI uart driver has removed qm_uart_get_config API. Updated
the shim driver to use alternatives.
Change-Id: I3ccfd0dfec3711d250de7d1004275d9b02d7477a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
This adds flags parameter to write callback which can be used to indicate
that data only need to be prepared with use of BT_GATT_WRITE_FLAG_PREPARE
fixing qualification tests that needs to check authorization or other
errors that cannot be verified with just the permissions.
Change-Id: I3d662b2027718ffb52a280e3bbc9750be14f89ae
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This fixes the regression of included services in nble.
Because user_data of BT_GATT_INCLUDE_SERVICE points to the first
attribute of service to include, and the bt_gatt_attr_read uses
memcpy, the pointer to pointer is needed to copy the address contained
in user_data to the buffer.
With this patch, included services work on nble as well as Zephyr.
Change-Id: If360014675c399fafc365185d5c1e41c913c8109
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Status shall be stored to be returned in the response to the
on_nble_gatts_write_exec_evt.
Change-Id: I03172e4b8833f83bd9b60f10d3cb52a067cc9f34
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
FIFO object has to be initialized before being used.
Change-Id: I3bd774f60e2585d09cfba657cb2aa50c95e0c2f5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Tickless idle is not yet supported. We program the timer period
to the desired system clock tick rate (sys_clock_hw_cycles_per_tick).
This was renamed to the same name used in the Altera Embedded IP
Peripherals Guide; used by other CPUs than Nios II.
Change-Id: Ic4fca8c16b923295b77b63f98f45cd3483c5f560
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If conn is not in BT_CONN_CONNECTED state we get extra reference.
Change-Id: Id78db628e776576ea120bda08e3f906c221015c7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Global data and device setting can be messed up by concurrent
API calls. This change is to serialize the access.
Jira: ZEP-454
Change-Id: I520722aecab7db443d053fd45498a22e165889de
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Add DMA shim driver based on QMSI 1.1
In order to enable this driver, the following options must
be set.
CONFIG_DMA
CONFIG_DMA_QMSI
Jira: ZEP-354
Origin: Original
Change-Id: I604cbf34e90f7653b956a6e4d428424beee3ef87
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This currently only supports outgoing messages without interrupts.
Change-Id: I635562f47106eb6cdc7104a8160e431bebea25dc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
According to Core 4.2 Vol 3, Part C, 9.3.12.2,
The Peripheral device should not perform a Connection Parameter
Update procedure within T_GAP (conn_pause_peripheral) after
establishing a connection.
T_GAP (conn_pause_peripheral) is 5 seconds.
Fixes TC_LE_REJ_BI_01_C.
1/3 L2CAP TC_LE_REJ_BI_01_C PASS
2/3 L2CAP TC_LE_CPU_BI_02_C PASS
3/3 L2CAP TC_LE_CPU_BV_01_C PASS
1/3 GAP TC_CONN_CPUP_BV_01_C PASS
2/3 GAP TC_CONN_CPUP_BV_02_C PASS
3/3 GAP TC_CONN_CPUP_BV_03_C PASS
Change-Id: I66bf57a2b8323b748c15f61b2daecfaa435dbb69
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Print debug statement allowing to track bugs with firmware, this also
removing Not Implemented warnings.
Change-Id: I15b77cd6efb5d9bc75910ef444f746c860ac3c6c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
To be reused by on_nble_gatts_write_exec_evt.
Change-Id: I2cb7f3b8e2c33cbede9af3f211e876c4038bef36
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This fixes the condition that has to be checked while writting attribute
value. According to the GATT API, write() callback returns the "number
of bytes written, or in case of an error BT_GATT_ERR() with a specific
ATT error code".
Change-Id: I4268e1d0585f5ce816ad64ca62232b6d739b780a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
- SREGs should use MEMRG/MEMWR instructions, FREGs use REGRD/REGWR
- REGRD/REGWR get the register address in the first byte along the
instruction.
Reported-by: Igor Modino <igor@emutex.com>
Change-Id: I0da9de5ecd4cab914c8711bd4276e7a2bc6147a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
In order to change the baudrate the DLAB bit of the LCR register has to
be set to 1 (This bit is used to enable reading and writing of the
divisor latch register). This bit must be cleared after the baudrate
setup in order to access other registers.
The set_baud_rate function correctly sets the DLAB bit of the LCR reg but
never clears it. Therefore the ns16550 doesn't properly work any more
after updating the initial baud rate.
In order to fix this issue the LCR reg has to be temporary saved
(because it contains other important settings). After switching to a new
baud rate the LCR reg value has to be restored.
Change-Id: Ied4db683cbf40ba3125e747552968ddf1a66e2be
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
Signed-off-by: Sebastien GRIFFOUL <sebastien.griffoul@intel.com>
Update NBLE driver to use the latest firmware fixing the
dependency on the bt_gatt_attr structure size.
Change-Id: Ib93d7d29656028bfb06bbb6ca883816e2a7072fc
Signed-off-by: Louis Caron <louis.caron@intel.com>
on_nble_gatts_prep_write_evt() indicates that this is IPC function
which is not true.
Change-Id: Ic0c5f12136a84abd7b8e6144f7ca67f9b36968fe
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update NBLE driver to use the latest firmware fixing long write and
updating IO capabilities model.
Change-Id: Iea154f934dd6502fce3960763890ac15492c2952
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove gatts_write_evt() function since it takes conn reference and
forgot to de-reference. Use directly attr->write() instead.
Change-Id: I21737c8feda23ff7df154fcd72327b8ff2d59467
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
With *.h added, the REST processor does not escape it and it thinks is
a non-finished emphasis line (*ddd*). Although the rest generator
should be fixed to escape those things, we don't have the resources to
tackle that and removing '*.h' doesn't alter the meaning.
Change-Id: I6b39551fc8d37d8dd63a68ed70619fc8fb64f2e5
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Now that buffers can contain fragments we should always use the
net_buf APIs to read/write FIFOs and never the nano_fifo APIs
directly.
Change-Id: I203af43e887145a1b14f33a3729ef721fbd46469
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Remove duplicate I2C_QMSI_SS option from Kconfig file, as there is no
reason to have it twice.
Change-Id: I602677676419c3f9581a606e8e3ebb889b439eb7
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
The code was setting the interrupt priority to 1 for each
vector to start. But I think it might be more appropriate
to set it to the LOWEST priority. Some ARCs will have
upwards to 15 priorities.
Change-Id: I9330ec8df323fe04ba0751faaafa39694f012364
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
It's common for the rx_queue to be written to in ISR context (by the
HCI driver). This means that if there's lots of data coming in from
the driver the rx_queue might get empty very rarely. With the current
code this means that the rx fiber might end up not yielding to other
higher priority runnable fibers for long durations (as long as there's
data in the rx_queue).
To solve the issue, call fiber_yield() explicitly after each processed
buffer from the rx_queue. This way we give other fibers a chance to
run even if there's a heavy flow of data from the Bluetooth
controller.
Change-Id: Ib3dbe6536a62360ad5153ed12eee8489645e4109
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is similar to previous patch which makes the API much more simple
when handling long writes.
Change-Id: Ibd3856863a43927195e23936872a160d5ff94648
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
address was passed to QMSi port read function, even though
value is needed.
Change-Id: I6b923fdc56114936fb4a0c55c923d6b37884e07c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Do not use the QMSI specfic define, use the one define in the
i2c API instead.
Change-Id: I979673e35060d041cb97f4de178069e2bdfd2c7b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Print commands names when matched instead of first creating
completion string in buffer. Common part of commands names
can only be reduced when matching further commands so only
first match needs to be kept for altering command line.
Change-Id: I5a9d2eb171ef4d31da9cbe6e93b577457b13c5a2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Use the more explicit net_buf_get_timeout() call where it makes sense
(e.g. where we always want to wait or never want to wait).
Change-Id: Id1eabe0ad2f9fa79f7be39e51fefa5161f9cc550
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The driver for the HTS221 sensor was added with the wrong type stated in
the Kconfig file, as it is a temperature and humidity sensor and not a
magnetometer.
Change-Id: Icc50c9b7ccc491b1c22e13d00607123a45338b11
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Add driver for LSM6DS0 accelerometer, gyroscope and temperature sensor.
Change-Id: Ic04fa8d0bbf935e7f04ed7981554d8095ceb5ccf
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Check that callback is defined before call, fixes issue in
on_nble_sm_status_evt calling cancel callback.
Change-Id: Ie2f49ed6e441f4260dacd16120e09f892c1fd528
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This will allow the driver to be safe from fibers and task
Jira: ZEP-411
Change-Id: I714f22c8df7002c45bed981c493e11af91c70d93
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
The locking and synch mechanisms were configured after the interrupts
for the I2C controller are enabled, now the configuration is done before
the enabling of the interrupts.
Jira: ZEP-419
Change-Id: Ia1b0e790b9f5f8e7560cc3556b7a0f394048d171
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This will allow the driver to be fiber and task safe
Jira: ZEP-410
Change-Id: I61d3d9e4128bae781f1c86c07af79eb6e43ebeda
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Currently enable procedure can be called only once regardles if it
failed or succeeded.
Change-Id: I3869e97442720860baba7bb1b7610738ca95561a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Using atomic flags instead of bool allows adding new states easily
without aditional memory footprint.
Change-Id: I0289a49af8353dc832a33e16ebdd6651c3913fe3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Remove NBLE_GAP_SM_EVT_START_PAIRING handling since this is handled
now in the special pairing event and defer negative status handling to
the actual event code processing.
Change-Id: I232d9e5ecd09b2600df3ff04128dfb7f71a2eae2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_smp_auth_passkey_entry() and bt_conn_auth_passkey_entry()
functions to be used by apps and tester.
Change-Id: I600284334c67840dd0c17991596ad31986bf0afd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This moves SMP related code to smp.c making code similar to the tree
of firmware developers.
Change-Id: I5b43dcbe40a721e11b64cbdd4203406e721f40cd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
There is no need for struct bt_storage being modified by stack.
Change-Id: I732cf94983a29de40d692e802d6a71b8986708df
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Update RPC to the newest RPC introducing some security improvements in
the firmware.
Change-Id: If031bb13927d63e029fcc6da34051257d13632a5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move pinmux defintions under board/<board> and have all board
configuration in one single place.
Change-Id: I055b024384fae2938881b1c57d8ce7426e732e92
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For CMSIS we now have HAS_CMSIS which needs to be added to the
SoC definition.
Instead of changing the main Makefile we now include a sub-Makefile
with all related header and library paths that are hosted in
ext/
Move redifintion of LIB_INCLUDE_DIR later to get variables defined
in Makefile.toolchain.*
Change-Id: I9f90f90247c2a66b4565427b89d4e1d4dd5c9622
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change the dev name from PWM to PWM_0. This will make it
consistent with other drivers and also fix the device binding
failure in the PWM sample app.
Jira: ZEP-395
Change-Id: I90b945a7e57700d384eaa52e5300c881a3251d83
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This will allow the driver to be fiber and task safe
Change-Id: I916d4ad67ab6f51f41f3d1136c105e4d1445de48
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This will allow the driver to be safe from fibers and task
Change-Id: I6c4c4fc387cf334f0287b8a02982be1941a311fd
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
The TX fifo threshold is pretty arbitrary.
Set this too big and too many interrupts will occur
for no good reason. Set it too small, and latency
in the SPI transactions is introduced. User's will probably
have to tune this per their application and SPI frequency, etc.
I think setting this to 50% is a good guess for now.
Change-Id: Ib325d40bc7ee10473d99443b3b3cd00fd6e4b95f
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
The ethernet driver generates a lot of spurious interrupts.
These spurious interrupts have two sources:
1) The Mac Management Counter (MMC) module generates a lot of interrupts
(GMI - bit 27 of the status register). Unfortunately the Interrupt
enable register doesn't allow us to enable/disable it (bit 27 is
reserved). Therefore the only way to mask this interrupt is to mask
all the MMC interrupts (register REG_MMC_RX_INTR_MASK,
REG_MMC_TX_INTR_MASK and REG_MMC_RX_IPC_INTR_MASK). By default
these interrupts are not masked.
2) The RX interrupt is not correctly acknowledged. According to the
datasheet, NIS is a sticky bit and must be cleared (by writing 1
to this bit) each time a corresponding bit, which causes NIS to
be set, is cleared.
Change-Id: I2033973849d87cddc328c65d0d4ad36b5a0c934e
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
This adds simple tab completion for shell use convenience.
Change-Id: If90ded32fb5044741232933d2cb0ce626227d025
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to register callback that will be called to
perform command completion.
Change-Id: Ide7a0427d9b8bb4dd8cfc0995ef2567b32e89632
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Building microkernel for ARC causes a compiler error
due to missing declaration of _sys_idle_elapsed_ticks.
Declare this as extern.
Jira: ZEP-397
Change-Id: I83701f693fea0fcb1ae2c30e0c52abe7987de1f1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
I notice there are some more places in this file
that can be switched to using tabs.
Change-Id: I7dac2b91f932aa6f167b7eaf93e7c8f571a22d41
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
The file gpio_dw_registers.h already had the 4-port GPIO
registers defined, yet the gpio_dw.c implementation didn't
support it properly. There are 4 ports here, not 2, and only
PORTA can support interrupts and debounce.
On the em_starterkit board, for example, PORTA
has 3 bits for buttons: A, L and R. The other 3 ports should not
be used with interrupts & debounce.
I've re-worked this file to derive the port number from the
base address given. The lower 6 bits are divided by 12 to
derive the port number. From this, the registers EXT_PORTA,
EXT_PORTB, EXT_PORTC or EXT_PORTD can be read.
Also, for those ports that don't support interrupts,
set irq_num to 0, and that code will be avoided. I've verified
that I can access GPIO now correctly on the EM Starterkit. The
em_starterkit board support will be submitted soon but I'm
staging in this change first.
Change-Id: I98dbe083e03e046b40e07b4b14a99a39a6d0f0be
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
Convert leading whitespace into tabs in Kconfig files. Also replaced
double spaces between config and <prompt>.
Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Defer Prepare write errors to be sent in Execute write response
Per Bluetooth Spec. The Attribute Value validation is done when an
Execute Write Request is received. Hence, any Invalid Offset or
Invalid Attribute Value Length errors are generated when an
Execute Write Request is received. Fixes test case
TC_GAW_SR_BI_33_C (run with shell).
Fixes: ZEP-218
Change-Id: I3dc4583f519e0da2e1f741c9b532d6a6c1970225
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This fixes GATT Server indications.
conn handle shall be set to the valid handle, not 0xffff.
If conn passed to bt_gatt_indicate is NULL, indication will be sent
to every client subscribed.
Fix related to ZEP-403
Change-Id: Ie36b957fddfbc5485318bba649d15349e9293868
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Fixed doxygen comments for flash API usage. Clarified the use of
flash_write_protection_set API for write and erase operations.
Jira: ZEP-383
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Change-Id: I6a323915c63a393b7be8f96fe3fcd9616a9b21d1
Print flag for write_evt() to distinguish between write and
prepare_write. Add offset printing when reading.
Change-Id: I8b53d8f49657ade39b190ab33e99097bb172077c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fix a compile error when trying to set I2C address of LSM9DS0 Gyro to
VCC (0x6B) caused by a typo.
Change-Id: I27850ecd70e715a10b96572aedea0d237dd55cd5
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
I noticed that even though I was building w/o ADC, that some
ADC config symbols were still defined. Adding some "depends on"
to clean that up.
Change-Id: Ie73d131ba1ad63b5f3d920e17b4c7b5a0d785609
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
Provide functions of saving and restoring LOAPIC
states to support deep sleep.
Jira: ZEP-223
Change-Id: I1fb427989b021ec8e3a4f6dd0f4766a214360621
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Save and restore IOAPIC flags and irq to vector translation
info for supporting deep sleep.
Jira: ZEP-223
Change-Id: Ifc50a5a72699ff6782ad194d8e96b18fac34da18
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
In scenarios where device PM is enabled and dynamic irqs are
used, move the irq to vector table to RAM and keep it updated,
so that we can use this to restore IOAPIC/LOAPIC vector entries.
Jira: ZEP-224
Change-Id: I0d4350d4e30f8ca337a2a1d4f012748c3cb450f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
This is external source code maintained somewhere else. Put it
under ext/ for clarity and maintainability.
Change-Id: I9e7c9d0948a2ba893006e316dc21d9b1a9edfa93
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add I2C QMSI shim driver for sensor system based on QMSI 1.1
Origin: Original
Change-Id: I9c8efe49e8e9b7a5f8496fa49beb68e409148be7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add QMSI 1.1 based GPIO sub-driver for sensor system.
Origin: Original
Change-Id: Ida5565a5911eb55651a11a4ac0b240c624f8e1ca
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add SPI sub-driver for sensor system.
Use SPI irq number definitions already in Zephyr header file.
Origin: Original
Change-Id: I215db3acc535093dd75c0817cbe5af77e6e76e16
Signed-off-by: Baohong Liu baohong.liu@intel.com
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Attributes should have stored their own attribute handle after
registering service. Handle values are assigned to attributes after
registering service and stack has to copy them.
Fixes:
GATT TC_GAD_SR_BV_03_C PASS
Change-Id: I8463340960d663161d0f7990390e60f06a1c7259
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This enable checking for errors and automatically print help string:
btshell> connect
connect <address: XX:XX:XX:XX:XX:XX> <address type: (public)>
Change-Id: Ie097ecddb72ab15bf6192e310d0bd839bfd251d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Remove the CONFIG_SENSOR_DEBUG as it is no longer needed since switching
to SYS_LOG_* in the sensor susbsystem.
Also, use __ASSERT where CONFIG_SENSOR_DEBUG was used to validate
function parameters.
Change-Id: I80ed7209abfb92220fa229d246c5b3a43b887e32
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
I've found many problems with the SPI driver and this repairs many of them.
The baud rate divisor was being derived from the CPU clock. But, some
targets may have a seperate clock attached to SPI. If the soc.h file
defines the symbol SPI_DW_SPI_CLOCK, it will use this instead
of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for the baud rate calculation.
completed() had a mistake where it would terminate the SPI transaction
too early, well before the tx data has cleared the FIFO. I found I couldn't
drive an OLED display correctly because completed() was wrong.
The repair is to now consider a new flag called spi->last_tx,
which will be set after the TX interrupt occurs with nothing to send any
longer. There is also a while loop added to SPIN until BUSY drops.
Another improvement is that push_data will NOT consider RX fifo size
if there is no RX going on. The calculation here when RX is going on
could go negative. I've added a check for that and prevent TX handling
if RX buffer is full. I think that is the intention -- to deal with RX first
if its fifos are more full.
In spi_dw_transceive, if we are only doing spi_write w/o reading,
don't enable RX interrupts at all. The OLED I'm working with failed
to have a pull-up on MISO SPI signal. As a result, a huge number of
garbage RX events arrive, and the interrupt handler finds there is
no rx buffer, so it tosses the data. But this is a waist of realtime.
It seems WRONG to enable RX interrupts if its something your not using,
so software can GATE these spurious events in this way.
With these changes, SPI can be used much more reliably, with FIFOs
that are deeper, and SPI devices that only require TX.
Change-Id: I0fe0745f2381c61c8a19ce086496b422a32a30a5
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
This checks if the command string is either NULL or empty since in these
cases there shouldn't be necessary to do any lookup.
Change-Id: I27e6d5b07ab4000cce93a4d1f7952e3c57672657
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Contrary to strcmp strncmp does not match the entire string only the
initial bytes passed as len thus causing a prefix match not a exact
match logic.
Change-Id: I85f96beb2249223f44c81c4efd6bd01bf2033a2e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Firmware does not filter by UUID so we need to do this ourselves.
Change-Id: I55808836369194fbc5ea7c35db2c72fcda75e4eb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This adds a optional help string to the command table which is printed
when user enters > help <command>.
Change-Id: Id3a8995bb6c4ff6b009418e31968c0677e6e4921
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When using the Synopsys DesignWare Synchronous Serial Interface (SSI),
the FIFO depth can vary from 2-256, depending upon how this module is built.
For quark_se_ss, it was using a depth of 8. For EM Starterkit, it will be
32. Adding this now as a configurable option. A larger FIFO really helps
reduce SPI interrupts.
Change-Id: Id2bc8470bfc08ab447d38b89c7904cff010c63bd
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
Just as rxftlr can be read, a macro is needed so that txftlr can be read.
Symmetry.
Change-Id: Id987f700d89268feca60850f4fdf512f990f3ab6
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
A recent submission caused a build error for DW
CONFIG_SPI_DW_INTERRUPT_SINGLE_LINE because the symbols
CONFIG_SPI_<0,1>_IRQ went missing from Kconfig.
I think these should probably NOT be configurable, because
on an SOC, interrupt lines are hard. So I'm changing
the names back to SPI_DW_PORT_<0,1>_IRQ, with there
definitions originatig in the soc.h file.
Also, on DesignWare ARC EM Starterkit, the SPI interface
has 6 slave selects, but IP itself can handle up to 16.
Why does this start from 1 and not 0? Argh!
DBG_COUNTER_RESULT() should expand to 0 when not used.
Also, don't check version from DesignWare IP because
it can be different for each target.
spi_dw_isr() requires a cast when converting arg to dev.
Change-Id: I83d55e0405583e7cafab80b09cbef44e0f96fcb8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
* Rename BMP280 to BME280 which is a superset for the former.
* Autodetect device based on chip ID.
* Implement humidity fetching and reading for BME280
* Rename sample BMP280 to BME280
Change-Id: I565c769a7011e7496c9f1cad861d5ee311839b4f
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Check if return value is negative when checking for errors, instead of
checking if it's 0.
Change-Id: I0b0af28c02b3760f3128e8cbe48908dabc89af88
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Update all drivers that have vectorial data to return all 3 channels (X,
Y and Z) if the chan parameter is _ANY.
Also fix a compile bug in LSM9DS0 MFD driver.
Change-Id: I5bf261846bcd68c288b96997ff164726f75c151c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
This is actually a revert from a previous revert. This updates RPC
following the very recent firmware development.
This reverts commit a146f9ef28.
Change-Id: I67b517c3959b5b78a5ef80fbb338d6cc66e43e8e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove the homegrown sensor delayed work API in favor of using the
system-wide workqueue. Drivers still have the option of using their own
fiber.
In a second step, drivers can be refactored to start and use their own
workqueue.
Change-Id: I70dea6fc2abcbc9e04ac1ed3c837483a3d3c4424
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Call bt_conn_security() the same way it is done in upstream code for
NBLE. Currently use BT_SECURITY_MEDIUM as default sec level.
Makes at least following cases pass:
...
1/6 GATT TC_GAR_CL_BI_05_C PASS
2/6 GATT TC_GAR_CL_BI_17_C PASS
3/6 GATT TC_GAR_CL_BI_22_C PASS
4/6 GATT TC_GAR_CL_BI_27_C PASS
5/6 GATT TC_GAR_CL_BI_33_C PASS
6/6 GATT TC_GAW_CL_BI_06_C PASS
...
Change-Id: I2a0c177a187db931e88e2f82a5bda1c0cc04a112
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add driver for the Grove Temperature Sensor which measures ambient
temperature.
Sensor reference page:
http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor
Change-Id: I4f56224be5fa7a968749d5d4df8cb99a462c3c21
Origin: original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Add driver for the Grove Light Sensor which detects changes in ambient light.
Sensor reference page:
http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor
Origin: Original
Change-Id: I88ae20cc9faa8ab8f274b0bd7a114db5c1a87a91
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Use the same Kconfig infrastructure and options for all SPI drivers.
Jira: ZEP-294
Change-Id: I7097bf3d2e1040fcec166761a9342bff707de4dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.
Jira: ZEP-294
Change-Id: I962ce36b7e2361ea77ae4178bb7c86c19a241c4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.
Jira: ZEP-294
Change-Id: I7688ca523915e3fa8a1d28dea7a1d84a66b39d56
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds a notify_le_param_updated function to call registered
le_param_updated callbacks with new connection parameters.
Change-Id: Idd660f7ca024c2f7712a6a41a51db77e4fc82a00
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This issues connection parametrs update on new connection event,
to mimic Zephyr stack behaviour.
Change-Id: Ic3fa86a02ff9a5135a026dfff6d2fbfb890656c1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This adds implementation of bt_conn_le_param_update function.
Connection parameters can be only issued while in slave role,
because, nRF51 supports this procedure over L2CAP only.
Closes ZEP-222.
Change-Id: I2bb5f718b60b8be279f333c9721629662c029a32
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
on_nble_gap_conn_update_evt gives information about new
connection parameters. These shall be stored in conn.
Closes ZEP-222.
Change-Id: I69e36136cfae98821b1f5467c72c94dbc6f1d10f
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This function will be used by bt_conn_le_param_update to validate
parameters.
Change-Id: Icd60d74dae3bf467af4b7277d1516b978ba937a5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
According to the data from nble_gap_connect_evt,
role_slave is "0 if connected as master, otherwise as slave",
so to be consistent with our API, this shall be mapped to
either BT_CONN_ROLE_MASTER or BT_CONN_ROLE_SLAVE.
Change-Id: Icf31ef02ea178e04cb28b2611e09b06c23f49704
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
IC_CON_SPEED_MASK isn't used, but I see it was defined wrong.
It should be a 2 bit mask.
Change-Id: I1003ae13b831ff481574bcf956daf2c54dbe7e47
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
The function i2c_dw_isr() in this file appears to have the wrong
decl for the IRQ_CONNECT macro. It should be: void i2c_dw_isr(void *arg).
Also, at the 2nd use of IRQ_CONNECT there was a variable created
and then marked as UNUSED. I've removed this.
Change-Id: I3f2c4ecb5c13147d577c82a0ec4fe486ae38a475
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
Some ARC targets can have a data-cache. Although there is no special
instruction to clear exceptions during early init, it is necessary to
invalidate the d-cache BEFORE any data is fetched. The ARC on arduino 101
doesn't have d-cache, and will thus skip this d-cache invalidate.
Also, it is important to set the vector table base register to point to
the interrupt vector table EARLY, so that if an exception is encountered,
the correct vector table is found. Set this base only if it is found to be
different from the one compiled in to the code.
These initialization steps assure that proper exception handling
is in place during early init.
Change-Id: Ie8b5928e5813e104680a6d6510c85d32dc8ed8f3
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
gatt_private should be reseted whenever used otherwise other commands
may fail when attempt to use.
Change-Id: I8bdda3d5136368a8f37fd9e2afd97e0957c4e04e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes bt_gatt_write similar to bt_gatt_read where the parameters are
stored in a struct which can be used to store intermediate values while
the operation is in progress.
Change-Id: I3c62af137b99985690cf88dcc37a977a0be891f5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Due to the recent changes, read parameters pointer is passed as user_data,
not as gatt_private.
Change-Id: I08b59164acfec8d71801ae2a23ce51abad080dc8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Revert to RPC to BLE Radio Module 0425 as it is going to be official
open source release beta.
This reverts commit a52d7d7fe0.
Change-Id: Ibdb98b26bcad0a04849e89622527884a2b67c8d4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Comparing the Synopsys GPIO driver with the one here in Zephyr revealed
that some register symbols are missing. I am adding them now, and will
be working on getting GPIO working on ARC EM Starterkit board.
Change-Id: Ifccd1e225eb1373a31c6a5c51cf3927e42601d1a
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
The timer implementation for ARC currently requires timer0 to be present.
I've added a comment that this is an assumption and to encourage developers
to build the ARC CPU with Timer0, when it is to be used with Zephyr.
There is also an optional provision for a Timer1. In future, this
code could be conditional to use either timer.
Change-Id: I4eb3aec59ba4e85f8b70d5531b21bdaab00b93bb
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
Fixes using uninitialized structure nble_gattc_write_param in
nble_gattc_write_req().
Change-Id: I476a3b833994c422691bf96dc0b2174368c47fa6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since RPC to the Nordic BLE module has no flow control increase
receive buffer pool to handle events from the module. Without this
NBLE stack is not capable of handling all events and we get "No
buffers" error message.
Change-Id: I0566b30a95ef0a027d4533c83c3c2915018a650a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
on_nble_gap_connect_evt() gets called in a case of incoming connection
but also with outcoming one. In this case connection is already
created so we should use conn_get() instead of conn_new().
Change-Id: I2ed2d0a1844f653000a12eb0f54f52533856bf0d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update RPC following major RPC update in firmware.
Change-Id: I4094b94319359a59164ac69394937ac1472b8cbe
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Looks like this snuck in with the GPIO API migration.
Change-Id: Ib58142e134a779431bacf9ca75a66541bf63d5b0
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
set_ad() already checks for length==0 so there is no need for
checking if sd is valid.
Change-Id: Idc0ce9135eca56a1e8057f3a2129adb0b5e5ddd7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Getting params from user_data seems to work now.
Change-Id: I81bccea9aa6994d3c09a3ff03a49fa6767e7305e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
In on_nble_gattc_discover_rsp conn->gatt_private is set to NULL prior
to calling this parser functions. This fixes this issue by passing
discover params pointer to these functions.
Change-Id: I6669cb0d16dc65d532e17f96ceb9cd94dbe6ce08
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Updating function names prepares for firmware RPC update, to this
moment only names changed.
Change-Id: I8d19e83c5c88a4b41ed803e276652eb15e0d87b1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This patch removes the PINMUX_SELECT_REGISTER macro definition from
pinmux_dev_quark_mcu.c since it is already defined in pinmux_quark_mcu.h
(which is included by the .c file).
Change-Id: I468cf6a54fc30d681f42a59eb2c8401d2b180849
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Add implementation for pinmux pin get API in the shim driver.
It is based on the function from pinmux_dev_quark_mcu.c
Jira: ZEP-189
Change-Id: Ib6673f90cfe8e367fcbd12ed546b1fa3af7e1dbf
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Current QMSI SPI API does not handle asymmetric tx/rx buffers, and thus
it's up to cc2520 driver to manage the tx dummy bytes.
Change-Id: I97900946bcd8d96e9f039646bccd765c574c363e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There's no need to drain twice if NRF51_PM is enabled, the draining
shouldn't use rx_ready(), and it should happen after disabling
interrupts. Also rename uart.h to util.h to avoid conflicts with
include/uart.h and remove the left-over ISR prototype declaration.
Change-Id: Id38110dd38cf48edfe4a7b8e2e68cd358a9aa5ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Update function names following firmware name changing.
Change-Id: I8b42c4d9f5c892abec10d8653544c3e03e4ee80d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
It's possible that there's a queued event from the nRF51 at the point
where we start resetting it, resulting in the stack receiving two NOP
events. To prevent this, make sure to drain the UART while the
controller is in a powered off state.
Change-Id: Ic009e11c11ac750fc76c881c0ffe9bd12d38da0a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of requiring application to provide both advertising type
and address type used just require app to provide info if advertising
is connectable or not. Advertising type is set based on provided
SCAN_RSP and local privacy support.
When local privacy is enabled it is no longer possible to advertise
using identity address. If such feature is to be required later on
advertising options can be extended.
This gives BT stack full control over what type of address is used
for advertising and is a preparation for random address rotation
and OOB support.
Change-Id: I90e9a683ef3794f155707343c874f75585439325
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
In a case connection is not known implement notification for all
connections the same way it is done for HCI stack. Attribute database
is scanned for CCC attribute and notifications are sent to all
connections.
Change-Id: Id556b4aa5af124aea672891ca89b278c71519643
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Use similar to HCI stack cfg structure to keep value.
Change-Id: I54cf731971c5e2822385dc8eb295ce9951969af6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Save peer address to use it with bt_gatt_notify()
Change-Id: Ie5e3af4cdc2d225c9572e010359f59323ae493a7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Basic build framework for Nios2. Everything is stubbed out,
we just want to have a build going so that we can start to
parallelize implementation tasks.
This patch is not intended to be functional, but should be
able to produce a binary for all the nanokernel-based
sanity checks.
Change-Id: I12dd8ca4a2273f7662bee46175822c9bbd99202a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Private gatt data from connection is indicator if another operation is
pending. Some att commands may be called within discovery callback
like subscription on ccc (within characteristic discovery procedure).
Without clearing conn private gatt data member, leads to rejection of
called in callback att command due to being "busy".
Change-Id: I72a35ed82dac2f0538f2d1637163bd2302f0b072
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This callback is needed to successfully perform write operation.
Change-Id: I09776dda16dac639320a7e83a66e7a9b31ebea6a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
conn object pointer has to be passed to the write callback instead
on NULL pointer.
Change-Id: Ifde88be0a43bcd9e1acbe11b16512776cd18fc66
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
If attribute has no write callback, BT_ATT_ERR_WRITE_NOT_PERMITTED
error shall be returned.
Change-Id: I9277f8682597ee7f93a1267d2de31b3cc245f1cd
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
* service include macro definition takes reference to
first service attribute of the included service
Change-Id: Ib2b1defe2c99aea738da791af74a534d56025eae
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
-EIO is an error code for operationnal error, not about invalid
argument.
Change-Id: I7064eaf01c6040d2e93ed43df3932d8baed1256e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add debug for bt_gatt_notify() and print parameters in
on_nble_gap_conn_update_evt().
Change-Id: I5b61b5dbf508a2ee8e0b79c8636bc2dc710fb2ef
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since the header was updated type cast is not needed.
Change-Id: I6a232cd8515fb48ef2a0d16cc064effac7b80bfd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The pinmux_stm32 and pinmux_dev_stm32 drivers use errno codes so they
should include errno.h.
Change-Id: I3fd19b338d5525f44207e8c770285ef218dd27a2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
DEV_* error codes are deprecated and should not be used anymore. This
patch replaces DEV_* occurrences by the corresponding errno.h code,
according to the error code conventions.
Change-Id: I2f38c869b4e00d22145e24375796ba6bf216b084
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
DEV_* error codes are deprecated and should not be used anymore. This
patch replaces DEV_* occurrences by the corresponding errno.h code,
according to the error code conventions.
Change-Id: I7b098a6107c390b46ed15aaeb9141627e9502727
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Refactor all sensor drivers so that they use SYS_LOG instead of
decentralized systems/functions.
Change-Id: Ibd9443e06004341bc5e9afaf5b49bbec547e073d
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Split driver for LSM9DS0 gyroscope in core functionalities and trigger.
Change-Id: I19736b65f45a6c4fc79a1f16423097b89accff24
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Split BMC150 magnetometer driver in core functionalities and trigger.
Change-Id: I955ac39c2e995a81fa830776da9c0bcc38d9490a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Add device driver for the multi function device (MFD) part of LSM9DS0:
accelerometer, magnetometer and temperature.
Datasheet:
https://www.adafruit.com/datasheets/LSM9DS0.pdf
Change-Id: I00b9db2c69c6e5229269afacb02bf5f921edabe9
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Runtime configurable attributes are now matched with the smallest
available value that is greater or equal to the parameter instead of
returning -EINVAL.
Change-Id: I9ca8e2eba443fcd247c329c6ce71dc2167fb7f03
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Rename sensor_value_type enums from SENSOR_TYPE_* to more concludent
name SENSOR_VALUE_TYPE_*. This change is required if we want to
introduce SENSOR_TYPE_* (SENSOR_TYPE_ACCEL - if the sensor/driver
supports accelerometer, SENSOR_TYPE_MAGN - etc.) in the future.
Also it is more clear with this notation what these enums are referring
to.
Change-Id: Ic58e29288669e10c0695e0f86f59b0e57f7ac38c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Now you can specify the sensor type you want to fetch using
sensor_sample_fetch_chan. This will inform the driver that you want only
one type of data updated, leaving the others unchanged and enabling
different sampling rates for multi function devices (MFDs).
Change-Id: I403e422dffadc697c19a5372ed55ed8f486a2607
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Assign driver_api only if *_init is successful.
Change-Id: Ib95cd358af358aec4fc58ff10dcede05fad00d0a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
* Fix coding style so line length does not exceed 80 chars.
* Remove unnecessary casts
* Remove unnecessary variable prefixes (from *_fiber_stack to
fiber_stack)
* Rewrite lsm9ds0_gyro_channel_get into more readable form
Change-Id: I086562644f707d9d6538cb34d000012464b02fe3
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Now that there's a helper for clearing nRF51-side bonds we can use
that in bt_storage_clear().
Change-Id: I9eea4b100834b150e7c55a5141f1624853335c0a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To ensure reliable behavior when pairing we need to clear the nRF51
persistent memory upon init.
Change-Id: I204bb27e7c6e33dc5dd006ad9937645e907e770f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use I2C register access API for writing/reading registers.
Change-Id: Ic35b3e7159f9827f2d202d8cd1ae8f26ee6300f1
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Use I2C register access API in drivers of sensors that have
8-bit registers.
Change-Id: I33e016feff09be396eae70fb312de055c49caca7
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
The regression was introduced by the following commit:
sensor: bmi160: Use the new GPIO callback API
The problem was that ipm context was not set when registering the
callback.
Change-Id: Icbe8fb9670b9e7e7d489e70adf93ff62fed98935
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
The nble firmware supports a max ATT MTU of 23 (i.e. the default).
Change-Id: I70f55b00b50b2ad6540850d594a6d2fb89b11d1a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We should be looking up the appropriate connection object and passing
that to the callback.
Change-Id: I04620b301541c8bda45f20e2b1dcca8f71562821
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We need to reset len to 0 in case of failure to prevent the nRF
firmware from reading past the end of buffer. At the same time clean
up the code a bit.
Change-Id: I2ac9a86e0f7704ae55c9b2758e02dfadf650f549
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Other IOs use this format, so lets be consistent and use
I2C_0 instead of I2C0 and I2C_1 an instead of I2C1.
Change-Id: I591ab08e14bd533ef0fac38e596559da783863b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
gpio_set_callback() is meant to be deprecated and thus modifying the
driver to use the new GPIO callback API.
Taking the opportunity to use ipm API properly in order to remove the
struct bmi160_data singleton.
Change-Id: Iafcf3fed10bd286962829a4157effd054dd78c1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Update RPC to Nordic BLE radio module to 0425 revision.
Change-Id: Ieb79821acd5a8fbc4358ea5e1f258834a7932c2c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
On current Curie-based boards UART 0 is wired to the nRF51 BLE
controller and requires HW flow control to be enabled in order to
function. This patch restores the same behavior that was present
before the "qmsi: uart: use built-in qmsi driver" patch.
Change-Id: If7ea347f5ab8b460f39123dcc0d75d711a5a1c2a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Adapting CC2520 driver to use the new callback format. That way, cc2520
will work on boards where FIFOP and SFD are hooked to a different GPIO
controller.
Change-Id: Ia40b17867000de26f332f36422f84bb3f20be2aa
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Adapting GPIO based sensors to use the new callback format.
Change-Id: Ibdc68bf80a2ee42dcaf25c7a6e4431f9b64dc20a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Many sub-systems might require to set a callback on different pins.
Thus enabling it via changing the API.
It is also possible to retrieve private-data in the callback handler
using CONTAINER_OF() macro (include/misc/util.h).
Former API is still available, and is emulated through the new one.
Using both should not be a problem as it's using new API calls.
However, it's now better to start using the new API.
Change-Id: Id16594202905976cc524775d1cd3592b54a84514
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To show possible usage of the device_busy_xxx() APIs.
Meant to show how drivers and power policy manager can use them.
Change-Id: I49d1dedd9a7b8d6bf09080c6c7243f0666330941
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
For linking with external library, use QMSI_LIBRARY and point
to path of the library using QMSI_INSTALL_PATH
Change-Id: Icd954188a26cc02074aa8fe08a4afdea31879f60
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fix naming and use a global driver name for instance.
Change-Id: I30a54cb9c20773e1b6fdc57b934aa564612a6c45
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not depend on specific implementation of the driver, use
well-known driver name used across multiple IPs.
Change-Id: I823fcfa01ce1484dd89f6ade8fbe7017f2084bc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not have priority per IP, use one config instead.
Change-Id: Ieb2923d4749a294e2a1c677d47d56a14cee3f36d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use same string for driver name used for binding and fix
sample app to work with multiple drivers, not only DW driver.
Change-Id: I4d40aa9d4e83fcf16dc883bb74c3f0e3e30e3502
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This is more of a convenience to let the driver identify itself in
debug logs and the monitor protocol.
Change-Id: I73351477e98d45d6344c180b8088bde29df6f7d9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The bus that we notify over the monitor protocol is really driver
specific, so let each driver specify their bus type.
Change-Id: Ic3a086fcc06352dbf051e52cef5bf6b8696349ae
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
() Make driver API into const, as it is not being modified
at runtime. Saves 24 bytes of RAM by putting it into ROM.
() Make device config structs as static as they are local to
the source file, and should not be referenced from outside at all.
() Same goes for the IRQ configuration functions, by declaring them
static.
Change-Id: I5225dc550bdd65ec88a8930944da063efe16a3b2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove handling not used and obsolete function prototypes.
Change-Id: I6086f2e13efe7fc219f237dda710a545bec07612
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update RPC adding gap_tx_power request and event. Corresponds to BLE
version ATLASEDGE/PVT/FACTORY-386-gc1f694b.
Change-Id: I7e47553af63c3c3405522e37f86d9004dcca46f7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add support for anymotion and data ready triggers. Also, the user can
choose at configuration time the source of the triggers. For quark, in
particular, since the current driver for ARC does not allow receiving
interrupts from AON GPIO controller, IPM is used: a helper app on x86,
registers a gpio callback and will 'relay' the interrupt, through IPM,
to arc core.
Origin: Original
Change-Id: I170d723425c6280f9aa8c240b66275647723edd9
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
These will be needed by the trigger implementation.
Change-Id: Ib408ae540571447059301046a3486cedffa735d5
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
A mask was not applied on the shifted value, hence allowing one to pass
a val that would change other fields in the register.
Change-Id: I3c7bdb24c7b3a0ce94f664dbba303db35660ce7b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
These will be used in the trigger implementation, which is a different
file, and will allow for the arrays to be static.
Change-Id: Ia34ebe9bde7d09abe8e93f3ace9e282cee1169db
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
The macro will be used in the upcoming trigger file.
Change-Id: I57a570fde37f31771b3d8bb9c028520fdc41da8f
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Fixes compilation with debug for drivers h4 and h5
Change-Id: Ia09ce0a5ca3d684a4f9d25fdfe8530e80a46afac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add configuration for OLIMEXINO_STM32 board.
By default, the UART console is forwarded to USART1 available on
UEXT connector. All GPIO ports available on the connecot headers
are enabled.
Change-Id: I60b3ff20ea60b5294a3a6c31f4dba0802794f9d8
Origin: Based on nucleo_f103rb board
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
This prepares for adding other debug types besides the printf-style
logging to the console.
Change-Id: Ic2ed305192491734da991c4f61fdaace03fd60f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add support for BMC150 accelerometer which differs from BMA280 only in
id, I2C address and acceleration data width.
Change-Id: Iccf47ecc5de9fdb1b9e45f1561c5dbb54f720806
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
The values from the accel data sample msb and lsb registers need to
be concatenated (using bitwise or) and not added, since together they
represent a single 14-bit value.
Change-Id: I476f05512beb3d6b81bacefd4c52e4b2a541708b
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Compute acceleration data and threshold scales based on data width and
acceleration measurement range instead of defining LSB values for each
measurement range.
Change-Id: I2a15877cef00d49d7a64fd6f6003722bb9f80b92
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Add Kinetis SoC family and rename fsl_frdm_k64f to mk64f12.
This will allow adding new SoCs of the same family and the reuse of code
among SoCs of the family and series.
Change-Id: Iea1a663aef7ce0487f147bdd36f668bebe80deb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use SOC_SERIES_* for naming SoCs with similar features and architectures
with the goal of code reuse. The Series in the config variable should avoid
name collisions and clearly denote the relationships within an SoC family.
Change-Id: I7a98542f96b5d5dc3acc23782c4d45f98cceb599
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use CONFIG_SOC_FAMILY for the top level SoC family. A family
will have different SoCs or different SoC series with multiple
SoCs.
Adding the Family string to the config variable to avoid confusion
between actual SoCs and families and to prevent name collisions.
Change-Id: Ic99a2c1df7850dee3a45641027af82464dd6fadb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The driver should not request any more bytes if it expects no empty
space in the FIFO. So fix the bail out condition to (<= 0) instead of
(< 0).
Change-Id: Ie16faf1da7df678fc8ab5af7ab33d7c0a2cdba7d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some controllers will emit an initial "NOP" Command Complete event
during initialization and expect the host to only send commands once
this event has been received. This patch adds a new Kconfig option to
be used in the case of such controllers and defaults this to true on
Arduino 101 with the H:4 driver where this behavior is currently
observed.
Change-Id: I440f14a7c07ac27545febf9f85ebcc343e2a4558
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Currently, the /CS pin is deasserted by _spi_config_cs() and
the pinmux driver sets it as an input afterwards. Later, setting
the /CS pin to an output via pinmux_dev asserts it.
Setting the SPI port 1 pins in the pinmux driver saves a few lines
of code. Moving the SPI init after pinmux init keeps the /CS pin as
configured by the SPI driver.
Change-Id: I4c587ba0a6983cd89dfb5ecedb2914335e86313b
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
Add driver for the TMP007 intrared thermopile sensor which measures
the temperature of an object without direct contact.
Datasheet:
http://www.ti.com/lit/ds/symlink/tmp007.pdf
Origin: Original
Change-Id: I29857b2e424a2144370d75e2ee40c4ff8b619afd
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
A debug server might want to redirect outgoing characters on the console
to another output if it piggybacks on the serial line normally reserved
for the console.
Change-Id: I534f5b35456306940a3926f52fe5cce2d5c94da4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Quark flash sub-driver. It is based on the QMSI driver.
In order to enable this driver, the following options
must be set.
CONFIG_QMSI_DRIVERS
CONFIG_QMSI_INSTALL_PATH
CONFIG_FLASH
CONFIG_SOC_FLASH_QMSI
Origin: Original
Change-Id: Iffbea3b17624c755e367677b76d7216c2fba2ca1
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Since device_get_binding() will not return any reference to
a driver instance if port->driver_api is NULL and grove_lcd
does not have any API struct, just populate it with some
magic number so grove_lcd can be referenced.
Change-Id: I16bdd13dfb49c54b5bdff34c4a4124af229aa20c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Note that the failure case can only be reached when compiling
for ARC side of Quark SE. Otherwise, the code is never compiled
which reduces code size for other platforms.
Change-Id: Ic76890cbaf22da5c3563e056cba9b39615d3da0c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Note that the failure case can only be reached when PCI is enabled.
Otherwise, the if-block is always false, which reduces code size
for non-PCI platforms.
Change-Id: I71656468eaee702bc481f5fbd490677b7bc491c1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Note that the failure case can only be reached when PCI is enabled.
Otherwise, the if-block is always false, which reduces code size
for non-PCI platforms.
Change-Id: I1f9def66b2ce7f08fc13b8f03e675ce4cd469e6d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Note that the failure case can only be reached when PCI is enabled.
Otherwise, the if-block is always false, which reduces code size
for non-PCI platforms.
Change-Id: Ib98b78a75cc2a5f124e67f32f2bf82960a963aec
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This converts the pinmux/dev drivers to use DEVICE_AND_API_INIT(),
since the driver_api assignment will never change.
Change-Id: I0063b19e2afe932e1daf3255e718455aaa200ff1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This fixes conn->gatt_private = NULL pointer dereference that occurs
in the next Read Blob Response, here:
/* TODO: Get params from user_data pointer, not working at the moment */
params = conn->gatt_private;
Change-Id: Icf280c856133a4c91fc10475d3a047809f917f46
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
If incoming pairing request would result in JustWorks pairing this
can be used to request consent from user for accepting it.
Change-Id: If0695d0e1bb010bade6a16abe1b57a2ce07856cc
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Parse include function intention is to return last parsed included
service handle. Next discovery iteration of included services should be
started from last found included service handle instead of end handle
from included handle value (which contains attribute handle of included
service declaration and the end group handle, BLUETOOTH SPECIFICATION
Version 4.2 [Vol 3, Part G], 4.5.1).
Change-Id: I73fe4027cb616242e838ea54c61b7780f1838e52
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
If on_nble_gattc_read_rsp returns an error, this error shall be
passed to the application to let know that Read Request/Read Blob Request
was aborted due to ATT error received.
Change-Id: I0efe26ec90fe27a1ab3c791e555ebe682927ab57
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
The Read Response only contains a Characteristic Value that is less
than or equal to (ATT_MTU – 1) octets in length so, condition
(length < bt_att_get_mtu(conn)) is always true, and the full
Characteristic Value will not be read.
Change-Id: Ib18fbedf277c880dc5cf0ce21fd7d550d12a64ef
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Disable reception and the oscillator as well when stopping. Revert
when starting.
Change-Id: I2a61066602267ac61e691ec9c20eb243de6fa076
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This prevents false packets to get accepted/generated into RX fifo.
Also, this will make AUTOACK working properly, when enabled. For some
reasons FRMFILT1 and SRCMATCH need to get their reset values written at
initialization, or then hw filtering won't work. This behavior is not
documented as it seems.
Change-Id: Ic0fe664dbc3b17d85d794c12b77bdbaafeb601f5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
For hw filtering and autoack to work, all the information should be
properly set in the chip.
That's a fix for the legacy radio/net API. From original code, these
were set from the application which is bad. But setting it from the
driver is not any better. ieee802154 and net stack should know what to
do, that will be fixed in the future.
Change-Id: I1688223e9488d10a423e788eb88ba1e251cb3f88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Slope threshold attribute values should be received in m/s^2 instead
of Gs, since accel channels return data in m/s^2.
Change-Id: I0669345ff8af8559e47895bca8225e15d2576a06
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Use the SENSOR_G constant from sensor.h in all accelerometer
drivers, instead of having the constant redefined in each
driver header file.
Since GRAVITY_CONST was measured in mili-m/s^2 and SENSOR_G
is measured in micro-m/s^2, some changes to the calculation
of the acceleration data were added.
Change-Id: Ia323dfc46bee00035e24b37e1b7fbc886dfbe029
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
If the driver fails initializations, do not set the driver_api.
This follows the idea that device_get_binding() will not return
a reference to the driver instance when driver init fails.
Change-Id: Iff56b4150658a76567928b1fd166bde5d2848d52
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Because the random number generator is very dumb at the moment,
the generated MAC address has always last byte set to 0.
The MAC address is used when generating IPv6 address.
In order to avoid IPv6 address collision, swap the last four
bytes of the MAC address so that the most random data is
at the end of the MAC.
Change-Id: I96c03654359e32f407bab3b29be0e3b08ee91bd7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.
Change-Id: I69590c463b84877d250c63d4460b7e254b79c8b3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.
Change-Id: Ibf08cb107885da7c1037c6e7d207530e1a4708f8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.
Change-Id: Ia0c7a0014eb28624cbf363f994d6149f1aa5aadd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add read multiple attributes request and response. Update RPC version
to niko-0412.
Change-Id: I5dfd99a1b8af866b69eae230ad24304eafccab4d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
So far the assumption has been that the host stack manages all
incoming and outgoing buffers. For the incoming buffers (from the
controller) this has required hci_core.c to manage its own pools and
do the host flow control. This setup makes perfect sense for an
architecture where the controller resides remotely on a different CPU
& address space (i.e. the "traditional" HCI transport case).
When the stack runs on a system where the controller resides in the
same address space this setup doesn't work that well. In such a
scenario the incoming buffers are ideally created as low down in the
stack as possible (i.e. below HCI), which means that the current
hci_core.c cannot be responsible for managing their pools.
To allow for both types of architectures this patch introduces a new
BLUETOOTH_HOST_BUFFERS Kconfig option that can be selected to say that
host-side management is desired, or deselected to say that the
controller (residing in the same address space) takes care of managing
the incoming buffers.
So far the incoming buffer types were identified by hci_core.c by
looking at their "free pool" pointers, however as soon as the pools
are allowed to be somewhere else this doesn't work. To solve this we
now require a minimum user data size for all Bluetooth buffers and use
that to store the buffer type.
Change-Id: I14bc32007e3e3f17c654f71f79b520650028d7ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The D2000 CRB is similar to the Arduino 101 (at least as GPIO is
concerned). Add support for using the GPIO controller without QMSI
libraries.
Change-Id: I001da05c9a9d5771b2ec678a9d4a91c44db05289
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Without this conn.c will cause logs whenever BLUETOOTH_DEBUG is
enabled.
Change-Id: I03f7d6b5b37e05ca23cba20536b24dbdb850304d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The previous enable/disable API implementations weren't actually what
their names implied, but simply gave the right result for the
initialization scenario when called after each other. Split these into
proper init/enable/disable APIs which do the exact thing that the
names imply.
Change-Id: I09a930d3607f4919ecd889ec3ee4ba8d7b12ee36
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a complete new cc2520 driver for zephyr. Intention is to fit
better within Zephyr device driver model.
- It's (almost*) ready to be instanciated as many times as necessary
- It's fully interrupt based on SFD and FIFOP (no pin polling)
- It's nicer to other sub-systems (it sleeps, no busy-wait loop)
- It still loosely complies to old legacy radio device driver model
*: GPIO API needs to be fixed in order to accept multiple callbacks, as
well as enabling callbacks to retrieve private data.
Notes:
- Hardware filtering does not work yet as the net stack, above, needs to
provide the relevant information for it (src/dst ieee802154 extended
addresses, short addresses...)
- A embryo of generic functions (txpower, channel, addresses...)
have been implemented but don't belong yet to any radio device driver
model. Such new driver model will come afterwards (soon?)
- SPI API would need to be improved to avoid as much as possible memcpy
as well as spi_slave_select() call.
Change-Id: I1fd6dfff28fba3984f6006d394ea12f1e763ac18
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
ieee802154 is a more relevant name. Applying the change in
include/drivers as well.
Change-Id: I7f7188ed0421045d7667303c375eeb8af1298b97
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
SENSOR_ATTR_FULL_SCALE attribute now expects the value as radians per
second.
Change-Id: I8082a1f112f1ed8efb511de39e3a8e5ae3d3ed0c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Clarify the name of the option and add a dependency to Arduino 101
which is the only known board that is currently known to need it.
Change-Id: Ibfb96cba202f34464b45b922da599da70c038d12
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Fix coding style so line length does not exceed 80 chars.
Change-Id: Iddebdf55593736cfa288a03a750cc927665f9065
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ib483419be5199b52cf281b4b106cd8a3be95b7be
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The configuration option CONFIG_RTC_IRQ_PRI does not longer exist, and have
to use the specific QMSI driver IRQ priority
Change-Id: I8074c6d8e095596d03e51a94f26a73c3a9ff91b7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This function is needed to get next attribute of passed to function
attribute.
Change-Id: Iefe2015f2d6bcb650012b1f9d5b1ea98e8fa8f48
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
When Nordic BLE chip is flashed with HCI firmware use H:4 UART driver
and enable chip the same way we enable for NBLE.
Change-Id: Ie14734266803088feadb0d0eb20c49c3615f0267
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The nble nRF51 firmware cannot handle situations where it receives
data before it is ready. The RPC calls otoh cannot be blocking.
Combine this with the fact that bt_enable(NULL) is supposed to be
blocking means we cannot support this mode of operation with nble.
Change-Id: Ib9c2c322b44b04bc48be243c2ba1c1bc4becb8ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Refactoring Power Management related code to special file nrf51_pm
making it possible to reuse the functions for H:4 UART driver when
Nordic BLE is flashed with HCI firmware.
Change-Id: If389c1f4af13fa786e5866129624527cec0928e0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The config option handles enabling, disabling and power management
operations with Nordic nRF51 BLE chip.
Change-Id: I816062a7fb17c9e57c234113a2cecdebceb407b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move NBLE code to the place where other Bluetooth drivers code resides.
Change-Id: Ibcf9ffb016e9b842bed66a61dff5c101b1573aaa
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Keep a single bt_storage_* name space for current and future storage
APIs.
Change-Id: If158eb7408cce7c06cd8f98d78a061b9f9585265
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Update RPC headers and change compatible_firmware version 0404.
Change-Id: Ie9920d302f3787c07181bc6aa519a96556463a79
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move NBLE pin handling to the driver from gap.c.
Change-Id: I4b7fd408c623971d19da12784c656c5c605852a5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_gatt_attr_read_cpf() for NBLE.
Change-Id: Ia99db05a3f67bef3c1617df37fd371a8b1e8beb6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add initial skeleton for the persistent storage API.
Change-Id: I7a6cc283aa88e7d861af18a6f0db2ed8c71e44a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ib7e0b81b2df1a0225fc244fea3035416d0a4f282
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The SPI API states:
"max_sys_freq is the maximum frequency supported by the slave it
will deal with"
However, currently, for DW the max_sys_freq is a divider which confuses
the user.
This patch adds a small hack to allow users to use both dividers and
frequencies when configuring the bus. The only trade-off is one has to
use dividers for bus frequencies smaller than 65536Hz. However, since
most devices nowadays can run at clock frequencies more than 100kHz,
this is a good compromise.
Change-Id: I44386cc8ad501b08eeaf71bc7588661ff36e108b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
The commands array is not expected to change and can be declared
const. This allows callers to cleanly declare their commands lists as
const, effectively moving the structures from SRAM to code section.
Change-Id: Ie1710622b8cfa609e129eb79712f910f1d1aace3
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
The comments in the sensor header specify that pressure should be
expressed in kPa, but the bmp280 driver returns a value in Pa.
Change-Id: I6d5346db250d1a01a1e5e31fb1d8685ab5dc405b
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Fixes this built error:
zephyr/drivers/pinmux/dev/pinmux_dev_quark_mcu.c:138:18:
error: 'PINMUX_BASE_ADDR' undeclared here (not in a function)
.base_address = PINMUX_BASE_ADDR,
Change-Id: I54f15bc262cb887117f7b56660bcf85983daa877
Signed-off-by: liu.lei <lei.a.liu@intel.com>
Implement bt_gatt_attr_read_cud() making working peripheral_esp app.
Change-Id: Ic9634bf31a39ae9cd55279de34ee4c0c0995a4dd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When an ethernet frame is larger than UIP_BUFSIZE,
a net_buf is allocated but never released. Therefore
after few bad frames, no more RX network packet
can be received.
Fixed by allocating the net_buf after checking
the frame length.
Change-Id: I436487e3c26d739de347b4db6facc3a3dbebbe75
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
This also separates IRQ_PRI into one for DW and one
for QMSI, to follow the convention of every other
drivers.
Change-Id: I338f819f71c18fa9e17015e8a588a3d0207350c6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ic73783189db57059d2b7f3727e4802e1b2e27931
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ifd65097a65f80539cac073f95aadc2d8e42efb9f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ifdbb5e3a997795ef577350d88f8cb06877eb6463
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.
Change-Id: Ib8158f00a6c6616360ddbcf63981f1a85911c1b9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This patch extends the i2c shim driver so it supports the 'default
configuration' infrastructure which enables the user to specify a
default configuration for the I2C device. The default configuration
is set during driver initialization.
This patch also changes Quark SE and D2000 Kconfig.defconfig files so
the i2c default configuration is set to '0x12' which means standard
bus speed, 7-bit addressing and master mode. This is the same value
used when DW driver is selected, by the way.
Change-Id: I06e0dc3c29e8da2f3317db5bef285177f2e92c9a
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Remove those kconfig options that are SoC specific, and should not be
configurable via kconfig.
Change-Id: Ia62888838877da4627419bd36c261d5254761acd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Each option within Kconfig.qmsi already set its dependency so this
patch removes the 'if I2C_QMSI' block since it is redundant.
Change-Id: Ic221b96766ecac685491cb31525caf28e641ee45
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Current interrupt status tells which pins triggered this interrupt, thus
the handler should acknowledge only these and not all possible, since we
don't know if other gpio controller interrupts are being taken care of
at the same moment.
Change-Id: I7d3f1bb13bb293f7b7ce9b5a717a37bbdd4e4e42
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
This is hardware design so there is no need for it to be
configurable in kconfig.
Change-Id: Iff162f330aae8ef9a7139b6e7ed9bfa87f26189a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The IRQ triggering condition should be specified by SoC as it is
a decision for hardware design. This should not be configurable
in kconfig.
The default is to be triggered on rising edge, just as the same
old kconfig did.
Change-Id: If59d88a30711eb8e03d9cc4f409055cefe1995c5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Moves those kconfig options which should be declared in
SoC or board header files instead. These are the one
that are tied to SoC or board and there is no need
for them to be configurable in kconfig.
Change-Id: I243d634f1a4a11dc8dc3530d95f93371015492b7
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This patch fixes drain of data left in UART Rx fifo.
uart_irq_tx_ready checks if Rx IRQ has been raised,
but because Rx IRQ is disabled this won't work even
if there are some data left in the UART buffers.
So simply uart_fifo_read is used to discard the data that
left in UART buffer.
Change-Id: I17f145ba58640650bafd3602412fc75229f39664
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
The PWM_QMSI_DEV_NAME and PWM_QMSI_NUM_PORTS options depend on PWM_QMSI
already so this patch removes the 'if PWM_QMSI' block since it is
redundant.
Change-Id: Iec303d27f088b96662fc58933eaa82fe9459cb59
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Fixes this built error:
zephyr/drivers/pinmux/quark_mcu/pinmux_board_quark_se_dev.c:149:19:
error: 'PINMUX_BASE_ADDR' undeclared (first use in this function)
_pinmux_defaults(PINMUX_BASE_ADDR);
Change-Id: I8302e4d6dbcf961e0c80f6bccf740a877bb364af
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The base addresses are SoC specific so there is no need to make
configurable via kconfig.
Change-Id: Iaf8444f77513255d5f0112af6710243aae09f066
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is to standardize the kconfig for specifying IRQ priority.
Change-Id: Iab10655c6fc6f17c0c6dd49cb7a4e74fabcf852c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is to standardize the kconfig for specifying IRQ priority.
Change-Id: I3a51b35e633dc7b1b841e9fa504bf0cfc0d4d575
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is to standardize the kconfig for specifying IRQ priority.
Change-Id: I05ae4033e2c5431ba2727c5d4000ef07e14739c8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Most of the SoC and board Kconfig use the same values for
driver initialization priorities. So refactor them, and
discard duplicate ones.
The shared IRQ init priority was changed so that the kernel
default init and device init priorities can be standardized
across all SoC/boards. Same goes for DesignWare SPI driver.
This also changes the UART_CONSOLE_PRIORITY and
IPM_CONSOLE_PRIORITY to UART_CONSOLE_INIT_PRIORITY and
IPM_CONSOLE_INIT_PRIORITY, to standardize across all drivers.
Note that this does not take away the ability to override
those values. This just provides reasonable defaults such
that there is virtually no need to override.
Change-Id: Ibbd95d802c637df06f9a2fd48763ee1e6f4ff627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The pinmux base address and number of pins are now defined in SoC or board
header files instead of specifying them in kconfig. This is because
the pinmux ties directly to the SoC (or board expanders) so the base
address and number of pins do not need to be configurable in kconfig.
Change-Id: Ib6090d7d022b491f3fe8f522858281504c6302bb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is to follow how kconfig are defined for other SoC/boards.
Origin: refactored from exising file
Change-Id: Ic83b8a336f1910f17b3cf4e7f029fd076ba1b6bb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The base address, IRQ line, chip select numbers, and clock
gating constants are static per SoC, so there is no need to
make them configurable in Kconfig.
Change-Id: I9f87ca29c28c38c42d4e4f1a3a41fa231f63ef03
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The base address and IRQ line are static per SoC, so there is no need
to make them configurable in Kconfig.
Change-Id: Ib78401ff136c29642356f5bda9d6cd3e5c98bece
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The UART port base address, IRQ line and clock frequency are static
per SoC, so there is no need to make them configurable in Kconfig.
Change-Id: Ia252958d205e0100d1b92e2a12d4c22411bc94b9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The UART port base address, IRQ line and clock frequency are static
per SoC, so there is no need to make them configurable in Kconfig.
Change-Id: I79b142414143bc5ef585d3136a00375233de1723
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There are two major issues with the kconfig:
() Some of the config options have incorrect dependencies inside help
under menuconfig. For example, CONFIG_GPIO depends on BOARD_GALILEO.
() Since the SoC and board specific kconfig files are parsed first,
the help screen would say, for example, CONFIG_SPI is defined at
arch/arm/soc/fsl_frdm_k64f/Kconfig. This is incorrect because
the actual config is defined in drivers/spi/Kconfig.
These cause great confusion to users of menuconfig/xconfig.
To fix these, the SoC and board defaults are now to be parsed last.
Note that the position swapping of defaults in this patch is due to
the fact the the default parsed last will be used.
And, spi_test is broken due to the fact that it requires
CONFIG_SPI_INTEL_PORT_1, but never enables it anywhere. This is
bypassed for now.
Origin: refactored and edited from existing files
Change-Id: I2a4b1ae5be4d27e68c960aa47d91ef350f2d500f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is a temperature and atmospheric pressure chip. The datasheet is
available at:
https://www.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf
Change-Id: I3406eb6c2c4da564757b8315323d0681d648b541
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Added device power management hook infrastructure. Added
DEVICE_INIT_PM and SYS_INIT_PM macros that creates device
structures with the supplied device_ops structure containing
the hooks.
Added example support in gpio_dw driver. Updated the sample
app and tested using LPS and Device Suspend Only policies.
Change-Id: I2fe347f8d8fd1041d8318e02738990deb8c5d68e
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Changed names of Kconfig flags, variables, functions, files and
return codes consistent with names used in the RFC. Updated
relevant comments to match the changes.
Origin: Original
Change-Id: Ie7941032d7ad7af61fc02928f74538745e7966e8
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.
To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.
Change-Id: Ie1d391945cd1cfb9a5dc199783c2d224eb1b0ef3
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Build with GPIO port E failed due to a missing comma.
Change-Id: Ib8fa7f4d03ed4f4c713a3a8a16ad3b37fcf6b0b7
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
This driver will be used when changing pinmux functionality during
runtime.
Change-Id: I8dc7b36af13202b97183c5ee05932567e7396276
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This moves the STM32 based boards (Nucleo F103RB and STM32 Mini A15) to
the "new" pinmux model.
Change-Id: I190df271a6b83fafeec0b281cd4ee7cf13d7e7db
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This driver can be used for multiple boards based on the Quark
microcontroller family, the exceptions are Quark X1000 and Quark D1000.
Change-Id: I4c6624293515e4bbf31ac94a7f57905b4a9ef13d
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This introduces the pinmux_dev driver for the Atmel SAM3X.
This driver implements what used to be the pinmux driver API, which
applications could use to modify the function of pins during runtime.
That functionality is now protected under the CONFIG_PINMUX_DEV option,
which should only be set during the early enabling of a new board, as
there is risk of damage to the board when misused.
Change-Id: I3aa00505d2771b53c41fe687c3e5230e804756be
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Setting the direction of a GPIO pin is not the responsibility of the
pinmux "board" initialisation. This should be left for the GPIO
utilising application.
Some macros that were only used when setting the pin direction are
removed.
Change-Id: I5b63d52446a27fe539c89f0639a8dcadf5ea9f80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This driver doesn't provide any API, it only initializes the pinmux
controller to appropriate values depending on the board.
The first board to use this new infrastructure is the Arduino 101 board,
because it is alphabetically the first.
To better organize code for the different SoCs and boards, a "family"
level is created in the 'drivers/pinmux' directory. The Arduino 101
board is part of the Quark MCU "family".
The PINMUX_DEV configuration (and functionality) is removed for now, it
will be added back when the pinmux_dev drivers are (re)introduced, with
clearer semantics.
Change-Id: Idf5cc3caf6be620aa50828ae8fdc535df6caf458
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
ASSERT are put each time the timer0 limit register or the timer0 count register
is modified.
Change-Id: I38684d57803de285f4e26c68b449c71396e4c750
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
Add device driver for the gyroscope part of LSM9DS0 gyroscope.
Datasheet:
https://www.adafruit.com/datasheets/LSM9DS0.pdf
Change-Id: I25e0c8470c9b68c594bc4a0d2a9a13f8f41ee309
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
When exiting from tickless idle uppon an external IRQ, the TICK timer
is set to fire at next TICK boundary. The current algorithm can lead
to a point that timer0_count register is higher than the timer0_limit
register.
In this situation the next TICK will fire after the counter has
wrapped and performed another cycle (~133 seconds).
This condition appears when the counter reaches the limit after the
Interrupt Pending flag is checked. At this point the counter is
automatically wrapped to 0, but is set just next to the limit to fire
at next TICK boundary by SW. At exit of the _timer_idle_exit function,
the timer handler is called, and sets the limit to 1 TICK. At this
point the situation is:
- limit register == 1 TICK
- count register is just below the old limit register and higher than
1 TICK
To fix this issue, at _timer_idle_exit, the limit register is always
set to 1 TICK and the count register set such as the next TICK fires
on time.
Change-Id: Ifa002809d426aa04109592e53d2b02a224f51101
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
The timer counts from 0 to programmed_limit included.
Change-Id: Ifc8585210c319f5452fafc911d4f6d72c4b91eaa
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
This patch fixes gpio_stm32 driver since it was merged with a few
occurrences of DEV_* error code.
Change-Id: I025e4f83d8ca07bc0fed7d3dcb9cce3b9d11c3fc
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Counter API and drivers were merged without fixing the new returning
error convention (errno.h codes). This patch fixes all occurrences of
DEV_* codes so -E* codes are used instead.
Change-Id: I85007e8565686b52121410badea547ed904460a0
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Moves config options for K64 into its own config file under its
own submenu.
Change-Id: I94ccac54709ab5ec8222daa8634818d9ebc3561d
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Makes K64 spi driver submenu available only if K64 soc is
selected.
Change-Id: I0ada8863a592f056dbe48e78d9374f2348dcac14
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Makes K64 pwm driver submenu available only if K64 soc is
selected.
Change-Id: I9959b4785c6deab01977f86bbbebe3d671a4eec7
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
According to the Core Sepcification, Advertising Interval Min/Max
shall not be set to less than 0x00a0 if ADV_SCAN_IND or ADV_NONCONN_IND
type is used.
Change-Id: I6c4ef4f73b82841c3a96694dda670cdd12a40a54
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Makes K64 gpio driver submenu available only if K64 soc is
selected.
Change-Id: I4097006a4dca718ed2da730fa85cd2ad9970f419
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Moves STM32 gpio driver under its own submenu, like atmel SAM3
and K64 gpio drivers.
Change-Id: Iebc474af9818a73275f99183d3f4788eea1e6ded
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Add support for use of HSE (incorrectly named PREDIV1)as input of PLL,
along with HSE bypass for stabilized external clock, and XTPRE
prescaler. Update PLL handling so that we do not unnecessarily enable
PLL clocks, instead enabling only the clocks sources that are required
as per user's configuration.
This change allows higher SYSCLK clock values, up to 72MHz.
Change-Id: Ia7c2be3ce11ac0de2efa664b20e7ab5fddd57a51
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Move re-enabling logic to the NBLE stack.
Change-Id: I1b895aa952a241dc41e2fc9faa2794a8c2c2d2db
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add driver for the HDC1008 temperature and relative humidity
sensor.
Datasheet:
http://www.ti.com/lit/ds/symlink/hdc1008.pdf
Origin: Original
Change-Id: I63cb4cdd94120b80d0d6f3205da073f0817c4f17
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
This moves both the Bluetooth HCI and NBLE drivers under
"Bluetooth Drivers" category. This also adds a selection for
choosing Bluetooth stacks as the bulk of both HCI and NBLE stacks
cannot be compiled together.
Note that this does not move the source files. That should be
done in a separate change.
Change-Id: I32fa7097ada0fdc52bcc745adb78c7273f4023c6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add device driver for the BMA280 I2C-based triaxial accelerometer
sensor, which supports reading data from the accel-x, accel-y, accel-z
and temperature channels. The driver also has support for data-ready
and any-motion triggers.
Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMA280-DS000-11_published.pdf
Origin: Original
Change-Id: Iff7246d7dd4a9358ec7a71e8ffbcfcccd49e393c
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
This patch fixes the QMSI UART shim driver so we are able to use it in
Quark D2000 based platforms. Differently from Quark SE, the peripheral
clock gate bit (CLK_PERIPH_CLK) is not enabled by default in Quark
D2000. We have to explicitly set this bit in order to properly initialize
the device.
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: I817b7703554be162ac628dcd8d3d07512b9eb3f5
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch fixes the gpio, i2c and watchdog shim drivers so they set the
CLK_PERIPH_CLK bit during driver initialization. Differently from Quark
SE, the peripheral clock gate bit (CLK_PERIPH_CLK) is not enabled by
default in Quark D2000. We have to explicitly set this bit in order to
properly initialize the device.
This issue has been masked so far because the CLK_PERIPH_CLK bit is set
when UART NS16550 driver is enabled. The UART NS16550 driver is enabled
by default for Quark D2000 so gpio, i2c and watchdog sample apps were
working just fine. But if we disable the NS16550 driver, these samples
applications stop working.
The remaining shim drivers already set the CLK_PERIPH_CLK bit during
initialization so there is no need to fix them.
Change-Id: I3f658da564f87e9d52092ce7aac423c7b3e0c890
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Add a driver for Independent Watchdog (IWDG) commonly found in STM32
MCUs. The driver has been tested on STM32F1 family MCU.
Change-Id: Idc6ac35990e46901a206b4af0ce3767eb4875de9
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Add support for interrupts for input GPIO pins on STM32 MCUs. The SoC
support code is expected to provide an implementation of
stm32_gpio_enable_int() call.
Change-Id: I61bae54b8e044be4d7d8eb60c0c67b71f8c59553
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Introcuce a driver for External Interrupt/Event Controller (EXTI) found
on STM32 MCUs.
Change-Id: Ib206521fcc51b5dfaaf5dea9d436f8304f3a36be
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
The patch extends STM32 serial port driver with support for IRQ API of
the common UART port driver API.
Change-Id: If105e8528ea4ed4181cc4af0c97c24aa874e69e0
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Add driver for U(S)ART ports on STM32 MCUs. The driver implements basic
RX/TX functionality. Data transmission is implemented using polling. The
driver configures the port to use 8bit data transmission, 1 stop bit, no
parity control.
The driver exposes a public uart driver API and registers a single UART
device 'UART_0'. The device binds to USART1 peripheral and performs
required pinmux and clock control configuration. The device can be
initialized at the PRIMARY level, with default device priority.
The driver has been verified to work with a sample Hello World
application on a STM32F103 series MCU.
Change-Id: Iae103fcd8d2fb0a6c173cf141a68e17791255aab
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Add necessary integration code enabling use of common STM32 pinmux
driver.
The alternate function listing currently consists of USART1 pins
only. The listing should be updated when support for more devices is
added.
Change-Id: Ic65aeea9df9aaea7636ecdd6996f56e6ef59dc2f
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
The driver implements a GPIO device interface for STM32 MCUs. Each SoC
must provide implementation of the follwoing calls:
stm32_gpio_flags_to_conf(), stm32_gpio_configure(),
stm32_gpio_set(). Consult gpio_stm32.h header for details on semantics
of these calls.
The driver registers 5 devices, each corresponding to a single GPIO
port. The users can then access individual pins by using values
0-15.
Change-Id: Id236b5b75c9dd091018a50a7be3501c8591cd551
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Add a common driver for pin control subsystem in STM32 MCU series. The
driver allows for selection of pin's function without the ability of pin
remapping.
The driver implements a pinmux driver API, with custom `func` and `pin`
encoding in API calls. The caller is expected to use STM32PIN() helper
macro for encoding port/pin numbers or using one of the provided
STM32_PIN_* defines.
The common driver requires SoC specific support to be implemented. The
SoC code must implement these calls: stm32_get_pin_config(),
stm32_get_port_clock(), stm32_pin_configure(). Consult pinmux_stm32.h
header for detailn on semantics of these calls.
The driver also requires board level integration. The call
stm32_board_get_pinconf() is expected to privide pin function
assignments for the target board.
Whenever an IO pin is being enabled, the driver will automatically
enable the clock for corresponding port. The driver does not implement
disabling of port's clock as this has potentially disruptive, as such
such operation should be done explicitly in the code.
The pin control module needs to be initialized before any other modules,
but after clock_control. For this reason, the driver is initialized by
default at PRIMARY level, with priority set to 2. The priority can be
changed through configuration.
Change-Id: I8cb746d0f3cad72cd50b3355fe6d93a9f469be25
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Current design of Nordic RPC requires strict firmware compatibility,
add check indicating if firmware is incompatible. At the moment we
allow to continue since something may work :).
Change-Id: Ie67d4a6509e53553ae6c41a2c8d2593ab20bdcfb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Allow to use Non Resolvable Private Address (NRPA) in advertisement,
following NBLE change.
Change-Id: I9491cfcd2e981237c99e55773a8beaddaee8b730
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update firmware version to 0317. Changes are mostly related to
advertising.
Change-Id: I3a438ad38e3c892e354f7ea59b99739153957f19
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This moves the kconfig options for each drivers into their own
submenus. This makes menuconfig easier to navigate.
Change-Id: I2bdc8c3b61e424248ffb65385a7eabc797d89684
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Moves the kconfig options for STM32F10X clock control driver
into its own submenu.
Change-Id: I9ef658defe85feab3dfdb3e329710cb48bbffd86
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Moves the Quark SE clock control into its submenu.
() Fixes the dependencies in the SoC default Kconfig
so the options are not displayed out of place in
menuconfig.
Change-Id: Ifdf06242be8ceed03c2c657c942875a5a7f2750e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Put the kconfig options for individual drivers into
their own submenus. This makes it easier to navigate.
Change-Id: I96b230c3236722c809337472f7efdc2dc1bafdee
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Replaces old DBG calls by new SYS_LOG_... ones, likewise updates the
grove/Kconfig file to include new per-level logging control.
Change-Id: I638ffa915a760b4f188c1bfa2dc68e63cbf7e624
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
() Moves config options for each controllers into their own
Kconfig files. This keeps upper level Kconfig from getting
too big.
() Options for each controller are moved under their own
submenus.
Origin: refactored from existing file
Change-Id: I77e92f72f8de85abaedfbe078283607b7c242c81
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Moves config options for each controllers into their own
Kconfig files. This keeps upper level Kconfig from getting
too big.
() Options for each controller are moved under their own
submenus.
Origin: refactored from existing file
Change-Id: I813694f26126b43523b08ebdb0a5383edd241cda
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Moves config options for each controllers into their own
Kconfig files. This keeps upper level Kconfig from getting
too big.
() Options for each controller are moved under their own
submenus.
() Adds the missing copyright to Kconfig.atmel_sam3.
Origin: refactored from existing file
Change-Id: I2dacd3d9b2bfa052c9e0c078ddffed40dbc2ddbf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Moves config options for each controllers into their own
Kconfig files. This keeps drivers/gpio/Kconfig from getting
too big.
() Options for each controller are moved under their own
submenus.
() Re-named the device names to standard as "GPIO_0", "GPIO_1",
etc.
() Adds the missing copyright to Kconfig.atmel_sam3.
Origin: refactored from existing file
Change-Id: I7c531b0109ca5a6840d3abd9daa6bc784f15233d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Adds some comment to divide config options for easier
visual navigation.
() Put config under submenus to make all driver options
consistent with each other.
Change-Id: Ia219c5283e4fa394adf8b0ac03577a0fd033ec1c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The helper for analyzing (fiber) stack usage is in no way specific to
Bluetooth and will likely be of use to many other places as well. Move
it therefore to include/misc.
Change-Id: Iedb699dbe248aca305e387998d37bb339cfb0e21
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Move driver specific config options to separate Kconfig sub-files
as this is a more scalable approach when considering that multiple
sensor drivers will be added in the future.
Change-Id: Ia1d62afd628723be33868d6c1a956ca7b27eba88
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Quark AON counter and timer sub-drivers. They are based
on the QMSI drivers.
In order to enable this driver, the following options
must be set.
CONFIG_QMSI_DRIVERS
CONFIG_QMSI_INSTALL_PATH
CONFIG_COUNTER
Origin: Original
Change-Id: Idbeabfaef3408f4d645b0e64a337d7f5f0f357c7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Add the public API for counter devices and the drivers infrastructure.
Origin: Original
Change-Id: If100fbc9b3d119ce2be6c131bd64dbeb4fe346f2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.
Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_NO_SUPPORT by
-ENODEV at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: I03007527367b03e6fd72a85004b7d3b81046a6a6
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_NO_ACCESS by
-EACCES at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: Ic7fd162b45e9ceb73141a164649b96eea9886873
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_USED by -EBUSY
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: I21eb3ffe9bdfde98593dcf63c50a8bdcd376e49e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_INVALID_CONF by
-EINVAL at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: Idae0d5af8dd780416977c9261a5fb6188c3aab64
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_INVALID_OP by
-ENOTSUP at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: I46aec3c65963018c479b01602e4a3eec8650eaff
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_FAIL by -EIO
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: I0594ab5dbe667e074c250129e7c13ce512ac940f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.
This patch is part of the effort to transition from DEV_* codes to
errno.h codes.
Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
All driver APIs (i2c, spi, gpio, etc.) return 'int' type, but pinmux
APIs. So this patch changes the returning type from 'uint32_t' to
'int' from include/pinmux.h and fixes all pinmux drivers according.
Besides keeping consistency between all drivers APIs, this patch is
also applicable for the errno.h code transition. Pinmux drivers will
return negative errno.h codes so returning 'int' is more suitable
than 'uint32_t'.
Change-Id: I2a6e92d567a0e21fec363226da6197df94657d4b
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
The patch adds a driver for STM32F10x series RCC (Reset and Clock
Control) subsystem.
The module is primarily responsible for setting up of MCU's clock
tree. In particular the driver sets up SYSCLK, PLL (with source
configuration), AHB prescaler, and APB1/APB2 prescalers. As part of this
functionality, the subsystem can enable/disable clock signal for
particular peripherals, thus reducing the power consumption of the MCU.
The driver implements clock control driver API. However, subsystem IDs
being HW specific are exposed in driver public header that must be
included by callers. The driver registers a single device using a common
name STM32_CLOCK_CONTROL_NAME. The device is initialized at
the PRIMARY level with priority 1. This allows the initialization to
take place right after SoC initialization routine.
The driver depends on selection of SOC_STM32F1X config option and is MCU
specific.
Change-Id: I8bea5db20726a24bce7b7ffe0b95de543240429a
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Extend the public API of clock_control driver with a function for
querying of clock rate driving given peripheral. This is useful when the
driver must calculate or configurae values that depend on the rate of
clock driving this subsystem.
A baud rate setting of UART port is an example of such operation. To
configure a particular baud rate the driver may need to set the internal
counters of UART port, where the actual value will depend on the clock
rate for this peripheral.
The implementation returns DEV_NO_SUPPORT for clock_control drivers that
do not implement such functionality.
Change-Id: I4e7ec96cd3678a4bb1ff289b0247488289310f2d
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Move quark_se clock control entries to separate file. This will help to
keep things organized once we add more clock control drivers.
Change-Id: Id8f4a94189ab5bbba9b6552777549cf426d79273
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Take into account btauth callbacks for finding out IO capabilities.
Change-Id: Ifc35a1919c7e4d1b5ebaace7f13744f9b977d7e8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add skeleton to handle events generated when trying to set security.
Change-Id: If9635690d50dce22a35dd0d05d8cc5046edaafee
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_conn_security() for NBLE. We call
nble_gap_sm_security_req() which shall do all needed job.
Change-Id: I5fdccc2ea3e88266db8f940dc453547d5ea51f59
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Refactor code to be aligned with upstream Nordic BLE RPC. There UUID
is used only for primary service and characteristics.
Change-Id: I8fa840570c2535a73aaa68793a45013faacc59da
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Correct error message sent to application using GATT API.
Change-Id: Ibf7f9f8943f7e11fd2cf6eaff7c2fabbcdcadba9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_gatt_indicate() and response to it
on_nble_gatts_send_ind_rsp().
Change-Id: Ibf427135c6385cb84f9fab4edeb3a21760a8702e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For printing two octets handle use 0x%04x print format specifier.
Change-Id: Ia654d9f2a639cfb9d63647497b302205efab0869
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update RPC to make it compatible with firmware 0309. Among other
changes mostly related to cleanup there is extra flag octet in
struct nble_discover_params.
Change-Id: Ib4dbe15a6919c251f14888090e2f1d91c150c5f2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Implement bt_gatt_subscribe() function and handle subscriptions.
Change-Id: Ib6ea63a237413ffc65d8572b14d7912d4c7d2699
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This makes sure the CONFIG_GPIO_K64F_* kconfig options have correct
dependencies. Or else CONFIG_GPIO_K64F can be disabled, but all
the CONFIG_GPIO_K64F_{A,B,C,D,E} are enabled.
Same goes for SPI, FTM and pinmux.
Change-Id: I8d225dea714081b14b19006d61b8f3f6afafa5ee
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The DesignWare GPIO options should really depend on whether
GPIO_DW is enabled.
Change-Id: I98b2964d6a0afdac89dc66a78342076afa6feec5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add a menu to enclose all the shared IRQ kconfig options.
Change-Id: I8083204c53f60022c06e9c683fa9544fdc278f32
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Support for data-ready and near/far triggers is included. Datasheet the
sensor available at <http://www.semtech.com/images/datasheet/sx9500_ag.pdf>.
Origin: Original
Change-Id: Idd491a8bad7e119b0ed66e655955228ffdac6e76
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
The MCP9808 supports threshold triggering. Add support for this feature
in the driver and the sample application.
If triggering is activated, the driver can create its own fiber or use
the system-wide sensor fiber.
Origin: Original
Change-Id: Ie825a22245cb48cbdffba3049011e4d305975d53
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
The driver only supports simple temperature readings. It does not
support the alarm feature. Datasheet available at
<http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf>.
Origin: Original
Change-Id: I283e6697fc6947975323d280f5ff0ba625fac5a9
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Making pinmux depend on GPIO breaks many tests and configurations
when running on real hardware. This should be added as local
configuration in the defconfig instead.
Change-Id: Ibbf1c9a3428ed692937383bf85218b0c120cbe44
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
According to documentation, there must be at least one cycle delay
between two consecutive writes of the DR register. Apparently, this is
true for reading too, though undocumented.
The read_dr() inline function is called as follows:
*(spi->rx_buf) = read_dr(info->regs);
which the compiler, with full optimizations on, turns it into:
ld_s r2,[r1,24] <- the spi->rx_buf
sr 0x80000000,[r4] <- this is the strobe bit write !!!
lr r4,[r4] <- this is the FIFO read!!!
stb r4,[r2] <- store the result
Unfortunately, the read from the FIFO is always 0 since the FIFO data is
not yet available.
During my investigations, I found that the following code works:
sys_out32(1 << 31, info->regs + 0xd);
*(spi->rx_buf) = sys_in32(info->regs + 0xd);
This does, basically, the same thing. But the compiler inserts an
instruction in between the write/read:
sr 0x80000000,[r4] <- write of the strobe bit!!!
ld_s r2,[r1,24] <- the pointer goes to r2
lr r4,[r4] <- read from FIFO!!!
stb r4,[r2] <- store the result
A single clock cycle between writing the register and reading seems
to be enough for the data to become available for reading.
This patch adds a nop in the read_dr() inline function.
Change-Id: I0c216d5738d5771835b1052e2e83363e8e3abf0c
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
This creates the QMSI comparator driver which is simply a shim driver
based on the comparator driver provided by QMSI BSP.
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_AIO_COMPARATOR=y
CONFIG_AIO_QMSI_COMPARATOR=y
Origin of the file: Original
Change-Id: Iad01cb80f7bb1eff1710cd76cd0afeb70c311e04
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This patch extends the UART QMSI driver so it supports the IRQ APIs from
include/uart.h. The IRQ APIs are enabled by the 'CONFIG_UART_INTERRUPT_
DRIVEN' option.
Differently from others APIs such as I2C and SPI, the UART API is very
low level. For that reason, the IRQ facilities (e.g. irq based transfers)
from the QMSI driver are not useful to the shim driver at the moment. In
order to implement the IRQ APIs we rely on UART registers defined by QMSI.
QMSI UART header is missing some macro definitions from IRR register so
we define them in the shim driver.
Since the IRQ trigger condition is not configurable in the QMSI shim
driver, this patch also changes drivers/serial/Kconfig so the "UART
IRQ Trigger Condition" choice doesn't appear on the menu if the QMSI
driver is selected.
Change-Id: Idf9a0f6a47af2a550a31f474d721068dca989713
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch extends the UART QMSI driver so it supports line control and
driver command APIs.
The line control function supports the baud rate option only (LINE_CTRL_
BAUD_RATE) and, at the moment, the QMSI driver doesn't have any custom
command.
Change-Id: Icc10cb39b4077ed4ccfefb1f0feecec75b79d67c
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch extends the UART QMSI driver so it supports different baud
rate configurations. The baud rate is set per UART controller via
menuconfig. The default baud rate is 115200.
Change-Id: Iad736d72bd309b8a33ab5d538251fce374e89fd2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This patch introduces the QMSI UART driver which is simply a shim driver
based on UART driver provided by QMSI BSP.
This initial version implements only the mandatory APIs 'poll_in',
'poll_out' and 'err_check' which are required by trivial sample apps and
by output functionality from the console driver. The remaining APIs will
be implemented by up coming patches. The driver supports only 115200 baud
rate at the moment.
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_SERIAL=y
CONFIG_UART_QMSI=y
This driver has been tested with Quark SE Devboard so this patch also
adds its platform-specific default configuration options to 'arch/x86/
soc/quark_se/Kconfig'.
Change-Id: Ibde1825d4b0349a376a8e7d91cc9de306946b62f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This reverts commit 0d50329105.
This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.
Change-Id: I015f20699c052b4089076699fc0180945c4d3d16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The driver should read the mac address from the chip but in
case of cc2520, the chip does not have it. So generate a
random mac address for this invocation of the device.
Change-Id: I2d0cf2ee70525e7f5e65da9fb8ceaa1a2dccecdd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Now that the internal libc has the off_t type it's the natural choice
for the offset parameters in the flash API.
Change-Id: I69999999625b46634f6d3008fe1b3f82c17d357c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This makes the ordering consistent e.g. with SPI, Bluetooth and
Networking APIs. This also follows the order of parameters in the
POSIX read/write APIs.
Change-Id: I4f11c8c90ccadf176d79f6a7bbd98aac61c26cf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
size_t is the natural type for any integer that describes a number of
bytes. For the actual data use void pointers to avoid callers having
to do explicit typecasts if the data doesn't originate in a uint8_t
array. Also use a const pointer for writing to avoid typecasts for
data that originates in a const location.
Change-Id: Idbfc14b2d61ca6189411b211c3727f857dbd4059
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Fix dependencies of K64 PWM config options so that they do not appear at
incorrect places in the menuconfig tree hierarchy.
Change-Id: Iea8077400a1bdf3ef1c38b3bf45b7a72373bd096
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.
To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.
Change-Id: I5b3cf3da4c8d8398a966e901ab211f2fcee18dd6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Implement GATT write without response, no signing yet.
Change-Id: Id676202ab270cf3f0b06ede26dee2f84a9965e09
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Config options 'Clock Radio and 'Serial Delay' appeared out of ADC menu
due to a missing dependency on ADC_QMSI.
Change-Id: Ia1ca0d5a4ea676205a5928689c2adee9e26c2691
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Support for Freescale/NXP K64 SPI modules, limited to:
- Master mode
- A single active set of clock and transfer attributes (CTAR0), which
includes non-adjustable delay parameters
- Tx FIFO fill and Rx FIFO drain interrupt handling
- Standard, continuous select and continuous SCK SPI transfer formats
Also, divide-by-zero code generation in this driver is prevented.
The 'volatile' attribute is added to some of the variables in the baud
rate and delay calculation functions of the K64 SPI driver in order to
prevent bad code generation by gcc toolchains for ARM seen when an
optimization setting above -O0 is used.
Specifically, a register is loaded with the constant 0 and is used as
the divisor in a following divide instruction, resulting in a
divide-by-zero exception.
This issue has been seen with gcc versions 4.8.1 (the VxWorks toolchain)
and 5.2.0 (the Zephyr SDK toolchain).
Change-Id: Ib5b2b748aad8fdfd5e8d40544e6e1abef3713abe
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
PWM support using the Freescale K64 FlexTimer Module (FTM)
Change-Id: Iaad429c01bd877babba04e84d6a4679bd7e38120
Work-by: Mike Hirst <michael.hirst@windriver.com>
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
Interrupt and callback function support is added to the K64F GPIO driver.
The implementation is based on the Designware GPIO driver (gpio-dw.*).
Change-Id: Id88d06f748400f8f822ca98e098cb44a53678c38
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
K64 pinmux support is created as a normal driver.
As opposed to the Galileo board, the pin configuration options are
defined by the MCU and are not board-specific. Separate
platform/board-specific configuration code uses the pinmux driver for
the default pin settings. For FRDM-K64F, only the Arduino pins (22 of a
possible 160) are set up.
Some of the I/O pins routed to the Arduino header are also configured as
JTAG/SWD signals by default and are used by the OpenSDAv2 debug
interface. Therefore, a PRESERVE_JTAG_IO_PINS config option was created
for the FRDM-K64 platform to prevent the default pin settings from
re-configuring these pins.
The K64 MCU separates pin configuration and control, implemented in the
pinmux driver, from GPIO. This results in some cross referencing
between the K64 GPIO driver and the K64 pinmux driver due to the
dependencies of one on the other.
This pinmux driver also uses the expanded pinmux function/mode parameter
size to describe pin configuration options with bit fields for the K64,
including up to 8 pin functions, plus interrupt, pullup/down, drive
strength, open-drain and slew rate.
The following GCC warnings in the K64 pinmux driver are prevented when not
compiling with 'no-optimization' (-O0):
warning: 'gpio_dev' may be used uninitialized in this function
[-Wmaybe-uninitialized]
Change-Id: Ie5031d18750143bf895883058b3cd55fd9989fd3
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
Implement GATT read reusing gatt_private to store GATT parameters.
Change-Id: Ie3c58a6272cc7cf380e4d3a04e45b191680d1ebe
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The pinmux API was modified to expand the meaning of the 'func' argument
to allow it to represent more than a pre-configured function. This was done
to reasonably accommodate a larger range of pin configuration options
offered by other MCUs, such as the Freescale K64 (up to 8 pin functions,
plus interrupt, pullup/down, drive strength, open-drain, slew rate, etc.).
This allows bit fields to be used to define various settings.
Change-Id: I2b216b822c6bae7133eed01c8c3339bb47b6c5db
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
Basic driver support for the Freescale K64 GPIO module.
Note that only pin direction, read and write are supported.
Change-Id: I6587bb260197a00497be9ac991002e3dde54718d
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
Fix dependencies for external and sensor clock device names in
clock_control Kconfig.
Change-Id: I708f025cf3ce97bcd003754fb5b395712d203107
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
bt_auth_cancel can be used to cancel any type of pairing.
Change-Id: Ia1a6ba834186ab6d5082d3eb473319c2d70cf4a7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Rearrange headers so that internal header files gap_internal.h and
gatt_internal.h do not source headers, they are included in *.c files.
Change-Id: I6450ab90eec1b450ee8a138da2ed72b8aaeaf616
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Update RPC functions and data types, works with NBLE firmware
niko-0301
Change-Id: I3538fab1d20c6e140d995a797d68486be6cd0f23
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This patch fixes the RTC_DW configuration option. DesignWare and QMSI
drivers shouldn't have any dependency from each other. All driveris
are following this policy, but the RTC.
Change-Id: Ic6bdef492d26978aa875c54d41ef39d407ddf4e1
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
SPI flash sub-driver to support WinBond SPI flash.
It is based on the generic flash driver framework.
Change-Id: I58202e38445a052fa0556b03f854e75ef836e2dd
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This uses ATT Indicate Value command to indicate changes and wait for
confirmation response.
Change-Id: I123a00e374929d779f96a02440215c32c0e79423
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The arguments to memset in pci_header_get were passed in the wrong
order, causing the memset to be a no-op. Fix this.
Change-Id: I1ea6d7d87d74cff6fec9bbc88c99a4b0e460cc95
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Implement GATT nble_gattc_disc_rsp() function, may be tested with
bluetooth shell app.
Change-Id: I80c9596e83310902de40f6e91d2ecd4b5d2f3292
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This creates the QMSI ADC driver which is simply a shim driver based
on the ADC driver provided by QMSI BSP.
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_ADC=y
CONFIG_ADC_QMSI=y
Optionally this can be set:
CONFIG_ADC_IRQ
CONFIG_ADC_PRI
CONFIG_ADC_QMSI_POLL
CONFIG_ADC_QMSI_INTERRUPT
CONFIG_ADC_QMSI_CALIBRATION
CONFIG_ADC_QMSI_CLOCK_RATIO
CONFIG_ADC_QMSI_SERIAL_DELAY
CONFIG_ADC_QMSI_SAMPLE_WIDTH
Origin of the file: This file has been created from scratch
Change-Id: Ie04776ac2ed88e56852409070edec568974f8e0d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This creates the QMSI PWM driver which is simply a shim driver based
on the PWM driver provided by QMSI BSP.
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_PWM=y
CONFIG_PWM_QMSI=y
Optionally this can be set:
CONFIG_PWM_QMSI_NUM_PORTS=Number of ports available, default is 1
Origin of the file: This file has been created from scratch
Change-Id: Icac90154d020babca1c11147056a3438b84b0d3f
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
The peripherals utilizing UART were required to register their own
ISR rountines. This means that all those peripherals drivers need
to know which IRQ line is attached to a UART controller, and all
the other config values required to register a ISR. This causes
scalibility issue as every board and peripherals have to define
those values.
Another reason for this patch is to support virtual serial ports.
Virtual serial ports do not have physical interrupt lines to
attach, and thus would not work.
This patch adds a simple callback mechanism, which calls a function
when UART interrupts are triggered. The low level plumbing still needs
to be done by the peripheral drivers, as these drivers may need to
access low level capability of UART to function correctly. This simply
moves the interrupt setup into the UART drivers themselves. By doing
this, the peripheral drivers do not need to know all the config values
to properly setup the interrupts and attaching the ISR. One drawback
is that this adds to the interrupt latency.
Note that this patch breaks backward compatibility in terms of
setting up interrupt for UART controller. How to use UART is still
the same.
This also addresses the following issues:
() UART driver for Atmel SAM3 currently does not support interrupts.
So remove the code from vector table. This will be updated when
there is interrupt support for the driver.
() Corrected some config options for Stellaris UART driver.
This was tested with samples/shell on Arduino 101, and on QEMU
(Cortex-M3 and x86).
Origin: original code
Change-Id: Ib4593d8ccd711f4e97d388c7293205d213be1aec
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Not all of the variables defined in the driver data structure are
required. So put some #ifdef around them.
Change-Id: I08a0c02d9e5c6885d9b4d6237446bdb9b98f3bfa
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The I2C has minimum timing requirements for clock signal.
This patch adds the code to make sure the minimum timing
requirements are met.
Change-Id: I3f148433e60be73866577fbe614b892481d7f69d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Fixed an issue where STOP would be sent twice when a read message
is only 1 byte.
() Skip resetting the controller when NACK is received. This is not
an issue with the controller, so there is no need to reset
the controller and its state machine.
() Cosmetic changes to trim lines > 80 characters.
Change-Id: If2c3b2728b3f088f7aa1fcaa6d2303ff5c4c197d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
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>