Commit Graph

12685 Commits

Author SHA1 Message Date
Flavio Santes 7b652b1f84 tests/crypto: Update testcase.ini to build on more platforms
This patch excludes qemu riscv32 due to the following msg:

qemu-system-riscv32: cannot set up guest memory
'riscv_sifive_board.ram': Cannot allocate memory

Jira: ZEP-1721

Change-Id: Ib1784fa57ad1e3d69871d4e216af1ad5dbe55a76
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-23 13:19:21 +00:00
Andre Guedes c7f01dc90d tests/power/multicorei/lmt: Fix RTC configuration
After QMSI 1.4 update, the alarm callback is not saved when
'alarm_en' is set to zero during RTC configuration. So this
patch fixes tests/power/multicore/lmt application according.

ZEP-1778

Change-Id: Ie1468458bc23a6394484aef2aeee97745d5d23b8
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2017-02-23 13:17:47 +00:00
Kumar Gala 31c5b4f112 Merge arm branch into master
Main changes:

- Various ST SoC changes:
  * Some bugfixes for ST platforms
  * Add support for 2 new STM32F4 SoCs
  * Flash driver support for STM32F4x
- Allow ROM offset to be configurable

----------------------------------------------------------------
Erwan Gouriou (4):
      dts: minor update for nucleo_l476rg
      arch: stm32: provide tick to Cube HAL
      gpio: enable ports F G (and H) for stm32f1xx (stm32f4xx)
      clock_control: fix to get PLL2 source for PREDV1 working

Gustavo Denardin (1):
      arm: Support for new STM32F4 socs (STM32F407 and STM32F429)

Jorge Ramirez-Ortiz (1):
      flash/stm32: driver for STM32F4x series

Marti Bolivar (1):
      arm: cortex-m: allow configurable ROM offset

 arch/arm/core/cortex_m/Kconfig                     |  11 +
 arch/arm/core/cortex_m/prep_c.c                    |   3 +-
 arch/arm/soc/st_stm32/stm32f1/soc.c                |  11 +
 arch/arm/soc/st_stm32/stm32f3/soc.c                |  11 +
 .../st_stm32/stm32f4/Kconfig.defconfig.stm32f407xx |  24 ++
 .../st_stm32/stm32f4/Kconfig.defconfig.stm32f429xx |  24 ++
 arch/arm/soc/st_stm32/stm32f4/Kconfig.soc          |   6 +
 arch/arm/soc/st_stm32/stm32f4/flash_map.h          |  58 +++++
 arch/arm/soc/st_stm32/stm32f4/flash_registers.h    |  20 +-
 arch/arm/soc/st_stm32/stm32f4/soc.c                |  11 +
 arch/arm/soc/st_stm32/stm32l4/soc.c                |  11 +
 drivers/clock_control/stm32f107xx_clock.c          |  13 +-
 drivers/flash/Kconfig                              |   2 +-
 .../flash/{Kconfig.stm32f3x => Kconfig.stm32fxx}   |   8 +-
 drivers/flash/Makefile                             |   4 +
 drivers/flash/flash_stm32f4x.c                     | 269 +++++++++++++++++++++
 drivers/gpio/gpio_stm32.c                          |  33 ++-
 dts/arm/nucleo_l476rg.dts                          |  55 +----
 dts/arm/stm32l476.dtsi                             |  17 +-
 include/arch/arm/cortex_m/scripts/linker.ld        |   6 +-
 .../drivers/clock_control/stm32f1_clock_control.h  |   2 +
 21 files changed, 521 insertions(+), 78 deletions(-)
 create mode 100644 arch/arm/soc/st_stm32/stm32f4/Kconfig.defconfig.stm32f407xx
 create mode 100644 arch/arm/soc/st_stm32/stm32f4/Kconfig.defconfig.stm32f429xx
 create mode 100644 arch/arm/soc/st_stm32/stm32f4/flash_map.h
 rename drivers/flash/{Kconfig.stm32f3x => Kconfig.stm32fxx} (72%)
 create mode 100644 drivers/flash/flash_stm32f4x.c
