Commit graph

18396 commits

Author SHA1 Message Date
Chuck Jordan
ae15a26751 arc: add _tsc_read for 64-bit timestamp
This implementation of _tsc_read returns a 64-bit value that
is derived from the 64-bit tick count multiplied by hwcycles per tick,
and then it adds the current value from the 32-bit timer.
This produces a 64-bit time. There is a bunch of math here, which
could be avoided if the CPU is built with Real-Time-Clock option.
EM Starter Kit SOCs don't have this. I don't think Arduino 101 does
either.

See ZEP-1559

Change-Id: I9f846d170246556ac40fe2f45809e457c6375d8c
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2017-02-15 05:55:09 +00:00
Andrew Boie
35fcb2736c arc: enable gen_isr_tables mechanism
Change-Id: I5897e110f554377796bfe38dd5c0f8652c29e5be
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:54:47 +00:00
Andrew Boie
3944d8313e gen_isr_tables: apply offset to irq parameter
The interrupts would be placed at incorrect offsets on systems where
some interrupt vectors are reserved for exceptions, such as ARC.

Change-Id: I5b1f00eb9e8aecb84ae66e3d0461a734ffb5fbe6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:49:19 +00:00
Andrew Boie
5c335ce55f tests: gen_isr_table: actually run the IRQ
So far, only implemented on ARM.
It's not possible to do this on Nios II and RISC-V.

Change-Id: I84c8d99cd163dff46de4bc4a7ae40768daf8e4ce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:49:18 +00:00
Andrew Boie
bd69c3bdf0 riscv32: enable gen_isr_tables mechanism
Change-Id: Ia09d9a4d3412424dcbb25db829059a0714d81214
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:49:17 +00:00
Andrew Boie
b2e136c5f0 gen_isr_tables: make vector offset a hidden option
If this is set incorrectly things will break all over the place.
Needs a default defined per-arch and left alone.

Change-Id: I3f8c842937a240297ee21589a22a7a9e51dbdfad
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:49:17 +00:00
Anas Nashif
15a6598691 Merge "Merge remote-tracking branch 'origin/core'" 2017-02-15 04:33:25 +00:00
Anas Nashif
643f3603f1 crypto: include tinycrypt only when enabled
Change-Id: Iea978586a529539255351fb05c7c76ca30baf8ce
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-15 02:07:16 +00:00
Anas Nashif
278f05770b ipm: fix Makefile to include drivers correctly
Change-Id: I606e7b4c5aebc5429e5e8288a5ed916569c7fa0a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-15 02:07:15 +00:00
Juan Manuel Cruz Alcaraz
485da78449 ataes132a: Adds a driver to support ATAES132A device
Adds a driver for Atmel Crypto Authorization solution
ATAES132A crypto device.

The driver supports the following functionality.

- AES CCM encryption, decryption and authentication
- AES ECB block operation.

The driver requires an I2C device to access crypto device registers.

Jira: ZEP-1387

Change-Id: I60aa8f3b069b703d4f83d866d28391625bb9ac13
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-02-15 02:07:14 +00:00
Richard Peters
bab3aafa2d qemu_cortex_m3: fixed network connectivity
The wrong UART was set on for the qemu_cortex_m3 slip (uart pipe) device

Change-Id: If6d6af0f32ef02ccc559cd1fff90ea499cc378c4
Signed-off-by: Richard Peters <mail@richardpeters.de>
2017-02-15 01:36:27 +00:00
Jithu Joseph
b0f2e3ef14 tests: kernel: import obj_tracing test to unified kernel
obj_tracing test from legacy modified to use unified APIs
directly.

Jira: ZEP-932

Change-Id: Ib5d300334e527b842668be076c94c40b65d7cbe4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:34 +00:00
Jithu Joseph
38aaa7c955 samples/drivers/crypto: crypto sample app
A sample application  to illustrate the usage of crypto APIs.
This shows the usage of AES - CTR, CBC and CCM  based encryption
and decryption.

origin: original

Change-Id: I17e4d966a70169b71a754c9cdc3f713a5d0c3ac0
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:16 +00:00
Jithu Joseph
de106b026a drivers/crypto: TinyCrypt shim driver
Shim layer interfacing between crypto APIs and TinyCrypt
library. Currently facilitates only a subset of TinyCrypt
features/algorithms.

Jira: ZEP-509

Change-Id: I7fe6b9d86df016d92d717378d08a1ab09caafb31
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:15 +00:00
Jithu Joseph
417c341011 include/crypto: Crypto abstraction header
Adds crypto API interface for interaction between applications
and crypto drivers. Encryption/Decryption APIs are defined
here.

Jira: ZEP-328

Change-Id: I1a534ae2a69c7e1c416fa78a2822c37040b225f6
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:13 +00:00
Iván Briano
867e61cbf3 drivers gpio: Fix disabling of interrupts for QMSI shims
When a GPIO pin is configured, the shim driver will first read the
current values in the controller registers to keep the other pins from
changing their configuration. After that it sets the bits for the
corresponding pin accordingly.

When the flag to enable interrupts is passed to the function, the
corresponding bits are all set properly, but no changes are made if
interrupts are not requested. This makes it impossible to disable
interrupts for a given pin once they've been enabled.

Fix it by always resetting the interrupt enabled bit when they have not
been requested. Other values can be left untouched as they won't have
any effect.

Jira: ZEP-1717

