Compare commits

...

456 Commits

Author SHA1 Message Date
Anas Nashif
0ce35823a4 Zephyr 1.3.0
Change-Id: I44ebde6cab75fbf64666c1a574ec57463a7167b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-02 20:50:45 -04:00
Anas Nashif
3905ff4482 update sanitycheck footprint data for the release
Change-Id: I32d8fbf94191d2f1c48cd1d514ed679dfa288a11
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-02 20:50:45 -04:00
Anas Nashif
80fe4aeb05 doc: add section about 3rd party compilers
Change-Id: I469f0daa63dabfccc87bb46c312ebe319a58d863
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-03 00:29:58 +00:00
Juan Manuel Cruz
b20edcae7d doc: Updates the toolchain path format instruction
Jira: ZEP-177
Changes the documentation for the toolchain path. Some windows environments
need the ISSM installation path to be written in windows format.

Change-Id: Ib4729eb668e0daa7f7f520f208def4be6b86c692
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:41 +00:00
Juan Manuel Cruz
a0ed1ff1dc build: add arc support to issm toolchain
Jira: ZEP-186
Change-Id: Ib58aaba3020d8db18130f7d73a394a79c972272a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:41 +00:00
Juan Manuel Cruz
2170ca79ff build: support icx llvm compiler
Change-Id: I0bcc1f2e0ea93830e61fb3eaf8b523b7c4e1c301
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:40 +00:00
Luiz Augusto von Dentz
bd602f6e98 Bluetooth: GATT: Update documentation to include error domain
Refer to ATT as error domain expected by GATT API.

Change-Id: I70d45a618191ae859f3b2c33427dbb7262511393
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-02 15:28:18 +03:00
Luiz Augusto von Dentz
6a4d39d5cd Bluetooth: GATT: Fix error type
Callback errors should contain ATT error code not posix errors.

Change-Id: I698fac086ab8b2dca3487ab99ee974b4318d16f7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-02 14:31:02 +03:00
Anas Nashif
3da30441f5 gpio: fix typo in function documentation
Change-Id: I24cd9386f05e807c77faa61fea9a4ee4a0efec4f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 16:21:52 -04:00
Anas Nashif
5f7dd521fc arduino_101: add missing version_header.h file
Jira: ZEP-219
Change-Id: I8ce78733f8699fdfc9fd38dd44a5888be522f1eb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 10:26:27 -04:00
Anas Nashif
f2bc6e9277 arduino_101: add support for factory configuration
The factory defconfigs should be used to generate images
compatible with the factory settings and the bootloader that
comes with the Arduino 101.

When using those images, you will be able to keep the original
bootloader and flash the images using dfu-utils and there will
be no need for a JTAG adapter.

Jira: ZEP-219
Change-Id: I34b5e9ef73314f46b31086a772d94d3ddcc6c436
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 10:23:00 -04:00
Johan Hedberg
e2a1c43cb3 include/arch/arc: Fix minor space vs tab issue in indentation
Indentation should be with tabs only (these lines were with tab +
spaces).

Change-Id: I8f199b1d6972b02513e4c293636606f481641266
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-01 08:25:57 +03:00
Anas Nashif
909dd7ee05 arduino_101: support booting with original bootloader
To boot zephyr on the Arduino 101 running the original bootloader
which supports DFU, set the following in your application configuration
file:

CONFIG_SS_RESET_VECTOR=0x40034000
CONFIG_PHYS_LOAD_ADDR=0x40010000
CONFIG_VERSION_HEADER=y

Jira: ZEP-219
Change-Id: Ia015a7b6fce888b49ed22c558de992132d4713ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:56:54 -04:00
Anas Nashif
2c4c6af2ec samples: cpp_synchronization: rename local configuration and use one config
Change-Id: If903f48c97d4ee6e603d9db32784639837fe0254
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
8f73a27035 samples: i2c_lsm9ds0: we are using printk only
printk is enabled by default.

Change-Id: Id10cb0678c32db98e7cfb313fe9681783cc0267c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
fab4f4def6 samples: pwm: rename local configuration and use printk
Change-Id: Idd72bb8c7147911e0bf19c157ac8294b936684a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
7d64e54577 led_apa102c: rename local configuration and use printk
Change-Id: I14192240fdcc595f1a9aa12513c72b07886ae210
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
79ba6c5d47 gpio: unify kernel configuration for all architectueres
This also enables GPIO on ATMEL SAM3 when GPIO is set.

Change-Id: I4125af4910d57bed98b0ee4967fb696e3f345e67
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:26 -04:00
Anas Nashif
407eb36ec4 sensor: apds9660: remove IP specific GPIO configs
The driver and port used are already configured per port, no need
to hardcode the sample to a specific driver.

Change-Id: I8056e35db1e0970ec4ad56ce14fe5654fac9cf3e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:02:03 -04:00
Anas Nashif
fb385ab066 doc: fixed bullet list for bluetooth
Change-Id: Ia3b8ac2f32704c509504b77a2894b1f38a90f2e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 09:48:49 -04:00
Anas Nashif
ea54982e99 quark_se: remove hardcoded reset vector for ARC
Change-Id: Iba4d46b50990167aa9e21635a6a8e6c1dd90c5e3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 11:00:35 +00:00
Anas Nashif
4806e8c6c5 Revert "samples: philosophers: reduce stack size used"
This reverts commit 7eb9c884bc.

This change causes failures on arduino 101.

Change-Id: I6f8620b629516a6a81c2b417aa3736752ba40873
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-29 18:51:16 +00:00
Luiz Augusto von Dentz
b76abc0460 Bluetooth: Fix not being able to set CONF_FILE for init test
Change-Id: I750cb062b88fd265c14ae3304ae33cd345683a0f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-29 11:51:18 +00:00
Grzegorz Kolodziejczyk
3639ddb7a7 Bluetooth: drivers/nble: Fix calling cmd from discov callback
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>
2016-04-29 10:50:10 +00:00
Szymon Janc
7c87c089fd Bluetooth: Fix using invalid responder address as peripheral
If Static Random address is used as Identity Address and local privacy
is not used, responder address for slave connection was not set to
Identity Address.

Change-Id: I7a057c0fcb8e6d7e043952a092d16e959841f792
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-29 12:07:07 +02:00
Grzegorz Kolodziejczyk
e0922851a1 Bluetooth: tester: Return pre defined db offset on start server
Some IUTs may have predefined attributes in db which aren't take into
consideration while building via tester database. BTP clients should
know about such attribute handle offset change. After start server
we're sure that none of attributes will be added since zephyr db is
constant.

Change-Id: Ia2c6edaa7a2f3ca4a9c88fe00122c808a529dadb
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-29 07:52:11 +00:00
Mariusz Skamra
8adb16fc32 drivers/nble: Fix missing write flush() callback
This callback is needed to successfully perform write operation.

Change-Id: I09776dda16dac639320a7e83a66e7a9b31ebea6a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-28 17:34:23 +02:00
Mariusz Skamra
76b6716452 drivers/nble: Fix passing NULL pointer instead of conn to write() cb
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>
2016-04-28 17:32:05 +02:00
Mariusz Skamra
a653f8a168 drivers/nble: Fix status returned from on_nble_gatts_write_evt
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>
2016-04-28 17:29:17 +02:00
Anas Nashif
19542114de samples: gpio: sanitize test and remove obsolete options
- CONFIG_GPIO_DW_0_BITS is not longer available
- Use default printk
- Do not enable debug
- remove useless whitelist in testcase.ini, we already whitelist
  boards

Change-Id: If21795d544e268c26a757b697ce3c9f2e56db65f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-28 12:29:33 +00:00
Anas Nashif
fe1fb2a9b9 samples: magn_polling: include stdio.h and remove redundant configs
Change-Id: I8b2c729761c36c777c675c2b26f9ec7d3a22567c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-28 12:29:14 +00:00
Luiz Augusto von Dentz
e2c1b2b7be tests: test_slist: Add test for sys_slist_insert
Change-Id: I7b478c78050027013f386146bae6198a554f2005
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-28 11:41:15 +00:00
Luiz Augusto von Dentz
e54db2914f misc: Add sys_slist_insert
sys_slist_insert can be used to insert a node in the middle of the list
which previously was not possible with sys_slist_append and
sys_slist_prepend.

Change-Id: Ib9e319469cd4911adf7ddf49c54c3f7390c4c953
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-28 11:41:15 +00:00
Roger Lendenmann
3278f542eb Bluetooth: gatt: include service api definition proposal
* 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>
2016-04-28 10:35:38 +00:00
Daniel Leung
ee795d87ff boards/arduino_due: remove redundant I2C default kconfigs
Enabling individual I2C controller is done in the SoC kconfig defaults.
There is no need to do that in the board defaults.

Change-Id: I45a62d8bc96a5f42b3fd613f5890bcdf04c92032
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:40 +00:00
Daniel Leung
c977b1b8cd spi/qmsi: don't assign driver_api if init fails
Change-Id: Ia2225dc1a389c49ddb256e66bd0c4ee86e29c4cb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Daniel Leung
75c4a181ab watchdog/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: I118df1333524f774a80602f6a1f2ce95a6e4f1c1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Daniel Leung
cd1981ea04 rtc/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: Ic780b87e7f9372af970d24443d1a231a2f2c513f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Daniel Leung
bb7e4ffa6e pwm/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: I2ec5bb2e00d78755f8db1e960f747f9099163eaf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Daniel Leung
0eca2bfc98 counter/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: I3a2eb5bfc7f131c9a700b2d96674c238482ef164
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:38 +00:00
Daniel Leung
fbae4abf14 aio_comparator/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: Iacc2a0d4772e26bf700da009ccdbb74138978ed9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:38 +00:00
Daniel Leung
b78c9b6a5d adc/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: I56af7fa2d4b9bdc09928d6a1db79b0f37b9b5db5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:38 +00:00
Anas Nashif
af70a288ee Zephyr 1.3.0-rc2
Change-Id: I796f4f5e9d21838224f4afaf5afc20bca1760046
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-27 19:18:00 -04:00
Andrew Boie
6371d21846 philosophers: nanokernel: use empty config
None of the configuration directives for any of the arches were
actually needed.

Change-Id: Id0bf7393b8e2c7e0f5188c50c13d7666cdfcd114
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:14 +00:00
Andrew Boie
edc81265b4 test_timer: nanokernel: use empty config for all arches
Extra config for x86 was unnecessary.

Change-Id: Ic86979e80db2c63e07b328375027acec97e751c7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:09 +00:00
Andrew Boie
3e156748d0 test_xip: nanokernel: use common proj.conf
They were all the same anyway...

Change-Id: I4cf54d7a837d585885990bfcd168e96059349c4a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:04 +00:00
Andrew Boie
7571cdfd59 test_obj_tracing: nanokernel: use common config
The extra config in x86 isn't necessary.

Change-Id: I967a58ae5c04d55c144e9f711a708f43dc023ebb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:59 +00:00
Andrew Boie
a9a3cdd00d linker-tool-gcc: improve readability
This no longer defaults to X86 and instead throws an error if a
supported arch isn't found. Output format now checks CONFIG_ARM
instead of Cortex M3, should be the same for all ARM chips.

Change-Id: Ib9bf07ad93a44b3f7cdac7b52432110776eb23fd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:54 +00:00
Andrew Boie
1bf37fb6d3 test_errno: remove unnecessary use of nanokernel API
Change-Id: I7bc26e11f82f697b980f9eb9105941bc9caeb6c6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:49 +00:00
Andrew Boie
7327c9ee1f nanokernel: move C atomic operations to centralized code
These C variants of atomic operations can work on any arch,
have platforms select them if they don't have ASM equivalents.

Change-Id: I38eb03bb58beff865681ee56ef7bc0fcded1e906
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:19 +00:00
Andrew Boie
97dcf63a5a arch/Makefile: simplify
The arch names and the directories are the same, make it so we
don't have to keep appending stuff to this file as new arches
are defined.

Change-Id: I640526f5cb83fe34f5af14b62e5d06295a4912b0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:19 +00:00
Andrew Boie
b2a343dcb0 Makefile.toolchain.zephyr: add nios2 arch
Directory layout per SDK 0.8 structure. Using toplevel libs for
now.

Change-Id: I7852a9def09fb0a5f0a6e496249d2ebb86720d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:18 +00:00
Johan Hedberg
48338958e6 Bluetooth: monitor: Update to new protocol format
The updated "monitor over UART" protocol looks like:

    uint16  data_len
    uint16  opcode
    uint8   flags
    uint8   hdr_len
    uint8   extra_hdr[hdr_len];
    uint8   payload[data_len - 4 - hdr_len]

Change-Id: I5fceafe69489a5bfc940d113066f100016f74bc3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-27 18:09:28 +03:00
Anas Nashif
9eaf052778 sensors: sample: this testcase is for arduino_101
Change-Id: Id0299a05aab171621a317e4ea446acd65150d6ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-27 15:04:18 +00:00
Bogdan Davidoaia
6aa36a3d0d samples: cleanup environmental sensing README file
Fix typos and wrap text to 80 characters.

Change-Id: I25228c1d63ad391c734be601ed1503f42b4f2468
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-27 14:09:24 +00:00
Tomasz Bursztyka
6fc7566cdd ieee802154: cc2520: Invalid argument should return -EINVAL
-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>
2016-04-27 14:49:41 +02:00
Andrei Emeltchenko
c6f9941311 drivers/nble: Improve debug
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>
2016-04-27 12:02:33 +00:00
Andrei Emeltchenko
5a19423bb4 drivers/nble: Remove unneeded type cast
Since the header was updated type cast is not needed.

Change-Id: I6a232cd8515fb48ef2a0d16cc064effac7b80bfd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-27 12:02:23 +00:00
Johan Hedberg
18cd8ad091 Bluetooth: Add temporary workaround for MyNewt HCI_LE_Random reliability
For some reason the HCI init procedure doesn't complete on the Arduino
101 using the MyNewt HCI firmware if we send HCI_LE_Random commands
too quickly (which probably is crashing the nRF51 RNG, or something
similar). Adding just a tiny delay makes the init complete reliably.

Change-Id: Ic87a965b0e5cb265a2bee09e23d337d741527773
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-27 11:39:56 +00:00
Johan Hedberg
23b2383cee doc: Bluetooth: Create separate development file
Move development instructions to a separate file to make way for a
more high-level description of the stack. Also add more high-level
text to the main Bluetooth file.

Change-Id: Ic14ef62e6f5f602797b61df8584860dfac575489
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-27 04:39:37 +00:00
Johan Hedberg
43cf2f445d doc: Bluetooth: General language fixes to the current documentation
Fix grammatical errors and try to make the language flow a bit better.

Change-Id: I76b9dd2c88c087a6e4ae49788388a1ec4d198496
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-27 04:39:28 +00:00
Andre Guedes
4dc6927976 device: Remove DEV_* codes
This patch removes DEV_* codes from device.h since they are not used
anymore. All APIs now use error codes from errno.h, following the
conventions from doc/collaboration/code/error_code_conventions.rst.

Change-Id: Ifc363ec8d3d5aa108eaef49d9283b67dcae69ce5
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-04-27 00:58:18 +00:00
Ramesh Thomas
6d1e3cf96d doc: power_mgmt: Added Power Management documentation
Documented the Power Management subsystem which includes the
power management hook interface, device power management,
device busy status interfac and other APIs. Also included
is a guide to writing Power Management applications.

This has 2 parts.  One is the general description of the
infrastructure and the PMA writing guide which goes in the
'subsystem' area. Other is the API description that gets
automatically pulled in from the comments in the source files.
The API description goes into the section where all other
Zephyr APIs are put.

Change-Id: Id630209b23f931a8fcccb6f59428610298486743
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-04-27 00:57:53 +00:00
Andre Guedes
36c8e09a3a device: Include errno.h
The file device.c uses errno codes so it should include errno.h.

Change-Id: I93e806a9b20b2c9bcb245ac5e86fba70486c9591
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-04-26 22:49:49 +00:00
Andre Guedes
981caded95 arch: st_stm32: Include errno.h
The files soc_config.c and soc_gpio.c use errno code so they should
include errno.h.

Change-Id: I94237aa294701cc71ed17ea42eca9d8073d4ae47
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-04-26 22:49:49 +00:00
Andre Guedes
580e659887 drivers: stm32: Include errno.h
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>
2016-04-26 22:49:48 +00:00
Andre Guedes
d38e2fa35d gpio: Fix returning codes
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>
2016-04-26 22:49:48 +00:00
Andre Guedes
04cdf8b6e8 ieee802154: Fix returning codes
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>
2016-04-26 22:49:48 +00:00
Murtaza Alexandru
f169a66205 sensor: migrate all drivers to new SYS_LOG
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>
2016-04-26 18:11:05 +00:00
Murtaza Alexandru
52ccdada9c sensor: split lsm9ds0_gyro driver
Split driver for LSM9DS0 gyroscope in core functionalities and trigger.

Change-Id: I19736b65f45a6c4fc79a1f16423097b89accff24
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:56 +00:00
Murtaza Alexandru
28cf0c210a sensor: split bmc150_magn driver
Split BMC150 magnetometer driver in core functionalities and trigger.

Change-Id: I955ac39c2e995a81fa830776da9c0bcc38d9490a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:41 +00:00
Murtaza Alexandru
075d081811 sensor: add driver for LSM9DS0 accel and magn
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>
2016-04-26 18:10:41 +00:00
Murtaza Alexandru
676b89cd1a sensor: make runtime configurable attrs continuous
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>
2016-04-26 18:10:40 +00:00
Murtaza Alexandru
f1b95df34e sensor: rename SENSOR_TYPE_* to SENSOR_VALUE_TYPE_*
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>
2016-04-26 18:09:41 +00:00
Murtaza Alexandru
1be6d1f6c8 sensor: add the posibility to fetch one data type
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>
2016-04-26 18:09:41 +00:00
Murtaza Alexandru
82cca9c56e sensor: fix bmc150_magn compile error
Fix bmc150_magn compile error introduced in I2C register access API
migration patch.

Change-Id: I48f4d6405b4b7ae25beb0fbd46169eac3689ec8e
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:08:38 +00:00
Murtaza Alexandru
db06b853d3 sensor: fix init driver_api
Assign driver_api only if *_init is successful.

Change-Id: Ib95cd358af358aec4fc58ff10dcede05fad00d0a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:08:38 +00:00
Murtaza Alexandru
6542e03a33 sensor: refactor bmc150 and lsm9ds0
* 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>
2016-04-26 18:08:38 +00:00
Johan Hedberg
9ce5e08b56 doc: Remove references to Bluetooth from Networking
Now that Bluetooth is its own subsystem Networking shouldn't reference
it as a sub-section anymore.

Change-Id: Id134f9b9e63cfc6533e35e91c7bc6aedd6e8fdf8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-26 15:31:59 +00:00
Anas Nashif
9d006e3119 arduino 101: use QMSI spi driver
Change-Id: Iffff51a2b92f6afd04c96a57678e3cf2262a44ed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-26 15:26:15 +00:00
Anas Nashif
72f22da617 quark_se_devboard: use QMSI drivers
Change-Id: Id8f380e099f512aa36462f52c6db660a732656f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-26 15:26:04 +00:00
Johan Hedberg
20e03a4ffa doc: Move Bluetooth into a separate subsystem
This helps avoid having the tree grow too deep.

Change-Id: Ic4055f30b6d6f2ab575b361062d7f44b84237ba5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-26 17:18:23 +03:00
Johan Hedberg
6a075ace24 Bluetooth: drivers/nble: Initial implementation of bt_storage_clear()
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>
2016-04-26 15:21:36 +03:00
Johan Hedberg
0b68af523e Bluetooth: drivers/nble: Clear bonds upon init
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>
2016-04-26 15:08:34 +03:00
Daeseok Youn
fa442b0287 microkernel: Match alignment with open parenthesis
fix alignment coding style issue

Change-Id: I29fefd994ffe772a6a52995b83ad5b0bf9a0dd2c
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
2016-04-26 11:10:37 +00:00
Bogdan Davidoaia
c4878335c8 gpio: pcal9535a: use I2C register access API
Use I2C register access API for writing/reading registers.

Change-Id: Ic35b3e7159f9827f2d202d8cd1ae8f26ee6300f1
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-26 11:06:50 +00:00
Bogdan Davidoaia
fb1ea43be2 sensors: use I2C register access API
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>
2016-04-26 11:06:50 +00:00
Bogdan Davidoaia
9496ec6a4d i2c: change i2c_reg_update_byte parameter order
Swap order of mask and value parameters from i2c_reg_update_byte
function. This is needed make refactoring of sensor drivers that
would use this function easier, since all the register update
functions written for each driver have the mask before the value
in the parameter list.

Change-Id: I7bef7be73e904fca353a492ab9edd2a210df199e
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-26 11:06:50 +00:00
Laurentiu Palcu
e7a8c7609a sensor: bmi160: fix regression
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>
2016-04-26 10:57:56 +00:00
Laurentiu Palcu
47de28535a sensor: bmi160: switch x86 app to QMSI GPIO driver
Change-Id: I1265507aec8214fbdad4ea3d88cd4358081dfced
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-26 10:57:56 +00:00
Arkadiusz Lichwa
8e34b5869b Bluetooth: L2CAP: Add API to register PSM server
Enables API to register PSM server on BREDR transport.
Adds l2cap_br.c file responsible for BREDR specific functionality to
build path based on Kconfig selection.

Change-Id: I92823b0207ab0da96bfb813353de9f95fa5dd0f4
Origin: Original
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-26 10:58:14 +02:00
Arkadiusz Lichwa
9853a040b9 Bluetooth: L2CAP: L2CAP_DYNAMIC_CHANNEL enabled by default when BREDR
Makes Kconfig L2CAP_DYNAMIC_CHANNEL option autoselected when turns on
BREDR support.

Change-Id: Ib56b0e4d578c322837b79c67a7737322b04414f0
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-26 08:26:05 +00:00
Flavio Santes
05bd623aa1 net: apps: Break long strings in loopback test
Use string literal concatenation to break the sample text.

Change-Id: I0729b113e80d3efec909603fbb143d1bc515f165
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-04-26 08:09:01 +00:00
Johan Hedberg
ee3f478687 Bluetooth: Fix monitor init priority
The monitor protocol handling needs to be initialized very early on,
e.g. before HCI driver registration. Use the same priority as used for
other console handlers, except we don't expose this as a Kconfig
option for now.

Change-Id: I61157d62327080eeac7a59bb64e5a18877cc26f6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-26 10:21:19 +03:00
Anas Nashif
bf1356c969 Zephyr 1.3.0-rc1
Change-Id: I794f435cd882abc87f2f37a5c07b6ba0a08ba5f3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-26 00:07:27 +00:00
Juro Bystricky
7989015e6c arduino_101_load.sh: Fixed misspelled envar
Change-Id: Ib7a5e70081585827a1ba9058bbc012933094ff4e
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-04-26 00:07:13 +00:00
Juro Bystricky
ae74c18bea arduino_101_backup.sh: Fixed misspelled envar
Change-Id: I585a60b427de1c4e829da59f596d4f58c7af1d17
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-04-26 00:06:45 +00:00
Johan Hedberg
4832da8db7 Bluetooth: drivers/nble: Fix using too large buffer
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>
2016-04-25 19:21:28 +00:00
Johan Hedberg
39e63117c4 Bluetooth: drivers/nble: Fix passing NULL to attr->read()
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>
2016-04-25 19:21:10 +00:00
Johan Hedberg
847703d91b Bluetooth: drivers/nble: Fix on_nble_gatts_read_evt() behavior
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>
2016-04-25 19:20:58 +00:00
Anas Nashif
81125feb06 samples: synchronization: reduce stack size used
This will allow this sample to run on systems with less than 8K SRAM.

Change-Id: Id3a1c826cfade09f91bc3b0dba3c98e386f5ab06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:06 +00:00
Anas Nashif
7eb9c884bc samples: philosophers: reduce stack size used
Change-Id: I89a21d16fc14f52226fad0bd92cab030b69c54f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Anas Nashif
4b854b00c3 sx9500: remove explicit definitions for GPIO/I2C
Change-Id: I6c0e13707a91db993737297c59ed77603c561377
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Anas Nashif
04e6243aa5 gpio: rename device name for AON GPIO
Change-Id: Iccd3790d3e7adbe790fe78755d297aad0ae97834
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Anas Nashif
5c30367a06 qmsi: gpio: add initialisation priority for driver
Change-Id: I4204d514f95c8e6e264a3cb71a2fa8eec8bab45a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:04 +00:00
Anas Nashif
3ca134b3ac doc: fix typo IMACU -> IAMCU
Change-Id: Ib89080b7f6f0fb1d7b92ad69a18cef26a26b9a4c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:04 +00:00
Anas Nashif
57605a558c build: generate error if board is not found
Change-Id: Icf0c713d5fe3bb56dea4d74c87176c04f80df329
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:04 +00:00
Anas Nashif
1a1f7fd916 arc: make SRAM/DCCM values configurable
Remove hardcoding and make the values configurable. Also make the
Kconfig variables consistent with other architectures.

Change-Id: I69334002303d4d8abaf7363d9134fd5f46ce4eeb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:03 +00:00
Anas Nashif
d18b584427 grove: use default i2c device set in Kconfig
Change-Id: I2925bb0f5f8f0537f5c21e8650b03c281081035e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Anas Nashif
9d8c332b21 i2c: use I2C_X nameing instead of I2CX
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>
2016-04-25 17:01:48 +00:00
Anas Nashif
052664d282 aio: build only when driver is configured in
Change-Id: Ida1a108fe8af585ba0c518bcb216b6c0f3253ab4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Anas Nashif
ce836e2c69 toolchain: move iamcu output format/arch to SoC
Instead of defining the output format in the toolchain environment
setup, define this per SoC that supports the ABI.

This will allow us to directly referencing an installed toolchain
without the need for declaring ZEPHYR_GCC_VARIANT

Change-Id: Icd1a7a21acbf075a51854fb2ebb3ef06788ce9b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Dan Kalowsky
69c7f1e621 boards: nucleo: Adding flash support
Adding an openocd.cfg to control flashing of the Nucleo-F103RB board

Change-Id: Ia730244bdc2d31d074fe72c41d3e58e7830c8df0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:47 +00:00
Bogdan Davidoaia
6f6e65bfb1 i2c: fix i2c_reg_update_byte
The device address must be given before the register address in the
parameter list of the i2c_reg_read_byte function.

Change-Id: I92afbbf83f76eeb58ec41a2a8c83dd909b78a23a
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-25 16:58:32 +00:00
Tomasz Bursztyka
cc53ac7918 samples: sensor: Use new GPIO callback API for bmi160 sample
gpio_set_callback is meant to be deprecated and thus modifying the
sample to use the new GPIO callback API.

Change-Id: I822cd1c81575834d40926c56cd61b87884230594
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-25 14:58:16 +00:00
Tomasz Bursztyka
559b768340 sensor: bmi160: Use the new GPIO callback API
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>
2016-04-25 14:58:16 +00:00
Tomasz Bursztyka
655c268d21 gpio: Deprecate API 1.0 callback function
If one use the old gpio_set_callback() function,
the build will generate deprecation warnings.

Change-Id: I3f008ab3fc46e1b38cb433340d2f97671d04906e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-25 14:58:15 +00:00
Andrei Emeltchenko
0ff961fb29 drivers/nble: Update Nordic RPC to 0425
Update RPC to Nordic BLE radio module to 0425 revision.

Change-Id: Ieb79821acd5a8fbc4358ea5e1f258834a7932c2c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-25 15:03:53 +03:00
Johan Hedberg
6f6984129a drivers: uart_qmsi: Re-enable HW FC for arduino_101 & quark_se_devboard
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>
2016-04-25 11:42:50 +00:00
Szymon Janc
15c1fed5b6 Bluetooth: SMP: Workaround LE SC bug in iOS
iOS BT stack has a bug in LE SC implementation. If EncKey is not set in
key distribution it sends Pairing Failed PDU if any (?) keys were
distributed. This wasn't visible before as without local privacy no
keys were distributed for LE SC with iPhone.

Change-Id: I36c2398ea821c6048d970b93a58189eb466ea434
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-25 12:31:23 +02:00
Szymon Janc
51b91e1a33 Bluetooth: shell: Update advertising command help
Add missing rpa parameter to help message.