Change-Id: I0e1791ccd0cf7a072ec8c481ff5510c10b98c290
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-22 18:12:51 -06:00
Erwan Gouriou de684bbdaa clock_control: fix to get PLL2 source for PREDV1 working
Some fixes where needed to get PLL2 source of PREVI1 functional.
Compiled ok with following configuration:
CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV1_SRC_PLL2CLK=y
CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV2=0
CONFIG_CLOCK_STM32F10X_CONN_LINE_PLL2_MULTIPLIER=8

Jira: ZEP-1758

Change-Id: I5ddfaef1b44c4c4e5e6adedc158a1c9092bc8df5
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:09:22 -06:00
Erwan Gouriou 0aea704462 gpio: enable ports F G (and H) for stm32f1xx (stm32f4xx)
Some GPIO ports activation where missing since not used
on available soc/boards.
Since stm32 family increases, activation of these ports
should be made available.

Jira: ZEP-1551

Change-Id: I612d135b28ef255bc771599e33796671ff81d0ac
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:09:11 -06:00
Jorge Ramirez-Ortiz 29a8e0292e flash/stm32: driver for STM32F4x series
Change-Id: I0f90bcda7a694de81c594a6616da0faf40306702
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-22 18:08:57 -06:00
Erwan Gouriou d39eedbad1 arch: stm32: provide tick to Cube HAL
Cube HAL implements timeout based on 1ms tick.
This commit allows Cube HAL to get Zephyr system clock.

Change-Id: I9a59edcf6fa8e0ebfd5040348db537dadd9fcdfa
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:08:57 -06:00
Erwan Gouriou ddfce25f17 dts: minor update for nucleo_l476rg
Move SRAM and flash nodes out of stm32l476.dtsi
RAM and Flash sizes depend on last letter ("G" in the case).
Hence it must be defined out of soc description file
Update information for leds

Change-Id: I980129c44c335322ddbe57252a7001296094c7cb
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:08:57 -06:00
Gustavo Denardin 3fdfcfc94f arm: Support for new STM32F4 socs (STM32F407 and STM32F429)
In order to support the discovery STM32F4 and STM32F429 boards,
it is necessary to make these socs available.

Change-Id: I351d294fb02c4385f291a6e258a3f7d81e85627e
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
2017-02-22 18:08:57 -06:00
Marti Bolivar bf2d34ba30 arm: cortex-m: allow configurable ROM offset
Currently, ARM Cortex-M image ROMs are linked starting at the flash
device's base address (CONFIG_FLASH_BASE_ADDRESS). This prevents XIP
Zephyr applications from being linked to run from elsewhere on the
flash device. Linking Zephyr applications to run from elsewhere can be
necessary when running under a bootloader (i.e., booting into a Zephyr
application from a bootloader, not using Zephyr as a bootloader).

To enable this use case, add a new config option: FLASH_LOAD_OFFSET.
This option directs the linker to treat ROM as if it started that many
bytes from the base of flash on Cortex-M targets. The option defaults
to zero to preserve backwards compatibility.

Change-Id: I64f82aee257c19c2451f9789b0ab56999775b761
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-02-22 18:08:57 -06:00
Andy Ross c6e27a05c2 quark_se: Don't enable UART 0 always
The defconfigs would always create a device for UART 0, which is
problematic in circumstances where both the x86 and ARC cores are
alive and one wants to use it in a non-default configuration.

Specifically: on Arduino 101 this is the bluetooth device and it
operates at 1MBps instead of of 115200kbps.  If an x86 app sets this
up correctly, but then starts the ARC core running an app which
doesn't reference this UART at all, the device will still exist and
set up the (wrong!) configuration, clobbering the correct settings.

Just remove the "def-bool y" bits from the defconfig.  There's no
need, users of these devices (e.g. the console) will enable them
anyway.  There's no value to compiling it in without a configured
user.

Issue: ZEP-1677
Change-Id: I4a0e944f23705495433e9f3d0459065f131579cb
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-02-22 22:42:25 +00:00
Andrew Boie b8d57738b8 cortex_m_systick: fix _timer_cycle_get_32() race
We need to account for the interrupt happening in the middle
of the calculation.

Issue: ZEP-1546
Change-Id: I193534856d7521cac7ca354d3e5b65e93b984bb1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-22 18:45:36 +00:00
Jukka Rissanen 1839cabe14 Merge net branch into master
Main changes:

- MQTT compiler warning fix.
- Fixes to NXP MCR20A driver for IEEE 802.15.4.
- Link (MAC) short address fixes for IEEE 802.15.4.
- TCP memory leak fixes.
- SLIP fixes.
- More fixes to build errors in net when using ISSM's llvm/icx
  compiler.
- Added Nordic IEEE 802.15.4 driver for nrf5.

----------------------------------------------------------------
Flavio Santes (1):
      tests/mqtt: Fix compiler warnings in MQTT Packet test case

Johann Fischer (1):
      drivers: mcr20a: cleanup and refactor interrupt processing

Jukka Rissanen (6):
      net: Add network link technology type to linkaddr
      net: Set the network link address type when setting link address
      net: nbuf: Set the link address type in nbuf
      net: ipv6: IEEE 802.15.4 short address fix
      net: buf: net_buf_frag_del() had insufficient debugging
      drivers/ieee802154/pipe: Use net_nbuf_unref to release net_buf

Michael Scott (1):
      net: context: let tcp_established() handle more TCP states

Ravi kumar Veeramally (5):
      net: context: Fix invalid order of statements
      drivers: slip: Remove unused variables
      drivers: slip: Add more comments for slip write scenario
      drivers: slip: Skip buffer allocation for incomplete packet
      net: tcp: Retransmit buffers are not freed on tcp_release

Tomasz Bursztyka (2):
      net: Fix stack type
      net/utils: Fix parameters type

Wojciech Bober (5):
      ext: Import Nordic 802.15.4 radio driver
      ext: Integrate Nordic's 802.15.4 radio driver into Zephyr
      drivers/net/ieee802154: nRF5 802.15.4 radio driver
      samples/net: ieee802154: Add configuration for nrf5
      samples/net/ieee802154: Update example with nrf5 802.15.4

 drivers/ethernet/eth_enc28j60.c                    |    3 +-
 drivers/ethernet/eth_mcux.c                        |    3 +-
 drivers/ethernet/eth_sam_gmac.c                    |    3 +-
 drivers/ieee802154/Kconfig                         |    2 +
 drivers/ieee802154/Kconfig.nrf5                    |   72 +
 drivers/ieee802154/Makefile                        |    1 +
 drivers/ieee802154/ieee802154_cc2520.c             |    2 +-
 drivers/ieee802154/ieee802154_mcr20a.c             |  693 ++++----
 drivers/ieee802154/ieee802154_mcr20a.h             |    6 +-
 drivers/ieee802154/ieee802154_nrf5.c               |  411 +++++
 drivers/ieee802154/ieee802154_nrf5.h               |   59 +
 drivers/ieee802154/ieee802154_uart_pipe.c          |    4 +-
 drivers/slip/slip.c                                |   79 +-
 ext/hal/Kbuild                                     |    1 +
 ext/hal/nordic/Kconfig                             |    6 +-
 ext/hal/nordic/Makefile                            |    4 +
 ext/hal/nordic/drivers/Kbuild                      |   33 +
 ext/hal/nordic/drivers/Makefile                    |    3 +
 ext/hal/nordic/drivers/README.md                   |  128 ++
 ext/hal/nordic/drivers/nrf_drv_radio802154.c       | 1649 ++++++++++++++++++++
 ext/hal/nordic/drivers/nrf_drv_radio802154.h       |  348 +++++
 include/net/buf.h                                  |    8 +
 include/net/nbuf.h                                 |    9 +
 include/net/net_core.h                             |    2 +-
 include/net/net_if.h                               |    5 +-
 include/net/net_ip.h                               |   23 +-
 include/net/net_linkaddr.h                         |   20 +
 samples/net/echo_client/prj_nrf5.conf              |   55 +
 samples/net/echo_server/prj_nrf5.conf              |   54 +
 samples/net/ieee802154/hw/prj_nrf5.conf            |   50 +
 samples/net/ieee802154/hw/src/ieee802154_test.c    |    4 +
 subsys/net/buf.c                                   |   11 +
 subsys/net/ip/l2/bluetooth.c                       |    6 +-
 subsys/net/ip/l2/dummy.c                           |    2 +
 subsys/net/ip/l2/ethernet.c                        |    2 +
 subsys/net/ip/l2/ieee802154/ieee802154.c           |    2 +
 subsys/net/ip/net_context.c                        |    6 +-
 subsys/net/ip/tcp.c                                |    8 +
 subsys/net/ip/utils.c                              |    4 +-
 tests/net/6lo/src/main.c                           |    2 +-
 tests/net/arp/src/main.c                           |    2 +-
 tests/net/context/src/main.c                       |    3 +-
 tests/net/dhcpv4/src/main.c                        |    2 +-
 tests/net/ieee802154/fragment/src/main.c           |    2 +-
 .../net/ieee802154/l2/src/ieee802154_fake_driver.c |    2 +-
 tests/net/iface/src/main.c                         |    3 +-
 tests/net/ip-addr/src/main.c                       |    2 +-
 tests/net/ipv6/src/main.c                          |    3 +-
 tests/net/lib/mqtt_packet/src/mqtt_packet.c        |   34 +-
 tests/net/mgmt/src/mgmt.c                          |    2 +-
 tests/net/route/src/main.c                         |    3 +-
 tests/net/rpl/src/main.c                           |    3 +-
 tests/net/tcp/src/main.c                           |    2 +-
 tests/net/udp/src/main.c                           |    2 +-
 54 files changed, 3406 insertions(+), 442 deletions(-)
 create mode 100644 drivers/ieee802154/Kconfig.nrf5
 create mode 100644 drivers/ieee802154/ieee802154_nrf5.c
 create mode 100644 drivers/ieee802154/ieee802154_nrf5.h
 create mode 100644 ext/hal/nordic/drivers/Kbuild
 create mode 100644 ext/hal/nordic/drivers/Makefile
 create mode 100644 ext/hal/nordic/drivers/README.md
 create mode 100644 ext/hal/nordic/drivers/nrf_drv_radio802154.c
 create mode 100644 ext/hal/nordic/drivers/nrf_drv_radio802154.h
 create mode 100644 samples/net/echo_client/prj_nrf5.conf
 create mode 100644 samples/net/echo_server/prj_nrf5.conf
 create mode 100644 samples/net/ieee802154/hw/prj_nrf5.conf