Change-Id: I30e97bb06d966291e23d0c66ddf39bce615c287b
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2017-02-15 00:25:32 +00:00
Jorge Ramirez-Ortiz
28e60ef7ed flash/nrf5: fix invalid write access
Requesting a flash_write with a length of 0 results in a flash
position being written. Instead we should return 0 unless there is
some other input parameter that is invalid.

Change-Id: Ife6e6e2314bbee2bde7d0b69db3122ca00c361e0
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-15 00:08:33 +00:00
Kumar Gala
047ae4033c toolchain.gccarmemb: set DTC for building targets that use devicetrees
We default DTC to /usr/bin/dtc so we can build targets that are using
devicetree and not using the zephyr SDK (which provides a version of
dtc).

Change-Id: I84c3e3181eda75b4da715e16bbde2e67f28785e7
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-14 14:15:10 +00:00
Anas Nashif
8bde07dfae Merge "Merge net branch into master" 2017-02-14 11:08:14 +00:00
Sharron LIU
bceabf6a4f tests: kernel: remove unsupported tests
Remove tests that assert due to invocation from ISR which is not supported.

Change-Id: Ib2313b8f75db0140aa475281bd76ba0414d6a481
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-14 06:45:40 +00:00
Jukka Rissanen
3958177f69 Merge net branch into master
Main changes:

- DHCPv4 fixes
- FRDM-K64F ethernet IPv6 workaround
- FRDM-K64F detect ethernet cable connect
- MQTT documentation fix
- Add HTTPS sample application
- HTTP fixes
- ZoAP fixes

----------------------------------------------------------------
Anas Nashif (1):
      net: remove obsolete CONFIG_NET_YAIP

Flavio Santes (5):
      net/dns: Update QEMU prj file
      net/mqtt: Fix inline doc for MQTT
      net/http: Add QEMU support to the HTTP server sample app
      net/http: Improve network configuration routines
      ext/lib/mbedtls: Add the TLS configuration file

Jorge Ramirez-Ortiz (1):
      net/mqtt: Add BT support to MQTT publisher sample

Marcus Shawcroft (4):
      eth/mcux: Add basic PHY support.
      net/dhcpv4: Fix event/state mismatch
      net/dhcpv4: Remove unused dhcpv4 offer state
      net/dhcpv4: Ensure udp header checksum is computed correctly

Paul Sokolovsky (1):
      eth/mcux: Add temporary workaround to unbreak IPv6 ND features.

Richard Peters (1):
      samples: net: Add .conf file for qemu_cortex_m3 in echo_*

Sergio Rodriguez (2):
      libc/include: Adding time.h
      samples/net/http: Add HTTP over TLS sample application

Vinicius Costa Gomes (5):
      iot/zoap: Improve zoap.h documentation
      samples/zoap-server: Update docs with information about libcoap
      iot/zoap: Fix handling of 16-bytes block-wise transfers
      iot/zoap: Fix header indentation
      iot/zoap: Add missing const modifier to header file

 boards/arm/frdm_k64f/doc/frdm_k64f.rst             |  10 +-
 drivers/ethernet/Kconfig.mcux                      |   7 +
 drivers/ethernet/eth_mcux.c                        | 204 +++++++--
 .../crypto/mbedtls/configs/config-mini-tls1_2.h    |  91 ++++
 include/net/dhcpv4.h                               |   1 -
 include/net/mqtt.h                                 | 390 ++++++++--------
 include/net/zoap.h                                 | 425 ++++++++++++++----
 lib/libc/minimal/include/time.h                    |  10 +
 samples/net/dns_client/prj_qemu_x86.conf           |   4 +-
 samples/net/echo_client/prj_qemu_cortex_m3.conf    |  26 ++
 samples/net/echo_server/prj_qemu_cortex_m3.conf    |  27 ++
 samples/net/http_server/README.rst                 |  57 ++-
 samples/net/http_server/prj_qemu_x86.conf          |  34 ++
 samples/net/http_server/src/Makefile               |   5 +
 samples/net/http_server/src/config.h               |   4 +
 samples/net/http_server/src/http_server.c          |  26 ++
 samples/net/http_server/src/http_server.h          |   4 +
 samples/net/http_server/src/https_server.c         | 406 +++++++++++++++++
 samples/net/http_server/src/main.c                 | 106 ++---
 samples/net/http_server/src/ssl_utils.c            | 295 ++++++++++++
 samples/net/http_server/src/ssl_utils.h            |  37 ++
 samples/net/http_server/src/test_certs.h           |  92 ++++
 samples/net/http_server/testcase.ini               |   2 +-
 samples/net/leds_demo/prj_802154.conf              |   1 -
 samples/net/mqtt_publisher/prj_96b_nitrogen.conf   |  65 +++
 samples/net/mqtt_publisher/src/Makefile            |   4 +
 samples/net/mqtt_publisher/src/main.c              |  59 ++-
 samples/net/mqtt_publisher/testcase.ini            |   5 +
 samples/net/zoap_server/README.rst                 |  28 +-
 samples/net/zoap_server/prj_cc2520.conf            |   1 -
 samples/net/zperf/prj_frdm_k64f_prof.conf          |   1 -
 samples/net/zperf/prj_qemu_x86.conf                |   1 -
 subsys/net/ip/dhcpv4.c                             |   6 +-
 subsys/net/ip/net_shell.c                          |   2 -
 subsys/net/lib/mqtt/mqtt.c                         | 110 ++---
 subsys/net/lib/mqtt/mqtt_pkt.c                     | 287 ++++++------
 subsys/net/lib/mqtt/mqtt_pkt.h                     | 495 +++++++++++----------
 subsys/net/lib/zoap/zoap.c                         |  32 +-
 38 files changed, 2506 insertions(+), 854 deletions(-)
 create mode 100644 ext/lib/crypto/mbedtls/configs/config-mini-tls1_2.h
 create mode 100644 lib/libc/minimal/include/time.h
 create mode 100644 samples/net/echo_client/prj_qemu_cortex_m3.conf
 create mode 100644 samples/net/echo_server/prj_qemu_cortex_m3.conf
 create mode 100644 samples/net/http_server/prj_qemu_x86.conf
 create mode 100644 samples/net/http_server/src/https_server.c
 create mode 100644 samples/net/http_server/src/ssl_utils.c
 create mode 100644 samples/net/http_server/src/ssl_utils.h
 create mode 100644 samples/net/http_server/src/test_certs.h
 create mode 100644 samples/net/mqtt_publisher/prj_96b_nitrogen.conf

