Commit graph

41120 commits

Author SHA1 Message Date
Johann Fischer
18b27b7f9d subsys: usb: fetch endpoint address from usb_ep_cfg_data
This patch changes all class functions so that the endpoint
address will be retrieved from the usb_ep_cfg_data at runtime.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
52eacf16a2 driver: usb: add check for endpoint capabilities
Add function to check capabilities of an endpoint.
Only basic properties are checked, especially on STM32
capabilities of different USB controller configurations
have to be considered in the future.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
7c7086049e include: driver: usb: add check for endpoint capabilities
Add API function to check capabilities of an endpoint.
It should be used to check the capabilities of an endpoint
before configuration. The driver should return 0 if the
endpoint configuration is possible.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
6807f3a826 subsys: usb: move descriptor parts to the class drivers
This patch moves the descriptor parts to related class
and function drivers and extends the usb_fix_descriptor
function so that the wTotalLength and bNumInterfaces
are corrected before enumeration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
589dbc4cd8 subsys: usb: add function to find and fix USB descriptors
This patch introduces a function to find and correct all string
descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
0fca16443a subsys: usb: rework usb string descriptor fixup
This patch simplifies the handling of the string descriptors.
It introduces common macro for all string descriptors to
calculate the length of the bString.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
cf14a60f5a include: usb: add descriptor and data section macros
This patch adds USB descriptor and data section macros.

Use USBD_DESCR_..._DEFINE macros to place the parts of USB device
descriptor in predetermined order in the USB descriptor
section. The parts of a device descriptor are also
sorted according to the macro argument. All parts of a
particular device descriptor must use the same argument.

Use USBD_CFG_DATA_DEFINE macro to place the data struct
of a class driver or function in the USB data section.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Johann Fischer
b35a41f981 include: linker: add sections for USB device stack
This patch adds a RAM section for the USB descriptors and
USB interfaces data.

The parts of USB descriptor can be declared independently in
different USB class drivers or functions. These must then be
placed in a predefined order one after the other without gaps
in a RAM section. There may also be several device descriptors
in the section such as for USB DFU.

Since at runtime the number of interfaces and endpoints in the
composite device descriptor is unknown, they must be corrected.
The class drivers or functions use the usb_cfg_data struct to
store the callbacks, interface and endpoints data. This struct
must also be corrected and needs to be placed in the data section.
The descriptor section and data section must be processed by
the USB Device Stack before the enumeration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-15 11:02:05 +02:00
Spoorthi K
a3fe7af2dd tests: obj_tracing: Enhance object counter logic
Restructured the test, added description and enhanced
semaphore count logic to check for semaphores created
only in the test.

Fixes: #7106

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-06-14 23:54:31 -04:00
Leandro Pereira
c16bce7a6a samples, subsys, tests: Use ARRAY_SIZE() whenever possible
The ARRAY_SIZE() utility macro will actually test the parameter types,
and ensure that it is only called with arrays, and not arrays decayed
to pointers.