Change-Id: I727a2f97fbb7f443a5f947bb4ca7e4274695737b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:31:42 +02:00
Jukka Rissanen c85127db80 drivers/ieee802154/pipe: Use net_nbuf_unref to release net_buf
Using net_nbuf_unref to release the net_buf so that we can
debug the allocations more easily. It is ok to use the original
net_buf_unref() too, we just miss some important net_buf
housekeeping information if done like that.

Change-Id: Ieb7b39ed525bfc46eb5c07a01f2a3a75fdbeb9fd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:26 +02:00
Jukka Rissanen 75c48fcbf2 net: buf: net_buf_frag_del() had insufficient debugging
In order to see who is freeing the fragment, add function
and line information to net_buf_frag_del() when net_buf
debugging is activated.

Change-Id: I732f579fab2390cb16804cb35b83f46e65fca342
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:26 +02:00
Ravi kumar Veeramally 05d5dcf007 net: tcp: Retransmit buffers are not freed on tcp_release
TCP maintains 'sent_list' for retransmission if it doesn't get ACK for it.
Same list is not freed on net_tcp_release() call. This causes memory leak.

Change-Id: I2b2def1ea19487cc48ea4fbb6343ef0c773f288f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-22 17:28:25 +02:00
Michael Scott f30a9e51c1 net: context: let tcp_established() handle more TCP states
Due to commit fece856959 ("net: tcp: Clean up FIN handling") the
tcp_established() callback now handles TCP connections which are
in various ending/closing states other than TCP_ESTABLISHED.

Currently, these states are generating the following error and not
being processed:
Context 0x123456778 in wrong state 6.
(Shown when TCP is in LAST_ACK state).

This commit also fixes a memory leak issue discribed in
Jira: ZEP-1658

Analysis of the memory leak issue is here:
When TCP connection is established, tcp context is in
NET_TCP_ESTABLISHED state. Once it receives FIN message from client
it goes to NET_TCP_CLOSE_WAIT and then it turns to NET_TCP_LAST_ACK
after connection closing request from server. Now server gets final
ack from client, but tcp_established() will reject it because current
state is not in NET_TCP_ESTABLISHED. Even if server receives proper
ack, it is not handled by server. Hence 'sent_list' is not freed.