Change-Id: Ic5d4766a98db84599f2238e0104c6bc37cbf34bd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-14 08:44:56 +02:00
Sergio Rodriguez
de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

Change-Id: Ifbbcd0347bec47d12158440e50a82dc2966334d3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00
Sergio Rodriguez
f054d3e897 libc/include: Adding time.h
Dummy time.h to fulfill the compilations requirements of certain
libraries i.e. mbedTLS

Change-Id: I07e66dbf07337b935dabe9eecdf1be3850bbf394
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-02-14 08:30:35 +02:00
Paul Sokolovsky
5035f97686 eth/mcux: Add temporary workaround to unbreak IPv6 ND features.
This is a workaround for lack of driver API support for multicast
management. So, instead we want to receive all multicast frames
"by default", or otherwise basic IPv6 features, like address
resolution, don't work. On Kinetis Ethernet controller, that
translates to enabling promiscuous mode. The real fix depends
on ZEP-1673.

Change-Id: I98a27584be65bdc405de005383eb30bad2a7fcfc
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-14 08:30:35 +02:00
Flavio Santes
d599af40c8 ext/lib/mbedtls: Add the TLS configuration file
This patch adds the TLS configuration file required by mbed.

Change-Id: I8d99f27e028775de153a69cdd6706b8e2d0a3d9b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00
Jorge Ramirez-Ortiz
f994efa8c1 net/mqtt: Add BT support to MQTT publisher sample
Change-Id: I56d54c3550a530bf250210e939840e7c7e89c5d9
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-14 08:30:35 +02:00
Marcus Shawcroft
0296cdd728 net/dhcpv4: Ensure udp header checksum is computed correctly
The dhcpv4 client code builds ip and udp packets from scratch rather
than using the network stack to do the heavy lifting (why ?).

When it computes the udp checksum of each packet it builds it neglects
to clear any preexisting detritus from the checksum field.  The result
of this is that some packets will be built with correct checksums and
some will be built with incorrect checksums.

This is the underlying reason that the dhcp client often taken many
retransmissions and elapsed time before in order to acquire an IP
address.

Change-Id: Iebd1ed34e06f7f2e53d45f6d1555e22f48490287
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 08:30:34 +02:00
Marcus Shawcroft
ccd6d8c79f net/dhcpv4: Remove unused dhcpv4 offer state
The offer state is unused, remove it.

Change-Id: I9d6217dae291bb90c57c77ce439809bf7e9a9177
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 08:30:34 +02:00
Marcus Shawcroft
45e199c812 net/dhcpv4: Fix event/state mismatch
Fix long standing issue where a dhcpv4 message type is compared
against a dhcpv4 state machine state name rather than a message type.
The issue probably arizes due to the similarity in names between
messages and states.  By accident, the relevant message types and
states happen to share the same numbers, hence the implementation
works, but is ill defined.

Change-Id: I5c028de4336ff42f6696e28b3492c932c58b5a05
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 08:30:34 +02:00
Richard Peters
d502c24a5d samples: net: Add .conf file for qemu_cortex_m3 in echo_*
Added conf files for qemu_cortex_m3, until a better solution
than CONF_FILE=prj_$(BOARD).conf exists in the makefile.

Change-Id: I1edc4f37bb3c49ecb65abf7c93b3c9f4608d601e
Signed-off-by: Richard Peters <mail@richardpeters.de>
2017-02-14 08:30:34 +02:00
Marcus Shawcroft
bbada2de50 eth/mcux: Add basic PHY support.
Add basic PHY management sufficient to detect link up, link down and
auto negotiated link speed / duplex.  The PHY driver is implemented as
a state machine that executed in the system work queue.  The
implementation is non blocking, using the MII interrupt to capture the
completion of read and write events.

This PHY management should be fairly generic. In the future, it may be
beneficial to pull this code out as a standalone PHY driver for use
with other ethernet drivers.

JIRA: ZEP-1674

Change-Id: I3dcb5c14982ef4b40591fcf10d84840b8a2558e5
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
f40bdd67ac net/http: Improve network configuration routines
Modify the network setup routine to accept the following parameters:
- network context
- accept callback
- server IP address
- server port

This change will allow us to reuse this routine for TLS.