Change-Id: I902e0f1308a8f8a8b603873a8ffcb9b03527f6e1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-25 10:15:16 +02:00
Johan Hedberg
a28babc9b7 Bluetooth: L2CAP: Fix coding style of bt_l2cap_chan_ops
Indenting away the function pointer name from the return type is not
consistent with the rest of the code base.

Change-Id: I8bd69ccfd201fa3c9eedb13caeff920774d1defd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-25 07:30:25 +00:00
Jukka Rissanen
cdb296a51f net: apps: Set IPv4 configuration when doing automatic testing
Set the IPv4 address, netmask and default router addresses
that are used for automatic testing.

Change-Id: Iebddc42c56dceeb089af7878102f8a73c30f0b74
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
7e91a42ced net: apps: Fix IPv4 support in echo-server
The IPv4 address is set properly for testing purposes.

Change-Id: I996e7435276f65dbb642aa9ab99c37cd842d4b39
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
74d6563627 net: apps: Add TCP support to echo-server application
If TCP is activated, then the echo-server application starts
to listen TCP socket and reply data to caller. For TCP
connections, the application data is not reversed because
it would make it difficult to verify the data in the sender
side. The TCP packets might be split into smaller chunks by
echo-client so client would have some unnecessary difficult
to verify the data it sent if we reverse it.

Change-Id: Ic146dfc75825bc8057968c581bfe9d3285e0d7b4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
67463d92f1 net: ipv4: Print configured IPv4 address to console
This helps debugging.

Change-Id: Id3b8f521e82952c8abf8a557ae94524c6b7165e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
2fb635a8e4 net: Wakeup TX fiber when packet needs to be sent
This is not mandatory but makes sure that TX fiber is wakeup
as soon as possible to send the actual IP packet.

Change-Id: I48fb8a5e428f67e249ba0ea2c0f14b0d512f148b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
e2692eba6f net: 802.15.4: Do not compress TCP packets
The IPv6 header compression is temporarily turned off for TCP
packets because of stack limitations when a packet needs to
be resent.

Change-Id: I572f177c727aa39757afebdc594cc07c8d8a1bd5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
9e172defc5 net: tcp: Disable client role
Currently we can only be a server that listens TCP data and
can send back data.

Change-Id: If009b7cb608029a8fb3889772fe15e45a154679d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
ad2e661569 net: Enable TCP support
User can enable TCP server (listening socket) support in the
IP stack. This commit does not yet have TCP client (connecting
socket) support.

Change-Id: I75dd02a81addc1d1e026463b53631d56378157df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:32 +03:00
Jukka Rissanen
d0ba82a581 net: Initial TCP support
Initial import for some new TCP related files from Contiki.
Fixed the compilation of imported TCP code but actual TCP
support comes in following commits.