Change-Id: I41c8af2e6851809f87a02c271a4290cf3d823ebb
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-22 17:28:25 +02:00
Ravi kumar Veeramally 84ce2a6d8f drivers: slip: Skip buffer allocation for incomplete packet
If slip_input_byte fails to get buffer for the first byte then no point
of saving later bytes and send it to upper layers. Final packet will be
incomplete and upper layers will discard it. Consider incoming bytes
only after successful buffer allocation on first byte, otherwise silently
ignore it.

Change-Id: Ie16d0df0c608d1644d39f66900252a340051c012
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-22 17:28:25 +02:00
Ravi kumar Veeramally eb31179cf3 drivers: slip: Add more comments for slip write scenario
No functionality changes. Added more comments and used switch cases
for more readability.

Change-Id: I9396270d7368d9b0c923a88f90b44129a1d69cbc
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-22 17:28:25 +02:00
Ravi kumar Veeramally 59b310e962 drivers: slip: Remove unused variables
Change-Id: Ib3aae91a1f40066f8902e9b2e709b13d1b57a2cb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-22 17:28:25 +02:00
Ravi kumar Veeramally 4da61f7fc7 net: context: Fix invalid order of statements
NET_ASSERT(net_nbuf_iface(buf)) should be called before setting
it on context [net_context_set_iface(context, net_nbuf_iface(buf))].

Change-Id: I9a1da1214857e96e03784bc98a9aae5cf59ef0fc
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-22 17:28:25 +02:00
Tomasz Bursztyka 46298d5a45 net/utils: Fix parameters type
Using char or uint8_t relevantly.

Jira: ZEP-1723

Change-Id: I512cb6ff4800cd23f6539e7a47c7f3c72dc94183
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-22 17:28:25 +02:00
Tomasz Bursztyka 799ad12ec5 net: Fix stack type
s/unsigned char/char

Jira: ZEP-1723

Change-Id: I07b23b28fdb4d2f0f78dcdd314faaebec06471db
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-22 17:28:25 +02:00
Jukka Rissanen a5605cedb0 net: ipv6: IEEE 802.15.4 short address fix
If IPv6 address is generated from IEEE 802.15.4 short address,
then the Universal/Local bit must be set to 0.

See RFC 6282 chapter 3.2.2 for details.

Change-Id: Ied38f40e807bdcd792570b331f6b99a6fcc7db1b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:25 +02:00
Jukka Rissanen b9c497ac49 net: nbuf: Set the link address type in nbuf
When we know the network interface where the packet is about
to be sent, then set the link address type too.

The link address type is used when working with IPv6 link
local and auto configured addresses.

Change-Id: If086c3c413c025809cffa64311f973bc7bdac7db
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:25 +02:00
Jukka Rissanen 4eb2020055 net: Set the network link address type when setting link address
The interface L2 address type is set at the same time as the
L2 address is set to the network interface. This is most
convinient place to set the address type.

Change-Id: I712d7357d075959eb79df3463141cfbc6d163a74
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:25 +02:00
Jukka Rissanen 24b66f4670 net: Add network link technology type to linkaddr
In order to know what kind of address the L2 link address is,
add a type of the address into struct net_linkaddr.

Change-Id: Icd4cb0374219583689cf9ee204c0840cad8559e9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:24 +02:00
Wojciech Bober f8c2b2e099 samples/net/ieee802154: Update example with nrf5 802.15.4
This commit updates the 802.15.4 example to work with the
nrf5 802.15.4 radio driver.

Change-Id: I8a4c80a21ebe29ce2616836b764c454979ebb2e9
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober 4be677fa45 samples/net: ieee802154: Add configuration for nrf5
This commit addes new configuration for examples which use
nrf5 802.15.4 radio.

Change-Id: I0c57334d071fb58bc2282feb3f4e6b949ce5d472
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober f810a202c8 drivers/net/ieee802154: nRF5 802.15.4 radio driver
This commit adds a driver for nRF5 802.15.4 radio. This driver
is a wrapper for the driver provided by ext/hal/nordic/drivers.