Change-Id: I1fdbaa908783c69f87863cbc597b42f39358762c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
79a064fae8 net/http: Add QEMU support to the HTTP server sample app
This patch adds the QEMU prj file for the HTTP server sample
app.

Change-Id: I0b910b5ec9970a7ffe9621e19d9544d899c22132
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
bed71d0a02 net/mqtt: Fix inline doc for MQTT
Fix inline documentation for the MQTT API.

Jira: ZEP-1669

Change-Id: I90702eae236a9189b58e0f2fb2a6c5a3eeaf959c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
449cbbd874 net/dns: Update QEMU prj file
Update the IPv4 addresses to 192.0.2.x.

Change-Id: I0eafccfaf691cfd2ffb896e18d3fdcf091837edc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Vinicius Costa Gomes
d8d16e81f5 iot/zoap: Add missing const modifier to header file
Makes it cleared that zoap_update_from_block() doesn't modify the
packet.

Change-Id: I35429b153370c50eb5ae9c914b47a3144faf2f04
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Vinicius Costa Gomes
b032f54f60 iot/zoap: Fix header indentation
Change-Id: Iea2dd0f2493e240caa33f81fa68e5be894f0de86
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Vinicius Costa Gomes
e190ffe200 iot/zoap: Fix handling of 16-bytes block-wise transfers
This fixes the case that a request for block number (NUM) 0, using a
16 byte block was considered invalid.

This was because it is encoded as the value 0 (zero), which can be
expressed as the BLOCK1 option present but without any value
associated. The old code considered this the same as the option not
existing.

Change-Id: I0f3912803a88865e9f544a6d0078ed4231775a88
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Vinicius Costa Gomes
62a6c9c6d0 samples/zoap-server: Update docs with information about libcoap
Add information about how to run libcoap's[1] implementation of the
ETSI testcases against zoap-server.

Jira: ZEP-1538

[1] https://github.com/obgm/libcoap (branch develop)

Change-Id: I6aa5989575cc15630371aa0761bee98fb6fe1b80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Vinicius Costa Gomes
0c94d6a085 iot/zoap: Improve zoap.h documentation
Now types and functions have better explanations of their usage and
parameters associated.

Jira: ZEP-1657

Change-Id: I146688324080ac3cf0876f1db3c92c9514e1303d
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif
d4c9a7d80c net: remove obsolete CONFIG_NET_YAIP
Change-Id: Ie8ef79e7d7a6f229af3771b7786af3db89c5e458
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 08:30:33 +02:00
Jean-Paul Etienne
d0a33869a5 riscv32: move riscv privileged architecture specifics within a common header file
Added a riscv-privilege.h header file that contains common
definitions for all riscv SOCs supporting the riscv
privileged architecture specification.

This shall ease addition of future riscv SOCs supporting
the riscv privileged architecture spec.

Change-Id: I5714bf70eeda738a25967ed26d3d0d2aaa0c9989
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-02-14 05:23:14 +00:00
Andrew Boie
587ba7b8ea arc: move openocd_dbg section
Its current placement was splitting the vector table in half.
Move to rodata, a better place for it. There's no requirement for
it to be in the text section.

Change-Id: I67724b2a26a9cb62c2ccd473cb54c53e4f74dc32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-14 02:14:51 +00:00
Marcus Shawcroft
459e850429 scripts: Fix hardwired python path in extract_dts_include.py
Replace the hardwired #! python path with a PATH search.  This is
necessary to allow build tools to execute from a virtualenv.

Change-Id: Ib83131fd96656bc9f76c606356b1f92c877cc117
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 02:14:39 +00:00
Jithu Joseph
4462509ea7 spi_test: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib97ed8da830126c9fbfa2269c8b2327d2f1be2f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:53 +00:00
Jithu Joseph
ecba9dee51 test_mpool_api: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: I5700ff6b374815325fa858cfd11f8938c82d8337
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:52 +00:00
Jithu Joseph
d3455754d3 samples: webusb: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib54d43bbfae4c7819b1e2b82d2931bfe1201ecce
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:52 +00:00
Anas Nashif
81dcc0933a boards: tinyTILE: enable USB console by default
Jira: ZEP-1710
Change-Id: I656373206af843915262d17c165a6525582fe12f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-13 23:44:50 +00:00
Andrew Boie
29fa81fec2 Merge remote-tracking branch 'origin/core'
Adds support for Xtensa architecture.

Andrew Boie (24):
      xtensa: fixup license identifiers
      xtensa: fix find_msb_set() and find_lsb_set()
      xcc: add location of C++ compiler
      Makefile: test for -fno-asynchronous-unwind-tables
      xtensa: Makefile: cleanup
      xtensa_sim_console: remove deprecation warning
      xt-run: delete any stale fifos to avoid mkfifo error
      xt-sim: enable use of xtensa simulator with 'make run'
      sanitycheck: don't disable tryrun
      xt-run: fix sanitycheck communication
      REVERTME: disable xip test on xtensa
      xt-sim: add support for 'make debug'
      xt-run: don't leave dead emulator processes lying around
      xcc: add ccache support
      legacy: work around XCC issue in MDEF threads
      xtensa: cleanup fatal error handling
      xtensa: fix build warning if no coprocessors present
      xtensa: remove nonexistent offset
      REVERTME: cpp_synchronization: disable on Xtensa
      REVERTME: tests: stackprot: disable on xtensa
      sanitycheck: fix defconfig regex
      sanitycheck: only disable tryrun when using SDK
      xtensa: fix numerous checkpatch issues
      REVERTME: tests: crypto: disable on Xtensa