Origin: Contiki
Change-Id: I0b42e2fa11de15f9b4da53e369cf114fcfd6cd21
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:18:24 +03:00
Juan Manuel Cruz
0e40db8a3b build: fixes issue in windows Kconfig support
It allows to silently ignore non-existent files.
When using wildcards in Kconfig source files
(e.g. source folder/*/Kconfig), it is possible to refer files
that does not exist. In the previous example, it is possible
that Kconfig files do not exist in one of the folder's
subfolders and it is not a requirement for the file to exist
in each one of the subfolders.

Additionally, it fixes an issue for wildcards in the file name.
If the name contains a wildcard, Kconfig should iterate
over each file included in the wildcard
(e.g source folder/myKconfig.*)

Jira: ZEP-177
Change-Id: I5aa192ca1e2df83461b12a86fe29a98cd95c4256
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-04-23 11:27:11 +00:00
Tomasz Bursztyka
51503a2388 cc2520: Using new GPIO API callbacks
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>
2016-04-22 22:17:53 -04:00
Tomasz Bursztyka
8386a49929 samples: Using new GPIO API callbacks
Adapting GPIO samples to use the new callback format.

Change-Id: I944dce4faeeee30117edbd7a065e40caa0b7ed66
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-22 22:17:39 -04:00
Tomasz Bursztyka
62fcd4ca82 sensors: Using new GPIO API callbacks
Adapting GPIO based sensors to use the new callback format.

Change-Id: Ibdc68bf80a2ee42dcaf25c7a6e4431f9b64dc20a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-22 22:17:25 -04:00
Tomasz Bursztyka
fea1c49ba2 gpio: Improve the public API to handle multi callbacks
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>
2016-04-22 22:15:12 -04:00
Jithu Joseph
18fc64dcff power_mgmt: Sample usage of device_xxx__busy() APIs
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>
2016-04-23 02:14:21 +00:00
Jithu Joseph
592882e5f4 power_mgmt: APIs for devices to signal busy
Certain Low power SOC states (e.g. deep sleep)  will result in device
IP blocks losing state. In such a scenario it can be useful to have
a mechanism for devices (driver code) to signal the power manager /
policy that they are in the middle of a transaction.

We expect the device driver code to make a call to
device_busy_set(device *) before initiating a transaction and
device_busy_clear(device *) on completion. It is expected that device
driver developers will add this as necessary in their drivers.

Further an API is provided  for power manager application / policy to
check this. Based on this the power manager / policy can  decide
whether or not to go into a particular power state.

Change-Id: I0fedd90b98e182cd41b53c7f9e08655532822faa
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-04-23 02:14:21 +00:00
Anas Nashif
35360df9be doc: index config variable only once
The index.rst file should reference variables only once.

Jira: ZEP-148
Change-Id: Ia5aad1d3ccd0f7c93fca94f1fa0ad88171eaf5c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-23 01:02:19 +00:00
Anas Nashif
e8bc8af602 quark_d2000: remove unused code
For Quark D2000 we use QMSI drivers, so the initialisation code is no
longer needed.

Change-Id: I22aaa35288e230c455a19b9e67dc6cfb7dc0ff12
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
b0c0040894 quark_se: quark_d2000: remove all defines that now come from qmsi
QMSI defines all the registers of the SoC and other values in
qm_soc_regs.h, so cleanup soc.h and rely on the data from the BSP
contained in qm_soc_regs.h.

Change-Id: I672925cf1c0144a9ed64073ea289c691285a8082
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
7c332df43b qmsi: use QMSI_LIBRARY instead of QMSI_DRIVERS
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>
2016-04-22 20:55:36 -04:00
Anas Nashif
dcf2f48413 qmsi: pinmux: use built-in qmsi driver
Change-Id: I84064cd42d85a687a505473a012a07763b4301e8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
a6915c070d qmsi: spi: use built-in qmsi driver
Change-Id: Ic7e86e015d4beb11a01d75aa50bc50f95c784e5e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
8e4f04d735 qmsi: spi: fixed warning due to const paramter in API call
Change-Id: I0cc6f5948a9f3d93aec970950c7b2db441bff570
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
a91b35b506 qmsi: flash: use built-in qmsi driver
Change-Id: I7e9fa271956c4e02998fa7f9cf19afcc3372f46f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
1797c8f108 qmsi: uart: use built-in qmsi driver
Change-Id: Ie19aee8dad8ba082891f92a2d42dc71f4ac34dbe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
b3e02b406a qmsi: adc: use built-in qmsi driver
Fix naming and use a global driver name for instance.

Change-Id: I30a54cb9c20773e1b6fdc57b934aa564612a6c45
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
85b3c2c62a qmsi: gpio: use built-in qmsi driver
Change-Id: I11444bcc146dbc477bb605f6b405bee559716f2a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif
324a83bed7 nble: Use string name for GPIO driver
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>
2016-04-23 00:54:34 +00:00
Anas Nashif
01aa9a1d37 samples: power: use string for driver name
Change-Id: I2a5d02cf13ce4ed304c0ebb3d81310aec9325add
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-23 00:54:33 +00:00
Anas Nashif
f4feacf8b2 qmsi: aon_counters: use built-in qmsi driver
Change-Id: I5df98e9eacf429f017a094c861dcf54ab61566c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
e6ab39a9c2 aio: rename sample name and make it generic
Change-Id: I3bd0a8b50551bec0bf4afeb6a912f558bc106de8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
b512681f8c qmsi: aio: use built-in qmsi driver
Change-Id: I24b227d9367a4f0144cb9fa968a51827f8c2dfc5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
940d539834 qmsi: pwm: use built-in qmsi driver
Change-Id: I154840f704b9cfec269addaf3cbd7e71bb6310af
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
b46f9db04b spi: use global init priority
Do not have priority per IP, use one config instead.

Change-Id: Ieb2923d4749a294e2a1c677d47d56a14cee3f36d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
82d4c96bd4 pwm: unify driver names
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>
2016-04-22 20:46:29 -04:00
Anas Nashif
a7d3329694 qmsi: i2c: use built-in qmsi driver
Change-Id: I2e650198117128cec79a64abcd2cc065b5f9804c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
98c09140f1 qmsi: watchdog: use built-in qmsi driver
Change-Id: I0cff75181bb2a51c91e6589f9624f0891db0b6e9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif
80e9d63dec qmsi: rtc: use built-in qmsi driver
Change-Id: If8e70c946f73abf03a695fecaeff30a9881f6e94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:28 -04:00
Anas Nashif
987016b954 drivers: add qmsi files for Quark MCUs
This is from QMSI porject at https://github.com/01org/qmsi

The version included in this change is 1.0.1:

https://github.com/01org/qmsi/releases/tag/v1.0.1

commit: c902bc5143546b76a3708ddb465ea9b7a8bd314a

Origin: https://github.com/01org/qmsi
Change-Id: I983deb2cffe2f84b7b7f2dd381367863eab7c6d1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:28 -04:00
Anas Nashif
3aab249aa0 Bluetooth: add drivers to include path
Compiling without the drivers prefix causes the following type of
compiler error:

include/uart.h:42:21: fatal error: pci/pci.h: No such file or directory

Change-Id: I99cd814708e74ed4722e5e906819497010263337
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 17:58:39 -04:00
Anas Nashif
7c27d8ab3a soc: arm: add Makefiles one level up
It was not possible to add directories under an SoC family
because of the direct call to Makefile in the SoC series from the
architecture level.

While we have SoC still using the old structure, add a conditional
to still support old structure and allow Makefiles directly under
an SoC family directory. 

This is useful for adding drivers and BSP files common to one family.

Change-Id: I85dc8341523b41949de91d78675153ce0baa5aac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 21:33:26 +00:00
Bogdan Davidoaia
ef26bf7848 i2c: add register access API
Add API for reading, writing and updating internal registers of I2C
devices. This API is meant to be used as a simpler way of communicating
with I2C devices that have 8-bit internal registers.

Change-Id: I7280eb530039aa10ad9cc19c1c309c7a2f473eb4
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-22 20:01:08 +00:00
Benjamin Walsh
1040509670 doc: add architecture porting guide
Explanations and guidelines when porting Zephyr to a new processor
architecture or ABI.

Change-Id: Ibb3a26636dca6b248103e4744c333911c2af0e50
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-22 19:11:03 +00:00
Johan Hedberg
dd59f2704e Bluetooth: Add recently added SPI & I2C HCI bus defines
Change-Id: I23b9e32f21b279a4a830bfa5685fe7d8250a5afc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Johan Hedberg
e3e91d3280 Bluetooth: Add name member to HCI driver struct
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>
2016-04-22 18:49:11 +03:00
Johan Hedberg
4488fc6cab Bluetooth: Move HCI device bus information to the driver
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>
2016-04-22 18:49:11 +03:00
Johan Hedberg
8c3add2b6a Bluetooth: tests: Add automated tests for new monitor code
Add two new test cases to exercise the code in monitor.c.

Change-Id: I66ae70e0d3b61d3b852916333019e1ed2c5c6cf4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Johan Hedberg
264c207f4f Bluetooth: Add custom "monitor" protocol logging over UART
With most boards there's no simple way to get access to the HCI
traffic. Simultaneously these boards only have one external UART for
the console. This patch introduces a protocol which combines both
normal logs and HCI logs over a single binary protocol sent over the
console UART.

The protocol is modeled based on the btsnoop/monitor protocols used by
BlueZ, and the first tool that's able to decode this is btmon from
BlueZ ("btmon --tty <tty>").

For platforms with two or more external UARTs it is still possible to
use CONFIG_UART_CONSOLE as long as the UART devices used are
different, however on platforms with a single external UART
UART_CONSOLE should be disabled if BLUETOOTH_DEBUG_MONITOR is enabled
(in this case printk/printf get encoded to the monitor protocol).

Origin: Original
Change-Id: I9d3997c7a06fe48e7decb212b2ac9bd8b8f9b74c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Szymon Janc
ad475d863a Bluetooth: Remove RX priority fiber
Processing command complete and status events in separate fiber is not
really needed as those handlers doesn't block nor do heavy computation.
This work can be done directly from ISR making code simpler.
Additionaly priority fiber stack is no longer needed resulting in 256
bytes memory savings.

Change-Id: I2ecb29b720d3a886e7881a2208f697a834f4cdaf
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 15:41:32 +00:00
Grzegorz Kolodziejczyk
9ac1782cd8 quark_se_devboard: Configure default UART for UART_PIPE
This UART config is needed to handle properly btp tester serial data
flow.

Change-Id: Id013a232e105247414d44148f5ccfe708b19c4a8
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-22 16:52:21 +02:00
Juan Manuel Cruz
401d67f91c debug: interrupt event logger sample for arc
Jira: ZEP-53
Change-Id: Idb24bb28d5f4b5f31f1cc32d9a9ec2b8c622543e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-04-22 12:39:22 +00:00
Juan Manuel Cruz
b17258b536 debug: interrupt event logger support for arc
Jira: ZEP-53
Change-Id: Id6ee505a7e89122a47fc22162b4c257ac2126d09
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-04-22 12:39:22 +00:00
Daniel Leung
267e6e639c i2c/quark_se_ss: make structs and functions const and static
() 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>
2016-04-22 12:32:26 +00:00
Szymon Janc
85d44978a5 Bluetooth: shell: Add support for advertising with RPA
This allows to test local privacy feature.

Change-Id: Ib231f9187e353f79fee9237acef0d1ffe9cb2b7d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 11:07:19 +00:00
Szymon Janc
68c707884e Bluetooth: Fail if advertise with unsupported address type
This allows to gracefully handle case when privacy is not enabled.

Change-Id: I3f4ebafd05abe186212b554161d8a8982f58ff45
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 11:07:11 +00:00
Andrei Emeltchenko
ac7a43a177 arduino_101: Correct UART name configuration
Change NBLE_UART_ON_DEV_NAME to BLUETOOTH_UART_ON_DEV_NAME for H:4

Change-Id: I4391b32c75c738478c964d4c79f6eb80d737b043
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-22 11:06:42 +00:00
Andrei Emeltchenko
45736940b9 quark_se_devboard: Add configuration for nimble HCI stack
Enable Power Management handling also for quark_se_devboard with
nimble HCI stack.

Change-Id: I6e5bb85c4f2370f52904be9dff14ce8e7fb1eb44
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-22 11:06:37 +00:00
Anas Nashif
13ce2d6285 doc: show information about documentation current version
show different information based on the state of the current
documentation and link to development version and released
versions depending on where the user lands.

Change-Id: Ifa6263900222db483efa0388e2588dd97222ecb6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 10:54:38 +00:00
Szymon Janc
828fe15bbe Bluetooth: Always use RPA for connection if privacy is enabled
We should always use RPA for outgoing connection if privacy is enabled.
Otherwise privacy might be compromised if connecting to devices that
don't support pairing.

Change-Id: Ib12a5d9dfdc9285b5ff721f0fdb8f824ff1a8f0f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:58:03 +00:00
Szymon Janc
7ba5715ae0 Bluetooth: Remove double address comparison
set_random_address already checks if current random address needs
to be updated so there is no need to double check that before it
is called.

Change-Id: If5fe16f1b886aa877bf014a8977ccaea2c8ba6e0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:57:43 +00:00
Szymon Janc
605f7a0979 Bluetooth: Simplify creation of LE connection
hci_le_create_conn sets controller random address to one from
connection so there is no need to do that again in command status
event.

Change-Id: I22a24a46946413489445e577341cbf6ea68c0964
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:57:02 +00:00
Szymon Janc
4e4b81f06f Bluetooth: Simplify setting advertising parameters
There is no need for special handling of command complete when
using bt_hci_cmd_send_sync for sending HCI command.

Change-Id: I60671e490958e67f5d20dc8c6ddbf51ca839c338
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:55:53 +00:00
Szymon Janc
e5493c9ac8 Bluetooth: Simplify setting random address
There is no need for special handling of command complete when
using bt_hci_cmd_send_sync for sending HCI command.

Change-Id: Ib67f06d47249d24854c07be34b0e39f70f5d5170
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:55:42 +00:00
Andrei Emeltchenko
1b737d4cf4 quark_se_devboard: Enable PM for the board
Enable Power Management and enable logic for quark_se_devboard,
without the patch BLE Radio module might be enabled with JTAG tools
or right after boot.

Note that some boards do not have the GPIO pins connected to BLE
module but this should be still OK wrt to board functionality.

Change-Id: I9019e406afa36fe2dea52c07075c947e8c50a961
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-21 15:31:17 +00:00
Andrei Emeltchenko
5860325b4f drivers/nble: Cleanup Nordic RPC code
Remove handling not used and obsolete function prototypes.

Change-Id: I6086f2e13efe7fc219f237dda710a545bec07612
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-21 15:31:09 +00:00
Andrei Emeltchenko
642d596d69 drivers/nble: Update RPC to 0422 revision
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>
2016-04-21 15:30:54 +00:00
Laurentiu Palcu
e5dc7ac363 sensor: bmi160: switch to the new logging API
Change-Id: Id370e06e95528c223e09bb4110eeec3dcc2d4aef
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu
01d133a201 sensor: bmi160: add trigger tests to the application
Also, lower the clock for the SPI bus in order not to hit the DW
controller CS issue.

Change-Id: I69c4211bfa6efb85117185e2ae813dd7c4915a7a
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu
8943f6c5ce sensor: bmi160: add support for triggers
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>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
f71df44204 sensor: bmi160: make some read/write functions global
These will be needed by the trigger implementation.

Change-Id: Ib408ae540571447059301046a3486cedffa735d5
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
5609ec95ee sensor: bmi160: fix bmi160_reg_field_update function
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>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
77e28d2263 sensor: bmi160: create two wrappers for bmi160_reg_val_to_range
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>
2016-04-21 14:16:13 +00:00
Laurentiu Palcu
6330388bf5 sensor: bmi160: move the printing macro to the header
The macro will be used in the upcoming trigger file.

Change-Id: I57a570fde37f31771b3d8bb9c028520fdc41da8f
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:13 +00:00
Laurentiu Palcu
b70278f113 sensor: bmi160: add x86 app for Arduino101
This app is needed for Arduino101 only, or boards using the Curie
module.

BMI160 interrupt pin is connected to AON GPIO controller. The driver
handling the AON GPIO controller runs on x86 core. Even though, the AON
GPIO controller is accesible to ARC core too, the current implementation
for Designware controller driver does not allow it. Hence, this app will
register a gpio callback and signal the ARC core through IPM.

Other boards that use a gpio pin on the regular GPIO controllers don't
need this app.

Origin: Original
Change-Id: I225ca60735e39c7a47693dc53237f48cd9ac2680
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu
8d7f52c2d9 sensor: sensor.h: fix typo
Change-Id: I989cd3de1096848c354b7eb597665849bc37bdb0
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu
559112a6a0 sensor: bmi160: move sample app to arc subdirectory
The movement is needed because on some boards, like Arduino101, the
current GPIO driver implementation does not allow for receiving
interrupts from AON GPIO controller directly on ARC core. Hence, IPM is
needed to relay the interrupts from x86 to arc.

However, other boards that can use a regular GPIO intterupt or users
that connect a BMI160 chip separately, can still use the ARC application
as is.

Change-Id: I58dd77edd45ea2b071db5b99073eb15722847bfe
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Szymon Janc
cef3c59488 Bluetooth: Refactor bt_init
This makes function flow follow common error handling convention
err = foo()
if (err)
  return err

Change-Id: Ifa3f44e3857b50436212cd5ed240795b220f8a15
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-21 14:03:10 +00:00
Grzegorz Kolodziejczyk
0d98a3633e Bluetooth: tester: Add support for seqence gatt database
This patch reorganize tester gatt commands to handle also sequence
builded gatt data base

Change-Id: I5fc89c1c498dd2ecf3999bc93e3caffd14f67cb7
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-21 13:32:42 +00:00
Johan Hedberg
3fbe227cdd Bluetooth: tests: Add DEBUG_DRIVER to automated tests
Change-Id: I9fa76816ceb1f6a49861a1145ae85394b6a64c80
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-21 10:41:48 +03:00
Johan Hedberg
b090d75d62 Bluetooth: drivers/h5: Remove redundant BT_DBG()
Change-Id: I90e7caadfb357c1c2451b0108d11ce57c0dae77a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-21 10:41:48 +03:00
Andrei Emeltchenko
503d01a96c Bluetooth: Fix typo tupe to type
Fixes compilation with debug for drivers h4 and h5

Change-Id: Ia09ce0a5ca3d684a4f9d25fdfe8530e80a46afac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-21 10:09:30 +03:00
Yannis Damigos
2b8d3626c6 sanitycheck: Add olimexino_stm32 board to sanitycheck
Adds olimexino_stm32 board to sanitycheck.

Change-Id: Icd0e5025bc7a348c7a1a4d18d10d2d1e3a9817bd
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:02 +00:00
Yannis Damigos
7a33682a03 doc/board: Add documentation file for olimexino_stm32
Adds documentation file of oliemxino_stm32 to the
supported boards.

Change-Id: Ide6c7767be56d33e8c040a03df13337919a09750
Origin: Original
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:02 +00:00
Yannis Damigos
de22f4e55e boards/olimexino_stm32: add new board
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>
2016-04-20 22:29:01 +00:00
Anas Nashif
1d93e321e8 samples: ipm: reset kernel binary name to zephyr
Those samples are confusing test suites by not generating
the expected zephyr.bin binary.

Change-Id: I4fb81782bacafb4f259e088df4b2518faa6f47cf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-20 17:20:10 +00:00
Johan Hedberg
560956c54d Bluetooth: Kconfig: Split debug selection into a choice
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>
2016-04-20 17:46:09 +03:00
Johan Hedberg
5cec79e4c8 Bluetooth: Add dedicated bt_send() function
This helps avoid digging out the driver and send callback pointers,
and helps prepare for extended logging support to export the HCI
traffic externally.

Change-Id: I1a9a58a6b47babed41b5bb9349635478905352e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 14:46:48 +03:00
Bogdan Davidoaia
b628aa8a87 sensors: bma280: add support for BMC150 accelerometer
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>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia
0eec9492fc sensors: bma280: fix accel data sample calculation
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>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia
62fca8fcc1 sensors: bma280: compute accel scales based on data width
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>
2016-04-19 18:40:42 +00:00
Arkadiusz Lichwa
bf62dfad70 Bluetooth: BR/EDR: Initiate encryption on link
Adds method to start encrypting the link by local controller. Encryption
implies successful authentication to be done before.

> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
	Handle: 11
	Encryption: Enabled (0x01)
> HCI Event: Command Status (0x0f) plen 4
	Set Connection Encryption (0x01|0x0013) ncmd 1
	Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4
	Status: Success (0x00)
	Handle: 11
	Encryption: Enabled with E0 (0x01)

Change-Id: I3bbfc6ca77a6fd088582ab45f14d7c122aec7f05
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:50:31 +00:00
Arkadiusz Lichwa
99483fded6 Bluetooth: BR/EDR: Notify about pairing while JustWorks
In some cases 'justworks' model applied on authentication/pairing process
requires user attention.
BT Core 4.2 says in table 5.7 [Vol 3, Part C, 5.2.2.6] that not always
passkey auto-accept can be applied on both devices involved in SSP
pairing for this authentication association model.

Change-Id: I7cc575ac088bcce7830f22d08e49dab40889f515
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:49:18 +00:00
Arkadiusz Lichwa
9d9e349b31 Bluetooth: BR/EDR: Initiate authentication
Enables initiate authentication using possibility to change security
level on link by calling internal security API. In case of failure
resets pairing state flag to re-enable change security on subsequent
authentication attempts.

To verify the process of authentication run BT shell app from
tests/bluetooth/shell folder and use commands like below:
 >br-connect xx:xx:xx:xx:xx:xx
 [Connected: xx:xx:xx:xx:xx:xx]
 >security 1

HCI log:
> HCI Event: Connect Complete (0x03) plen 11
	Status: Success (0x00)
	Handle: 11
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link type: ACL (0x01)
	Encryption: Disabled (0x00)
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
	Handle: 11
> HCI Event: Command Status (0x0f) plen 4
	Authentication Requested (0x01|0x0011) ncmd 1
	Status: Success (0x00)
> HCI Event: Link Key Request (0x17) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Command Complete (0x0e) plen 10
	Link Key Request Negative Reply (0x01|0x000c) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: PIN Code Request (0x16) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	PIN length: 4
	PIN code: 0000
> HCI Event: Command Complete (0x0e) plen 10
	PIN Code Request Reply (0x01|0x000d) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link key: d9ff76c09284c1ed369851f87d7ac623
	Key type: Combination key (0x00)
> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11

Change-Id: I2d383d34e19c04ead3fa254e5514d5c7f352a21e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:48:45 +00:00
Johan Hedberg
d458c616df Bluetooth: Add missing debug log to HCI driver send()
Change-Id: I0842675192cd1fbf3997a8f0d4906f114c0489c1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-19 14:39:55 +03:00
Johan Hedberg
483fc4705f Bluetooth: samples: Add sample Kconfig for nimble based controllers
Add config files to be used on Arduino 101 (or any Curie-based) board
with the MyNewt nimble stack running on the nRF51 and exposing HCI
over UART. These configs contain a stripped-down set of features so
that the resulting image fits e.g. on the Arduino 101.

Change-Id: I7300e9ca4205de6f52aa6ca1bfe4e0b011b6dcbe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-19 13:19:02 +03:00
Mariusz Skamra
3bea520c6c Bluetooth: tester: Update tester application README
This adds the guidelines for the tester application building usage.

Change-Id: Ibcd31b7bed827f8eee99fdf21d3bb1e8edd24d2e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-19 06:58:55 +00:00
Anas Nashif
ef2fc59cab fixed inclusion of limits.h when building with newlib
The -nostdinc flag to GCC makes it not include its own directories when
searching headers, which means they need to be added manually. The same
Makefile line (~657) that adds the -nostdinc is also adding the correct path
for the gcc used to build, using the "-print-file-name=include" switch to get
the correct path for the respective gcc version.

The problem is that including limits.h from newlib will try to include gcc's
version too, which in every toolchain the SDK provides (and at least on my
machine, the same thing applies for the system gcc), limits.h is found under
gcc's "include-fixed" directory, not just include. So another -isystem should
be added with the value from "-print-file-name=include-fixed".

Jira: ZEP-142
Credits: Iván Briano
Change-Id: I33b7d9808d000a7346df4f88df92dc76e31fb2dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Anas Nashif
0c8564cacb checkpatch: warn on COMPLEX_MACRO and MULTISTATEMENT_MACRO_USE_DO_WHILE
generates lots of false postives, so make it warn only.

Change-Id: I0b2fedc564c29bff32f7c48702a9ad54a969650b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Anas Nashif
d2f1c76686 new SoC naming convention
Use SOC_FAMILY and SOC_SERIES to identify soc families and series
and to point to the correct linker files and files related to a
specific SoC.

Change-Id: I8b1a7339f37d6ea4161d03073d36557a40c0b4a6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
a02c34ef0b soc: introduce SoC families and series
Add additional layers when defining SoCs to allow reuse among SoCs
of the same family and architecture.

The Board is the first location where we search for a linker.cmd file,
if not found we look for the linker file in
arch/<arch>/soc/<family>/<series>

Change-Id: I51d5e9a056220d0bd2ae0fa31474ffe63568e698
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
b85ffc8104 stm32: reorganise soc directory and use family/series
Use SoC family/series and reoganise the structure to follow new
hierarchy.

Change-Id: I8637f1487a8287a6614ce6636cd018cf342fec95
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
65c06afa58 kinetis: reorganise soc directory using soc family
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>
2016-04-18 21:24:58 +00:00
Anas Nashif
4b411b34a1 stm32: rename SOC_STM32F1X -> SOC_SERIES_STM32F1X
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>
2016-04-18 21:24:58 +00:00
Anas Nashif
9bf2da7ef4 stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32
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>
2016-04-18 21:24:58 +00:00
Daniel Leung
5250283c33 i2c/quark_se_ss: fix RX request pause conditions
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>
2016-04-18 20:27:09 +00:00
Javier B Perez
a508c3739c doc: collaboration: code: gerrit commit message JIRA key
Added line for JIRA key in the commit message and a note about
the JIRA key.

Change-Id: I8b447d42a592a1ba88a1cc476fbb563365a4316f
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-04-18 20:25:40 +00:00
Anas Nashif
6acc6c645a arduino_101: speed up loading of firmware
Using ARC for flashing is faster.

Change-Id: Ic13466781c5974bf29fb5309fcf6c99c7b260dcf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 20:25:20 +00:00
Anas Nashif
4b6cdea524 doc: remove collaboration guides
contribution guide is now a top level document and other guides
are being moved to the wiki.

Change-Id: I1e207e18659f3aa98111cfaa1597478ff29eedef
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 15:35:28 +00:00
Anas Nashif
246d3f27f3 doc: process tinycrypt headers with doxygen
Change-Id: I155819335ac3574a54cd35f161c7659b84634e59
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 15:35:28 +00:00
Johan Hedberg
01e29cf395 Bluetooth: samples/shell: Make more features optional
For memory-constrained platforms (like the Arduino 101) it's desirable
to be able to build a slimmed-down shell app that doesn't contain any
unnecessary features. This patch makes more of them optional.

Change-Id: Ia7f2cc0930dda6dfed5ce020b56913c6e0bc3d6f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 13:46:21 +00:00
Johan Hedberg
7c038ef99e Bluetooth: Provide static inline stubs for UUID string helpers
This way when BLUETOOTH_DEBUG has been disabled we don't need to make
extra #ifdefs in application code to make it build without debug
support.

Change-Id: Iceabe0d700d571afae8b85c2c559ba372a883682
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 13:45:33 +00:00
Jukka Rissanen
3e12469c38 net: rdc: Debug print missing \n in simplerdc plugin
Change-Id: I44e6f170e2928dc72cd17a71f382d63d7100aac9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 13:42:44 +00:00
Johan Hedberg
72ce7c7dc1 Bluetooth: Add support for waiting for "NOP" Command Complete
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>
2016-04-18 12:58:22 +00:00
Andrei Emeltchenko
2329d54546 arduino: Remove Kconfig warnings rearranging GPIO selection
Remove warnings below:
...
warning: (BLUETOOTH_NRF51_PM) selects GPIO which has unmet direct
dependencies (BOARD_GALILEO || BOARD_QUARK_SE_DEVBOARD &&
NETWORKING_WITH_15_4_TI_CC2520 || SOC_FSL_FRDM_K64F)
...

Change-Id: I15db8cf5f9895e0693e3363974e4cdad533b55a4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-18 12:54:20 +00:00
Jukka Rissanen
54b234634b net: buf: Fix the code indentation in ip_buf_unref()
Change-Id: I75a28b6be648c5ba0a706cacae234e378ba2e4f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:22 +00:00
Jukka Rissanen
44d6a4c101 net: buf: Add reference count check for IP buf
If the buf ref count is already 0 meaning that it is freed,
then do not continue but return.

Change-Id: I6c7e15d48b988fda34af43971c1638fb386100c4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:21 +00:00
Jukka Rissanen
ae0d60c575 net: buf: Fix the debug print when unreffing the net_buf
The number of free bufs is just that, no need to +1 it here.

Change-Id: I82549d33b00bd2f421babd10442f4d4a9ad9551b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:21 +00:00
Jukka Rissanen
04dc2fe4e1 net: buf: Check we are not overflowing free buf count
Make sure the number of free bufs will never go over the
allocated limit. This is only used for debugging when printing
the free buf count so this is not very serious issue.

Change-Id: Icb5e34e969cbf07280c24966659addcf32829f7c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:20 +00:00
Jukka Rissanen
bf5d208f25 net: buf: Add helper for catching ref counting errors
Add ip_buf_ref() helper that helps to track the calls to
net_buf refcounting in IP stack.

Change-Id: Ie5f5a5d57b6ffcb20df4fbc9f25c6c73a99589df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:20 +00:00
Jukka Rissanen
00891f1d64 net: Removed obsolete print defines from slip driver
Change-Id: I5a1a806b4abf8102d676e49284148323b4908397
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:19 +00:00
Tomasz Bursztyka
8475956600 net: rdc: Make simplerdc a full replacement against nullrdc
Removing nullrdc altogether.

Change-Id: Ic8e73c57c3d469a3ca70a60fe10f5e2aed0ca118
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-18 07:40:56 +00:00
Tomasz Bursztyka
62fd66e240 net: ieee802154: Add a simpler but working default RDC driver
The legacy nullrdc driver is not meant to be power efficient, and
supports requesting ACK on all packets. However, it's logic was based on
former Radio API which let it to read packet synchronously. That's not
working anymore as the new cc2520 driver does not support any
synchronous packet reception.
Thus a new driver, simplerdc, is provided. It supports the same features
as nullrdc, is of course not power efficient and fits properly with
the new driver.

- simplerdc is selected by default.
- to enable ack request on all packet, Kconfig proposes a
  NETWORKING_WITH_15_4_ALWAYS_ACK option.
- simplerdc retransmissions is set to 3, as for nullrdc

Change-Id: I53880fcce5ce00f53831eaeb15d51329121314ec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-18 07:40:55 +00:00
jgarcia
7b8d89d921 net:apps: zperf application
zperf is a network traffic generator for Zephyr.
Same application is able to work dynamically in client or server mode.
It allows to assess network bandwidth.
zperf is compliant with iperf_2.0.5.
zperf can be run in micro or nano kernel.

Change-Id: Icbd69e1ad56ad29c678b098e7a2e07c44f90e48e
Signed-off-by: jgarcia <jeremie.garcia@intel.com>
2016-04-18 06:07:02 +00:00
Vlad Lungu
c36daba63d spi: intel: fix port 1 pin setup
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>
2016-04-16 21:14:43 +00:00
Baohong Liu
1a164b85f0 samples: Use consistent file naming for project config file
Some sample applications are using file naming .config which are
inconsistent from others. Changed them to .conf.

Change-Id: I2ea3944f3809671d4c6f4782dbf77fe9c2a22864
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-04-16 21:12:19 +00:00
Bogdan Davidoaia
b53b27701a sensors: add driver for TMP007 infrared thermopile sensor
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>
2016-04-16 05:32:35 +00:00
Benjamin Walsh
43592b1127 x86/debug: GDB server needs to handle some exceptions
GDB server needs ownership of some exceptions to display information when
taking a fatal exception (DIVIDE_ERROR, PAGE_FAULT).

Introduce a Kconfig option that can work for any debugger.

Change-Id: I39aef22a820543a7fe9ac333b487592946abc0f3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh
f703f7d0f6 debug: add target GDB server
The GDB server implements a set of GDB commands, such as read/write
memory, read/write registers, connect/detach, breakpoints, single-step,
continue. It is not OS-aware, and thus provides a 'system-level'
debugging environment, where the system stops when debugging (such as
handling a breakpoint or single-stepping).

It currently only works over a serial line, taking over the
uart_console. If target code prints over the console, the GDB server
intecepts them and does not send the characters directly over the serial
line, but rather wraps them in a packet handled by the GDB client.

Change-Id: Ic4b82e81b5a575831c01af7b476767234fbf74f7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh
270d602efd debug/x86: add runtime info needed by target debuggers
Introduce an x86 interrupt stack frame that contains more information
than the non-debug one, namely the caller-saved GPRs, as well as an API
to retrieve it. Able to handle nested interrupts stack frames.

Change-Id: If182aaa2f34e4714b16ca65ff79da63b72d962f7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh
45d9689dc8 debug: add missing MEM_SAFE dependency
Change-Id: Ia13b84d1bacfcc9ff7e429be41db31e5e63ae282
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Benjamin Walsh
6ec02cc807 debug: fit Kconfig lines in 80 columns
Change-Id: I2df06d14cf0c219006adf7609542498b78ce342e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Benjamin Walsh
f557d71b52 libc: add strncat() to minimal libc
Change-Id: I0a44e1bb80c815ff89d8c9648d6e5db70e911fd2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Benjamin Walsh
e83ddd1471 x86: add debug hook in _NanoFatalErrorHandler()
Allow a debug server such a GDB to take control when a fatal error
occurs. The debug server simply has to define a _debug_fatal_hook()
function that will override the weak function installed by default.

Change-Id: Ib9dca5755868f747b697fa3178e09109f1eedb07
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Benjamin Walsh
0ff5d37a4a console: add hook for debug server to handle outgoing characters
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>
2016-04-16 05:29:20 +00:00
Benjamin Walsh
2fa37a0bec gcc: add __weak for shorter __attribute__((__weak__))
Change-Id: Idd878c19201247492bbc42228f2a225ed625f4b8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:20 +00:00
Anas Nashif
8980a92ca1 pinmux: include errno.h
Change-Id: I870a46aaa8d0cac0a35a1b8691607a2436daa68f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-16 02:02:11 +00:00
Anas Nashif
874877519e Bluetooth: include errno.h
Change-Id: I42e9e952780c4ffeba28a857b9a3836dcda5d7ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-16 02:02:11 +00:00
Baohong Liu
d45eab2a7c drivers: Quark flash support
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>
2016-04-16 02:01:25 +00:00
Dan Kalowsky
14a50f0b8c docs: adding details for the D2000 board
Adding documentation for building, flashing, and debugging the Quark
D2000 series CRB.

Change-Id: I3d61d5c8b88b5f74da76262d4fcda823c6f7b9b3
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-04-16 01:57:41 +00:00
Rodrigo Caballero
b6e41a7148 doc: Modify the master file to a single ToC.
- Consolidates the links to the sections in a single table of contents.
- Adds the documentation's version number.
- Adds a link to the project's Wiki.

Change-Id: I762d30ce8cbf518df8a28e428e94a2f9a3c7085d
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-04-16 09:31:17 +08:00
Rodrigo Caballero
97db3c380f doc: Remove communication section.
The communication section is being removed.
The content will be available elswhere.

Change-Id: Idca52a7d3bc2f0607f108d639e2edf931bf99ffd
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-04-16 09:29:45 +08:00
Rodrigo Caballero
e2d3e0e139 doc: Remove documentation collaboration section.
The documentation collaboration section is being removed.
It will be included elsewhere.

Change-Id: Ia669a48df37996572c95e71827d69f4faba5a232
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-16 09:28:35 +08:00
Andrew Boie
f0dbdb0ab7 headers: use __deprecated
Change-Id: I0cdb22cee206a3eacf25637a45844b7f588996ff
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 22:07:57 +00:00
Andrew Boie
facd6e51c6 gcc: add __deprecated for shortened __attribute__((deprecated))
Change-Id: If4e589f8eaeb7439e5e17474ad63bbdbaabde072
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 22:07:57 +00:00
Daniel Leung
a2ff6eaf1c grove/lcd_rgb: assign magic number to driver_api
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>
2016-04-15 22:07:34 +00:00
Anas Nashif
6b75db44e6 doc: link in device model APIs
Change-Id: Iceb8f011839fbaa67f39e91e9ad9377ac64f72b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-15 22:07:09 +00:00
Anas Nashif
d57af675d1 doc: merge coding conventions into one document
Change-Id: I85d11d9ba2f2029833caa0a0190eac013a219f92
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-15 22:07:09 +00:00
Anas Nashif
5b309af05f doc: move code contribution guidelines one level up
Change-Id: I0d57dd5874e026020e103b2d15367313f5f9a0fc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-15 22:07:08 +00:00
Daniel Leung
acc4eafb11 doc: device.h: hide DEV_* from public documentation
DEV_* error codes are being deprecated so hide them from
public documentation, to prevent mis-use.

Change-Id: Iee2f59502c9470c14ddf2fb1ed19b3526609e43b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:44 +00:00
Daniel Leung
8285427d21 doc: misc/slist: fixed unsupported xml/html tag warnings
Doxygen complained about "Unsupported xml/html tag <user> found".
Make the correct indentation to signify a code block, since it is
indeed a code block. This gets rid of the warning.

Change-Id: I78ea7709f1d45b2ff48c86153151d4f71a41d1e3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:43 +00:00
Daniel Leung
0853405762 doc: irq.h: fix mismatched parameter names in comment
Change-Id: Ie07b7fc5fc6b6b11f7fe9002995db1f399f89773
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:43 +00:00
Daniel Leung
623af156f9 doc: kernel_event_logger: fix complain about @defgroup
Doxygen complained about @defgroup not closing. Fix it by moving
code around, as doxygen was confused by all the #ifdef-#endif.

Change-Id: Iacc2e983cc82b0dfcaaea423ff64bdcc4db8577f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:43 +00:00
Daniel Leung
f07539313c gitignore: Fix doxygen generated directory names
The dir/file names in .gitignore are relatively to the root
of the git tree, so amend it.

Change-Id: I532b3fae4f66590fb34555dd8407576f1e27f744
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:42 +00:00
Daniel Leung
3d655c7286 doc: include/misc/slist: Fix @file tag
The @file tag should follow by a file (or nothing for current file),
instead of file description. Fix it by separating the description.

Change-Id: I1944b164ebe420fbdc03fc65b314ac53493a5d2c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:42 +00:00
Daniel Leung
cf97ca685e doc: clock_control/stm32f1: Fix @file tag
The @file tag should follow by a file (or nothing for current file),
instead of file description. Fix it by separating the description.

Change-Id: Iabe3550568cdfdda6ad71be6fab3e8b5dfbeb940
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:42 +00:00
Daniel Leung
b816814b72 doc: microkernel/memory_pool: fix parameter reference tag
Use \p to refer to parameters instead of using "@" which
doxygen complains.

Change-Id: I0e8384084497f422ea635caf656ae4a8b06fde94
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:42 +00:00
Daniel Leung
99778ee7c3 doc: pwm: remove extra function param from comment
The param "pwm" is not in the argument list of pwm_all_set_phase().
So remove it.

Change-Id: I960b5b42de33edc4a6216fb5a65e0f1352bd637d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:41 +00:00
Daniel Leung
0c9876cc8d ipm: convert to use DEVICE_AND_API_INIT()
Change-Id: I2c81bc0d232473c76c0a4ffbf13faf4eabedda85
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:16 +00:00
Daniel Leung
36fe805057 serial/stellaris: convert to use DEVICE_AND_API_INIT()
Change-Id: I4da787515ef01d4ee72c6ad35478b460b9a7fb0d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:16 +00:00
Daniel Leung
46052f2ad8 watchdog/iwdg_stm32: convert to use DEVICE_AND_API_INIT()
Change-Id: Ie72eedbe17d4534751a8b459bd35939f57534011
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:15 +00:00
Daniel Leung
73be1230ee serial/uart_stm32: convert to use DEVICE_AND_API_INIT()
Change-Id: I82ba83453f14761c325b208fc56387411ab8ce40
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:15 +00:00
Daniel Leung
9e575ddbe6 gpio/stm32: convert to use DEVICE_AND_API_INIT()
Change-Id: I584c73e7418344e73af0ca7a4fc8f5d745e2ec35
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:15 +00:00
Daniel Leung
00dce01c89 clock_control/stm32f10x: convert to use DEVICE_AND_API_INIT()
Change-Id: Ifba0123c6843396341d213601889fa6839bfedd6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:14 +00:00
Daniel Leung
4dee91bea9 gpio/atmel_sam3: convert to use DEVICE_AND_API_INIT()
Change-Id: I09cd91737993d30c89073656b8ae95462d5f317d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:14 +00:00
Daniel Leung
8f9e38adc4 i2c/atmel_sam3: convert to use DEVICE_AND_API_INIT()
Change-Id: I810716d5eb99b7b8c0f06534877eccfc71d959eb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:14 +00:00
Daniel Leung
fbdc7945e3 uart/atmel_sam3: convert to use DEVICE_AND_API_INIT()
Change-Id: I55edf55b366f6516652a5c65b9efd5009564df90
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:14 +00:00
Daniel Leung
196b88f4d0 spi/k64: convert to use DEVICE_AND_API_INIT()
Change-Id: I6eda6fdcc735250f83c39b43973655582090401e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:13 +00:00
Daniel Leung
c8bc070d72 pwm/k64_ftm: convert to use DEVICE_AND_API_INIT()
Change-Id: Ia9f7c31f62046970a77fabad61fcbbd64b91aea2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:13 +00:00
Daniel Leung
ecf4836d25 serial/k20: convert to use DEVICE_AND_API_INIT()
Change-Id: I4f895f58eb84740f11be5450f244217f7e1a4a22
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:13 +00:00
Daniel Leung
9b23654f68 gpio/k64: convert to use DEVICE_AND_API_INIT()
Change-Id: I7fa0aa8f23e6d3b6c0664e211d605a03ae7e150c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:12 +00:00
Daniel Leung
aa0635aa30 watchdog/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: Id345c74ca4b466838f0382ef686d70ff5aedb10e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:12 +00:00
Daniel Leung
6a8681a8d4 rtc/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: I64b0a2d926813654318b289b2d8491deb107e94d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:12 +00:00
Daniel Leung
2898e249da spi/dw: convert to use DEVICE_AND_API_INIT()
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>
2016-04-15 22:06:11 +00:00
Daniel Leung
317922a3b6 pwm/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: I31ee7b631293f1bd94085adec5979d113adf6026
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:11 +00:00
Daniel Leung
6bb186b754 adc/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: Ieaf72ea553bff766314e69f1e58888c2ccc07f21
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:11 +00:00
Daniel Leung
da782358aa i2c/quark_se_ss: convert to use DEVICE_AND_API_INIT()
Change-Id: Iefe73cf68355a02e78f328e5d13c354f6e1624c8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:10 +00:00
Daniel Leung
21727b5d86 i2c/dw: convert to use DEVICE_AND_API_INIT()
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>
2016-04-15 22:06:10 +00:00
Daniel Leung
c21e93eeee gpio/dw: convert to use DEVICE_AND_API_INIT()
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>
2016-04-15 22:06:10 +00:00
Daniel Leung
793da30039 serial/uart_ns16550: convert to use DEVICE_AND_API_INIT()
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>
2016-04-15 22:06:10 +00:00
Daniel Leung
0ac7c72e7b clock_control/quark_se: convert to use DEVICE_AND_API_INIT()
Change-Id: Ib3aa021b8e8c32079d5800b3f2ffc9f9fabdb4b6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:09 +00:00
Daniel Leung
ab38abff12 pinmux/dev: convert to use DEVICE_AND_API_INIT()
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>
2016-04-15 22:06:09 +00:00
Daniel Leung
ce2e4ebdf1 device: add macro to assign driver_api at compile time
This adds the DEVICE_AND_API_INIT() macro to take in a parameter
to assign to device->driver_api. This eliminates the need to
assign to driver_api during runtime device initialization.

This provides an alternative way to declare devices. This should
save a few bytes in ROM for those devices that will never fail
initialization (in other words, never need to manipulate
driver_api pointer at all).

Also clean up the documentation a bit to remove duplicated
block of information.

Change-Id: I6abed1abe75db2e8babfcf1ecf590491132a5543
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:09 +00:00
Arkadiusz Lichwa
26a8dcd2c1 Bluetooth: L2CAP: l2cap_chan_get() can get BR/EDR L2CAP SIG channel
Enables to get right channel reference on both connection transports,
LE and BR/EDR.

Change-Id: Ia577963132e3a600cd9a95b90f218a5bffee8e58
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-15 19:15:20 +00:00
Daniel Leung
f9f10f37fe doc: counter should be under device driver
Adds the missing @ingroup for counter API so it appears
under device driver category.

Change-Id: I763faab802d3a6453ab46ee969b5ffd082282f1d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 18:42:17 +00:00
Arkadiusz Lichwa
c94cfbd4db Bluetooth: L2CAP: l2cap_send_reject() can use BR/EDR L2CAP SIG channel
The L2CAP reject command can now be propagated over both connection
transports, LE and BR/EDR.

Change-Id: Ie8466490ed205e194a586646f496ebfce5ceea70
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-15 18:35:14 +00:00
Flavio Santes
051a37dbd7 wdt: update sample code
Remove wdt_fired, whose existence is irrelevant.

Change-Id: I27e5f5fe449423cd747b34fc6a38d261ae02d1e3
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-04-15 18:28:26 +00:00
Andrei Emeltchenko
8418b2eeb3 drivers/nble: Implement read multiple response
Implement on_nble_gattc_read_multiple_rsp().

Change-Id: I25e8e7f74325024fde1737086e4674893f4a105a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-15 17:02:11 +00:00
Grzegorz Kolodziejczyk
52e5c91f37 Bluetooth: Remove redundant returns from switch
Primary and secondary service attributes discovery uses att_find_type,
include service and characteristic uses att_read_type.

Change-Id: Ia3539b446a4afb5c72bc1aba443167be6f893d0d
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-15 17:00:44 +00:00
Mariusz Skamra
1cfccfda84 Bluetooth: tester: Start using net_buf to store GATT database
With this patch net_buf based heap will be used to store attribute
user_data and UUID. This is the first step to remove gatt_buf.

Change-Id: I578f26b781e01f5f3464c05f7210dc27cdea8edf
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-15 16:51:40 +00:00
Andrew Boie
15800ce78a nanokernel: deprecate dynamic IRQs
We have not found any use-cases for dynamic IRQs where a static
IRQ did not also suffice. Deprecate so that we can eventually
remove from Zephyr and nontrivially decrease the complexity of
the kernel.

Change-Id: I509655371773aeaca7d01134dd850eb4cd95f387
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 16:02:12 +00:00
Andrew Boie
a83f895dd5 microkernel: deprecate task IRQs
This mechanism does not add enough value to the kernel to be worth
maintaining it. Drivers that need deferred processing of interrupts
can simply define their own task and have the interrupt handler
release an event that the task waits on.

The API is marked as deprecated and it is removed from unit test
coverage as well as the documentation.

Change-Id: Ib87b91cb41e9b6d7fdf0dc62b240a531b6a8889f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 16:02:12 +00:00
Grzegorz Kolodziejczyk
38b202e810 Bluetooth: tester: Update server commands with sequence params
Most iuts data base are intended to have its attribute database builded
in sequence and its constant (except attribute values, parameters,
permissions). Patch allows btp specification to cover also devices
which cannot assign an ID right after issuing add attribute command or
set attribute component (which points to defined attribute ID).

Change-Id: Ie8e5ed223609cca2b6e3fb8444065f33b1408142
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-15 15:14:23 +00:00
Mariusz Skamra
1bc53f3f47 drivers/nble: Fix NULL pointer dereference
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>
2016-04-15 11:04:20 +02:00
Szymon Janc
cdd5851715 Bluetooth: shell: Add confirming incoming JustWorks pairing
This allows to accept or decline incoming pairing that would
otherwise result in JustWorks pairing.

Change-Id: I759ea067ef298b437e0112b8b7ef3bedf106dc52
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-15 04:57:41 +00:00
Andrei Emeltchenko
9e158899eb quark_se_devboard: Do not select GPIO
GPIO is not needed for quark_se_devboard for now when dealing with
NBLE.

Change-Id: I0dedf2bee0af153e1d6e224d90f4662f5601b2b7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-14 15:23:35 +00:00
Andrei Emeltchenko
8e18fa8903 arduino_101: Do not duplicate GPIO select
GPIO would be selected by BLUETOOTH_NRF51_PM

Change-Id: I5d920723a46c1455d34c90c9dc43b21b91569ce1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-14 15:22:58 +00:00
Szymon Janc
c2a1ac8ae7 Bluetooth: Add support for confirming incoming JustWorks pairing
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>
2016-04-14 15:20:03 +00:00
Andrei Emeltchenko
931afc81a4 drivers/nble: Fix spelling typo
Change-Id: Ibe5c910a69fccdf4375738ec13cbea9d6c972a41
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-14 14:48:51 +00:00
Szymon Janc
d11824ff58 Bluetooth: SMP: Refactor pairing request handling
This is in preparation for adding support to confirm incoming pairing
requests. smp_pairing_req is now more similar to smp_pairing_rsp making
code easier to follow.

Change-Id: Ie5a77ae5092b7bbf76a482d0bd49e022c4d19d70
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-14 14:44:43 +00:00
Grzegorz Kolodziejczyk
2bae7b4c5f Bluetooth: drivers/nble: Fix returning included service handle
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>
2016-04-14 13:47:26 +00:00
Mariusz Skamra
ff8b88b634 drivers/nble: Fix handling read errors
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>
2016-04-14 12:42:09 +02:00
Mariusz Skamra
5047d54403 drivers/nble: Fix compare logic in on_nble_gattc_read_rsp
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>
2016-04-14 12:41:39 +02:00
Tomasz Bursztyka
c239a8cb7b cc2520: Properly start and stop the device
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>
2016-04-14 07:49:23 +00:00
Tomasz Bursztyka
d8dcf56334 cc2520: Enable hardware filtering all the time
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>
2016-04-14 07:49:23 +00:00
Tomasz Bursztyka
a9af3c0512 cc2520: Set short address and ieee address from the driver
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>
2016-04-14 07:49:23 +00:00
Tomasz Bursztyka
af33e21017 net: Test random is necessary to use CC2520 as radio driver
It will not build without it. Generalize it then.

Change-Id: I334586f629de1f057e654a13a1c705cd559b44d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-14 07:49:22 +00:00
Javier B Perez
3186d30ea6 doc: sphinx conf: use env var in sphinx doc version
Changed conf.py to use env var in the version of documentation.
CI can take advantage of this to name documentation using
tag version from git.

Change-Id: If59f800ccd37648a9c0dab6c948b13166a7f4aed
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-04-13 23:42:18 +00:00
Bogdan Davidoaia
176c2525a6 sensors: bma280: fix slope threshold measurement unit
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>
2016-04-13 17:27:08 +00:00
Bogdan Davidoaia
69793bb320 sensors: use SENSOR_G constant in all accelerometer drivers
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>
2016-04-13 17:27:08 +00:00
Gerardo Aceves
46e5fc6330 doc: Edit microkernel API links
Edited the microkernel API sections to get the proper linakage.

Change-Id: I1bc95c6e21ed996c4c5d72188c5f018038e3e958
Signed-off-by: Gerardo Aceves <gerardo.aceves@intel.com>
2016-04-13 15:04:04 +00:00
Daniel Leung
756b90b01f flash/spi_flash_w25qxxdv: do not set driver_api if init fails
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>
2016-04-12 23:52:10 +00:00
Anas Nashif
3cf33cb0d8 doc: remove usage of sudo and reduce notes
Change-Id: I67cf7d6537c429df304fc3fa89c8d68c702c646a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:45 +00:00
Anas Nashif
a1ae6fdcdf doc: remove networking configuration section
Change-Id: Ia5990d7dfdc7abbefa28f7e6b9d060a14758332e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:45 +00:00
Anas Nashif
d0c5eaf4a0 docs: Getting Started overhaul
- Put everything in one page and simplify workflow.
- Fix indent and layout

Change-Id: Ifd9d11531c9b906324cf87cf401cbce416cc01a4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:44 +00:00
Anas Nashif
2a8560e06d doc: make naming conventions apply to none kernel functions
Change-Id: I0204a0131959ed665ea6a61a0de48f2d808bb448
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:44 +00:00
Anas Nashif
c2170dfca9 doc: fix wording in device documentation
Change-Id: Ie1e9f908797d1c3473ad36acd0b10d205e665e81
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:44 +00:00
Anas Nashif
9daa1076cb docs: remove notes from bluetooth document
Integrate the notes into the actual steps, notes are usually understood
as optional and disturb the actual flow.

Change-Id: If3168581ca130bd506bc44c353acc082dfa003fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
4dd845db13 doc: Fixed structure in collab guide
Merge documents and improve structure. Avoid too many jumps to get
to the information and avoid single paragraph pages.

Change-Id: Ifed4fa90d1105022bfe87e6d078845938e13bd3a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
530a422a98 doc: create subsystem section
Add sensors and networking into the new section and seperate
those from the kernel documentation.

Change-Id: I585845c3ba09173ced7caa0b7fbc1f1a81a26f96
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
73fcb9f503 doc: move device driver to a new section
Put all device drivers and device model documentation into one
section.

Change-Id: Iba6a50796b02b7f9234c23dca706be62fd7b4259
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:42 +00:00
Jukka Rissanen
12485eb8c9 cc2520: Make the generated MAC address to look more random
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>
2016-04-12 16:27:21 +03:00
Jeremie Garcia
5e6da236cb net: fix uip_udp_conn leak
On each net_receive() call with different destination and/or port,
µIP stack consumes a uip_udp_conns[UIP_UDP_CONNS] entry.
As net_context_put() doesn't free it up, Zephyr applications can very
quickly reach the point where it can no more create new UDP connection
(default UIP_UDP_CONNS value is 10).

This patch is both IPv4 and IPv6 compliant.
It modifies net_context_put() so that it frees up such entries if
a UDP connection is registered for the context provided as argument.

Change-Id: I9abe686c81368231d4443fc53da9038761a1787d
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
2016-04-12 12:40:41 +00:00
Daniel Leung
00525c2acf sanitycheck: align output for easier visual comparison
() The test names are getting longer so adds more padding.
() Aligns the numerical size numbers for easier visual
   comparison when scrolling in shell.

Change-Id: Id218a641e9d5dffb77bf813ffbd828c48d14020f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 12:00:47 +00:00
Anas Nashif
11ee55a6cc openocd: make openocd variables overridable from env
Some boards require a newer version of openocd, this will
allow overriding the default version that comes with the SDK.

Change-Id: I70113182c3a2c8610e3b36542c6057ff3f0df547
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 12:00:05 +00:00
cacu
124feb27c5 build: Add a toolchain file for the GCC ARM Embedded toolchain
Change-Id: Iea501d30297123955fd699eb7d53e642949b6af7
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-04-12 11:59:38 +00:00
Daniel Leung
3257193c6d serial/uart.h: no need to check driver_api being NULL
The device_get_binding() no longer returns pointers
to device struct when driver_api is NULL. Therefore,
there is no need to check for driver_api being NULL
in the serial driver wrapper functions.

Change-Id: I018a409324d7c1ae83c699a3ebf30f2f2abfb3b3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
dd5e90ec6c device_get_binding() returns NULL if driver_api is not set
This changes the behavior of device_get_binding() so that
it returns NULL if driver_api is not set. This provides
a way for driver to state that it has not been initialized
properly, and prevents app from using it since no reference
to the device struct will be returned.

This implements the idea specified in [1]. The idea is to
reuse an existing resource by piggy-backing onto driver_api,
thus avoiding an extra "device state" variable in the device
struct. This differs from the code specified in the mailing
list by checking driver_api for NULL first. This avoids
the unnecessary strcmp() if driver_api is NULL.

[1] https://lists.zephyrproject.org/archives/list/devel@lists.zephyrproject.org/message/MZB5PYBSRHV3NIEHJYXYQVLTPFIIHPB3/

Change-Id: I978b1a6683cd56c8a72532d6368c47e67515c82d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
90e93dce05 spi/intel: move driver_api assignment later
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>
2016-04-12 19:30:35 +08:00
Daniel Leung
1870f95364 uart/nsim: fixed missing driver_api assignment
Change-Id: Icbda7600b808fa0338e4d672ccca1b969b6f5867
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
b8e887a112 gpio/pcal_9535a: move driver_api assignment later
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>
2016-04-12 19:30:35 +08:00
Daniel Leung
aa98192cad pwm/pca_9685: move driver_api assignment later
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>
2016-04-12 11:25:03 +00:00
Baohong Liu
5ba89ffdea samples: A test app for spi flash
Demonstrate the use of SPI flash driver API on Arduino 101 board.

This is a re-submit of a previous merged patch which was reverted
because merge sequence was incorrect (the test app got merged
before the driver).

Origin: Original

Change-Id: I3fce61488ed7d48f400c12448f1c7a01c555661c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-04-12 09:59:33 +00:00
Vlad Dogaru
b2419abfbc gpio: dw: Activate by default on D2000
Change-Id: I4b5a72ee086fae7c3d29311cd138af28d329f635
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-12 09:58:00 +00:00
Johan Hedberg
bacdf02061 Bluetooth: drivers/nble: Fix minor coding style issue
Change-Id: I71caf45702f053033fde5c5c0bc4dea22dbe95d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-12 12:33:24 +03:00
Andrei Emeltchenko
e12cf24e6d drivers/nble: Implement multiple read in bt_gatt_read
Implement read multiple characteristics in bt_gatt_read().

Change-Id: I18c11275e4352bfc571b06558116bcbb9b4a32d3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-12 12:09:08 +03:00
Andrei Emeltchenko
424cf4f9d2 drivers/nble: Update RPC to Nordic BLE Module
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>
2016-04-12 10:32:41 +03:00
Peter Mitsis
5aaf7ab930 nano_fifo: Fix problem with nano_fifo and timeouts
Fixes a problem where the nanokernel FIFO state information could get
out of sync due to a timeout.

The nanokernel FIFO structure nano_fifo now maintains two separate
queues: one for waiting fibers and the other for posted data. This
permits the safe and independent querying of the queues as needed
when getting and/or putting data from/on the nanokernel FIFO.

Change-Id: Ifbcb5004558b06fc55cad2a955f5be20e716b392
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-04-12 01:22:42 +00:00
Arkadiusz Lichwa
af2deb8dea Bluetooth: BR/EDR: Move up code in conn.c
Moves up and consolidate the BREDR specific code to skip certain forward
declaration and to prepare for possibility to initiate authentication
using start_security() routine.

Change-Id: Ic32d7d1376173d47b0eb0481eff37c6e56f995d4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 19:15:24 +00:00
Mariusz Skamra
550d031107 Revert "Bluetooth: Fix compare logic in ATT read rsp"
This reverts commit 3d08d16780.

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: I63280e65b4ff5b830295aa9aadebe2758b626912
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-11 15:24:33 +00:00
Andrei Emeltchenko
37ef89511d drivers/nble: Correct auth configuration for No Input / Output
Change-Id: I5d1a9508ca8deca97149db2faa2f3406517e3b05
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-11 15:24:24 +00:00
Szymon Janc
01f80c48ff Bluetooth: shell: Use same config for arm and x86 build
There is no need to have separate configs as init sample is now
used for different build configuration tests.

Change-Id: I917692f8a8e96345afc561dd04bdcf08cdfa5de7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-11 11:54:07 +00:00
Arkadiusz Lichwa
435ccd3e81 Bluetooth: BR/EDR: Refactor internals of 'Cancel' authentication API
For better code readability use 'switch-case' statement selecting valid
authentication cancel method. Adds also legacy pairing (pre-SSP) as first
item in valid paring method set.

Change-Id: I4d9c5178526cd5210b844878360d12b58b99a24f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:31 +00:00
Arkadiusz Lichwa
8f844fac29 Bluetooth: BR/EDR: Rename pair method field
Refines pairing method holder name to be more generic in connection object
representing applied method during authentication process.

Change-Id: Ia6f51788912974fbbda26b760d187c0f7e24bb0b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:10 +00:00
Johan Hedberg
54425117d0 Bluetooth: Export helpers for defining buffer pools
Now that the incoming ACL & HCI event pools can be defined externally
to hci_core.c there should be convenience macros to know what's the
minimum required buffer size for these pools.

Change-Id: I6f2a7322a3d77e1304e9d925767a1fd3471c76c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-11 11:52:38 +00:00
Johan Hedberg
30601c09bb Bluetooth: Refactor buffer handling for non-host managed buffers
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>
2016-04-11 11:52:29 +00:00
Jukka Rissanen
14cc0401b4 Revert "net: Use TICKS_UNLIMITED if there are no timers"
This reverts commit 5680396aaa.

The network timers do not trigger with this patch so this needs
to be reverted for time being.

Change-Id: If653e3ecaae1ebddabe26227af876ff6b592675b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-11 07:33:17 +00:00
Johan Hedberg
30fcb2fdca Bluetooth: L2CAP: Store BR/EDR fixed channel mask per channel
This information will be used to construct the fixed channel mask in
the L2CAP information response.

Change-Id: I66244ca2d5e40b3d204f5115c4bddad578f3ea64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg
8a2c7915e3 Bluetooth: L2CAP: Fix logs to account for BR/EDR signaling channel
The same l2cap_recv function is now used for BR/EDR as well so remove
LE references from the logs.

Change-Id: I841ceea2eee72ee099be922eb00c1f6a3a16a787
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg
52401300f3 Bluetooth: L2CAP: Fix missing line termination
Change-Id: I28f18c1afbb168ed021bd15962b2087066eed341
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:24 +03:00
Arkadiusz Lichwa
a5d264774e Bluetooth: BR/EDR: Make available L2CAP signal channel
Makes room for L2CAP signal channel transport and start listening
on signalling CID.

Change-Id: I152973a9a9e672f0b4f66b06055e305561123f34
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:24:01 +00:00
Arkadiusz Lichwa
83674b1d52 Bluetooth: BR/EDR: Get proper L2CAP CID limits
Applies L2CAP CID valid values based on link type and proper limitations
according to BT Core L2CAP spec principles.

Change-Id: Ifa0719cf593d1d22977da59fb8a6c0ed9c3a176b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:20:58 +00:00
Arkadiusz Lichwa
f6cdc3f3ab Bluetooth: BR/EDR: Refactor bt_l2cap_connected handler
Makes possible to initiate L2CAP signalling handling on set connection
based on connection transport type.

Change-Id: I114dc3e4408f428301628520a569a2b087c325b8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:19:23 +00:00
Arkadiusz Lichwa
d719c362f1 Bluetooth: BR/EDR: Add register routine for L2CAP fixed channel
Makes available to register fixed L2CAP signalling channel on
dedicated channels list.

Change-Id: I9a90a64dac40b34799353ff261ba570541347084
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:54 +00:00
Arkadiusz Lichwa
740bd96abc Bluetooth: Rename bt_l2cap_fixed_chan_register()
Renames routine to be clear to be used to register LE L2CAP fixed
channel only. The routine operates on le_channels list object that also
was renamed to reflect the connection type. Updates all calls to
the procedure in the stack.

Change-Id: I01348b8186a0f537532f6a7b9dc59586827b204b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:26 +00:00
Juro Bystricky
d57a503a55 Makefile: Fix linking order of libraries
Link with libm.a before libc.a, as libc.a can contain
references used by libm.a.

Change-Id: I5cde8f2e323f59ecae452a8a868a5d54942e9f39
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-04-09 14:31:19 +00:00
Khem Raj
a8aa603242 benchmark: Remove trailing whitespaces.
Change-Id: I852fbf40899e3d4f0715377c955870e5b3990af1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-04-09 10:32:09 +00:00
Andrew Boie
27025e1988 x86.ini: increase arduino_101 priority
The ordering of the list of platforms is in priority order,
as the sanitycheck --platform-limit option chooses the first
N platforms in this list when doing a run. Move arduino_101 to
second position. qemu_x86_iamcu is still top priority as it
can execute code as part of the tests.

Change-Id: I989d91c66a0a741ce8eebe6279ee4512c33eb5e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 21:37:59 +00:00
Andrew Boie
14ac902633 sanitycheck: fix test names to be same as before
Add the last path information in the testcase root to the
test name, so that there is much less of chance of name
collisions and the reports come out with the same names
as before.

Change-Id: I75ed6ee96251058dd2547e57be31db3c2517a497
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 13:31:53 -07:00
Vlad Dogaru
146b76d839 doc: Add sensor section to kernel primer
Create a new top-level section in the primer that includes sensor
drivers and the synchronous call API.

Change-Id: I0c1b734ec56abc20724ff682caba618ab0965230
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 20:10:45 +00:00
Andrew Boie
3d348715d8 sanitycheck: be smarter about scanning for test cases
A recent tree change moved testcases to both the tests/ and
samples/ directory. The default testcase root was just made
the root of the Zephyr tree, which could lead to potentially
long scan times as every single directory in-tree was checked.
For example, it could be very time-consuming to scan everything
under the sanity-out/ dir if -n is used and --all was used in
a previous run.

Now we allow multiple testcase roots to be supplied on the
command line, and by default only scan under tests/ and
samples/.

Change-Id: I8dac747835b87801474e08c236913e04db64f87b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 20:09:18 +00:00
Daniel Leung
7f8501090c sanitycheck: add ability to use arbitrary report for comparison
This adds the ability for sanitycheck to use arbitrary report file
for size comparison. This is useful when optimizing binary size.
For example, a report can be generated with master head, and used
as base for comparison.

Change-Id: Id8c61146c498ba62c4cc77a9ef7d390c0fb11487
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 20:09:11 +00:00
Vlad Dogaru
81dbc7e8f9 doc: Add sensor section in API documentation
Change-Id: Ie35bf6a8630db25d25604cd0a1667699ba261577
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 19:59:02 +00:00
Vlad Dogaru
9e563c8769 gpio: dw: add support for D2000 board
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>
2016-04-08 17:55:44 +00:00
Johan Hedberg
722a36a03a arduino_101: defconfig: Limit UART defaults for Bluetooth H:4 driver
Currently there's no support for the H:5 driver on Arduino 101, so the
defaults set in defconfig should only be limited to the H:4 UART
driver.

Change-Id: I805d81c33701d179ffe26f4aed3fe2fb70d60d7b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 17:39:14 +00:00
Vlad Dogaru
fd094f8cfc samples: revert to default CFLAGS
SDK version 0.7.5 has fixed ZEP-62.  It is no longer necessary to use
-O0 in order to get correct readings from sensors.

Change-Id: Ia8ac2f55453b7dfdda71fe2f41863cbd0b366739
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 17:24:38 +00:00
Dmitriy Korovkin
977ba05d53 galileo: Enable PCI enumeration
If an external PCIe card inserted into Galileo board, the
devices I/O addresses may differ from the preconfigured ones.
For this reason PCI enumeration needs to be enabled.

Change-Id: I54b5ef9149f9eda0a390909a433b0e13a3dd7ecd
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-04-08 16:02:44 +00:00
Dmitriy Korovkin
4fc7d0242c kernel: Make idle task sleep
Device drivers may use task_sleep() routine during the initialization.
As device driver initialization is carried by idle task, it can not
be sheduled out as any other task. Idle task goes into a wait loop
instead.

In order to invoke task_sleep() device drivers must enable
CONFIG_NANO_TIMEOUTS option.

Change-Id: Ib73a2ad1f3c0bda44c24f2417e102bfaa3a13a15
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-04-08 15:08:33 +00:00
Tomasz Bursztyka
1c827b9721 tests: test_early_sleep: Let's test at all initialization level
Not only SECONDARY, but also the following ones:
- NANOKERNEL
- MICROKERNEL
- APPLICATION

Change-Id: Id41fa572c830727166101fa3c6254398857b31c7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-08 15:08:33 +00:00
Daniel Leung
6b17007b56 sanitycheck: parallelize binary size calculations
Instead of running nm/objdump and parsing the results one testcase
at a time, do these in parallel to speed up sanity check a bit.

The sanitycheck now requires at least Python 3.2 to run because of
the usage of concurrent.futures.

This reduces build time (--all -b) from 4:30 to 3:08 on 24C/48T
Xeon-E5.

Change-Id: I8e7c1efb2f473c7f2b65658f8ed9a101ed091eea
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 14:50:20 +00:00
Ravi kumar Veeramally
79bf4a0e5a net: coap: Create buffer while generating observe notification
CoAP observe notifications are originated from server, those
are not replies. So create a new buffer and copy remote address
and port number from obs list. Set udp_conn to null as this is
new buffer. Reason for setting the udp_conn to null is that there
is a chance that buffer might already have udp_conn set due to
reusing same buffers.

Change-Id: I3c7eada987cf539d77ea162b6f5901791cfa6ee0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
db247d0fa1 net: coap: Use correct network buffer in serialization
Need to use the network buffer when sending CoAP serial message
because the message was constructed to net_buf

Change-Id: I74c54178707edf2d8451ce5ac719d63f99661332
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
ee858020dc net: Fix ip_buf_len after removing extra header
After removing extra header from IP packet, only uip_len is
updated not ip_buf_len. uip_len parameter is set to zero
at some point after handover to net_core. From net_core
only ip_buf_len holds the actual length. So update ip_buf_len
after removing extra header.

Change-Id: I2cc03ed1125df5216a0fa6e94eebfeee0a343481
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
e37dd00f6b net: Add Kconfig debug option for coap observe and well-known
User can activate debugging in coap observe and well-known by
setting CONFIG_NETWORK_IP_STACK_DEBUG_COAP_OBSERVE and
CONFIG_NETWORK_IP_STACK_DEBUG_COAP_WELL_KNOWN option in config file.

Change-Id: Id63824c88df1a84586518eaec8a8a929ae04b717
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
f27af5afb7 net: Add Kconfig debug option for simple udp and udp packet
User can activate debugging in simple UDP and UDP packet by
setting CONFIG_NETWORK_IP_STACK_DEBUG_SIMPLE_UDP and
CONFIG_NETWORK_IP_STACK_DEBUG_UDP_PACKET option in config file.

Change-Id: I581d4b33204f26119c5b194cb367adad8c6505c2
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:06 +00:00
Johan Hedberg
9d90ef45ec Bluetooth: drivers/nble: Add Kconfig option for conn.c
Without this conn.c will cause logs whenever BLUETOOTH_DEBUG is
enabled.

Change-Id: I03f7d6b5b37e05ca23cba20536b24dbdb850304d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 13:27:33 +00:00
Johan Hedberg
8e4582f80d Bluetooth: Kconfig: don't hardcode "UART_0"
Change-Id: Ic1da719450d3ba516d61c67a3256b38e04f7585c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 13:27:20 +00:00
Johan Hedberg
e5df34041f Bluetooth: Refactor nRF51 API
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>
2016-04-08 13:27:02 +00:00
Andrei Emeltchenko
a9652d0afd arduino_101: Add default Bluetooth UART configurations
When choosing Bluetooth UART driver on arduino_101 select also
BLUETOOTH_NRF51_PM which enables the Nordic chip.

Change-Id: I22dcb60a676bb0e4cdfe995590803dbfbf87f23a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-08 13:23:08 +00:00
Johan Hedberg
a36a4920ec boards/arduino_101: defconfig: Enable nRF51 PM if NBLE is selected
To avoid explicitly having to state this in every application's config
file simply set the defaults to the sanest values.

Change-Id: I2c2bbd2424a12ec9a36bbd6d0c9cd9a1d259e5e5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 12:52:27 +00:00
Jukka Rissanen
01771500ee net: contiki: Fix the timer expiration check
We need to check the timer expiration properly. The nano_timer_test()
will return user data to caller if the timer is expired.

The issue that is fixed by this commit started to appear after
the commit 9b2452047d which combined
nano_timers and nano_timeouts.

Change-Id: I9cf10e605f1c4767caa1aad9dcf29a159af55e28
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
0be1fa53b4 net: Add Kconfig debug option for REST API
User can activate debugging in REST by setting
CONFIG_NETWORK_IP_STACK_DEBUG_REST_ENGINE option in config file.

Change-Id: I1c1c62803c0fcc5fb3a37d3d76de94754b33506a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
6c703542d5 net: coap: Make sure that local endpoint IP address is set
When initializing the CoAP engine, make sure that we
initialize the local IP address properly.

Change-Id: I8ddc670371c3a58095cd5db6b435c5b1793c268b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
21161a39fe net: coap: Delete network context when CoAP context is deleted
Network context must be cleared when CoAP context using that
is removed.

Change-Id: Id8deb798919fccf025af67c18f3a246cfa46598f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
70ffc56a95 net: coap: Add debugging support for CoAP internals
Print info about packet serialization if debugging is turned on.

Change-Id: I578ecb4e85ab34c74a960cbce9aa4f9bf5b9473d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
24911b81bd net: contiki: Enhance the IPv6 prefix calculation routine
The routine does not check prefixes properly which are not
multiple of 8.

Change-Id: I421456720541894eb4d9a2839361095a50587513
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
7eb15eeb56 net: coap: Add debug activation support to Kconfig
User can select various coap debugging options from Kconfig.

Change-Id: I97cc82278c230b9678f506063fed5683dc271c8a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Luiz Augusto von Dentz
5680396aaa net: Use TICKS_UNLIMITED if there are no timers
This makes the fiber_sleep sleep indefinitely until fiber_wakeup is
called.

Change-Id: Id674c1f689376784599fc79c86d1c406474bb48f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-08 13:09:52 +03:00
Tomasz Bursztyka
a1adbcb125 ieee802154: Replace the CC2520 driver with a new implementation
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>
2016-04-07 17:25:02 +00:00
Tomasz Bursztyka
f7d5d2c8f5 drivers: Renaming directory "802.15.4" into "ieee802154"
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>
2016-04-07 17:24:55 +00:00
Murtaza Alexandru
fbd45861f3 sensor: lsm9ds0-gyro: fix FULL_SCALE attribute
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>
2016-04-07 17:00:09 +00:00
Bogdan Davidoaia
9773fdaade samples: add environmental sensing sample for Arduino 101
The ARC application collects temperature, humidity and pressure data from
a set of sensors connected to the Arduino 101 and sends it to the x86 core
through IPM. The collected data is also displayed on a Grove LCD.

The x86 application exposes the received sensor data as a simple Bluetooth
Environmental Sensing Service.

This version of the sample does not offer notifications when the sensor data
values change.

Change-Id: Iee456d5d2455c7ccb7c5923ef3c94ecb20b5cecb
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 16:55:38 +00:00
Tomasz Bursztyka
814f5d0b5e sys_clock: Add a helper to compute micro seconds
As for SECONDS() and MSEC, now sys_clock.h provides a USEC() macro.

Change-Id: I43e8b132d2deeb862d8cfda1f785115f339d6ddb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 16:51:07 +00:00
Arkadiusz Lichwa
9385a47e53 Bluetooth: Fix not using endianess helper in LE L2CAP conn req
Corrects response 'result' protocol field to right endianess when
responding to LE L2CAP connection request on error case.

Change-Id: I066bad2f0f3173739676e918f42d425581084dbe
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-07 09:20:17 +00:00
Johan Hedberg
7f07d28f37 Bluetooth: Fix BLUETOOTH_NRF51_PM Kconfig definition
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>
2016-04-07 10:50:52 +03:00
Bogdan Davidoaia
3bdf498716 sensors: fix coding style regarding max line length
Fix coding style so line length does not exceed 80 chars.

Change-Id: Iddebdf55593736cfa288a03a750cc927665f9065
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 01:03:40 +00:00
Daniel Leung
ba4099430b ethernet/dw: remove kconfigs that are SoC specific
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>
2016-04-07 00:58:57 +00:00
Daniel Leung
1bdc6f8b22 sanitycheck: fix initlevel section being mentioned twice
The "initlevel" section is being metioned twice. It does not affect
the final size calculation, but just remove it just for reader's
sanity.

Change-Id: I0e7d6e82c730631d2c83ca09dde0f675805840f3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:56:41 +00:00
Sergio Rodriguez
1b41169828 rtc/qmsi: Fix the IRQ priority setting according to the SoC specific option
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>
2016-04-06 12:05:23 -07:00
Grzegorz Kolodziejczyk
bae91cf980 Bluetooth: tester: Use bt enable cb to indicate cmd rsp success
This is needed especially for nble. If bluetooth is not enabled we
cannot send another commands to tester.

Change-Id: I17e639301bba6efd127f2c743b8942c1b493f9da
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-06 17:25:11 +00:00
Grzegorz Kolodziejczyk
355ded1863 drivers/nble: Add support to bt_gatt_attr_next
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>
2016-04-06 12:35:49 +00:00
Andrei Emeltchenko
bd5f745e25 Bluetooth: Enable Nordic BLE chip using PM helpers
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>
2016-04-06 12:10:21 +00:00
Johan Hedberg
f72063e214 Bluetooth: drivers/nble: Require callback for bt_enable()
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>
2016-04-06 11:51:27 +00:00
Andrei Emeltchenko
f7da2220d7 quark_se_devboard: Remove UART default name from soc config
Remove UART default configuration to make it default UART_0. This
makes default working fine with Nordic BLE chip using H:4 driver.

Change-Id: Icb6d9f068b586bbf04694bc77ed968211de94c8a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
3252f6cf1a drivers/nble: Refactor PM code to make it reusable
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>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
8e4440674e Bluetooth: Add option for PM with Nordic BLE chip
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>
2016-04-06 14:00:55 +03:00
Andrei Emeltchenko
ecc35267da drivers/nble: Move Nordic Bluetooth LE driver inside drivers/bluetooth
Move NBLE code to the place where other Bluetooth drivers code resides.

Change-Id: Ibcf9ffb016e9b842bed66a61dff5c101b1573aaa
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 14:04:44 +03:00
Johan Hedberg
bc706e2a88 Bluetooth: Add stub for bt_storage_clear()
Change-Id: I7ab9ee4ca1d9702e7aef23aadfa627554907d145
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
d0e4e0183e Bluetooth: Rename bt_register_storage to bt_storage_register
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>
2016-04-05 12:29:14 +03:00
Johan Hedberg
e70771d3c8 Bluetooth: Export bt_storage inside the stack
It's likely that other files besides hci_core.c will be needing to
read/write the storage. Export it therefore through hci_core.h (same
time adding a missing 'const' to the declaration).

Change-Id: I7c08bc0d69c752bef68f9da9e4aee1acfa00de72
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
499b44201b Bluetooth: Don't update random address unnecessarily
If the wanted address is already programmed to the controller there's
no need to send a HCI command to change it.

Change-Id: Ib73d09cc5b20cd6820e603f0828f000f8310a89e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
5ccb20c591 Bluetooth: Use bt_addr_t inside bt_addr_le_t
In many cases when we want to access the 'val' member of bt_addr_le_t
it's in situations where the type needed is actually bt_addr_t. To
avoid unnecessary typecasts in these places simply embed bt_addr_t
inside bt_addr_le_t.

Change-Id: I7eecf129bee1dcf085abc83ec2f32e1a10b0b5aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
13be3947ab Bluetooth: Add Privacy Feature support
Add initial support for the Privacy Feature, including the ability to
manage a local IRK and to use Resolvable Random Addresses.

Change-Id: I1c70aea67078dd2a5d07f3b797c37746ebe9ab61
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Andrei Emeltchenko
24732e8fb9 drivers/nble: Fix typo in compatible_firmware name
Change-Id: I81a211892e61bc11db5e5e8c1715f7971d64ace1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
8f5e21154b drivers/nble: Update RPC to Nordic firmware 0404 version
Update RPC headers and change compatible_firmware version 0404.

Change-Id: Ie9920d302f3787c07181bc6aa519a96556463a79
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
f0f91d4a7b drivers/nble: Refactor Nordic BLE chip enable functions
Move NBLE pin handling to the driver from gap.c.

Change-Id: I4b7fd408c623971d19da12784c656c5c605852a5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
36748b9f33 ia32: Allow to connect Nordic chip to qemu
Allow to connect Nordic Devkit or dongle to qemu. Simple
configuration for the current NBLE firmware is following:

Connect Nordic board to PC, ttyACMX gets created.
$ socat -x /dev/ttyACMX,raw,b1000000 unix-listen:/tmp/bt-server-bredr
Build app with prj_nble.conf and run with make qemu

Change-Id: I354644b465ad09ab0ca62fbd97f15d9bb3c87d6a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
53c5979c2e quark_se_devboard: Configure UART0 for quark_se_devboard
UART0 is connected to Nordic BLE chip, copy the configuration from
arduino_101 where there is the same chip.

Change-Id: Ic9fe30f4562d261920c0cfd359ea34be4e7e2476
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
feaa25315e quark_se_devboard: Enable NBLE for quark_se_devboard in Kconfig
Enable GPIO and select UART0 for Nordic BLE chip.

Change-Id: Ic1bf82a8b97fcc231eb857ee0bd05381a24a2d25
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:52 +03:00
Johan Hedberg
ad7912422f Bluetooth: Introduce SMP helper to generate RPAs
This will be needed to implement local privacy support.

Change-Id: I6222a7d396d47929d6f8946793bbf3f49eaae179
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 17:35:02 +03:00
Johan Hedberg
5c45a3bce1 Bluetooth: Export is_bonded through hci_core.c
There will be other uses, so rename this to bt_addr_le_is_bonded and
export it through hci_core.h.

Change-Id: Ia033a215255f2ec2e513c785dd1b9862faaf5ac8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 17:35:02 +03:00
Andrei Emeltchenko
777a76297d drivers/nble: Implement GATT read Characteristic Presentation Format
Implement bt_gatt_attr_read_cpf() for NBLE.

Change-Id: Ia99db05a3f67bef3c1617df37fd371a8b1e8beb6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-04 14:34:18 +00:00
Andrei Emeltchenko
0fd771acfc samples/nble: Remove default driver debug for samples
CONFIG_BLUETOOTH_DEBUG_DRIVER provides too low level information to be
useful for samples. Remove it from default settings.

Change-Id: I9d99f9953d4e6b839eeb51ed393e4aed1eeeb01b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-04 14:33:50 +00:00
Johan Hedberg
0537c2c579 Bluetooth: Add support for reading local address from storage
If the local controller doesn't have a public address we need to
generate a static random address and use that as our Identity Address.

Change-Id: I3db261b630c670d285c6bfacbe090184cccb5e8c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 14:01:59 +03:00
Johan Hedberg
7e7eee0fb4 Bluetooth: Add skeleton for persistent storage API
Add initial skeleton for the persistent storage API.

Change-Id: I7a6cc283aa88e7d861af18a6f0db2ed8c71e44a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 14:01:59 +03:00
Johan Hedberg
03ea90db8f Bluetooth: Rework local address tracking
Store the Identity Address and Random Address in their own variables.
If the controller doesn't have a public address a static random
address is set as the Identity Address. Also keep properly track of
which address was used for advertising and initiating connections so
that the connection object contains the right information.

Change-Id: I3e9dc2036b330c19c2725b180fd061da2df8a0fa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 13:56:55 +03:00
Daniel Leung
8425568a8a gpio/dw: remove kconfigs that are SoC specific
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>
2016-04-02 23:11:07 +00:00
Daniel Leung
16d0b8b0a3 tests: enable pinmux build tests
Enable building pinmux drivers to catch build breakage.

Origin: Original
Change-Id: I86ec02423bf23ee6aca41b9413e240e984313fcf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-02 23:11:06 +00:00
Laurentiu Palcu
7dd2372dd5 spi_dw: use SPI bus frequency in spi_dw_configure()
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>
2016-04-02 23:08:49 +00:00
Laurentiu Palcu
dbe2c5faff bmi160: Add sample application
Origin: Original
Change-Id: I8bd3fa30f3794de0fa22ffff8e3eaeb213612741
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Laurentiu Palcu
5d2a200381 sensor: add driver for BMI160
This patch adds support for the Curie's BMI160 IMU chip. Only polling is
supported in this version.

Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMI160-DS000-07.pdf

Origin: Original
Change-Id: I759856d4bf123c21e9e4928f32bdf8f00aeeed24
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Laurentiu Palcu
d43e152845 sensor.h: Add helper functions for unit conversions
Since sensors' API uses SI units, all attributes and channel reading use
SI units. Hence, conversions from other units to SI are necessary.

This patch adds helper for converting:
 * m/s^2 to Gs (and vice versa);
 * degrees to radians (and vice versa);

Change-Id: I49f8763bed253ff6bde4c97618766b05f97da699
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Laurentiu Palcu
3ed141ecd3 sensor.h: add new attributes
This patch as following attributes:
 * SENSOR_ATTR_OFFSET: for setting offsets in order to adjust the read
   values;
 * SENSOR_ATTR_CALIB_TARGET: for setting target that the chip internal
   algorithms need to converge to when calibrating;

Change-Id: I3aae5aa06bcd1376423e58b0511267ea43038718
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:47 +00:00
Johan Hedberg
9eec87a0ef Bluetooth: Remove unnecessary double check for CONFIG_BLUETOOTH_CONN
Change-Id: I3329cf1314cbcd4e6bb7015b9b52fd6c52526567
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-02 20:59:09 +03:00
Johan Hedberg
a85b1f7752 Bluetooth: Shorten set_adv_parameters to set_adv_param
The shorter form "param" is used elsewhere and this helps avoid overly
long lines.

Change-Id: Ie76497b5bf30e72099d13a26db9cacb8cd2c9c79
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-02 20:59:09 +03:00
786 changed files with 37136 additions and 15372 deletions

6
.gitignore vendored
View File

@@ -19,9 +19,9 @@ scripts/kconfig/zconf.hash.c
scripts/kconfig/zconf.lex.c
scripts/kconfig/zconf.tab.c
doc/_build
xml
html/
doc/latex/
doc/xml
doc/html
doc/latex
sanity-out/
scripts/grub
doc/reference/kconfig/CONFIG_*

View File

@@ -1,5 +1,5 @@
VERSION_MAJOR = 1
VERSION_MINOR = 2
VERSION_MINOR = 3
PATCHLEVEL = 0
VERSION_RESERVED = 0
EXTRAVERSION =
@@ -281,15 +281,6 @@ KBUILD_BUILTIN := 1
export KBUILD_BUILTIN
export KBUILD_CHECKSRC KBUILD_SRC
ifneq ($(CC),)
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
COMPILER := clang
else
COMPILER := gcc
endif
export COMPILER
endif
# Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir=$(srctree)
@@ -345,18 +336,22 @@ endif
USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h
SOC_NAME = $(subst $(DQUOTE),,$(CONFIG_SOC))
SOC_SERIES = $(subst $(DQUOTE),,$(CONFIG_SOC_SERIES))
SOC_FAMILY = $(subst $(DQUOTE),,$(CONFIG_SOC_FAMILY))
override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
BOARD_NAME = $(subst $(DQUOTE),,$(CONFIG_BOARD))
KERNEL_NAME = $(subst $(DQUOTE),,$(CONFIG_KERNEL_BIN_NAME))
KERNEL_ELF_NAME = $(KERNEL_NAME).elf
KERNEL_BIN_NAME = $(KERNEL_NAME).bin
export SOC_NAME BOARD_NAME ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME
export SOC_FAMILY SOC_SERIES SOC_PATH SOC_NAME BOARD_NAME
export ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME
# Use ZEPHYRINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
ZEPHYRINCLUDE = \
-I$(srctree)/arch/$(ARCH)/include \
-I$(srctree)/arch/$(ARCH)/soc/$(SOC_NAME) \
-I$(srctree)/arch/$(ARCH)/soc/$(SOC_PATH) \
-I$(srctree)/boards/$(BOARD_NAME) \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(srctree)/include \
@@ -575,7 +570,16 @@ $(if $(CROSS_COMPILE),, \
$(error ZEPHYR_GCC_VARIANT is not set. ))
endif
ifdef CONFIG_QMSI_DRIVERS
ifneq ($(CC),)
ifeq ($(shell $(CC) -v 2>&1 | grep -Ec "clang version|icx version"), 1)
COMPILER := clang
else
COMPILER := gcc
endif
export COMPILER
endif
ifdef CONFIG_QMSI_LIBRARY
LIB_INCLUDE_DIR += -L$(CONFIG_QMSI_INSTALL_PATH:"%"=%)/lib
ALL_LIBS += qmsi
endif
@@ -586,7 +590,7 @@ endif
ifdef CONFIG_NEWLIB_LIBC
ZEPHYRINCLUDE += $(TOOLCHAIN_CFLAGS)
ALL_LIBS += c m
ALL_LIBS += m c
endif
QEMU_BIN_PATH ?= /usr/bin
@@ -624,6 +628,11 @@ KBUILD_CFLAGS += $(subst $(DQUOTE),,$(CONFIG_COMPILER_OPT))
export LDFLAG_LINKERCMD
ifeq ($(SOC_SERIES),)
SOC_PATH = $(SOC_NAME)
else
SOC_PATH = $(SOC_FAMILY)/$(SOC_SERIES)
endif
include arch/$(ARCH)/Makefile
KBUILD_CFLAGS += $(CFLAGS)
@@ -632,7 +641,6 @@ KBUILD_AFLAGS += $(CFLAGS)
ifeq ($(COMPILER),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
@@ -655,6 +663,7 @@ endif
# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
NOSTDINC_FLAGS += -isystem $(shell $(CC) -print-file-name=include-fixed)
CHECKFLAGS += $(NOSTDINC_FLAGS)
# disable pointer signed / unsigned warnings in gcc 4.0
@@ -704,7 +713,7 @@ KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.cmd
# If not available, try an SoC specific linker file
ifeq ($(wildcard $(KBUILD_LDS)),)
KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/linker.cmd
KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/linker.cmd
endif
endif

View File

@@ -25,7 +25,9 @@ override CONF_FILE := $(strip $(subst $(DQUOTE),,$(CONF_FILE)))
ifdef BOARD
KBUILD_DEFCONFIG_PATH=$(wildcard $(ZEPHYR_BASE)/boards/*/$(BOARD)_defconfig)
export KBUILD_DEFCONFIG_PATH
ifeq ($(KBUILD_DEFCONFIG_PATH),)
$(error Board $(BOARD) not found!)
endif
else
$(error BOARD is not defined!)
endif