Change-Id: I20ee4aff3d1b994c621ba8eaab208d15d85e4c01
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober 37b3e9f78b ext: Integrate Nordic's 802.15.4 radio driver into Zephyr
This patch includes the new files in the build and refactors the
Kconfig and Kbuild files in ext/hal/nordic to acommodate for the presence of
the radio driver.

Change-Id: Ifeda1f6d51916c7096be3c09ef7db6ca59c87728
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober 16a9a502a3 ext: Import Nordic 802.15.4 radio driver
Origin: OpenThread (commit 0dec46315)
URL: https://github.com/openthread/openthread
License: 3-clause BSD
Maintained-by: External

Change-Id: Ia5f26d93d7cb4584cdb3343f7a80c500c4e3ebc8
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Flavio Santes 216ccb7198 tests/mqtt: Fix compiler warnings in MQTT Packet test case
Cast to uint8_t * some char * values to avoid compiler warnings.

Jira: ZEP-1179

Change-Id: I9973eecbed357a2fc44958cad22f812d166f6756
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-22 17:28:24 +02:00
Johann Fischer 0c65215ab5 drivers: mcr20a: cleanup and refactor interrupt processing
The interrupt processing of MCR20A was flawed and complicated.
This patch simplifies the handling of interrupts and reduces
the number of necessary SPI transfers.

Minor fixes:
 - use mutex for the PHY access control
 - remove unnecessary mcr20a_mask_irqb calls
 - do not read RX_FRM_LEN twice
 - increase timeout for sequence synchronization semaphore
   if the log level greater than 1
 - enable only the Sequence-end (SEQIRQ) interrupt
 - fix magic in NET_DEVICE_INIT
 - make the timeout values dependent on the log level

Change-Id: Ib3f64a092ffba91c80ff6e1d5cec995ab9d40bfb
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-02-22 17:28:24 +02:00
Jean-Paul Etienne 9acda0f695 tests: gen_isr_table: account for riscv32 architecture
Account for riscv32 SOCs supporting the riscv privileged architecture.

Change-Id: I8c26a2bcc2baded5db252896abe6e1b5ab052113
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-02-22 14:59:01 +00:00
Marcus Shawcroft f62e681a5c checkpatch: Recognized volatile as part of a declaration.
Adjust the checkpatch script to recognize the volatile keyword as
forming part of a declaration.  This prevents inappropriate checkpatch
gripes for patches such as:

https://gerrit.zephyrproject.org/r/#/c/10345/

Change-Id: Ia29a9002bb9ef15f747d29231d938ae12790724d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-22 14:56:44 +00:00
Jesus Sanchez-Palencia e4c0a431f9 ext qmsi: Update QMSI to 1.4 RC3
No major fixes since RC2 were made, but some clean up was done.
There are no changes to shim drivers at this moment.

JIRA: ZEP-1572

Change-Id: I2436f91bfa3aae186c778b5ff4129bb0e6b7db1f
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2017-02-22 14:18:22 +00:00
Øyvind Hovdsveen d787099c90 drivers/timer: Fixing issue in nRF RTC driver when RTC handler is blocked.
Fixes an unlikely issue that could arise if the RTC handler in the nRF RTC
driver was blocked for more than one sys tick interval. This could lead to
_sys_clock_tick_announce() being called with more than one sys tick when the
kernel did not expect it.

Jira: ZEP-1763

Change-ID: I5608fca6f0ac97a17c1ce452c1c5c67696a49a9a
Signed-off-by: Øyvind Hovdsveen <oyvind.hovdsveen@nordicsemi.no>
2017-02-22 13:58:53 +00:00
Rishi Khare 62ed635119 frdm: fixed path and dependencies for extract_dts_includes.py
the existing Kbuild is missing the path and needed python script
has new dependencies on yaml package also split the long line shorter ones.

Change-Id: I34fdd2ff70b2d76b0e2af6f78f2980d20651b12d
Signed-off-by: Rishi Khare <rishi.khare@intel.com>
2017-02-22 13:57:52 +00:00
Andrew Boie 9c48b54d65 tests: add timer monotonic test
k_cycle_get_32() needs to return a monotonically increasing value,
except in cases of 32-bit integer overflow. Enforce this with a
test case.