Max Filippov (1):
      xtensa: support 'make qemu' target

Mazen NEIFER (62):
      Xtensa port: Started port to for Xtensa cores family.
      Xtensa port: Added board config files for Xtensa simulator paltform
      Xtensa port: Added support for XCC, the Cadence Systems Inc compiler
      Xtensa port: Added kernel arch dependent structs and functions.
      Xtensa port: Added Xtensa header generic files.
      Xtensa port: Fixed typo in XCC toochain specific make file.
      Xtensa port: Added Xtensa specific include files.
      Xtensa port: Added support for Xtensa cores in toolchain/gcc.h.
      Xtensa port: Added support in arch/cpu.h for Xtensa cores.
      Xtensa port: Remove XCC warning about unrecognized CLI option.
      Xtensa port: Added fields offset support for kernel and thread structures.
      Xtensa port: Added Kbuild file for Xtensa arch.
      Xtensa port: Added support for Xtensa architecture in zephyr include files.
      Xtensa port: Added support for Xtensa architecture to linker-defs.h.
      Xtensa port: Removed the need to put an empy file soc.c in arch/xtensa/soc dir.
      Xtensa port: Added Xtensa internal timer configuration need by assembly files.
      Xtensa port: Added support for Xtensa simulator console driver.
      Xtensa port: Added Xtensa specific code (C + S) files.
      Xtensa port: Fixed tests/kernel/context to compile with Xtensa internal timer.
      Xtensa port: Enable long calls for Xtensa vector table.
      Xtensa port: Moved XCC specific libraries out of genric Xtensa make file.
      Xtensa port: Added linker script for several Xtensa cores.
      Xtensa port: Define __builtin_unreachable() as CLI macro when using XCC.
      Xtensa port: Changed simulation support with xt-run/xtsc-run to be qemu like.
      Xtensa port: Fixed assembly comments to be accurate with code.
      Changed Kbuild to pass also KBUILD_CPPFLAGS to CC on addition to KBUILD_CFLAGS.
      Xtensa port: Added support for Xtensa internal timer as system timer.
      Xtensa port: Replaced call to legacy sys_thread_self_get by one to k_current_get
      Xtensa port: _thread_entry shall use call4 to start the thread.
      Xtensa port: Let xcc specific make file override unsupported -Og with -O0.
      Xtensa port: Removed compiler warnings about printf formats/arguments mismatch.
      Xtensa port: Added missing initalization of thread base sturct in _new_thread.
      Xtensa port: Removed warnings related to function _NanoFatalErrorHandler.
      Xtensa port: Fixed Swap function not updating _kernel.current.
      Xtensa port: Fixed RAMABLE_REGION in linker scripts.
      sanitycheck: support other simulators (xt-run and/or xtsc) than QEMU.
      gitignore: Ignore Eclipse (Xtensa Xplorer) project files.
      Xtensa port: Fixed function setting Sawp return value.
      Xtensa port: Enable console when building for Xtensa simulator as board.
      Fixed compilation error caused by bad initialization of unamed union field.
      Xtensa port: Increased idle thread stack size to avoid stack overflow.
      Xtensa port: Removed duplicate file and renamed to sys_io.h as other platforms.
      Xtensa port: Fixed linker script for hifi_mini core.
      Xtensa port: Use directly assmebler and linker instead of via the compiler.
      sanitycheck: Fixed displayed log when current directory is a symbolic link.
      Xtensa port: Removed duplicate code and fixed update of current thread pointer.
      Xtensa port: Restore interrupted context the same way as premption resume.
      Xtensa port: Moved coprocessor stack area on bottom of stack, just after TCS.
      Xtensa port: xt*-run requires options to be passed before file to be ran.
      Xtensa port: Set Swap function result to -EAGAIN.
      Xtensa port: Removed unsupported c++ flags cuasing xt-c++ to throw an error.
      Xtensa port: Connect Xtensa timer to tick IRQ in legacy test_context.
      Xtensa port: Fixed memory corruption in interrupt handler exit function.
      Xtensa port: Fixed defintion of MAX_HEAP_SIZE, thus, compilation of new_lib.
      Xtensa port: Added support for sample_controller core and set is as default.
      Xtensa port: Fixed scheduling bug caused to missing Endianess related macros.
      Xtensa port: Prevent preemption of locked threads.
      Xtensa port: Fixed compilation errors caused by last rebase on master.
      Xtensa port: Fixed Xtensa timer in case of tickles idle.
      tests: Introduced new config option to add extra stack size for tests.
      xtensa port: Added arch .ini file to support xt-sim
      Xtensa port: Removed trailing spaces and unused macros. Reformatted comments.

 .gitignore                                   |    3 +
 Kbuild                                       |    2 +-
 Makefile                                     |   16 +-
 arch/Kconfig                                 |    4 +
 arch/xtensa/Kbuild                           |   12 +
 arch/xtensa/Kconfig                          |   81 +
 arch/xtensa/Makefile                         |   41 +
 arch/xtensa/core/Makefile                    |   18 +
 arch/xtensa/core/atomic.S                    |  405 ++++
 arch/xtensa/core/cpu_idle.c                  |   39 +
 arch/xtensa/core/crt1-boards.S               |  271 +++
 arch/xtensa/core/crt1-sim.S                  |  246 ++
 arch/xtensa/core/fatal.c                     |  242 ++
 arch/xtensa/core/irq_manage.c                |   38 +
 arch/xtensa/core/irq_offload.c               |   39 +
 arch/xtensa/core/offsets/Makefile            |    1 +
 arch/xtensa/core/offsets/offsets.c           |   65 +
 arch/xtensa/core/startup/Makefile            |    2 +
 arch/xtensa/core/startup/reset-vector.S      |  695 ++++++
 arch/xtensa/core/sw_isr_table.S              |   59 +
 arch/xtensa/core/swap.S                      |   96 +
 arch/xtensa/core/thread.c                    |  179 ++
 arch/xtensa/core/xt_zephyr.S                 |  388 ++++
 arch/xtensa/core/xtensa_context.S            |  609 +++++
 arch/xtensa/core/xtensa_intr.c               |   69 +
 arch/xtensa/core/xtensa_intr_asm.S           |  140 ++
 arch/xtensa/core/xtensa_vectors.S            | 1887 ++++++++++++++++
 arch/xtensa/include/kernel_arch_data.h       |  195 ++
 arch/xtensa/include/kernel_arch_func.h       |   94 +
 .../include/kernel_event_logger_arch.h       |   36 +
 arch/xtensa/include/offsets_short_arch.h     |   40 +
 arch/xtensa/include/start_task_arch.h        |   37 +
 arch/xtensa/include/xtensa_api.h             |   73 +
 arch/xtensa/include/xtensa_config.h          |  141 ++
 arch/xtensa/include/xtensa_context.h         |  314 +++
 arch/xtensa/include/xtensa_rtos.h            |  202 ++
 arch/xtensa/include/xtensa_timer.h           |  149 ++
 arch/xtensa/soc/D_108mini/Kconfig            |   12 +
 arch/xtensa/soc/D_108mini/Makefile           |    1 +
 arch/xtensa/soc/D_108mini/linker.ld          |  606 +++++
 arch/xtensa/soc/D_212GP/Kconfig              |   12 +
 arch/xtensa/soc/D_212GP/Makefile             |    1 +
 arch/xtensa/soc/D_212GP/linker.ld            |  612 +++++
 arch/xtensa/soc/D_233L/Kconfig               |   12 +
 arch/xtensa/soc/D_233L/Makefile              |    3 +
 arch/xtensa/soc/D_233L/linker.ld             |  513 +++++
 arch/xtensa/soc/Kconfig.cores                |   62 +
 arch/xtensa/soc/XRC_D2PM/Kconfig             |   12 +
 arch/xtensa/soc/XRC_D2PM/Makefile            |    1 +
 arch/xtensa/soc/XRC_D2PM/linker.ld           |  616 +++++
 arch/xtensa/soc/XRC_D2PM_5swIrq/Kconfig      |   12 +
 arch/xtensa/soc/XRC_D2PM_5swIrq/Makefile     |    1 +
 arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld    |  616 +++++
 .../xtensa/soc/XRC_FUSION_AON_ALL_LM/Kconfig |   12 +
 .../soc/XRC_FUSION_AON_ALL_LM/Makefile       |    1 +
 .../soc/XRC_FUSION_AON_ALL_LM/linker.ld      |  445 ++++
 arch/xtensa/soc/hifi2_std/Kconfig            |   12 +
 arch/xtensa/soc/hifi2_std/Makefile           |    1 +
 arch/xtensa/soc/hifi2_std/linker.ld          |  616 +++++
 arch/xtensa/soc/hifi3_bd5/Kconfig            |   12 +
 arch/xtensa/soc/hifi3_bd5/Makefile           |    1 +
 arch/xtensa/soc/hifi3_bd5/linker.ld          |  392 ++++
 arch/xtensa/soc/hifi3_bd5_call0/Kconfig      |   12 +
 arch/xtensa/soc/hifi3_bd5_call0/Makefile     |    1 +
 arch/xtensa/soc/hifi3_bd5_call0/linker.ld    |  392 ++++
 arch/xtensa/soc/hifi4_bd7/Kconfig            |   12 +
 arch/xtensa/soc/hifi4_bd7/Makefile           |    1 +
 arch/xtensa/soc/hifi4_bd7/linker.ld          |  439 ++++
 arch/xtensa/soc/hifi_mini/Kconfig            |   12 +
 arch/xtensa/soc/hifi_mini/Makefile           |    1 +
 arch/xtensa/soc/hifi_mini/linker.ld          |  364 +++
 arch/xtensa/soc/hifi_mini_4swIrq/Kconfig     |   12 +
 arch/xtensa/soc/hifi_mini_4swIrq/Makefile    |    1 +
 arch/xtensa/soc/hifi_mini_4swIrq/linker.ld   |  364 +++
 arch/xtensa/soc/sample_controller/Kconfig    |   12 +
 arch/xtensa/soc/sample_controller/Makefile   |    1 +
 arch/xtensa/soc/sample_controller/linker.ld  |  606 +++++
 boards/xtensa/xt-sim/Kconfig                 |   12 +
 boards/xtensa/xt-sim/Kconfig.board           |    8 +
 boards/xtensa/xt-sim/Kconfig.defconfig       |   11 +
 boards/xtensa/xt-sim/Makefile                |    5 +
 boards/xtensa/xt-sim/Makefile.board          |    4 +
 boards/xtensa/xt-sim/board.c                 |    4 +
 boards/xtensa/xt-sim/board.h                 |   10 +
 boards/xtensa/xt-sim/xt-sim_defconfig        |    4 +
 drivers/console/Kconfig                      |   19 +-
 drivers/console/Makefile                     |    1 +
 drivers/console/xtensa_sim_console.c         |   86 +
 drivers/timer/Kconfig                        |   43 +
 drivers/timer/Makefile                       |    2 +
 drivers/timer/xtensa_sys_timer.c             |  351 +++
 include/arch/cpu.h                           |    2 +
 include/arch/xtensa/addr_types.h             |   15 +
 include/arch/xtensa/arch.h                   |  144 ++
 include/arch/xtensa/exc.h                    |   45 +
 include/arch/xtensa/offsets.h                |   11 +
 include/arch/xtensa/sys_io.h                 |  113 +
 include/arch/xtensa/xtensa_irq.h             |   54 +
 include/kernel.h                             |    4 +-
 include/legacy.h                             |    2 +-
 include/linker-defs.h                        |    2 +
 include/linker-tool-gcc.h                    |    2 +
 include/toolchain/common.h                   |    4 +-
 include/toolchain/gcc.h                      |    5 +-
 kernel/Kconfig                               |    1 +
 lib/libc/newlib/libc-hooks.c                 |    3 +
 .../microkernel/testcase.ini                 |    1 +
 .../nanokernel/testcase.ini                  |    1 +
 scripts/Makefile.toolchain.xcc               |  104 +
 scripts/Makefile.xt-run                      |   32 +
 scripts/Makefile.xtsc-run                    |   51 +
 scripts/sanity_chk/arches/xtensa.ini         |    7 +
 scripts/sanitycheck                          |    9 +-
 scripts/support/xt-gdb.sh                    |   23 +
 scripts/waitpid                              |    5 +
 tests/Kconfig                                |    5 +
 tests/crypto/test_aes/testcase.ini           |    2 +
 tests/crypto/test_ctr_prng/testcase.ini      |    2 +
 tests/crypto/test_ecc_dh/testcase.ini        |    2 +
 tests/kernel/context/src/context.c           |    5 +-
 .../test_fifo_api/src/test_fifo_contexts.c   |    2 +-
 .../fifo/test_fifo_api/src/test_fifo_loop.c  |    2 +-
 .../test_lifo_api/src/test_lifo_contexts.c   |    2 +-
 .../lifo/test_lifo_api/src/test_lifo_loop.c  |    2 +-
 .../kernel/mbox/mbox_api/src/test_mbox_api.c |    2 +-
 .../src/test_mpool_threadsafe.c              |    2 +-
 tests/kernel/stackprot/testcase.ini          |    2 +-
 .../cdata_api/src/test_customdata_api.c      |    2 +-
 .../src/test_threads_cancel_abort.c          |    2 +-
 .../lifecycle_api/src/test_threads_spawn.c   |    2 +-
 .../src/test_threads_suspend_resume.c        |    2 +-
 .../schedule_api/src/test_sched.h            |    2 +-
 tests/kernel/xip/testcase.ini                |    2 +
 .../legacy/kernel/test_context/src/context.c |    7 +-
 .../kernel/test_sema/nanokernel/src/sema.c   |    4 +-
 tests/legacy/kernel/test_sleep/src/sleep.c   |    4 +-
 .../test_stackprot/microkernel/testcase.ini  |    2 +-
 137 files changed, 14962 insertions(+), 39 deletions(-)
 create mode 100644 arch/xtensa/Kbuild
 create mode 100644 arch/xtensa/Kconfig
 create mode 100644 arch/xtensa/Makefile
 create mode 100644 arch/xtensa/core/Makefile
 create mode 100644 arch/xtensa/core/atomic.S
 create mode 100644 arch/xtensa/core/cpu_idle.c
 create mode 100644 arch/xtensa/core/crt1-boards.S
 create mode 100644 arch/xtensa/core/crt1-sim.S
 create mode 100644 arch/xtensa/core/fatal.c
 create mode 100644 arch/xtensa/core/irq_manage.c
 create mode 100644 arch/xtensa/core/irq_offload.c
 create mode 100644 arch/xtensa/core/offsets/Makefile
 create mode 100644 arch/xtensa/core/offsets/offsets.c
 create mode 100644 arch/xtensa/core/startup/Makefile
 create mode 100644 arch/xtensa/core/startup/reset-vector.S
 create mode 100644 arch/xtensa/core/sw_isr_table.S
 create mode 100644 arch/xtensa/core/swap.S
 create mode 100644 arch/xtensa/core/thread.c
 create mode 100644 arch/xtensa/core/xt_zephyr.S
 create mode 100644 arch/xtensa/core/xtensa_context.S
 create mode 100644 arch/xtensa/core/xtensa_intr.c
 create mode 100644 arch/xtensa/core/xtensa_intr_asm.S
 create mode 100644 arch/xtensa/core/xtensa_vectors.S
 create mode 100644 arch/xtensa/include/kernel_arch_data.h
 create mode 100644 arch/xtensa/include/kernel_arch_func.h
 create mode 100644 arch/xtensa/include/kernel_event_logger_arch.h
 create mode 100644 arch/xtensa/include/offsets_short_arch.h
 create mode 100644 arch/xtensa/include/start_task_arch.h
 create mode 100644 arch/xtensa/include/xtensa_api.h
 create mode 100644 arch/xtensa/include/xtensa_config.h
 create mode 100644 arch/xtensa/include/xtensa_context.h
 create mode 100644 arch/xtensa/include/xtensa_rtos.h
 create mode 100644 arch/xtensa/include/xtensa_timer.h
 create mode 100644 arch/xtensa/soc/D_108mini/Kconfig
 create mode 100644 arch/xtensa/soc/D_108mini/Makefile
 create mode 100644 arch/xtensa/soc/D_108mini/linker.ld
 create mode 100644 arch/xtensa/soc/D_212GP/Kconfig
 create mode 100644 arch/xtensa/soc/D_212GP/Makefile
 create mode 100644 arch/xtensa/soc/D_212GP/linker.ld
 create mode 100644 arch/xtensa/soc/D_233L/Kconfig
 create mode 100644 arch/xtensa/soc/D_233L/Makefile
 create mode 100644 arch/xtensa/soc/D_233L/linker.ld
 create mode 100644 arch/xtensa/soc/Kconfig.cores
 create mode 100644 arch/xtensa/soc/XRC_D2PM/Kconfig
 create mode 100644 arch/xtensa/soc/XRC_D2PM/Makefile
 create mode 100644 arch/xtensa/soc/XRC_D2PM/linker.ld
 create mode 100644 arch/xtensa/soc/XRC_D2PM_5swIrq/Kconfig
 create mode 100644 arch/xtensa/soc/XRC_D2PM_5swIrq/Makefile
 create mode 100644 arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld
 create mode 100644 arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/Kconfig
 create mode 100644 arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/Makefile
 create mode 100644 arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/linker.ld
 create mode 100644 arch/xtensa/soc/hifi2_std/Kconfig
 create mode 100644 arch/xtensa/soc/hifi2_std/Makefile
 create mode 100644 arch/xtensa/soc/hifi2_std/linker.ld
 create mode 100644 arch/xtensa/soc/hifi3_bd5/Kconfig
 create mode 100644 arch/xtensa/soc/hifi3_bd5/Makefile
 create mode 100644 arch/xtensa/soc/hifi3_bd5/linker.ld
 create mode 100644 arch/xtensa/soc/hifi3_bd5_call0/Kconfig
 create mode 100644 arch/xtensa/soc/hifi3_bd5_call0/Makefile
 create mode 100644 arch/xtensa/soc/hifi3_bd5_call0/linker.ld
 create mode 100644 arch/xtensa/soc/hifi4_bd7/Kconfig
 create mode 100644 arch/xtensa/soc/hifi4_bd7/Makefile
 create mode 100644 arch/xtensa/soc/hifi4_bd7/linker.ld
 create mode 100644 arch/xtensa/soc/hifi_mini/Kconfig
 create mode 100644 arch/xtensa/soc/hifi_mini/Makefile
 create mode 100644 arch/xtensa/soc/hifi_mini/linker.ld
 create mode 100644 arch/xtensa/soc/hifi_mini_4swIrq/Kconfig
 create mode 100644 arch/xtensa/soc/hifi_mini_4swIrq/Makefile
 create mode 100644 arch/xtensa/soc/hifi_mini_4swIrq/linker.ld
 create mode 100644 arch/xtensa/soc/sample_controller/Kconfig
 create mode 100644 arch/xtensa/soc/sample_controller/Makefile
 create mode 100644 arch/xtensa/soc/sample_controller/linker.ld
 create mode 100644 boards/xtensa/xt-sim/Kconfig
 create mode 100644 boards/xtensa/xt-sim/Kconfig.board
 create mode 100644 boards/xtensa/xt-sim/Kconfig.defconfig
 create mode 100644 boards/xtensa/xt-sim/Makefile
 create mode 100644 boards/xtensa/xt-sim/Makefile.board
 create mode 100644 boards/xtensa/xt-sim/board.c
 create mode 100644 boards/xtensa/xt-sim/board.h
 create mode 100644 boards/xtensa/xt-sim/xt-sim_defconfig
 create mode 100644 drivers/console/xtensa_sim_console.c
 create mode 100644 drivers/timer/xtensa_sys_timer.c
 create mode 100644 include/arch/xtensa/addr_types.h
 create mode 100644 include/arch/xtensa/arch.h
 create mode 100644 include/arch/xtensa/exc.h
 create mode 100644 include/arch/xtensa/offsets.h
 create mode 100644 include/arch/xtensa/sys_io.h
 create mode 100644 include/arch/xtensa/xtensa_irq.h
 create mode 100644 scripts/Makefile.toolchain.xcc
 create mode 100644 scripts/Makefile.xt-run
 create mode 100644 scripts/Makefile.xtsc-run
 create mode 100644 scripts/sanity_chk/arches/xtensa.ini
 create mode 100644 scripts/support/xt-gdb.sh
 create mode 100755 scripts/waitpid

Change-Id: I666a35e30526bcc6d57cc95ac5381abaec0ca0a5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 12:32:29 -08:00
Andrew Boie
f1260fb618 arc: linker.ld: fix BSS section declaration
The BSS section needs to use AT> in XIP systems otherwise the LMA
addresses in the ELF binary are wrong, leading to issues if we
try to manipulate the binary with objcopy. The GROUP_DATA_LINK_IN
macro does the right thing here.

This was already done on other arches but ARC was missed.

Change-Id: I93748e919e0b68c1ff2dfb4b85b7064a8d980f3a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 20:02:40 +00:00