View File

@@ -63,16 +63,35 @@ config ARCH
System architecture string.
config SOC
string
help
This option holds the directory name used by the build system to locate
the correct linker file.
string
help
SoC name which can be found under arch/<arch>/soc/<soc name>.
This option holds the directory name used by the build system to locate
the correct linker and header files for the SoC. This option will go away
once all SoCs are using family/series structure.
config SOC_SERIES
string
help
SoC series name which can be found under arch/<arch>/soc/<family>/<series>.
This option holds the directory name used by the build system to locate
the correct linker and header files.
config SOC_FAMILY
string
help
SoC family name which can be found under arch/<arch>/soc/<family>.
This option holds the directory name used by the build system to locate
the correct linker and header files.
config BOARD
string
help
This option holds the name of the board and is used to located the files
related to the board in the source tree.
related to the board in the source tree (under boards/).
The Board is the first location where we search for a linker.cmd file,
if not found we look for the linker file in
arch/<arch>/soc/<family>/<series>
source "arch/*/Kconfig"

View File

@@ -1,9 +1 @@
ifeq (${ARCH},arm)
obj-y += arm/
endif
ifeq (${ARCH},x86)
obj-y += x86/
endif
ifeq (${ARCH},arc)
obj-y += arc/
endif
obj-y += $(ARCH)/