We also check that the number of cycles elapsed after sleeping for 1
second is at the expected value. This can help catch errors on platforms
that use different timer sources for the system clock and timestamps.

This test case adapted from some code provided by Sergey Arkhipov
when troubleshooting ZEP-1546.

Issue: ZEP-1546
Change-Id: If27fff026ea6de659f7b41b60ff26f4962b734d4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-21 22:31:07 +00:00
Andrew Boie 68c9d9779c x86: loapic_timer: use TSC for k_cycle_get_32()
The LOAPIC driver was doing this in a way susceptible to a very
nasty race condition: the CCR register could reset and be readable
before the associated interrupt could be delivered.

This resulted in a small window of time where CCR was reset, but
accumulated_cycle_count not updated, causing some calls to
k_cycle_get_32() to appear to jump backwards in time.

Just use the x86 TSC for these cycle timestamps. A divisor may be
provided in cases where the CPU clock speed is some multiple of
the bus speed. Modern x86 CPUs do not change their TSC rate even
when adjusting cpu frequency, so this should be a reliable timing
source.

Issue: ZEP-1546
Change-Id: I441bd8e32af866587a91f306e89e3fa0ece512b5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-21 22:30:47 +00:00
Andrew Boie 15b8ed1a6a arcv2_timer: fix cycle count race
It's possible the timer interrupt could occur when performing the
computation, resulting in incorrect values returned.

It's still possible for bad values to be returned if the function is
called with interrupts locked, but that is only fixable with a second
timer source.

Issue: ZEP-1546
Change-Id: I16d5b04c3e32377f7249eb4fb1bf2f7c22bd0836
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-21 01:44:01 +00:00
Anas Nashif fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Kumar Gala d3d2fab1ba boards: Add panther & panther_ss to sanity
Change-Id: I08345fb1063a4ba38095fca6512c5b7eb3e96da8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-20 15:41:31 +00:00
Benjamin Walsh 44d7cff207 doc: add polling API to the kernel primer
Change-Id: I17578f8350f1a26d2ecf8c0886c8e93078a2cdca
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-20 15:35:44 +00:00
Benjamin Walsh e3f927bc11 doc: reorder sections in kernel/other
Put them in order where they are most likely to be useful.

Change-Id: Ia9c358a096556a9838b2b69311e10aba3b9ca587
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-20 15:35:44 +00:00
Qiu Peiyang 34b53f181f tests: add zephyr uart driver api test case
This commit verifies the following uart driver apis:
	uart_irq_callback_set()
	uart_irq_rx_enable()
	uart_irq_rx_disable()
	uart_irq_rx_ready()
	uart_irq_tx_enable()
	uart_irq_tx_disable()
	uart_irq_tx_ready()
	uart_fifo_fill()
	uart_fifo_read()
	uart_irq_update()
	uart_poll_in()
	uart_poll_out()

Change-Id: I9be9341aee4357f86a2bc49f19733fb84273e89c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-20 13:42:47 +00:00
Daniel Thompson 4d096a44a1 doc: Restore documentation for 'make outputexports'
Commit 7cb8a16c86 ("doc: restructure application primer") removed
the section documenting the build system support for third party
libraries. Restore this section making a few editorial changes to
ensure the text sits well in its surroundings.

Jira: ZEP-1733
Change-Id: Ie62b956732f36fac70b392eeee880acebaef6cf9
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2017-02-18 15:17:07 +00:00
David B. Kinder d73d3aa901 doc: update glossary, remove from wiki
Promote a glossary.rst up into the doc/ folder, merge wiki
glossary entries (and remove from the wiki), and format use
the .. glossary directive to allow references by using the
:term: role (using :term:`ISR` will make a link to the
glossary entry for ISR)

Jira: ZEP-1321

Change-Id: Ie1461037ab456371604594488f01df9f21284561
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-02-18 11:19:06 +00:00
Andy Gross 74d95eedc4 dts: arm: Kinetis: Add bluetooth ports
This patch adds the UART ports required by for Bluetooth.  Baud rate
was moved from the Kinetis dtsi file to the relevant board files.

Jira: ZEP-1745

Change-Id: Iac4f748fd82217662800dbf48baea087e5d3a1df
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-18 01:29:52 +00:00