Changes were performed with a simple Coccinelle script.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-14 19:12:51 -04:00
David B. Kinder
d901add4c7 doc: update .gitignore file list
Changes to kconfig documentation generation added some new files
(choice*.rst) that need to be added to the .gitignore list.  Actually,
all the doc/reference/kconfig/*.rst files should be ignored.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-14 18:01:36 -04:00
Rodrigo Peixoto
f5e3813010 docs: Fix mailbox k_mbox_msg.tx_block documentation
- Replace old tx_block.pool_id to tx_block.data;
- Fix code examples.

Signed-off-by: Rodrigo Peixoto <rodrigopex@ayna.tech>
Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-14 18:00:17 -04:00
Sebastian Bøe
d62117e5b8 kconfig: Change how BT affects SYSTEM_WORKQUEUE_PRIORITY
Invalid configurations should be detected during configuration instead
of during compilation whenever possible.

This patch replaces a BUILD_ASSERT on CONFIG_SYSTEM_WORKQUEUE_PRIORITY
with what is intended to be an equivalent Kconfig restriction.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-14 16:49:50 -04:00
Yasushi SHOJI
2e0af08e55 build: remove unused CMakeLists.txt
lib/libc/minimal/source/CMakeLists.txt and
lib/libc/minimal/source/stdout/CMakeLists.txt was introduced in
12f8f7616 but it is not used by the build system.  CMakeLists.txt in
the parent dir lib/libc/minimal/CMakeLists.txt adds C files to the
target with the lines like:

    ${CMAKE_CURRENT_SOURCE_DIR}/source/stdlib/atoi.c
    ${CMAKE_CURRENT_SOURCE_DIR}/source/stdlib/strtol.c

To make other empty CMakeLists.txt explicit, this commit adds a
comment line to them.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
2018-06-14 15:02:02 -04:00
Tomasz Bursztyka
2fe51996db drivers/flash: Remove irrelevant option in w25qxxdv driver
CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN is a left-over from old SPI API
usage. Now, there is no limit (besides the flash size) in SPI data
transaction.

Fixes #8327

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-14 14:41:52 -04:00
Ulf Magnusson
59c8ae8caf kconfiglib: Fix incorrectly ordered props. for some multi.def symbols
This commit fixes a pretty nasty bug that could cause properties on
symbols and choices defined in multiple locations to end up in the wrong
order, potentially affecting evaluation.

Alexander Wachter ran into this for an out-of-tree build.

Multi.def. symbols are rare in the Linux kernel, which is what the
Kconfiglib test suite uses for compatibility testing, so this managed to
slip through. Comprehensive selftests have been added for property
ordering on nested multi.def. symbols/choices.

This bug was introduced by commit e307ba340c ("kconfiglib: Record
which MenuNode has each property").

Commit message from Kconfiglib (c8801514d63aa)
==============================================

Fix incorrectly ordered properties for some nested multi.def. symbols

_propagate_deps() visits menu nodes roughly breadth-first, meaning
properties on symbols and choices defined in multiple locations could
end up in the wrong order when copied from the menu node for some
unlucky if/menu nestings.

Fix it by moving the menu-node-to-symbol/choice property copying in
_finalize_tree() so that it's guaranteed to happen in definition order.

This bug was introduced by commit 63a4418 ("Record which MenuNode has
each property").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-14 19:45:58 +02:00
Aurelien Jarno
bb55155d5b arch: arm: core: cortex_m: add a barrier before the dummy FP instruction
On Cortex-M7 CPU (at least on STM32F723), the dummy move FPU instruction
is executed before the FPU lazy state preservation is disabled. Add an
instruction synchronization barrier before it to avoid that.

At the same time, remove the data synchronization barrier after the
dummy move as it does not have any effect on RAM or registers.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-06-14 19:09:34 +02:00
Vinayak Kariappa Chettimada
660c5c92c0 Bluetooth: controller: Remove include guards in internal files
Remove include guards in internal files; it is an agreed
convention to not have include guards in internal header
files in Bluetooth subsystem.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-06-14 17:11:42 +02:00
Marc Reilly
6c60abb03b drivers: gpio: add dts support for nrf52 gpio
This adds basic support for declaring gpio nodes in dts for nrf52.
The dts.fixup provides mapping for the generated defines to the config
defines currently used by the nrf gpio driver.

Existing boards that use nrf52 are updated.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2018-06-14 15:56:39 +02:00
Aurelien Jarno
a55c72d35f subsys: usb/class/hid: make interrupt endpoint size configurable
The Kconfig option HID_INTERRUPT_EP_MPS does not have a prompt entry,
so it is not configurable in practice. Fix that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-06-13 21:07:09 -04:00
David B. Kinder
ef75956deb doc: update known-issues filter
New versions of Sphinx/Breathe are throwing a new  warning that
we'll need to filter before upgrading to breathe 4.9.1 and sphinx 1.7.5

This change won't impact our current builds but will prevent new known
warning messages when we upgrade the doc build tools.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-13 21:02:24 -04:00
Tomasz Gorochowik
e86c53b48f arch: arm: atmel_sam: Map the whole RAM in MPU
The extra region is wrapped in an "ifdef" as two MPU regions are used
only if the total memory size is not a power of two.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-06-13 16:12:05 -07:00
Tomasz Gorochowik
31aa9b9ad1 arch: arm: atmel_sam: Use a single RAM region when possible
There is no need for two RAM regions when the total amount of memory is
a power of two. With this change it will be possible to map the whole
memory and save one MPU region for such cases.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-06-13 16:12:05 -07:00
Gautier Seidel
77643677a1 esp32: update to ESP-IDF v3.0-dev-2648-gb2ff235b
Recent ESP-IDF provides OS-agnostic wifi binary, needed by #3723

Closes #8240

Signed-off-by: Gautier Seidel <gautier.seidel@tado.com>
2018-06-13 18:53:43 -04:00
Andy Ross
7bbd3a79ae tests/kernel: Add a test for CONFIG_MULTITHREADING=n
This is a feature Ben added so you could use Zephyr's arch layer to
bootstrap things like bootloaders without sucking in the whole kernel.
And it's worked until now.

But we never had a test for it, and I just broke it with the scheduler
rework.  Add a trivial test just to make sure this continues to link
and run.  Longer term it would be nice to have some kind of size
metric here to guarantee that the feature stays lean and doesn't pull
in needless code.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-06-13 17:23:05 -04:00
Andy Ross
3d14615f56 kernel: Restore CONFIG_MULTITHREADING=n behavior
The prepare_multithreading()/switch_to_main_thread() steps were being
done unconditionally, when with multhreading disabled we want to jump
straight into the main thread on the existing stack.

Needless to say, that doesn't work well.  Fixes #8361.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-06-13 17:23:05 -04:00
Johan Hedberg
b20aff2f80 Bluetooth: Introduce HCI driver quirks
Introduce a quirks field to the HCI driver struct, which can be used
to create exceptions in host behavior for non-standard or unusual
controller behavior. An initial quirk is added to prevent the host
from sending the HCI_Reset command (in which case the controller is
responsible for performing the reset).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-13 21:04:27 +02:00
Johan Hedberg
b1b1017178 Bluetooth: Export HCI command APIs through public hci.h header file
This is the simplest & cleanest way to make these APIs available for
drivers. We already have a public hci.h header file, so using it seems
most natural.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-13 21:04:27 +02:00
Ulf Magnusson
8df42eb4dc drivers: Replace ff hex constants with 0xff
This makes it easier to distinguish them from "true" undefined symbols.

Internally, all int/hex literals are treated as undefined symbols, which
always get their name as their value. The C tools work the same way.

The plan is to turn references to undefined Kconfig symbols into an
error later.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
2a8349950e drivers: sensors: Consistently quote "GPIO_0" string default
These cases weren't caught by the heuristic used by the warning added in
commit 6eabea3a7e ("Kconfiglib: Warn for unquoted string defaults"),
because "GPIO_0" has no lowercase characters in it.

Unquoted Kconfig values are are indistinguishable from reference to
(undefined) symbols in general. Quoting all string defaults will help
find "true" references to undefined Kconfig symbols, and makes it
clearer that the value is constant.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
02b5f3edc8 drivers: gpio: Fix GPIO_QMSI_{0,1}_NAME Kconfig references
These symbols were removed by commit ed26b95 ("drivers/gpio:
Removing dts generated options in QMSI Kconfig"). The settings should
come from DTS now.

Commit 9611002f7a ("boards/x86: Use right GPIO names for CC2520")
fixed some of the references, but there are still others left. Guess
that the same fix is appropriate in those spots (hardcoded
"GPIO_0"/"GPIO_1" names).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
2e6386f5af drivers: ieee802154: Remove GPIO_MCUX_PORT{A,B}_NAME Kconfig references
These symbols were removed by commit 4e8f29f319 ("gpio: Refactor the
mcux gpio driver to use dts"). The settings should come from DTS now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
7f5203d370 kconfig: Remove UART_QMSI_{0,1}_NAME Kconfig reference
This symbol was removed by commit 17c6456678 ("drivers/uart: Use dts
to set uart priorities for QMSI driver"). The setting should come from
DTS now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
4db7cce06e ext: lib: mgmt: Remove MDLOG Kconfig reference
This symbol never seems to have been defined.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
c0e0d6131d net: rpl: Fix malformed Kconfig default
'default false' should have been 'default n', though they happen to have
the same effect here, due to undefined Kconfig symbols ('false')
evaluating to 'n' in a boolean sense.

Kconfig bool symbols implicitly default to 'n', so remove the default
rather than fixing it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
99cef4c60d lib: Fix malformed JSON_LIBARY Kconfig default
'default N' should have been 'default n', though they happen to have the
same effect here, due to undefined Kconfig symbols ('N') evaluating to
'n' in a boolean sense.

Kconfig bool symbols implicitly default to 'n', so remove the default
rather than fixing it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Ulf Magnusson
f177fb88a0 arch: arc: Fix reference to removed NSIM Kconfig symbol
The NSIM symbol was removed in commit 9bc69a46fa ("boards: Update arc
em_starterkit support from 2.2 to 2.3").

Guess that UART_NSIM should be used here now, similar to what was done
in commit 45221a9706 ("serial: nsim: Fix impossible-to-enable
CONFIG_UART_NSIM").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 13:35:56 -04:00
Vinayak Kariappa Chettimada
070c1ae041 soc: nRF52x: Add Kconfig options to enable DC/DC converter
Added a hidden Kconfig option in arch/arm/soc/nordic_nrf
which is selected by selecting DC/DC circuitry being present
in the board.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-06-13 18:56:54 +02:00
Henrik Brix Andersen
e5b5f85c1a samples: servo_motor: Add support for the BBC micro:bit
Add support for the BBC micro:bit to the servo_motor sample
application.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-06-13 18:55:22 +02:00
Henrik Brix Andersen
fc1898ccb5 drivers: pwm: pwm_nrf5_sw: Add prescaler support
Add support for specifying the clock prescaler value for the HF timer
used for generating the PWM signals. This allows for lower timer
frequency and thus slower PWM signals (e.g. for use as servo
controller).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-06-13 18:55:22 +02:00
Henrik Brix Andersen
f5310d5b54 drivers: pwm: pwm_nrf5_sw: Fix calculation of cycles per second
The nRF5x HF timer base frequency is 16 MHz, not 16777216 Hz.

The improved accurracy of the PWM signal was verified with an
oscilloscope on a BBC micro:bit.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-06-13 18:55:22 +02:00
Alberto Escolar Piedras
ebbb744b03 native: Fix host BT driver kconfig warning
Fixed the BT_USERCHAN config warning
by setting it only if BT_HCI is selected,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-06-13 18:48:26 +02:00
Alberto Escolar Piedras
3a87e0ed05 native: Fix entropy generator kconfig warning
Fixed the FAKE_ENTROPY_NATIVE_POSIX config warning
by setting it only if the entropy generator is used,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-06-13 18:48:26 +02:00
Sebastian Bøe
8f3fea300a cmake: bluetooth: Don't #include gatt files from src files
Due to a bug in KBuild, bluetooth samples needed to #include the gatt
sources to re-use code between samples. This bug was not ported to
CMake so we can stop applying this workaround.

gatt source files are now directly added to the 'app' library instead
of having adapter source files in the app's src directory that
\#include's the gatt files.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-13 15:14:40 +02:00
Sebastian Bøe
f8dc4b6b50 net: bluetooth: Enforce the minimum user_data size at Kconfig
Invalid configurations should be detected during configuration instead
of during compilation whenever possible.

This patch replaces a BUILD_ASSERT on CONFIG_NET_BUF_USER_DATA_SIZE
with what is intended to be an equivalent Kconfig restriction.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-13 15:13:18 +02:00
Savinay Dharmappa
b7c4c0302c dts: riscv32: riscv32-qemu: Add device tree support
add device tree support for riscv32-qemu

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-06-13 08:47:52 -04:00
Paul Sokolovsky
268c0e3310 net: tcp: Add MSS option on sending SYN request
Currently, we add TCP options only to SYN+ACK reply to peer's SYN
(i.e. passive open). For consistency, add them also when we send
SYN ourselves (active open). In both cases, we add just MSS option
currently.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-13 08:45:54 -04:00
Paul Sokolovsky
e62972bb8e net: ethernet: net_eth_fill_header: Remove superfluous "frag" param
Ethernet header is always filled in the first fragment of a packet,
so passing it as a separate function paramter is supefluous.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-13 08:44:51 -04:00
Paul Sokolovsky
699023a987 net: ethernet: Fix asserts in net_eth_fill_header()
There's an apparent typo in testing net_buf headroom. Also, after
adding VLAN header support, its size should be used too.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-13 08:44:51 -04:00
Ulf Magnusson
f425c0aa27 scripts: kconfig: Disable the "FOO set more than once" warning
Some prj.conf files seem to deliberately override settings from the
board configuration (e.g. samples/bluetooth/hci_usb/prj.conf, with
GPIO=y). Disable the warning about a symbol being assigned more than
once to avoid warnings for those cases.

A list similar to WARNING_WHITELIST could be added later if more
warnings need to be disabled.

Also refactor the warning checking code a bit to get rid of some not's.

Suggested by Sebastian Bøe.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 14:06:38 +02:00