View File

@@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers
subdir-asflags-y += $(subdir-ccflags-y)
obj-y += soc/$(SOC_NAME)/
obj-y += soc/$(SOC_PATH)/
obj-y += core/

View File

@@ -40,6 +40,7 @@ config CPU_ARCEM4
bool
default y
select CPU_ARCV2
select ATOMIC_OPERATIONS_C
help
This option signifies the use of an ARC EM4 CPU
@@ -54,14 +55,6 @@ config CPU_ARCV2
help
This option signifies the use of a CPU of the ARCv2 family.
config RAM_START
prompt "RAM start address"
hex
config RAM_SIZE
prompt "RAM size (in kB)"
int
config NSIM
prompt "Running on the MetaWare nSIM simulator"
bool
@@ -164,6 +157,47 @@ config XIP
default n if NSIM
default y
config DCCM_SIZE
int "DCCM Size in kB"
help
This option specifies the size of the DCCM in kB. It is normally set by
the platform's defconfig file and the user should generally avoid modifying
it via the menu configuration.
config DCCM_BASE_ADDRESS
hex "DCCM Base Address"
help
This option specifies the base address of the DCCM on the platform. It is
normally set by the platform's defconfig file and the user should generally
avoid modifying it via the menu configuration.
config SRAM_SIZE
int "SRAM Size in kB"
help
This option specifies the size of the SRAM in kB. It is normally set by
the platform's defconfig file and the user should generally avoid modifying
it via the menu configuration.
config SRAM_BASE_ADDRESS
hex "SRAM Base Address"
help
This option specifies the base address of the SRAM on the platform. It is
normally set by the platform's defconfig file and the user should generally
avoid modifying it via the menu configuration.
config FLASH_SIZE
int "Flash Size in kB"
help
This option specifies the size of the flash in kB. It is normally set by
the platform's defconfig file and the user should generally avoid modifying
it via the menu configuration.
config FLASH_BASE_ADDRESS
hex "Flash Base Address"
help
This option specifies the base address of the flash on the platform. It is
normally set by the platform's defconfig file and the user should generally
avoid modifying it via the menu configuration.
config NSIM
prompt "Running on the MetaWare nSIM simulator"
bool
@@ -240,19 +274,6 @@ config ARCH_HAS_NANO_FIBER_ABORT
# omit prompt to signify a "hidden" option
default n
config ARC_ATOMIC_ASM
bool
default n
depends on !CPU_ARCEM4
help
Say y if the processor supports atomic assembly instructions:
LLOCK and SCOND.
Say n if not sure.
Note that these instructions are not supported on ARC EM family
processors.
endmenu

View File

@@ -2,7 +2,7 @@ cflags-y += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-secti
cflags-$(CONFIG_ARC_STACK_CHECKING) = $(call cc-option,-fomit-frame-pointer)
cflags-$(CONFIG_LTO) = $(call cc-option,-flto,)
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CXXFLAGS += $(cflags-y)

View File

@@ -15,10 +15,8 @@ obj-y += prep_c.o \
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
obj-$(CONFIG_ERRNO) += errno.o
ifeq ($(CONFIG_ARC_ATOMIC_ASM),y)
ifneq ($(CONFIG_ATOMIC_OPERATIONS_C),y)
obj-y += atomic.o
else
obj-y += atomic_native.o
endif
obj-$(CONFIG_IRQ_VECTOR_TABLE_BSP) += irq_vector_table.o

View File

@@ -211,6 +211,22 @@ SECTION_FUNC(TEXT, _isr_enter)
j_s.nd [r2]
#if defined(CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT)
GTEXT(_sys_k_event_logger_interrupt)
.macro log_interrupt_k_event
clri r0 /* do not interrupt event logger operations */
push_s r0
push_s blink
jl _sys_k_event_logger_interrupt
pop_s blink
pop_s r0
seti r0
.endm
#else
#define log_interrupt_k_event
#endif
#if defined(CONFIG_NANOKERNEL) && defined(CONFIG_TICKLESS_IDLE)
.macro exit_tickless_idle
clri r0 /* do not interrupt exiting tickless idle operations */
@@ -232,6 +248,7 @@ SECTION_FUNC(TEXT, _isr_demux)
/* cannot be done before this point because we must be able to run C */
/* r0 is available to be stomped here, and exit_tickless_idle uses it */
exit_tickless_idle
log_interrupt_k_event
lr r0, [_ARC_V2_ICAUSE]
sub r0, r0, 16

View File

@@ -28,7 +28,7 @@
#include <sections.h>
#include <arch/cpu.h>
#define _RAM_END (CONFIG_RAM_START + CONFIG_RAM_SIZE * 1024)
#define _RAM_END (CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024)
GTEXT(__reset)

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @brief Kernel event logger support for ARM
*/
#ifndef __KERNEL_EVENT_LOGGER_ARCH_H__
#define __KERNEL_EVENT_LOGGER_ARCH_H__
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Get the identification of the current interrupt.
*
* This routine obtain the key of the interrupt that is currently processed
* if it is called from a ISR context.
*
* @return The key of the interrupt that is currently being processed.
*/
int _sys_current_irq_key_get(void)
{
return _INTERRUPT_CAUSE();
}
#ifdef __cplusplus
}
#endif
#endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */

View File

@@ -278,6 +278,21 @@ static ALWAYS_INLINE int _IS_IN_ISR(void)
return ((act & 0xffff) != 0);
}
/**
*
* @bried Indicates the interrupt number of the highest priority
* active interrupt
*
* @return IRQ number
*/
static ALWAYS_INLINE int _INTERRUPT_CAUSE(void)
{
uint32_t irq_num = _arc_v2_aux_reg_read(_ARC_V2_ICAUSE);
return irq_num;
}
extern void nanoCpuAtomicIdle(unsigned int);
extern void _thread_entry_wrapper(void);

View File

@@ -37,14 +37,26 @@ config NUM_IRQS
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 32000000
config RAM_START
config FLASH_BASE_ADDRESS
default 0x40000000
config FLASH_SIZE
default 152
config SRAM_BASE_ADDRESS
default 0x4000 if NSIM
default 0xa8000400
config RAM_SIZE
config SRAM_SIZE
default 16 if NSIM
default 24
config DCCM_BASE_ADDRESS
default 0x80000000
config DCCM_SIZE
default 8
if GPIO
config GPIO_DW
@@ -60,14 +72,8 @@ config GPIO_DW_0
if GPIO_DW_0
config GPIO_DW_0_BASE_ADDR
default 0x80017800
config GPIO_DW_0_IRQ
default 20
config GPIO_DW_0_PRI
default 2
config GPIO_DW_0_BITS
default 8
endif # GPIO_DW_0
@@ -76,14 +82,8 @@ config GPIO_DW_1
if GPIO_DW_1
config GPIO_DW_1_BASE_ADDR
default 0x80017900
config GPIO_DW_1_IRQ
default 21
config GPIO_DW_1_PRI
default 2
config GPIO_DW_1_BITS
default 8
endif # GPIO_DW_1
@@ -104,7 +104,7 @@ config I2C_QUARK_SE_SS_0
if I2C_QUARK_SE_SS_0
config I2C_QUARK_SE_SS_0_NAME
default "I2C0"
default "I2C_0"
config I2C_QUARK_SE_SS_0_DEFAULT_CFG
default 0x12
@@ -114,7 +114,7 @@ endif # I2C_QUARK_SE_SS_0
if I2C_QUARK_SE_SS_1
config I2C_QUARK_SE_SS_1_NAME
default "I2C1"
default "I2C_1"
config I2C_QUARK_SE_SS_1_DEFAULT_CFG
default 0x12

View File

@@ -20,8 +20,8 @@
*/
/* Flash base address and size */
#define FLASH_START 0x40000000 /* Flash bank 1 */
#define FLASH_SIZE 152K
#define FLASH_START CONFIG_FLASH_BASE_ADDRESS /* Flash bank 1 */
#define FLASH_SIZE CONFIG_FLASH_SIZE
/*
* SRAM base address and size
@@ -29,11 +29,11 @@
* Internal SRAM includes the exception vector table at reset, which is at
* the beginning of the region.
*/
#define SRAM_START CONFIG_RAM_START
#define SRAM_SIZE CONFIG_RAM_SIZE
#define SRAM_START CONFIG_SRAM_BASE_ADDRESS
#define SRAM_SIZE CONFIG_SRAM_SIZE
/* Data Closely Coupled Memory (DCCM) base address and size */
#define DCCM_START 0x80000000
#define DCCM_SIZE 8K
#define DCCM_START CONFIG_DCCM_BASE_ADDRESS
#define DCCM_SIZE CONFIG_DCCM_SIZE
#include <arch/arc/v2/linker.cmd>

View File

@@ -148,8 +148,22 @@
/*
* GPIO
*/
#define GPIO_DW_PORT_0_INT_MASK (SCSS_REGISTER_BASE + 0x408)
#define GPIO_DW_PORT_1_INT_MASK (SCSS_REGISTER_BASE + 0x40C)
#define GPIO_DW_IO_ACCESS
#define GPIO_DW_0_BASE_ADDR 0x80017800
#define GPIO_DW_0_IRQ 20
#define GPIO_DW_0_BITS 8
#define GPIO_DW_PORT_0_INT_MASK (SCSS_REGISTER_BASE + 0x408)
#define GPIO_DW_1_BASE_ADDR 0x80017900
#define GPIO_DW_1_IRQ 21
#define GPIO_DW_1_BITS 8
#define GPIO_DW_PORT_1_INT_MASK (SCSS_REGISTER_BASE + 0x40C)
#if defined(CONFIG_IOAPIC)
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#define GPIO_DW_1_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#endif
/*
* UART

View File

@@ -33,9 +33,10 @@ static int arc_quark_se_ipm_init(void)
static struct quark_se_ipm_controller_config_info ipm_controller_config = {
.controller_init = arc_quark_se_ipm_init
};
DEVICE_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
DEVICE_AND_API_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
NULL, &ipm_controller_config,
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&ipm_quark_se_api_funcs);
#if CONFIG_IPM_CONSOLE_SENDER
#include <console/ipm_console.h>

View File

@@ -2,5 +2,10 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers
subdir-asflags-y := ${subdir-ccflags-y}
obj-y += soc/$(SOC_NAME)/
ifneq ($(SOC_FAMILY),)
obj-y += soc/$(SOC_FAMILY)/
else
obj-y += soc/$(SOC_PATH)/
endif
obj-y += core/

View File

@@ -18,7 +18,7 @@
choice
prompt "ARM SoC Selection"
default SOC_FSL_FRDM_K64F
default SOC_SERIES_KINETIS_K6X
depends on ARM
source "arch/arm/soc/*/Kconfig.soc"

View File

@@ -1,6 +1,6 @@
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,)
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)

View File

@@ -1,5 +1,5 @@
ccflags-y +=-I$(srctree)/include/drivers
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(SOC_NAME)
ccflags-y +=-I$(srctree)/arch/arm/soc/$(SOC_PATH)
asflags-y = $(ccflags-y)

View File

@@ -75,7 +75,10 @@ config UART_ATMEL_SAM3_CLK_FREQ
endif # UART_ATMEL_SAM3
if GPIO_ATMEL_SAM3
if GPIO
config GPIO_ATMEL_SAM3
def_bool y
config GPIO_ATMEL_SAM3_PORTA
default y
@@ -89,9 +92,12 @@ config GPIO_ATMEL_SAM3_PORTC
config GPIO_ATMEL_SAM3_PORTD
default y
endif # GPIO_ATMEL_SAM3
endif # GPIO
if I2C_ATMEL_SAM3
if I2C
config I2C_ATMEL_SAM3
def_bool y
config I2C_ATMEL_SAM3_0
default y
@@ -99,6 +105,6 @@ config I2C_ATMEL_SAM3_0
config I2C_ATMEL_SAM3_1
default y
endif # I2C_ATMEL_SAM3
endif # I2C
endif # SOC_ATMEL_SAM3

View File

@@ -1,6 +0,0 @@
config SOC_FSL_FRDM_K64F
bool "Freescale FRDM-K64F"
select CPU_CORTEX_M
select CPU_CORTEX_M4
select SYS_POWER_LOW_POWER_STATE_SUPPORTED

View File

@@ -0,0 +1,2 @@
obj-y += $(SOC_SERIES)/

View File

@@ -0,0 +1,28 @@
#
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
config SOC_FAMILY_KINETIS
bool
# omit prompt to signify a "hidden" option
default n
if SOC_FAMILY_KINETIS
config SOC_FAMILY
string
default "nxp_kinetis"
endif
source "arch/arm/soc/nxp_kinetis/*/Kconfig.soc"

View File

@@ -0,0 +1 @@
source "arch/arm/soc/nxp_kinetis/*/Kconfig.defconfig.series"

View File

@@ -0,0 +1,17 @@
#
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
source "arch/arm/soc/nxp_kinetis/*/Kconfig.series"

View File

@@ -16,29 +16,11 @@
# limitations under the License.
#
if SOC_FSL_FRDM_K64F
if SOC_MK64F12
config SOC
default fsl_frdm_k64f
config SRAM_BASE_ADDRESS
default 0x20000000
config FLASH_BASE_ADDRESS
default 0x00000000
config NUM_IRQ_PRIO_BITS
int
default 4
config NUM_IRQS
int
# must be >= the highest interrupt number used
default 86
config SYS_CLOCK_HW_CYCLES_PER_SEC
int
default 120000000
string
default mk64f12
if UART_K20
@@ -185,4 +167,4 @@ endif # SPI_K64
endif # SPI
endif # SOC_FSL_FRDM_K64F
endif # SOC_MK64F12

View File

@@ -0,0 +1,41 @@
# Kconfig - Kinetis K6x series configuration options
#
# Copyright (c) 2014-2016 Wind River Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if SOC_SERIES_KINETIS_K6X
config SOC_SERIES
default k6x
config SRAM_BASE_ADDRESS
default 0x20000000
config FLASH_BASE_ADDRESS
default 0x00000000
config NUM_IRQ_PRIO_BITS
int
default 4
config NUM_IRQS
int
# must be >= the highest interrupt number used
default 86
source "arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk*"
endif # SOC_SERIES_KINETIS_K6X

View File

@@ -0,0 +1,25 @@
# Kconfig - Kinetis K6X MCU line
#
# Copyright (c) 2016 Open-RnD Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
config SOC_SERIES_KINETIS_K6X
bool "Kinetis K6x Series MCU"
select CPU_CORTEX_M
select CPU_CORTEX_M4
select SOC_FAMILY_KINETIS
select SYS_POWER_LOW_POWER_STATE_SUPPORTED
help
Enable support for Kinetis K6x MCU series

View File

@@ -1,7 +1,6 @@
# Kconfig - FSL FRDM K64F platform configuration options
# Kconfig - Kinetis K6X MCU line
#
# Copyright (c) 2014-2016 Wind River Systems, Inc.
# Copyright (c) 2016 Open-RnD Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,7 +15,16 @@
# limitations under the License.
#
if SOC_FSL_FRDM_K64F
choice
prompt "Kinetis K6x MCU Selection"
depends on SOC_SERIES_KINETIS_K6X
config SOC_MK64F12
bool "SOC_MK64F12"
endchoice
if SOC_SERIES_KINETIS_K6X
config K64_CORE_CLOCK_DIVIDER
int
@@ -59,7 +67,7 @@ config WDOG_INIT
during reset handling.
config PRESERVE_JTAG_IO_PINS
bool "Freescale FRDM-K64F JTAG pin usage"
bool "Kinetis K6x JTAG pin usage"
depends on PINMUX
default y
help
@@ -68,4 +76,4 @@ config PRESERVE_JTAG_IO_PINS
the Arduino header as D8, D3 and D5, respectively.
Enable this option to preserve these pins for the debug interface.
endif # SOC_FSL_FRDM_K64F
endif # SOC_SERIES_KINETIS_K6X

View File

@@ -0,0 +1,2 @@
obj-y += $(SOC_SERIES)/

View File

@@ -15,9 +15,15 @@
# limitations under the License.
#
config SOC_STM32
config SOC_FAMILY_STM32
bool
# omit prompt to signify a "hidden" option
default n
source "arch/arm/soc/st_stm32/*/Kconfig.soc.family"
if SOC_FAMILY_STM32
config SOC_FAMILY
string
default st_stm32
endif
source "arch/arm/soc/st_stm32/*/Kconfig.soc"

View File

@@ -1 +1 @@
source "arch/arm/soc/st_stm32/*/Kconfig.defconfig.family"
source "arch/arm/soc/st_stm32/*/Kconfig.defconfig.series"

View File

@@ -15,11 +15,4 @@
# limitations under the License.
#
config SOC_STM32F1X
bool "STM32F1x Series MCU"
select CPU_CORTEX_M
select CPU_CORTEX_M3
select SOC_STM32
select SYS_POWER_LOW_POWER_STATE_SUPPORTED
help
Enable support for STM32F1 MCU series
source "arch/arm/soc/st_stm32/*/Kconfig.series"

View File

@@ -15,12 +15,12 @@
# limitations under the License.
#
if SOC_STM32F1X
if SOC_SERIES_STM32F1X
source "arch/arm/soc/st_stm32/stm32f1/Kconfig.defconfig.stm32f1*"
config SOC
default st_stm32/stm32f1
config SOC_SERIES
default stm32f1
config SRAM_BASE_ADDRESS
default 0x20000000
@@ -32,4 +32,4 @@ config NUM_IRQ_PRIO_BITS
int
default 4
endif # SOC_STM32F1X
endif # SOC_SERIES_STM32F1X

View File

@@ -17,6 +17,9 @@
if SOC_STM32F103RB
config SOC
string
default stm32f103rb
config SRAM_SIZE
default 20

View File

@@ -17,6 +17,10 @@
if SOC_STM32F103VE
config SOC
string
default stm32f103ve
config SRAM_SIZE
default 64

View File

@@ -0,0 +1,25 @@
# Kconfig - ST Microelectronics STM32F1 MCU series
#
# Copyright (c) 2016 Open-RnD Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
config SOC_SERIES_STM32F1X
bool "STM32F1x Series MCU"
select CPU_CORTEX_M
select CPU_CORTEX_M3
select SOC_FAMILY_STM32
select SYS_POWER_LOW_POWER_STATE_SUPPORTED
help
Enable support for STM32F1 MCU series

View File

@@ -17,7 +17,7 @@
choice
prompt "STM32F1x MCU Selection"
depends on SOC_STM32F1X
depends on SOC_SERIES_STM32F1X
config SOC_STM32F103VE
bool "STM32F103VE"

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
#include <errno.h>
#include "soc.h"
#include <device.h>
#include <misc/util.h>

View File

@@ -25,6 +25,8 @@
* (GPIOs and AFIOs)
*/
#include <errno.h>
#include <device.h>
#include "soc.h"
#include "soc_registers.h"

View File

@@ -80,4 +80,7 @@ config BLUETOOTH_UART_ON_DEV_NAME
config UART_PIPE_ON_DEV_NAME
default "UART_2" if UART_PIPE
config BLUETOOTH_MONITOR_ON_DEV_NAME
default "UART_2" if BLUETOOTH_DEBUG_MONITOR
endif

View File

@@ -1,2 +1,3 @@
obj-y += core/
obj-y += soc/$(SOC_NAME)/
obj-$(CONFIG_GDB_SERVER) += debug/
obj-y += soc/$(SOC_PATH)/

View File

@@ -8,9 +8,18 @@ PREFERRED_STACK_BOUNDARY = y
endif
ifeq ($(COMPILER),clang)
ifeq ($(CONFIG_X86_IAMCU),)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
else
CC_M32 = -m32 -mmcu
KBUILD_CFLAGS += -mmcu
KBUILD_CPPFLAGS += -mmcu
endif
biarch := $(call cc-option,-m32)
dwarf2 := $(call cc-option,-gdwarf-2)
KBUILD_AFLAGS += $(biarch)
KBUILD_CFLAGS += $(biarch)
KBUILD_CFLAGS += $(dwarf2)
else
cflags-$(PREFERRED_STACK_BOUNDARY) += $(call cc-option,-mpreferred-stack-boundary=2)
endif
@@ -20,7 +29,7 @@ ifneq ($(CONFIG_SSE_FP_MATH),y)
cflags-y += -mno-sse
endif
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
KBUILD_CXXFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(cflags-y)

View File

@@ -1,7 +1,7 @@
ccflags-y += -I$(srctree)/kernel/nanokernel/include
ccflags-y += -I$(srctree)/kernel/microkernel/include
ifeq ($(COMPILER),clang)
ifeq ($(COMPILER)$(CONFIG_X86_IAMCU),clang)
# We rely on GAS for assembling, so don't use the integrated assembler
KBUILD_AFLAGS += -no-integrated-as
endif
@@ -28,3 +28,6 @@ obj-$(CONFIG_MICROKERNEL) += strtask.o
obj-$(CONFIG_ERRNO) += errno.o
obj-$(CONFIG_GDT_DYNAMIC) += gdt.o
obj-$(CONFIG_REBOOT_RST_CNT) += reboot_rst_cnt.o
obj-$(CONFIG_DEBUG_INFO) += debug/
obj-$(CONFIG_REBOOT_RST_CNT) += reboot_rst_cnt.o

View File

@@ -0,0 +1,4 @@
ccflags-y += -I$(srctree)/kernel/nanokernel/include
ccflags-y += -I$(srctree)/kernel/microkernel/include
obj-y = debug_frames.o

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @brief Stack frames for debugging purposes
*
* This file contains a routine useful for debugging that gets a pointer to
* the current interrupt stack frame.
*/
#include <nanokernel.h>
#include <nano_private.h>
NANO_ISF *sys_debug_current_isf_get(void)
{
return _nanokernel.isf;
}

View File

@@ -308,7 +308,11 @@ SYS_NANO_CPU_EXC_CONNECT(_FpNotAvailableExcHandler,IV_DEVICE_NOT_AVAILABLE)
#define EXC_HANDLER(vec) NANO_CPU_EXC_CONNECT_NO_ERR(handle_exc_##vec, vec, 0)
#define EXC_HANDLER_CODE(vec) NANO_CPU_EXC_CONNECT(handle_exc_##vec, vec, 0)
#if !defined(CONFIG_DEBUGGER_OWNS_FATAL_PROG_EXC_HANDLERS)
EXC_HANDLER(IV_DIVIDE_ERROR)
EXC_HANDLER_CODE(IV_PAGE_FAULT)
#endif
EXC_HANDLER(IV_NON_MASKABLE_INTERRUPT)
EXC_HANDLER(IV_OVERFLOW)
EXC_HANDLER(IV_BOUND_RANGE)
@@ -321,7 +325,6 @@ EXC_HANDLER_CODE(IV_INVALID_TSS)
EXC_HANDLER_CODE(IV_SEGMENT_NOT_PRESENT)
EXC_HANDLER_CODE(IV_STACK_FAULT)
EXC_HANDLER_CODE(IV_GENERAL_PROTECTION)
EXC_HANDLER_CODE(IV_PAGE_FAULT)
EXC_HANDLER(IV_X87_FPU_FP_ERROR)
EXC_HANDLER_CODE(IV_ALIGNMENT_CHECK)
EXC_HANDLER(IV_MACHINE_CHECK)

View File

@@ -30,6 +30,8 @@
#include <asmPrv.h>
#include <drivers/loapic.h>
__weak void _debug_fatal_hook(const NANO_ESF *esf) { ARG_UNUSED(esf); }
/*
* Define a default ESF for use with _NanoFatalErrorHandler() in the event
* the caller does not have a NANO_ESF to pass
@@ -68,6 +70,7 @@ const NANO_ESF _default_esf = {
FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
const NANO_ESF *pEsf)
{
_debug_fatal_hook(pEsf);
#ifdef CONFIG_PRINTK

View File

@@ -2,7 +2,7 @@ ccflags-y += -I$(srctree)/kernel/nanokernel/include
ccflags-y += -I$(srctree)/kernel/microkernel/include
# see explanation for flags in arch/x86/core/Makefile
ifeq ($(COMPILER),clang)
ifeq ($(COMPILER)$(CONFIG_X86_IAMCU),clang)
KBUILD_AFLAGS += -no-integrated-as
endif
KBUILD_AFLAGS += -Wa,--divide

View File

@@ -132,6 +132,21 @@ SECTION_FUNC(TEXT, _IntEnt)
pushl %ecx
pushl %edx
#ifdef CONFIG_DEBUG_INFO
/*
* Push the cooperative registers on the existing stack as they are
* required by debug tools.
*/
pushl %edi
pushl %esi
pushl %ebx
pushl %ebp
leal 44(%esp), %ecx /* Calculate ESP before interrupt occurred */
pushl %ecx /* Save calculated ESP */
#endif
#ifdef CONFIG_INT_LATENCY_BENCHMARK
/*
* Volatile registers are now saved it is safe to start measuring
@@ -173,7 +188,11 @@ SECTION_FUNC(TEXT, _IntEnt)
incl __tNANO_nested_OFFSET(%ecx) /* inc interrupt nest count */
cmpl $1, __tNANO_nested_OFFSET(%ecx) /* use int stack if !nested */
#ifdef CONFIG_DEBUG_INFO
jne nested_save_isf
#else
jne alreadyOnIntStack
#endif
/* switch to base of the interrupt stack */
@@ -185,12 +204,30 @@ SECTION_FUNC(TEXT, _IntEnt)
pushl %edx /* Save stack pointer */
#ifdef CONFIG_DEBUG_INFO
/*
* The saved stack pointer happens to match the address of the
* interrupt stack frame. To simplify the exit case, push a dummy ISF
* for the "old" ISF and save it to the _nanokernel.isf.
*/
pushl %edx
movl %edx, __tNANO_isf_OFFSET(%ecx)
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
cmpl $0, __tNANO_idle_OFFSET(%ecx)
jne _HandleIdle
/* fast path is !idle, in the pipeline */
#endif
#ifdef CONFIG_DEBUG_INFO
jmp alreadyOnIntStack
BRANCH_LABEL(nested_save_isf)
movl __tNANO_isf_OFFSET(%ecx), %edx /* Get old ISF */
movl %esp, __tNANO_isf_OFFSET(%ecx) /* Save new ISF */
pushl %edx /* Save old ISF */
#endif
/* fall through to nested case */
@@ -290,6 +327,9 @@ BRANCH_LABEL(_IntExit)
/* determine whether exiting from a nested interrupt */
movl $_nanokernel, %ecx
#ifdef CONFIG_DEBUG_INFO
popl __tNANO_isf_OFFSET(%ecx) /* Restore old ISF */
#endif
decl __tNANO_nested_OFFSET(%ecx) /* dec interrupt nest count */
jne nestedInterrupt /* 'iret' if nested case */
@@ -331,6 +371,14 @@ BRANCH_LABEL(_IntExit)
popl %esp /* switch back to kernel stack */
#ifdef CONFIG_DEBUG_INFO
popl %ebp /* Discard saved ESP */
popl %ebp
popl %ebx
popl %esi
popl %edi
#endif
pushfl /* push KERNEL_LOCK_KEY argument */
call _Swap
@@ -397,6 +445,15 @@ BRANCH_LABEL(nestedInterrupt)
#ifdef CONFIG_INT_LATENCY_BENCHMARK
call _int_latency_stop
#endif
#ifdef CONFIG_DEBUG_INFO
popl %ebp /* Discard saved ESP */
popl %ebp
popl %ebx
popl %esi
popl %edi
#endif
popl %edx /* pop volatile registers in reverse order */
popl %ecx
popl %eax

View File

@@ -41,10 +41,10 @@ tNANO _nanokernel = {0};
/* forward declaration */
#ifdef CONFIG_GDB_INFO
#if defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO)
void _thread_entry_wrapper(_thread_entry_t, _thread_arg_t,
_thread_arg_t, _thread_arg_t);
#endif /* CONFIG_GDB_INFO */
#endif
/**
*
@@ -199,7 +199,7 @@ static void _new_thread_internal(char *pStackMem, unsigned stackSize,
_nano_timeout_tcs_init(tcs);
}
#ifdef CONFIG_GDB_INFO
#if defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO)
/**
*
* @brief Adjust stack before invoking _thread_entry
@@ -263,7 +263,7 @@ __asm__("\t.globl _thread_entry\n"
*/
"\tmovl $0, (%esp)\n" /* zero initialEFLAGS location */
"\tjmp _thread_entry\n");
#endif /* CONFIG_GDB_INFO */
#endif /* defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO) */
/**
*
@@ -320,7 +320,7 @@ void _new_thread(char *pStackMem, unsigned stackSize, _thread_entry_t pEntry,
*--pInitialThread = (EflagsGet() & ~EFLAGS_MASK) | EFLAGS_INITIAL;
#ifdef CONFIG_GDB_INFO
#if defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO)
/*
* Arrange for the _thread_entry_wrapper() function to be called
@@ -329,11 +329,11 @@ void _new_thread(char *pStackMem, unsigned stackSize, _thread_entry_t pEntry,
*--pInitialThread = (unsigned long)_thread_entry_wrapper;
#else /* CONFIG_GDB_INFO */
#else /* defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO) */
*--pInitialThread = (unsigned long)_thread_entry;
#endif /* CONFIG_GDB_INFO */
#endif /* defined(CONFIG_GDB_INFO) || defined(CONFIG_DEBUG_INFO) */
/*
* note: stack area for edi, esi, ebx, ebp, and eax registers can be

View File

@@ -46,6 +46,9 @@
GEN_OFFSET_SYM(tNANO, nested);
GEN_OFFSET_SYM(tNANO, common_isp);
#ifdef CONFIG_DEBUG_INFO
GEN_OFFSET_SYM(tNANO, isf);
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
GEN_OFFSET_SYM(tNANO, idle);
#endif

3
arch/x86/debug/Makefile Normal file
View File

@@ -0,0 +1,3 @@
ccflags-y += -I$(srctree)/kernel/nanokernel/include
obj-$(CONFIG_GDB_SERVER) = gdb_arch.o gdb_dbg_regs.o gdb_arch_exc.o

696
arch/x86/debug/gdb_arch.c Normal file
View File

@@ -0,0 +1,696 @@
/*
* Copyright (c) 2015-2016 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* x86 part of the GDB server
*/
#include <nanokernel.h>
#include <nano_private.h>
#include <string.h>
#include <debug/gdb_arch.h>
#include <misc/debug/gdb_server.h>
#include <asmPrv.h>
#define TRACE_FLAG 0x0100 /* EFLAGS:TF */
#define INT_FLAG 0x0200 /* EFLAGS:IF */
#define INSTRUCTION_HLT 0xf4
#define INSTRUCTION_STI 0xfb
#define INSTRUCTION_CLI 0xfa
#ifdef GDB_ARCH_HAS_RUNCONTROL
#ifdef GDB_ARCH_HAS_HW_BP
static int gdb_hw_bp_find(struct gdb_debug_regs *regs,
enum gdb_bp_type *bp_type,
long *address);
#endif
#endif
/**
* @brief Initialize GDB server architecture part
*
* This routine initializes the architecture part of the GDB server.
*
* Does nothing currently.
*
* @return N/A
*/
void gdb_arch_init(void)
{
/* currently empty */
}
/**
* @brief Fill a GDB register set from a given ESF register set
*
* This routine fills the provided GDB register set with values from given
* NANO_ESF register set.
*
* @param regs Destination GDB register set to fill
* @param esf Source exception stack frame
*
* @return N/A
*/
void gdb_arch_regs_from_esf(struct gdb_reg_set *regs, NANO_ESF *esf)
{
regs->regs.eax = esf->eax;
regs->regs.ecx = esf->ecx;
regs->regs.edx = esf->edx;
regs->regs.ebx = esf->ebx;
regs->regs.esp = esf->esp;
regs->regs.ebp = esf->ebp;
regs->regs.esi = esf->esi;
regs->regs.edi = esf->edi;
regs->regs.eip = esf->eip;
regs->regs.eflags = esf->eflags;
regs->regs.cs = esf->cs;
}
/**
* @brief Fill a GDB register set from a given ISF register set
*
* This routine fills the provided GDB register set with values from given
* NANO_ISF register set.
*
* @param regs Destination GDB register set to fill
* @param isf Source interrupt stack frame
*
* @return N/A
*/
void gdb_arch_regs_from_isf(struct gdb_reg_set *regs, NANO_ISF *isf)
{
memcpy(&regs->regs, isf, sizeof(regs->regs));
}
/**
* @brief Fill an ESF register set from a given GDB register set
*
* This routine fills the provided NANO_ESF register set with values
* from given GDB register set.
*
* @param regs Source GDB register set
* @param esf Destination exception stack frame to fill
*
* @return N/A
*/
void gdb_arch_regs_to_esf(struct gdb_reg_set *regs, NANO_ESF *esf)
{
esf->eax = regs->regs.eax;
esf->ecx = regs->regs.ecx;
esf->edx = regs->regs.edx;
esf->ebx = regs->regs.ebx;
esf->esp = regs->regs.esp;
esf->ebp = regs->regs.ebp;
esf->esi = regs->regs.esi;
esf->edi = regs->regs.edi;
esf->eip = regs->regs.eip;
esf->eflags = regs->regs.eflags;
esf->cs = regs->regs.cs;
}
/**
* @brief Fill an ISF register set from a given GDB register set
*
* This routine fills the provided NANO_ISF register set with values
* from given GDB register set.
*
* @param regs Source GDB register set
* @param isf Destination interrupt stack frame to fill
*
* @return N/A
*/
void gdb_arch_regs_to_isf(struct gdb_reg_set *regs, NANO_ISF *isf)
{
memcpy(isf, &regs->regs, sizeof(NANO_ISF));
}
/**
* @brief Fill given buffer from given register set
*
* This routine fills the provided buffer with values from given register set.
*
* The provided buffer must be large enough to store all register values.
* It is up to the caller to do this check.
*
* @param regs Source GDB register set
* @param esf Destination buffer to fill
*
* @return N/A
*/
void gdb_arch_regs_get(struct gdb_reg_set *regs, char *buffer)
{
*((uint32_t *) buffer) = regs->regs.eax;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.ecx;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.edx;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.ebx;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.esp;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.ebp;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.esi;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.edi;
buffer += 4;
*((uint32_t *) buffer) = (uint32_t) regs->regs.eip;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.eflags;
buffer += 4;
*((uint32_t *) buffer) = regs->regs.cs;
}
/**
* @brief Write given registers buffer to GDB register set
*
* This routine fills given register set with value from provided buffer.
* The provided buffer must be large enough to contain all register values.
* It is up to the caller to do this check.
*
* @param regs Destination GDB register set to fill
* @param esf Source buffer
*
* @return N/A
*/
void gdb_arch_regs_set(struct gdb_reg_set *regs, char *buffer)
{
regs->regs.eax = *((uint32_t *)buffer);
buffer += 4;
regs->regs.ecx = *((uint32_t *)buffer);
buffer += 4;
regs->regs.edx = *((uint32_t *)buffer);
buffer += 4;
regs->regs.ebx = *((uint32_t *)buffer);
buffer += 4;
regs->regs.esp = *((uint32_t *)buffer);
buffer += 4;
regs->regs.ebp = *((uint32_t *)buffer);
buffer += 4;
regs->regs.esi = *((uint32_t *)buffer);
buffer += 4;
regs->regs.edi = *((uint32_t *)buffer);
buffer += 4;
regs->regs.eip = *((uint32_t *)buffer);
buffer += 4;
regs->regs.eflags = *((uint32_t *)buffer);
buffer += 4;
regs->regs.cs = *((uint32_t *)buffer);
}
/**
* @brief Get size and offset of given register
*
* This routine returns size and offset of given register.
*
* @param reg_id Register identifier
* @param size Container to return size of register, in bytes
* @param offset Container to return offset of register, in bytes
*
* @return N/A
*/
void gdb_arch_reg_info_get(int reg_id, int *size, int *offset)
{
/* Determine register size and offset */
if (reg_id >= 0 && reg_id < GDB_NUM_REGS) {
*size = 4;
*offset = 4 * reg_id;
}
}
#ifdef GDB_ARCH_HAS_RUNCONTROL
#ifdef GDB_ARCH_HAS_HW_BP
/**
* @brief Get the HW breakpoint architecture type for a common GDB type
*
* This routine gets the specific architecture value that corresponds to a
* common hardware breakpoint type.
*
* The values accepted for the @a type are GDB_HW_INST_BP,
* GDB_HW_DATA_WRITE_BP, GDB_HW_DATA_ACCESS_BP and GDB_HW_DATA_READ_BP.
*
* @param type Common GDB breakpoint type
* @param len Data length
* @param err Error code on failure (return value of -1)
*
* @return The architecture type, -1 on failure
*/
static char gdb_hw_bp_type_get(enum gdb_bp_type type, int len,
enum gdb_error_code *err)
{
char hw_type = -1;
switch (type) {
/* Following combinations are supported on IA */
case GDB_HW_INST_BP:
hw_type = 0;
break;
case GDB_HW_DATA_WRITE_BP:
if (len == 1) {
hw_type = 0x1;
} else if (len == 2) {
hw_type = 0x5;
} else if (len == 4) {
hw_type = 0xd;
} else if (len == 8) {
hw_type = 0x9;
}
break;
case GDB_HW_DATA_ACCESS_BP:
if (len == 1) {
hw_type = 0x3;
} else if (len == 2) {
hw_type = 0x7;
} else if (len == 4) {
hw_type = 0xf;
} else if (len == 8) {
hw_type = 0xb;
}
break;
case GDB_HW_DATA_READ_BP:
/* Data read not supported on IA */
/*
* NOTE: Read only watchpoints are not supported by IA debug
* registers, but it could be possible to use RW watchpoints
* and ignore the RW watchpoint if it has been hit by a write
* operation.
*/
*err = GDB_ERROR_HW_BP_NOT_SUP;
return -1;
default:
/* Unknown type */
*err = GDB_ERROR_HW_BP_INVALID_TYPE;
return -1;
}
return hw_type;
}
/**
* @brief Set the debug registers for a specific HW BP.
*
* This routine sets the @a regs debug registers according to the HW breakpoint
* description.
*
* @param regs Debug registers to set
* @param addr Address of the breakpoint
* @param type Common GDB breakpoint type
* @param len Data length
* @param err Error code on failure (return value of -1)
*
* @return 0 if debug registers have been modified, -1 on error
*/
int gdb_hw_bp_set(struct gdb_debug_regs *regs, long addr,
enum gdb_bp_type type,
int len, enum gdb_error_code *err)
{
char hw_type;
hw_type = gdb_hw_bp_type_get(type, len, err);
if (hw_type < 0) {
return -1;
}
if (regs->db0 == 0) {
regs->db0 = addr;
regs->db7 |= (hw_type << 16) | 0x02;
} else if (regs->db1 == 0) {
regs->db1 = addr;
regs->db7 |= (hw_type << 20) | 0x08;
} else if (regs->db2 == 0) {
regs->db2 = addr;
regs->db7 |= (hw_type << 24) | 0x20;
} else if (regs->db3 == 0) {
regs->db3 = addr;
regs->db7 |= (hw_type << 28) | 0x80;
} else {
*err = GDB_ERROR_HW_BP_DBG_REGS_FULL;
return -1;
}
/* set GE bit if it is data breakpoint */
if (hw_type != 0) {
regs->db7 |= 0x200;
}
return 0;
}
/**
* @brief Clear the debug registers for a specific HW BP.
*
* This routine updates the @a regs debug registers to remove a HW breakpoint.
*
* @param regs Debug registers to clear
* @param addr Address of the breakpoint
* @param type Common GDB breakpoint type
* @param len Data length
* @param err Error code on failure (return value of -1)
*
* @return 0 if debug registers have been modified, -1 on error
*/
int gdb_hw_bp_clear(struct gdb_debug_regs *regs, long addr,
enum gdb_bp_type type, int len,
enum gdb_error_code *err)
{
char hw_type;
hw_type = gdb_hw_bp_type_get(type, len, err);
if (hw_type < 0) {
return -1;
}
if ((regs->db0 == addr) && (((regs->db7 >> 16) & 0xf) == hw_type)) {
regs->db0 = 0;
regs->db7 &= ~((hw_type << 16) | 0x02);
} else if ((regs->db1 == addr)
&& (((regs->db7 >> 20) & 0xf) == hw_type)) {
regs->db1 = 0;
regs->db7 &= ~((hw_type << 20) | 0x08);
} else if ((regs->db2 == addr)
&& (((regs->db7 >> 24) & 0xf) == hw_type)) {
regs->db2 = 0;
regs->db7 &= ~((hw_type << 24) | 0x20);
} else if ((regs->db3 == addr)
&& (((regs->db7 >> 28) & 0xf) == hw_type)) {
regs->db3 = 0;
regs->db7 &= ~((hw_type << 28) | 0x80);
} else {
/* Unknown breakpoint */
*err = GDB_ERROR_INVALID_BP;
return -1;
}
return 0;
}
/**
* @brief Look for a Hardware breakpoint
*
* This routine checks from the @a regs debug register set if a hardware
* breakpoint has been hit.
*
* @param regs Debug registers to check
* @param bp_type Common GDB breakpoint type
* @param address Address of the breakpoint
*
* @return 0 if a HW BP has been found, -1 otherwise
*/
static int gdb_hw_bp_find(struct gdb_debug_regs *regs,
enum gdb_bp_type *bp_type,
long *address)
{
int ix;
unsigned char type = 0;
long addr = 0;
int status_bit;
int enable_bit;
/* get address and type of breakpoint from DR6 and DR7 */
for (ix = 0; ix < 4; ix++) {
status_bit = 1 << ix;
enable_bit = 2 << (ix << 1);
if ((regs->db6 & status_bit) && (regs->db7 & enable_bit)) {
switch (ix) {
case 0:
addr = regs->db0;
type = (regs->db7 & 0x000f0000) >> 16;
break;
case 1:
addr = regs->db1;
type = (regs->db7 & 0x00f00000) >> 20;
break;
case 2:
addr = regs->db2;
type = (regs->db7 & 0x0f000000) >> 24;
break;
case 3:
addr = regs->db3;
type = (regs->db7 & 0xf0000000) >> 28;
break;
}
}
}
if ((addr == 0) && (type == 0))
return -1;
*address = addr;
switch (type) {
case 0x1:
case 0x5:
case 0xd:
case 0x9:
*bp_type = GDB_HW_DATA_WRITE_BP;
break;
case 0x3:
case 0x7:
case 0xf:
case 0xb:
*bp_type = GDB_HW_DATA_ACCESS_BP;
break;
default:
*bp_type = GDB_HW_INST_BP;
break;
}
return 0;
}
/**
* @brief Clear all debug registers.
*
* This routine clears all debug registers
*
* @return N/A
*/
void gdb_dbg_regs_clear(void)
{
struct gdb_debug_regs regs;
regs.db0 = 0;
regs.db1 = 0;
regs.db2 = 0;
regs.db3 = 0;
regs.db6 = 0;
regs.db7 = 0;
gdb_dbg_regs_set(&regs);
}
#endif /* GDB_ARCH_HAS_HW_BP */
/**
* @brief Clear trace mode
*
* This routine makes CPU trace-disabled.
*
* @param regs GDB register set to modify.
* @param arg Interrupt locking key
*
* @return N/A
*/
void gdb_trace_mode_clear(struct gdb_reg_set *regs, int arg)
{
regs->regs.eflags &= ~INT_FLAG;
regs->regs.eflags |= (arg & INT_FLAG);
regs->regs.eflags &= ~TRACE_FLAG;
}
/**
* @brief Test if single stepping is possible for current program counter
*
* @param regs GDB register set to fetch PC from.
*
* @return 1 if it is possible to step the instruction, 0 otherwise
*/
int gdb_arch_can_step(struct gdb_reg_set *regs)
{
unsigned char *pc = (unsigned char *)regs->regs.eip;
if (*pc == INSTRUCTION_HLT) {
return 0;
}
return 1;
}
/**
* @brief Set trace mode
*
* This routine makes CPU trace-enabled.
*
* In the event that the program counter currently points to a sti or a cli
* instruction, the returned eflags will contain an IF bit as if that
* instruction had executed (set for sti, cleared for cli).
*
* @param regs GDB register set to modify.
*
* @return eflags with IF bit possibly modified by current sti/cli instruction.
*/
int gdb_trace_mode_set(struct gdb_reg_set *regs)
{
unsigned char *pc = (unsigned char *)regs->regs.eip;
int simulated_eflags = regs->regs.eflags;
if (*pc == INSTRUCTION_STI) {
simulated_eflags |= INT_FLAG;
}
if (*pc == INSTRUCTION_CLI) {
simulated_eflags &= ~INT_FLAG;
}
regs->regs.eflags &= ~INT_FLAG;
regs->regs.eflags |= TRACE_FLAG;
return simulated_eflags;
}
#ifdef GDB_ARCH_HAS_HW_BP
/**
* @brief Implementation of GDB trace handler for HW breakpoint support
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
static void _do_gdb_trace_handler(NANO_ESF *esf)
{
struct gdb_debug_regs regs;
gdb_dbg_regs_get(&regs);
if ((regs.db6 & 0x00004000) == 0x00004000) {
gdb_handler(GDB_EXC_TRACE, esf, GDB_SIG_TRAP);
} else {
int type;
long addr;
gdb_dbg_regs_clear();
(void)gdb_hw_bp_find(&regs, &type, &addr);
gdb_cpu_stop_hw_bp_addr = addr;
gdb_cpu_stop_bp_type = type;
gdb_debug_status = DEBUGGING;
gdb_handler(GDB_EXC_BP, esf, GDB_SIG_TRAP);
}
}
#else
/**
* @brief Implementation of GDB trace handler for SW breakpoint support
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
static void _do_gdb_trace_handler(NANO_ESF *esf)
{
gdb_handler(GDB_EXC_TRACE, esf, GDB_SIG_TRAP);
}
#endif
/**
* @brief GDB trace handler
*
* The GDB trace handler is used to catch and handle the trace mode exceptions
* (single step).
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
void gdb_trace_handler(NANO_ESF *esf)
{
(void)irq_lock();
_do_gdb_trace_handler(esf);
}
/**
* @brief GDB breakpoint handler
*
* The GDB breakpoint handler is used to catch and handle the breakpoint
* exceptions.
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
void gdb_bp_handler(NANO_ESF *esf)
{
(void)irq_lock();
gdb_debug_status = DEBUGGING;
GDB_SET_STOP_BP_TYPE_SOFT(GDB_SOFT_BP);
esf->eip -= sizeof(gdb_instr_t);
gdb_handler(GDB_EXC_BP, esf, GDB_SIG_TRAP);
}
/**
* @brief GDB division-by-zero handler
*
* This GDB handler is used to catch and handle the division-by-zero exception.
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
void gdb_div_by_zero_handler(NANO_ESF *esf)
{
(void)irq_lock();
gdb_debug_status = DEBUGGING;
gdb_handler(GDB_EXC_OTHER, esf, GDB_SIG_FPE);
}
/**
* @brief GDB page fault handler
*
* This GDB handler is used to catch and handle the page fault exceptions.
*
* @param esf Exception stack frame when taking the exception
*
* @return N/A
*/
void gdb_pfault_handler(NANO_ESF *esf)
{
(void)irq_lock();
gdb_debug_status = DEBUGGING;
gdb_handler(GDB_EXC_OTHER, esf, GDB_SIG_SIGSEGV);
}
#endif /* GDB_ARCH_HAS_RUNCONTROL */

View File

@@ -0,0 +1,41 @@
/*
* Copyright (c) 2015-2016 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Hooking of exception handlers.
*/
#define _ASMLANGUAGE
#include <arch/x86/asm.h>
#include <arch/x86/arch.h>
#include <asmPrv.h>
#include <debug/gdb_arch.h>
#ifdef GDB_ARCH_HAS_RUNCONTROL
GTEXT(gdb_bp_handler)
GTEXT(gdb_trace_handler)
GTEXT(gdb_div_by_zero_handler)
GTEXT(gdb_pfault_handler)
NANO_CPU_EXC_CONNECT_NO_ERR(gdb_div_by_zero_handler, IV_DIVIDE_ERROR, 0);
NANO_CPU_EXC_CONNECT_NO_ERR(gdb_trace_handler, IV_DEBUG, 0);
NANO_CPU_EXC_CONNECT_NO_ERR(gdb_bp_handler, IV_BREAKPOINT, 0);
NANO_CPU_EXC_CONNECT(gdb_pfault_handler, IV_PAGE_FAULT, 0);
#endif

View File

@@ -0,0 +1,87 @@
/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
*
* This module provides the implementation of the gdb_dbg_regs_set/get()
* utilities.
*/
#define _ASMLANGUAGE
#include <arch/x86/asm.h>
/* exports (internal APIs) */
GTEXT(gdb_dbg_regs_set)
GTEXT(gdb_dbg_regs_get)
/**
* @brief Write debug registers
*
* This function is used to write to debug registers
*
* C function prototype:
*
* void gdb_dbg_regs_set (struct gdb_debug_regs * regs);
*
* @return N/A
*/
SECTION_FUNC(TEXT, gdb_dbg_regs_set)
movl SP_ARG1(%esp),%edx
movl 0(%edx),%eax
movl %eax,%db0
movl 4(%edx),%eax
movl %eax,%db1
movl 8(%edx),%eax
movl %eax,%db2
movl 12(%edx),%eax
movl %eax,%db3
movl 16(%edx),%eax
movl %eax,%db6
movl 20(%edx),%eax
movl %eax,%db7
ret
/**
* @brief Read debug registers
*
* This function is used to read debug registers
*
* C function prototype:
*
* void gdb_dbg_regs_get (struct gdb_debug_regs * regs);
*
* @return N/A
*/
SECTION_FUNC(TEXT, gdb_dbg_regs_get)
movl SP_ARG1(%esp),%edx
movl %db0,%eax
movl %eax,0(%edx)
movl %db1,%eax
movl %eax,4(%edx)
movl %db2,%eax
movl %eax,8(%edx)
movl %db3,%eax
movl %eax,12(%edx)
movl %db6,%eax
movl %eax,16(%edx)
movl %db7,%eax
movl %eax,20(%edx)
ret

View File

@@ -0,0 +1,122 @@
/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _GDB_ARCH__H_
#define _GDB_ARCH__H_
#ifdef __cplusplus
extern "C" {
#endif
#include <nano_private.h>
#include <misc/debug/gdb_server.h>
#define GDB_ARCH_HAS_ALL_REGS
#ifndef CONFIG_GDB_SERVER_BOOTLOADER
#undef GDB_ARCH_HAS_HW_BP
#define GDB_ARCH_HAS_REMOTE_SERIAL_EXT_USING_NOTIF_PACKETS
#define GDB_ARCH_HAS_RUNCONTROL
#define GDB_ARCH_CAN_STEP gdb_arch_can_step
#endif
#ifndef CONFIG_GDB_RAM_SIZE
#define CONFIG_GDB_RAM_SIZE (CONFIG_RAM_SIZE * 1024)
#endif
#ifndef CONFIG_GDB_RAM_ADDRESS
#define CONFIG_GDB_RAM_ADDRESS 0x100000
#endif
/* Default GDB buffer size */
#ifdef CONFIG_GDB_SERVER_BOOTLOADER
#define GDB_BUF_SIZE 8192
#else
#define GDB_BUF_SIZE 600
#endif
#define GDB_TGT_ARCH "i386"
#define GDB_NUM_REGS 16
#define GDB_NUM_REG_BYTES (GDB_NUM_REGS * 4)
#define GDB_PC_REG 8
#define GDB_BREAK_INSTRUCTION 0xcc /* 'int3' opcode */
#ifndef _ASMLANGUAGE
typedef unsigned char gdb_instr_t;
struct gdb_reg_set {
NANO_ISF regs;
unsigned int pad1; /* padding for ss register */
unsigned int pad2; /* padding for ds register */
unsigned int pad3; /* padding for es register */
unsigned int pad4; /* padding for fs register */
unsigned int pad5; /* padding for gs register */
};
struct gdb_debug_regs {
unsigned int db0; /* debug register 0 */
unsigned int db1; /* debug register 1 */
unsigned int db2; /* debug register 2 */
unsigned int db3; /* debug register 3 */
unsigned int db6; /* debug register 6 */
unsigned int db7; /* debug register 7 */
};
#if defined(GDB_ARCH_HAS_RUNCONTROL) && defined(GDB_ARCH_HAS_HW_BP)
extern volatile int gdb_cpu_stop_bp_type;
extern long gdb_cpu_stop_hw_bp_addr;
#define GDB_SET_STOP_BP_TYPE_SOFT(x) \
do { gdb_cpu_stop_bp_type = (x); } while ((0))
#else
#define GDB_SET_STOP_BP_TYPE_SOFT(x)
#endif
extern void gdb_arch_init(void);
extern void gdb_arch_regs_from_esf(struct gdb_reg_set *regs,
NANO_ESF *esf);
extern void gdb_arch_regs_to_esf(struct gdb_reg_set *regs,
NANO_ESF *esf);
extern void gdb_arch_regs_from_isf(struct gdb_reg_set *regs,
NANO_ISF *esf);
extern void gdb_arch_regs_to_isf(struct gdb_reg_set *regs,
NANO_ISF *esf);
extern void gdb_arch_regs_get(struct gdb_reg_set *regs, char *buffer);
extern void gdb_arch_regs_set(struct gdb_reg_set *regs, char *buffer);
extern void gdb_arch_reg_info_get(int reg_id, int *size, int *offset);
extern void gdb_trace_mode_clear(struct gdb_reg_set *regs, int arg);
extern int gdb_trace_mode_set(struct gdb_reg_set *regs);
extern int gdb_arch_can_step(struct gdb_reg_set *regs);
#ifdef GDB_ARCH_HAS_HW_BP
extern int gdb_hw_bp_set(struct gdb_debug_regs *regs, long addr,
enum gdb_bp_type type, int length,
enum gdb_error_code *err);
extern int gdb_hw_bp_clear(struct gdb_debug_regs *regs, long addr,
enum gdb_bp_type type, int length,
enum gdb_error_code *err);
extern void gdb_dbg_regs_set(struct gdb_debug_regs *regs);
extern void gdb_dbg_regs_get(struct gdb_debug_regs *regs);
extern void gdb_dbg_regs_clear(void);
#endif
#endif /* _ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* _GDB_ARCH__H_ */

View File

@@ -710,6 +710,10 @@ typedef struct s_NANO {
unsigned nested; /* nested interrupt count */
char *common_isp; /* interrupt stack pointer base */
#if defined(CONFIG_DEBUG_INFO)
NANO_ISF *isf; /* ptr to interrupt stack frame */
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
int32_t idle; /* Number of ticks for kernel idling */
#endif

View File

@@ -94,4 +94,7 @@ config UART_PIPE_ON_DEV_NAME
endif
config BLUETOOTH_MONITOR_ON_DEV_NAME
default "UART_1" if BLUETOOTH_DEBUG_MONITOR
endif

View File

@@ -87,6 +87,13 @@ config BLUETOOTH_UART_ON_DEV_NAME
endif
if NBLE
config NBLE_UART_ON_DEV_NAME
default "UART_1"
endif
if UART_PIPE
config UART_PIPE_ON_DEV_NAME
@@ -94,4 +101,7 @@ config UART_PIPE_ON_DEV_NAME
endif
config BLUETOOTH_MONITOR_ON_DEV_NAME
default "UART_1" if BLUETOOTH_DEBUG_MONITOR
endif

View File

@@ -1,6 +1,10 @@
ifeq ($(CONFIG_X86_IAMCU),y)
LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__ -D__IAMCU
OUTPUT_FORMAT = elf32-iamcu
OUTPUT_ARCH = iamcu:intel
KBUILD_CFLAGS += $(call cc-option,-msoft-float)
endif
KBUILD_CFLAGS += $(call cc-option,-march=pentium)
KBUILD_CXXFLAGS += $(call cc-option,-march=pentium)
KBUILD_AFLAGS += $(KBUILD_CFLAGS)

View File

@@ -52,60 +52,19 @@ config PHYS_RAM_ADDR
config TOOLCHAIN_VARIANT
default "iamcu"
if UART_NS16550
config UART_NS16550_DLF
config QMSI
def_bool y
config UART_NS16550_PORT_0
config QMSI_BUILTIN
def_bool y
if UART_NS16550_PORT_0
config UART_NS16550_PORT_0_NAME
default "UART_0"
config UART_NS16550_PORT_0_IRQ_PRI
default 3
config UART_NS16550_PORT_0_BAUD_RATE
default 115200
config UART_NS16550_PORT_0_OPTIONS
default 0
config UART_NS16550_PORT_0_DLF
default 0x06
endif # UART_NS16550_PORT_0
config UART_NS16550_PORT_1
def_bool y
if UART_NS16550_PORT_1
config UART_NS16550_PORT_1_NAME
default "UART_1"
config UART_NS16550_PORT_1_IRQ_PRI
default 3
config UART_NS16550_PORT_1_BAUD_RATE
default 115200
config UART_NS16550_PORT_1_OPTIONS
default 0
config UART_NS16550_PORT_1_DLF
default 0x06
endif # UART_NS16550_PORT_1
endif # UART_NS16550
if UART_QMSI
config UART_QMSI_0
def_bool y
config UART_QMSI_0_IRQ
default 8
config UART_QMSI_0_IRQ_PRI
default 0
config UART_QMSI_1
def_bool y
config UART_QMSI_1_IRQ
default 6
config UART_QMSI_1_IRQ_PRI
default 0
endif # UART_QMSI
@@ -124,72 +83,49 @@ config UART_PIPE_ON_DEV_NAME
endif
config BLUETOOTH_MONITOR_ON_DEV_NAME
default "UART_1" if BLUETOOTH_DEBUG_MONITOR
if WATCHDOG
config WDT_DW
config WDT_QMSI
def_bool y
if WDT_DW
config WDT_DW_IRQ_PRI
default 0
endif # WDT_DW
if WDT_QMSI
config WDT_QMSI_IRQ
default 16
config WDT_QMSI_IRQ_PRI
default 0
endif # WDT_QMSI
endif # WATCHDOG
if RTC
config RTC_QMSI
def_bool y
if RTC_QMSI
config RTC_QMSI_IRQ
default 2
config RTC_QMSI_IRQ_PRI
default 0
endif # RTC_QMSI
config RTC_DW
def_bool y
config RTC_DW_IRQ_PRI
default 0 if RTC_DW
endif # RTC
if I2C
config I2C_DW
if GPIO
config GPIO_QMSI
def_bool y
config GPIO_QMSI_0
def_bool y
config GPIO_QMSI_0_PRI
default 0
endif # GPIO
if I2C_DW
config I2C_DW_0
if PWM
config PWM_QMSI
def_bool y
endif
if I2C_DW_0
config I2C_DW_0_NAME
default "I2C0"
config I2C_DW_0_IRQ_PRI
default 0
config I2C_DW_0_DEFAULT_CFG
default 0x12
config I2C_CLOCK_SPEED
default 32
endif # I2C_DW_0
endif # I2C_DW
if I2C
config I2C_QMSI
def_bool y
if I2C_QMSI
config I2C_QMSI_0
def_bool y
config I2C_QMSI_0_IRQ
default 4
config I2C_QMSI_0_IRQ_PRI
default 0
config I2C_QMSI_0_DEFAULT_CFG
@@ -197,29 +133,38 @@ config I2C_QMSI_0_DEFAULT_CFG
endif # I2C_QMSI
endif # I2C
if GPIO_QMSI
config GPIO_QMSI_0
def_bool y
config GPIO_QMSI_0_IRQ
default 15
config GPIO_QMSI_0_PRI
default 0
endif # GPIO_QMSI
if SPI_QMSI
config SPI_QMSI_PORT_0
if AIO_COMPARATOR
config AIO_QMSI_COMPARATOR
def_bool y
config SPI_QMSI_PORT_0_IRQ
default 7
config SPI_QMSI_PORT_0_PRI
default 0
endif # SPI_QMSI
endif
if AON_TIMER_QMSI
config AON_TIMER_IRQ
default 3
if COUNTER
config AON_COUNTER_QMSI
def_bool y
config AON_TIMER_QMSI
def_bool y
config AON_TIMER_IRQ_PRI
default 0
endif # AON_TIMER_QMSI
endif
if ADC
config ADC_QMSI
def_bool y
endif
if SPI
config SPI_QMSI
def_bool y
config SPI_QMSI_PORT_0
def_bool y
config SPI_QMSI_PORT_0_PRI
default 0
endif # SPI
if SOC_FLASH_QMSI
config SOC_FLASH_QMSI_SYS_SIZE
default 0x8000
endif # SOC_FLASH_QMSI
endif # SOC_QUARK_D2000

View File

@@ -1,7 +1,14 @@
ifeq ($(COMPILER),clang)
arch-cflags = $(call cc-option,-msoft-float, -march=pentium)
else
arch-cflags = $(call cc-option,-march=lakemont -mtune=lakemont -msoft-float, -march=pentium)
endif
ifeq ($(CONFIG_X86_IAMCU),y)
arch-cflags += $(call cc-option,-miamcu)
LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__ -D__IAMCU
OUTPUT_FORMAT = elf32-iamcu
OUTPUT_ARCH = iamcu:intel
else
arch-cflags += $(call cc-option,-mno-iamcu)
endif

View File

@@ -23,47 +23,10 @@
*/
#include <nanokernel.h>
#include <arch/cpu.h>
#include <misc/printk.h>
#include <misc/__assert.h>
#include "soc.h"
#include <drivers/mvic.h>
#include <init.h>
/**
*
* _InitHardware - perform basic hardware initialization
*
* Initialize the Quark D2000 Interrupt Controller (MVIC) device driver and the
* Intel 8250 UART device driver.
* Also initialize the timer device driver, if required.
*
* RETURNS: N/A
*/
static int quark_d2000_init(struct device *arg)
{
ARG_UNUSED(arg);
#ifdef CONFIG_UART_NS16550
/* enable clock gating */
#ifdef CONFIG_UART_NS16550_PORT_0
sys_set_bit(CLOCK_PERIPHERAL_BASE_ADDR, 17);
#endif
#ifdef CONFIG_UART_NS16550_PORT_1
sys_set_bit(CLOCK_PERIPHERAL_BASE_ADDR, 18);
#endif
sys_set_bit(CLOCK_PERIPHERAL_BASE_ADDR, 1);
#endif /* CONFIG_UART_NS16550 */
#ifdef CONFIG_I2C_DW_0
/* Unmask interrupt */
sys_clear_bit(I2C_MST_0_INT_MASK, 0);
#endif
return 0;
}
SYS_INIT(quark_d2000_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#ifdef CONFIG_MVIC
SYS_INIT(_mvic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_IOAPIC */

View File

@@ -41,139 +41,20 @@
#define CLOCK_SENSOR_BASE_ADDR (SCSS_REGISTER_BASE + 0x28)
#define CLOCK_SYSTEM_CLOCK_CONTROL (SCSS_REGISTER_BASE + 0x38)
struct scss_peripheral {
volatile uint32_t usb_phy_cfg0; /**< USB Configuration */
volatile uint32_t periph_cfg0; /**< Peripheral Configuration */
volatile uint32_t reserved[2];
volatile uint32_t cfg_lock; /**< Configuration Lock */
};
struct int_ss_i2c {
volatile uint32_t err_mask;
volatile uint32_t rx_avail_mask;
volatile uint32_t tx_req_mask;
volatile uint32_t stop_det_mask;
};
struct int_ss_spi {
volatile uint32_t err_int_mask;
volatile uint32_t rx_avail_mask;
volatile uint32_t tx_req_mask;
};
struct scss_interrupt {
volatile uint32_t int_ss_adc_err_mask;
volatile uint32_t int_ss_adc_irq_mask;
volatile uint32_t int_ss_gpio_intr_mask[2];
struct int_ss_i2c int_ss_i2c[2];
struct int_ss_spi int_ss_spi[2];
volatile uint32_t int_i2c_mst_mask[2];
volatile uint32_t reserved;
volatile uint32_t int_spi_mst_mask[2];
volatile uint32_t int_spi_slv_mask[1];
volatile uint32_t int_uart_mask[2];
volatile uint32_t int_i2s_mask;
volatile uint32_t int_gpio_mask;
volatile uint32_t int_pwm_timer_mask;
volatile uint32_t int_usb_mask;
volatile uint32_t int_rtc_mask;
volatile uint32_t int_watchdog_mask;
volatile uint32_t int_dma_channel_mask[8];
volatile uint32_t int_mailbox_mask;
volatile uint32_t int_comparators_ss_halt_mask;
volatile uint32_t int_comparators_host_halt_mask;
volatile uint32_t int_comparators_ss_mask;
volatile uint32_t int_comparators_host_mask;
volatile uint32_t int_host_bus_err_mask;
volatile uint32_t int_dma_error_mask;
volatile uint32_t int_sram_controller_mask;
volatile uint32_t int_flash_controller_mask[2];
volatile uint32_t int_aon_timer_mask;
volatile uint32_t int_adc_pwr_mask;
volatile uint32_t int_adc_calib_mask;
volatile uint32_t int_aon_gpio_mask;
volatile uint32_t lock_int_mask_reg;
};
#define SCSS_PERIPHERAL_BASE (0xB0800800)
#define SCSS_PERIPHERAL ((struct scss_peripheral *)SCSS_PERIPHERAL_BASE)
#define SCSS_INT_BASE (0xB0800400)
#define SCSS_INTERRUPT ((struct scss_interrupt *)SCSS_INT_BASE)
/* Peripheral Clock Gate Control */
#define SCSS_CCU_PERIPH_CLK_GATE_CTL 0x18
#define CCU_PERIPH_CLK_EN (1 << 1)
#define CCU_PERIPH_CLK_DIV_CTL0 0x1C
#define INT_UNMASK_IA (~0x00000001)
/*
* Local APIC (LOAPIC) device information (Intel loapic)
*/
#define LOAPIC_IRQ_BASE CONFIG_LOAPIC_TIMER_IRQ
#define LOAPIC_IRQ_COUNT 1
#define LOAPIC_LVT_REG_SPACING 0x10
/* Watchdog */
#define WDT_DW_INT_MASK (SCSS_INT_BASE + 0x7C)
#define SCSS_PERIPH_CFG0 0x4
/* RTC */
#define RTC_DW_INT_MASK (SCSS_INT_BASE + 0x78)
#define CCU_RTC_CLK_DIV_OFFSET 0x3
/*
* I2C
*/
#define I2C_MST_0_INT_MASK (SCSS_INT_BASE + 0x48)
#define I2C_DW_0_BASE_ADDR 0xB0002800
#define I2C_DW_0_IRQ 4
#if defined(CONFIG_MVIC)
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#endif
/* Comparator */
#define INT_AIO_CMP_IRQ (0x0E)
#define LOAPIC_LVT_REG_SPACING 0x10
/*
* PINMUX configuration settings
*/
#if defined(CONFIG_PINMUX)
#define PINMUX_BASE_ADDR 0xb0800900
#define PINMUX_NUM_PINS 25
#endif /* CONFIG_PINMUX */
/*
* RTC (Real Time Clock)
*/
#define RTC_DW_BASE_ADDR 0xB0000400
#define RTC_DW_IRQ 2
/*
* UART
*/
#define UART_NS16550_PORT_0_BASE_ADDR 0xB0002000
#define UART_NS16550_PORT_0_IRQ 8
#define UART_NS16550_PORT_0_CLK_FREQ MHZ(32)
#define UART_NS16550_PORT_1_BASE_ADDR 0xB0002400
#define UART_NS16550_PORT_1_IRQ 6
#define UART_NS16550_PORT_1_CLK_FREQ MHZ(32)
#ifdef CONFIG_MVIC
#include <drivers/ioapic.h>
#define UART_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#endif /* CONFIG_MVIC */
/*
* WDT/Watchdog
*/
#define WDT_DW_BASE_ADDR 0xB0000000
#define WDT_DW_IRQ 16
#endif /* __SOC_H_ */

View File

@@ -25,6 +25,13 @@ config EOI_FORWARDING_BUG
Quark SE LOAPIC has issues with forwarding EOI to the IOAPIC for level
triggered interrupts, this is a SW workaround.
config SS_RESET_VECTOR
hex "Sensor Subsystem Reset Vector"
default 0x40000000
help
Sensor subsystem reset vector. This value is needed to init the ARC
system on the SoC.
config ARC_INIT
bool "Quark SE ARC Kickoff"
default n

View File

@@ -45,139 +45,42 @@ config LOAPIC_TIMER_IRQ
config TOOLCHAIN_VARIANT
default "iamcu"
config QMSI
def_bool y
config QMSI_BUILTIN
def_bool y
if PWM
config PWM_QMSI
def_bool y
endif
if GPIO
config GPIO_DW
def_bool y
if GPIO_DW
config GPIO_DW_BOTHEDGES_SUPPORT
def_bool y
config GPIO_DW_CLOCK_GATE
def_bool n
if GPIO_DW_CLOCK_GATE
config GPIO_DW_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_PERIPHERAL_DRV_NAME
endif # GPIO_DW_CLOCK_GATE
config GPIO_DW_0
def_bool y
if GPIO_DW_0
config GPIO_DW_0_BASE_ADDR
default 0xb0000C00
config GPIO_DW_0_IRQ
default 8
config GPIO_DW_0_PRI
default 2
config GPIO_DW_0_BITS
default 32
config GPIO_DW_0_CLOCK_GATE_SUBSYS
default 13
depends on GPIO_DW_CLOCK_GATE
endif # GPIO_DW_0
config GPIO_DW_1
def_bool y
if GPIO_DW_1
config GPIO_DW_1_BASE_ADDR
default 0xb0800b00
config GPIO_DW_1_IRQ
default 31
config GPIO_DW_1_PRI
default 2
config GPIO_DW_1_BITS
default 6
endif # GPIO_DW_1
endif # GPIO_DW
if QMSI_DRIVERS
config GPIO_QMSI
def_bool n
if GPIO_QMSI
def_bool y
config GPIO_QMSI_0
def_bool n
def_bool y
if GPIO_QMSI_0
config GPIO_QMSI_0_IRQ
default 8
config GPIO_QMSI_0_PRI
default 2
endif # GPIO_QMSI_0
config GPIO_QMSI_AON
def_bool n
config GPIO_QMSI_AON_NAME
default "gpio_aon"
config GPIO_QMSI_AON_IRQ
default 31
def_bool y
config GPIO_QMSI_AON_PRI
default 2
endif # GPIO_QMSI
endif # QMSI_DRIVERS
endif # GPIO
if I2C
config I2C_DW
config I2C_QMSI
def_bool y
if I2C_DW
config I2C_DW_0
def_bool y
if I2C_DW_0
config I2C_DW_0_NAME
default "I2C0"
config I2C_DW_0_IRQ_PRI
default 2
endif # I2C_DW_0
config I2C_DW_1
def_bool y
if I2C_DW_1
config I2C_DW_1_NAME
default "I2C1"
config I2C_DW_1_IRQ_PRI
default 2
endif # I2C_DW_1
endif # I2C_DW
if I2C_QMSI
config I2C_QMSI_0
def_bool y
if I2C_QMSI_0
config I2C_QMSI_0_IRQ
default 0
config I2C_QMSI_0_IRQ_PRI
default 2
config I2C_QMSI_0_DEFAULT_CFG
@@ -189,9 +92,6 @@ config I2C_QMSI_1
def_bool y
if I2C_QMSI_1
config I2C_QMSI_1_IRQ
default 1
config I2C_QMSI_1_IRQ_PRI
default 2
config I2C_QMSI_1_DEFAULT_CFG
@@ -199,10 +99,9 @@ config I2C_QMSI_1_DEFAULT_CFG
endif # I2C_QMSI_1
endif # I2C_QMSI
endif # I2C
if CLOCK_CONTROL
config CLOCK_CONTROL_QUARK_SE
@@ -229,184 +128,69 @@ endif # CLOCK_CONTROL_QUARK_SE
endif # CLOCK_CONTROL
if COUNTER
config AON_COUNTER_QMSI
def_bool y
config AON_TIMER_QMSI
def_bool y
config AON_TIMER_IRQ_PRI
default 2
endif
if SPI
config SPI_DW
def_bool y
if SPI_DW
config SPI_DW_CLOCK_GATE
def_bool n
if SPI_DW_CLOCK_GATE
config SPI_DW_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_PERIPHERAL_DRV_NAME
endif # SPI_DW_CLOCK_GATE
config SPI_DW_PORT_0
def_bool y
if SPI_DW_PORT_0
config SPI_DW_PORT_0_CLOCK_GATE_SUBSYS
default 14
depends on SPI_DW_CLOCK_GATE
config SPI_DW_PORT_0_REGS
default 0xb0001000
config SPI_DW_PORT_0_IRQ
default 2
config SPI_DW_PORT_0_PRI
default 2
endif # SPI_DW_PORT_0
config SPI_DW_PORT_1
def_bool y
if SPI_DW_PORT_1
config SPI_DW_PORT_1_CLOCK_GATE_SUBSYS
default 15
depends on SPI_DW_CLOCK_GATE
config SPI_DW_PORT_1_REGS
default 0xb0001400
config SPI_DW_PORT_1_IRQ
default 3
config SPI_DW_PORT_1_PRI
default 2
endif # SPI_DW_PORT_1
endif # SPI_DW
config SPI_QMSI
def_bool n
if SPI_QMSI
def_bool y
config SPI_QMSI_PORT_0
def_bool y
if SPI_QMSI_PORT_0
config SPI_QMSI_PORT_0_IRQ
default 2
config SPI_QMSI_PORT_0_PRI
default 2
endif # SPI_QMSI_PORT_0
config SPI_QMSI_PORT_1
def_bool y
if SPI_QMSI_PORT_1
config SPI_QMSI_PORT_1_IRQ
default 3
config SPI_QMSI_PORT_1_PRI
default 2
endif # SPI_QMSI_PORT_1
endif # SPI_QMSI
endif # SPI
if ADC
config ADC_QMSI
def_bool y
endif
if AIO_COMPARATOR
config AIO_QMSI_COMPARATOR
def_bool y
endif
if WATCHDOG
config WDT_DW
config WDT_QMSI
def_bool y
if WDT_DW
config WDT_DW_CLOCK_GATE
def_bool n
config WDT_DW_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_PERIPHERAL_DRV_NAME
config WDT_DW_CLOCK_GATE_SUBSYS
default 10
config WDT_DW_IRQ_PRI
default 2
endif # WDT_DW
if WDT_QMSI
config WDT_QMSI_IRQ
default 12
config WDT_QMSI_IRQ_PRI
default 2
endif # WDT_QMSI
endif # WATCHDOG
if RTC
if RTC_QMSI
config RTC_QMSI_IRQ
default 11
config RTC_QMSI
def_bool y
config RTC_QMSI_IRQ_PRI
default 2
endif # RTC_QMSI
config RTC_DW
def_bool y
if RTC_DW
config RTC_DW_CLOCK_GATE
def_bool y
config RTC_DW_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_PERIPHERAL_DRV_NAME
config RTC_DW_CLOCK_GATE_SUBSYS
default 11
config RTC_DW_IRQ_PRI
default 2
endif # RTC_DW
endif # RTC
if UART_NS16550
config UART_NS16550_PORT_0
def_bool y
if UART_NS16550_PORT_0
config UART_NS16550_PORT_0_NAME
default "UART_0"
config UART_NS16550_PORT_0_IRQ_PRI
default 3
config UART_NS16550_PORT_0_BAUD_RATE
default 115200
config UART_NS16550_PORT_0_OPTIONS
default 0
endif # UART_NS16550_PORT_0
config UART_NS16550_PORT_1
def_bool y
if UART_NS16550_PORT_1
config UART_NS16550_PORT_1_NAME
default "UART_1"
config UART_NS16550_PORT_1_IRQ_PRI
default 3
config UART_NS16550_PORT_1_BAUD_RATE
default 115200
config UART_NS16550_PORT_1_OPTIONS
default 0
endif # UART_NS16550_PORT_1
endif # UART_NS16550
if UART_QMSI
config UART_QMSI_0
def_bool y
if UART_QMSI_0
config UART_QMSI_0_IRQ
default 5
config UART_QMSI_0_IRQ_PRI
default 3
@@ -417,8 +201,6 @@ config UART_QMSI_1
if UART_QMSI_1
config UART_QMSI_1_IRQ
default 6
config UART_QMSI_1_IRQ_PRI
default 3
@@ -433,20 +215,9 @@ config UART_CONSOLE_ON_DEV_NAME
endif
if BLUETOOTH_UART
config BLUETOOTH_UART_ON_DEV_NAME
default "UART_1"
endif
if AON_TIMER_QMSI
config AON_TIMER_IRQ
default 28
config AON_TIMER_IRQ_PRI
default 2
endif # AON_TIMER_QMSI
if SOC_FLASH_QMSI
config SOC_FLASH_QMSI_SYS_SIZE
default 0x60000
endif # SOC_FLASH_QMSI
endif # SOC_QUARK_SE

View File

@@ -1,7 +1,14 @@
ifeq ($(COMPILER),clang)
arch-cflags = $(call cc-option,-msoft-float, -march=pentium)
else
arch-cflags = $(call cc-option,-march=lakemont -mtune=lakemont -msoft-float, -march=pentium)
endif
ifeq ($(CONFIG_X86_IAMCU),y)
arch-cflags += $(call cc-option,-miamcu)
LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__ -D__IAMCU
OUTPUT_FORMAT = elf32-iamcu
OUTPUT_ARCH = iamcu:intel
else
arch-cflags += $(call cc-option,-mno-iamcu)
endif

View File

@@ -100,25 +100,3 @@ SYS_INIT(arc_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /*CONFIG_ARC_INIT*/
#ifdef CONFIG_UART_NS16550
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static int platform_uart_init(struct device *arg)
{
ARG_UNUSED(arg);
#ifdef CONFIG_UART_NS16550_PORT_0
SCSS_INTERRUPT->int_uart_mask[0] &= INT_UNMASK_IA;
#endif
#ifdef CONFIG_UART_NS16550_PORT_1
SCSS_INTERRUPT->int_uart_mask[1] &= INT_UNMASK_IA;
#endif
return 0;
}
SYS_INIT(platform_uart_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#endif /* CONFIG_UART_NS16550 */

View File

@@ -32,138 +32,22 @@
#endif
#define INT_VEC_IRQ0 0x20 /* Vector number for IRQ0 */
#define HPET_TIMER0_IRQ INT_VEC_IRQ0
#ifndef _ASMLANGUAGE
/* Core system registers */
struct scss_ccu {
volatile uint32_t osc0_cfg0; /**< Hybrid Oscillator Configuration 0 */
volatile uint32_t osc0_stat1; /**< Hybrid Oscillator status 1 */
volatile uint32_t osc0_cfg1; /**< Hybrid Oscillator configuration 1 */
volatile uint32_t osc1_stat0; /**< RTC Oscillator status 0 */
volatile uint32_t osc1_cfg0; /**< RTC Oscillator Configuration 0 */
volatile uint32_t usb_pll_cfg0; /**< USB Phase lock look configuration */
volatile uint32_t
ccu_periph_clk_gate_ctl; /**< Peripheral Clock Gate Control */
volatile uint32_t
ccu_periph_clk_div_ctl0; /**< Peripheral Clock Divider Control 0 */
volatile uint32_t
ccu_gpio_db_clk_ctl; /**< Peripheral Clock Divider Control 1 */
volatile uint32_t ccu_ext_clock_ctl; /**< External Clock Control Register */
volatile uint32_t ccu_ss_periph_clk_gate_ctl; /**< Sensor subsustem
peripheral clock gate
control */
volatile uint32_t ccu_lp_clk_ctl; /**< System Low Power Clock Control */
volatile uint32_t reserved;
volatile uint32_t ccu_mlayer_ahb_ctl; /**< AHB Control Register */
volatile uint32_t ccu_sys_clk_ctl; /**< System Clock Control Register */
volatile uint32_t osc_lock_0; /**< Clocks Lock Register */
};
struct scss_peripheral {
volatile uint32_t usb_phy_cfg0; /**< USB Configuration */
volatile uint32_t periph_cfg0; /**< Peripheral Configuration */
volatile uint32_t reserved[2];
volatile uint32_t cfg_lock; /**< Configuration Lock */
};
struct int_ss_i2c {
volatile uint32_t err_mask;
volatile uint32_t rx_avail_mask;
volatile uint32_t tx_req_mask;
volatile uint32_t stop_det_mask;
};
struct int_ss_spi {
volatile uint32_t err_int_mask;
volatile uint32_t rx_avail_mask;
volatile uint32_t tx_req_mask;
};
struct scss_interrupt {
volatile uint32_t int_ss_adc_err_mask;
volatile uint32_t int_ss_adc_irq_mask;
volatile uint32_t int_ss_gpio_intr_mask[2];
struct int_ss_i2c int_ss_i2c[2];
struct int_ss_spi int_ss_spi[2];
volatile uint32_t int_i2c_mst_mask[2];
volatile uint32_t reserved;
volatile uint32_t int_spi_mst_mask[2];
volatile uint32_t int_spi_slv_mask[1];
volatile uint32_t int_uart_mask[2];
volatile uint32_t int_i2s_mask;
volatile uint32_t int_gpio_mask;
volatile uint32_t int_pwm_timer_mask;
volatile uint32_t int_usb_mask;
volatile uint32_t int_rtc_mask;
volatile uint32_t int_watchdog_mask;
volatile uint32_t int_dma_channel_mask[8];
volatile uint32_t int_mailbox_mask;
volatile uint32_t int_comparators_ss_halt_mask;
volatile uint32_t int_comparators_host_halt_mask;
volatile uint32_t int_comparators_ss_mask;
volatile uint32_t int_comparators_host_mask;
volatile uint32_t int_host_bus_err_mask;
volatile uint32_t int_dma_error_mask;
volatile uint32_t int_sram_controller_mask;
volatile uint32_t int_flash_controller_mask[2];
volatile uint32_t int_aon_timer_mask;
volatile uint32_t int_adc_pwr_mask;
volatile uint32_t int_adc_calib_mask;
volatile uint32_t int_aon_gpio_mask;
volatile uint32_t lock_int_mask_reg;
};
#define SCSS_PERIPHERAL_BASE (0xB0800800)
#define SCSS_PERIPHERAL ((struct scss_peripheral *)SCSS_PERIPHERAL_BASE)
#define SCSS_INT_BASE (0xB0800400)
#define SCSS_INTERRUPT ((struct scss_interrupt *)SCSS_INT_BASE)
/* Base Register */
#define SCSS_REGISTER_BASE 0xB0800000
#define SCSS_CCU ((struct scss_ccu *)SCSS_REGISTER_BASE)
#define SCSS_CCU_SYS_CLK_CTL 0x38
/* Peripheral Clock Gate Control */
#define SCSS_CCU_PERIPH_CLK_GATE_CTL 0x18
#define CCU_PERIPH_CLK_EN (1 << 1)
#define CCU_PERIPH_CLK_DIV_CTL0 0x1C
#define INT_UNMASK_IA (~0x00000001)
/* PWM */
#define CCU_PWM_PCLK_EN_SW (1 << 12)
/* Watchdog */
#define WDT_DW_INT_MASK (SCSS_INT_BASE + 0x7C)
#define SCSS_PERIPH_CFG0 (0x4)
/* RTC */
#define RTC_DW_INT_MASK (SCSS_INT_BASE + 0x78)
#define CCU_RTC_CLK_DIV_OFFSET (3)
/* Clock */
#define CLOCK_PERIPHERAL_BASE_ADDR (SCSS_REGISTER_BASE + 0x18)
#define CLOCK_EXTERNAL_BASE_ADDR (SCSS_REGISTER_BASE + 0x24)
#define CLOCK_SENSOR_BASE_ADDR (SCSS_REGISTER_BASE + 0x28)
#define CLOCK_SYSTEM_CLOCK_CONTROL (SCSS_REGISTER_BASE + SCSS_CCU_SYS_CLK_CTL)
/* SPI */
#define SPI_DW_PORT_0_INT_MASK (SCSS_INT_BASE + 0x54)
#define SPI_DW_PORT_1_INT_MASK (SCSS_INT_BASE + 0x58)
/* GPIO */
#define GPIO_DW_PORT_0_INT_MASK (SCSS_INT_BASE + 0x6C)
#define GPIO_DW_PORT_1_INT_MASK (SCSS_INT_BASE + 0xD4)
/* Comparator */
#define INT_AIO_CMP_IRQ (0x16)
/*ARC INIT*/
#define RESET_VECTOR 0x40000000
/* ARC INIT */
#define RESET_VECTOR CONFIG_SS_RESET_VECTOR
#define SCSS_SS_CFG 0x0600
#define SCSS_SS_STS 0x0604
#define ARC_HALT_INT_REDIR (1 << 26)
@@ -175,64 +59,8 @@ struct scss_interrupt {
/*
* PINMUX configuration settings
*/
#if defined(CONFIG_PINMUX)
#define PINMUX_BASE_ADDR 0xb0800900
#endif
/*
* UART
*/
#define UART_NS16550_PORT_0_BASE_ADDR 0xB0002000
#define UART_NS16550_PORT_0_IRQ 5
#define UART_NS16550_PORT_0_CLK_FREQ MHZ(32)
#define UART_NS16550_PORT_1_BASE_ADDR 0xB0002400
#define UART_NS16550_PORT_1_IRQ 6
#define UART_NS16550_PORT_1_CLK_FREQ MHZ(32)
#ifdef CONFIG_IOAPIC
#include <drivers/ioapic.h>
#define UART_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#endif /* CONFIG_IOAPIC */
/*
* AIO/Comparator
*/
#define AIO_DW_COMPARATOR_BASE_ADDR 0xb0800300
/*
* I2C
*/
#define I2C_DW_0_BASE_ADDR 0xb0002800
#define I2C_DW_0_IRQ 0
#define I2C_DW_1_BASE_ADDR 0xb0002c00
#define I2C_DW_1_IRQ 1
#if defined(CONFIG_IOAPIC)
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
#endif
/*
* PWM
*/
#define PWM_DW_BASE_ADDR 0xB0000800
#define PWM_DW_NUM_PORTS 4
/*
* RTC (Real Time Clock)
*/
#define RTC_DW_BASE_ADDR 0xB0000400
#define RTC_DW_IRQ 11
/*
* WDT/Watchdog
*/
#define WDT_DW_BASE_ADDR 0xB0000000
#define WDT_DW_IRQ 12
#endif /* _ASMLANGUAGE */
#endif /* __SOC_H_ */

View File

@@ -38,9 +38,10 @@ static int x86_quark_se_ipm_init(void)
static struct quark_se_ipm_controller_config_info ipm_controller_config = {
.controller_init = x86_quark_se_ipm_init
};
DEVICE_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
DEVICE_AND_API_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
NULL, &ipm_controller_config,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&ipm_quark_se_api_funcs);
#if defined(CONFIG_IPM_CONSOLE_RECEIVER) && defined(CONFIG_PRINTK)
#include <console/ipm_console.h>

View File

@@ -87,7 +87,7 @@ config I2C_DW_0
if I2C_DW_0
config I2C_DW_0_NAME
default "I2C0"
default "I2C_0"
config I2C_DW_0_DEFAULT_CFG
default 0x12
config I2C_DW_0_IRQ_PRI
@@ -144,20 +144,6 @@ if GPIO_DW_0
config GPIO_DW_0_NAME
default "GPIO_0"
config GPIO_DW_0_BUS
default 0
config GPIO_DW_0_DEV
default 21
config GPIO_DW_0_FUNCTION
default 2
config GPIO_DW_0_BAR
default 1
config GPIO_DW_0_BITS
default 8
config GPIO_DW_0_BASE_ADDR
default 0x90006000
config GPIO_DW_0_IRQ
default 18
config GPIO_DW_0_PRI
default 2
config GPIO_DW_0_IRQ_SHARED_NAME
@@ -287,10 +273,6 @@ config ETH_DW_0
if ETH_DW_0
config ETH_DW_0_BASE_ADDR
default 0x90002000
config ETH_DW_0_IRQ
default 18
config ETH_DW_0_IRQ_SHARED_NAME
default SHARED_IRQ_0_NAME if SHARED_IRQ

View File

@@ -36,6 +36,21 @@
#include <drivers/ioapic.h>
#endif
/*
* Ethernet (DesignWare)
*/
#define ETH_DW_PCI_VENDOR_ID 0x8086
#define ETH_DW_PCI_DEVICE_ID 0x0937
#define ETH_DW_PCI_CLASS 0x02
#define ETH_DW_0_BASE_ADDR 0x90002000
#define ETH_DW_0_IRQ 18
#define ETH_DW_0_PCI_BUS 0
#define ETH_DW_0_PCI_DEV 20
#define ETH_DW_0_PCI_FUNCTION 6
#define ETH_DW_0_PCI_BAR 0
/*
* GPIO
*/
@@ -47,6 +62,23 @@
#define GPIO_SCH_1_BASE_ADDR 0x10A0
#define GPIO_SCH_1_BITS 6
#define GPIO_DW_PCI_VENDOR_ID 0x8086
#define GPIO_DW_PCI_DEVICE_ID 0x0934
#define GPIO_DW_PCI_CLASS 0x0C
#define GPIO_DW_0_BASE_ADDR 0x90006000
#define GPIO_DW_0_IRQ 18
#define GPIO_DW_0_BITS 8
#define GPIO_DW_0_PCI_BUS 0
#define GPIO_DW_0_PCI_DEV 21
#define GPIO_DW_0_PCI_FUNCTION 2
#define GPIO_DW_0_PCI_BAR 1
#if defined(CONFIG_IOAPIC)
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
#endif
/*
* I2C
*/

View File

@@ -9,18 +9,40 @@ if NBLE
config GPIO
def_bool y
config BLUETOOTH_NRF51_PM
def_bool y
config NBLE_UART_ON_DEV_NAME
default UART_NS16550_PORT_0_NAME
default UART_QMSI_0_NAME
endif
if BLUETOOTH_H4
config GPIO
def_bool y
config BLUETOOTH_NRF51_PM
def_bool y
config BLUETOOTH_WAIT_NOP
def_bool y
config BLUETOOTH_UART_ON_DEV_NAME
default UART_QMSI_0_NAME
endif
if UART_PIPE
config UART_PIPE_ON_DEV_NAME
default UART_NS16550_PORT_1_NAME
default UART_QMSI_1_NAME
endif
config BLUETOOTH_MONITOR_ON_DEV_NAME
default UART_QMSI_1_NAME if BLUETOOTH_DEBUG_MONITOR
if FLASH && SPI
config SPI_FLASH_W25QXXDV
@@ -29,7 +51,7 @@ config SPI_FLASH_W25QXXDV
if SPI_FLASH_W25QXXDV
config SPI_FLASH_W25QXXDV_SPI_NAME
default SPI_DW_PORT_0_DRV_NAME
default SPI_QMSI_PORT_0_DRV_NAME
config SPI_FLASH_W25QXXDV_SPI_SLAVE
default 1

View File

@@ -5,9 +5,9 @@ CONFIG_CPU_MINUTEIA=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_NS16550=y
CONFIG_UART_NS16550_PORT_0_BAUD_RATE=1000000
CONFIG_UART_NS16550_PORT_0_OPTIONS=1
CONFIG_UART_QMSI=y
CONFIG_UART_QMSI_0_BAUDRATE=1000000
CONFIG_UART_QMSI_0_HW_FC=y
CONFIG_PRINTK=y
CONFIG_IPM=y
CONFIG_IPM_QUARK_SE=y
@@ -15,4 +15,3 @@ CONFIG_IPM_QUARK_SE_MASTER=y
CONFIG_IPM_CONSOLE_RECEIVER=y
CONFIG_ARC_INIT=y
CONFIG_PINMUX=y
CONFIG_SPI_DW_LEVEL_HIGH=y

View File

@@ -0,0 +1,20 @@
CONFIG_X86=y
CONFIG_SOC_QUARK_SE=y
CONFIG_BOARD_ARDUINO_101=y
CONFIG_CPU_MINUTEIA=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_QMSI=y
CONFIG_UART_QMSI_0_BAUDRATE=1000000
CONFIG_UART_QMSI_0_HW_FC=y
CONFIG_PRINTK=y
CONFIG_IPM=y
CONFIG_IPM_QUARK_SE=y
CONFIG_IPM_QUARK_SE_MASTER=y
CONFIG_IPM_CONSOLE_RECEIVER=y
CONFIG_ARC_INIT=y
CONFIG_PINMUX=y
CONFIG_SS_RESET_VECTOR=0x40034000
CONFIG_PHYS_LOAD_ADDR=0x40010000
CONFIG_VERSION_HEADER=y

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2011-2015, Wind River Systems, Inc.
* Copyright (c) 2016, Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,3 +20,15 @@
#include <uart.h>
#include <device.h>
#include <init.h>
#ifdef CONFIG_VERSION_HEADER
#include "version_header.h"
/* The content of this struct is overwritten in a post-build script */
struct version_header version_header __attribute__((section(".version_header")))
__attribute__((used)) = {
.magic = {'$', 'B', '!', 'N'},
.version = 0x01,
.reserved_1 = {0, 0, 0, 0},
.reserved_2 = {0, 0, 0, 0},
};
#endif

View File

@@ -2,7 +2,7 @@
if [ -z ${ZEPHYR_SDK_INSTALL_DIR} ];
then
echo "ZEPHYR_SDK_INSTLL_DIR is not set. Unable to continue"
echo "ZEPHYR_SDK_INSTALL_DIR is not set. Unable to continue"
exit 1
fi

View File

@@ -2,7 +2,7 @@
if [ -z ${ZEPHYR_SDK_INSTALL_DIR} ];
then
echo "ZEPHYR_SDK_INSTLL_DIR is not set. Unable to continue"
echo "ZEPHYR_SDK_INSTALL_DIR is not set. Unable to continue"
exit 1
fi
@@ -22,7 +22,7 @@ echo "About to flash Zephyr comptaible ROM"
$OPENOCD -s ${OPENOCD_SCRIPT} \
-f ${ZEPHYR_BASE}/boards/arduino_101/support/restore.cfg \
-c 'init' \
-c 'targets' \
-c 'targets 1' \
-c 'reset halt' \
-c 'load_image quark_se_rom.bin 0xffffe000 bin' \
-c 'verify_image quark_se_rom.bin 0xffffe000 bin' \
@@ -48,7 +48,7 @@ echo "About to flash the OS and BOOT binaries"
$OPENOCD -s ${OPENOCD_SCRIPT} \
-f ${ZEPHYR_BASE}/boards/arduino_101/support/restore.cfg \
-c 'init' \
-c 'targets' \
-c 'targets 1' \
-c 'reset halt' \
-c "load_image A101_OS.bin 0x40000000 bin" \
-c "verify_image A101_OS.bin 0x40000000 bin" \

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Intel Corporation
* Copyright (c) 2016, Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,9 @@
* limitations under the License.
*/
#ifndef __VERSION_HEADER_H__
#define __VERSION_HEADER_H__
#include <stdint.h>
/**
@@ -24,13 +27,9 @@
* version header.
* - the position of this struct is usually defined in the linker script and
* its content is overwritten after the build (in a special post-build script).
* It therefore doesn't need to be initialized at compile-time (excepted magic
* It therefore doesn't need to be initialized at compile-time (expected magic
* and version), yet can be used in the code at runtime.
*
* The binary version header is usually localized at the beginning of
* the payload, but in the case of e.g. a bootloader, it can also be stored
* at the end of the payload, or even anywhere within the payload.
*
* Major, Minor, Patch are the following the usual definition, e.g. 1.0.0
*/
struct version_header {
@@ -46,30 +45,30 @@ struct version_header {
/**
* Human-friendly version string, free format (not NULL terminated)
* Advised format is: PPPPXXXXXX-YYWWTBBBB
* - PPPP : product code, e.g ATP1
* - PPPP : product code
* - XXXXXX: binary info. Usually contains information such as the
* binary type (bootloader, application), build variant (unit tests,
* debug, release), release/branch name
* - YY : year last 2 digits
* - WW : work week number
* - T : build type, e.g. [W]eekly, [L]atest, [R]elease, [P]rod,
* - T : build type, e.g. [W]eekly, [L]atest, [R]elease, [P]roduction,
* [F]actory, [C]ustom
* - BBBB : build number, left padded with zeros
* Examples:
* - ATP1BOOT01-1503W0234
* - CLRKAPP123-1502R0013
* - A101BOOT01-1503W0234
* - CCCKAPP123-1502R0013
*/
char version_string[20];
/**
* Micro-SHA1 (first 4 bytes of the SHA1) of the binary payload excl
* Micro-SHA1 (first 4 bytes of the SHA1) of the binary payload excluding
* this header. It allows to uniquely identify the exact binary used.
* In the case the header is located in the middle of the payload, the
* SHA1 has to be computed from two disjoint buffers.
*/
uint8_t hash[4];
/** Position of the payload start relative to the address of struct */
/** Position of the payload start relative to the address of this structure */
int32_t offset;
/** Filled with zeros, can be eventually used for 64 bits support */
@@ -81,3 +80,9 @@ struct version_header {
/** Filled with zeros, can be eventually used for 64 bits support */
uint8_t reserved_2[4];
} __packed;
/** The global version header struct */
extern struct version_header version_header;
#endif /* __VERSION_HEADER_H__ */

View File

@@ -1,7 +1,7 @@
FLASH_SCRIPT = openocd.sh
OPENOCD_PRE_CMD = "-c targets 1"
OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} 0x40000000"
OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} 0x40000000"
OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)"
OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)"
GDB_PORT = 3334

View File

@@ -0,0 +1,19 @@
CONFIG_ARC=y
CONFIG_SOC_QUARK_SE_SS=y
CONFIG_BOARD_ARDUINO_101_SSS=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
CONFIG_XIP=y
CONFIG_NANO_TIMERS=y
CONFIG_PRINTK=y
CONFIG_CPU_ARCEM4=y
CONFIG_CPU_ARCV2=y
CONFIG_ARCV2_INTERRUPT_UNIT=y
CONFIG_ARCV2_TIMER=y
CONFIG_IPM=y
CONFIG_IPM_QUARK_SE=y
CONFIG_IPM_CONSOLE_SENDER=y
CONFIG_CONSOLE=y
CONFIG_SPI_DW_INTERRUPT_SEPARATED_LINES=y
CONFIG_VERSION_HEADER=y
CONFIG_FLASH_BASE_ADDRESS=0x40034000

View File

@@ -19,3 +19,15 @@
#include <uart.h>
#include <device.h>
#include <init.h>
#ifdef CONFIG_VERSION_HEADER
#include "version_header.h"
/* The content of this struct is overwritten in a post-build script */
struct version_header version_header __attribute__((section(".version_header")))
__attribute__((used)) = {
.magic = {'$', 'B', '!', 'N'},
.version = 0x01,
.reserved_1 = {0, 0, 0, 0},
.reserved_2 = {0, 0, 0, 0},
};
#endif

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 2016, Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __VERSION_HEADER_H__
#define __VERSION_HEADER_H__
#include <stdint.h>
/**
* Define the content of a 48-bytes binary version header.
*
* The binary version header allows to uniquely identify the binary used. Note:
* - a device may include more than one binary, each having its own binary
* version header.
* - the position of this struct is usually defined in the linker script and
* its content is overwritten after the build (in a special post-build script).
* It therefore doesn't need to be initialized at compile-time (expected magic
* and version), yet can be used in the code at runtime.
*
* Major, Minor, Patch are the following the usual definition, e.g. 1.0.0
*/
struct version_header {
/** Always equal to $B!N */
uint8_t magic[4];
/** Header format version */
uint8_t version;
uint8_t major;
uint8_t minor;
uint8_t patch;
/**
* Human-friendly version string, free format (not NULL terminated)
* Advised format is: PPPPXXXXXX-YYWWTBBBB
* - PPPP : product code
* - XXXXXX: binary info. Usually contains information such as the
* binary type (bootloader, application), build variant (unit tests,
* debug, release), release/branch name
* - YY : year last 2 digits
* - WW : work week number
* - T : build type, e.g. [W]eekly, [L]atest, [R]elease, [P]roduction,
* [F]actory, [C]ustom
* - BBBB : build number, left padded with zeros
* Examples:
* - A101BOOT01-1503W0234
* - CCCKAPP123-1502R0013
*/
char version_string[20];
/**
* Micro-SHA1 (first 4 bytes of the SHA1) of the binary payload excluding
* this header. It allows to uniquely identify the exact binary used.
* In the case the header is located in the middle of the payload, the
* SHA1 has to be computed from two disjoint buffers.
*/
uint8_t hash[4];
/** Position of the payload start relative to the address of this structure */
int32_t offset;
/** Filled with zeros, can be eventually used for 64 bits support */
uint8_t reserved_1[4];
/** Size of the payload in bytes, including this header */
uint32_t size;
/** Filled with zeros, can be eventually used for 64 bits support */
uint8_t reserved_2[4];
} __packed;
/** The global version header struct */
extern struct version_header version_header;
#endif /* __VERSION_HEADER_H__ */

View File

@@ -9,16 +9,6 @@ if I2C
config I2C_ATMEL_SAM3
default y
if I2C_ATMEL_SAM3
config I2C_ATMEL_SAM3_0
default y
config I2C_ATMEL_SAM3_1
default y
endif # I2C_ATMEL_SAM3
endif # I2C
endif # BOARD_ARDUINO_DUE

View File

@@ -1,4 +1,4 @@
config BOARD_FRDM_K64F
bool "Freescale FRDM-K64F"
depends on SOC_FSL_FRDM_K64F
depends on SOC_SERIES_KINETIS_K6X

View File

@@ -10,4 +10,4 @@ config FLASH_SIZE
config SRAM_SIZE
default 192
endif # BOARD_FSL_FRDM_K64F
endif # BOARD_FRDM_K64F

View File

@@ -1,5 +1,6 @@
CONFIG_ARM=y
CONFIG_SOC_FSL_FRDM_K64F=y
CONFIG_SOC_MK64F12=y
CONFIG_SOC_SERIES_KINETIS_K6X=y
CONFIG_BOARD_FRDM_K64F=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
@@ -7,3 +8,4 @@ CONFIG_SERIAL=y
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_UART_K20=y
CONFIG_GPIO=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000

View File

@@ -25,6 +25,9 @@ config ADC
config SHARED_IRQ
def_bool y
config PCI_ENUMERATION
def_bool y
if PINMUX
config PINMUX_GALILEO_EXP0_NAME
@@ -139,9 +142,9 @@ endif # PWM_PCA9685
endif # PWM && I2C
# SPI uses GPIO pin for CS, so it needs to be initialized after
# the gpio_dw driver
config SPI_INTEL_INIT_PRIORITY
default 70 if SPI_INTEL
# the gpio_dw driver ( and the pinmux driver for port 1)
config SPI_INIT_PRIORITY
default 90 if SPI_INTEL
# Pin multiplexer uses PCAL9535A, needs to be initialized after it
config PINMUX_INIT_PRIORITY

View File

@@ -0,0 +1,6 @@
FLASH_SCRIPT = openocd.sh
OPENOCD_LOAD_CMD = "flash write_image erase ${O}/${KERNEL_BIN_NAME} ${CONFIG_FLASH_BASE_ADDRESS}"
OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_FLASH_BASE_ADDRESS}"
export FLASH_SCRIPT OPENOCD_LOAD_CMD OPENOCD_VERIFY_CMD

Some files were not shown because too many files have changed in this diff Show More