Commit graph

99049 commits

Author SHA1 Message Date
Vikrant More
21f7bad751 samples: mesh: nrf52: Removed bug in reassignment of transition type
This PR will solve bug in reassignment of transition type to
Server.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 14:38:45 +02:00
Vikrant More
a7d1ce667c samples: mesh: nrf52: optimisation in timer uses
Now states which are bound have single timer that means
means for lightness variation there is one timer & for
temperature variation there is one timer.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
3ca4f7e215 samples: mesh: nrf52: corrected mapping of Message handler
Corrected mapping of message handler for Generic
Move Set, Generic Move Set Unack, Light CTL Set &
Light CTL Set Unack.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
ac1045acd2 samples: mesh: nrf52: coding style improvements.
Removed extra blank line. Add new
bound_states_transition_type_reassignment() function in
transition.c to improve code readability & understanding.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
bbef36e071 samples: mesh: nrf52: edition to improve Mesh performance
This edition would improve by default mesh network
performance. This is after testing with nRFMesh app
from Nordic Semiconductor.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Maureen Helm
f2d8d93269 drivers: sensor: Convert adxl362 to device tree
Converts the adxl362 sensor driver to get the device name and spi slave
properties from the device tree rather than Kconfig. Updates the
build_all test accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-11-14 23:54:57 -05:00
Andrei Emeltchenko
db42716cde usb: msc: Check input parameters for class handle
Fixes USB Certification tests for class requests.

Fixes #11359

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-14 23:54:08 -05:00
Andrei Emeltchenko
5bf12356e2 usb: msc: Do not give warning after SET_INTERFACE
Add USB_DC_INTERFACE 'handling'.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-14 23:54:08 -05:00
Andrei Emeltchenko
3f698494bb usb: msc: Set default Serial Number string
According to the "USB Mass Storage Class" Spec. the serial
number shall contain at least 12 valid digits, represented
as a UNICODE string.

Fixes: #11336

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-14 23:54:08 -05:00
Spoorthi K
93ddc232d7 samples: drivers: Update yaml with regex and fixture
Include regex pattern matching of console output
to determine the sample execution status.

Add fixture to determine the hardware dependency
if any. If FRAM is connected to board externally,
then with fixture, automation would be able to
identify the board with sensor to trigger the
execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-11-14 23:43:48 -05:00
Spoorthi K
a38042d2eb samples: sensor: Include regex matching and fixture
Regex pattern matching is included to match the
execution log from console to return test result
in automation.

Also add fixture to identify the external sensor
connected for automation framework to trigger test
cases on particular board which is connected with
required sensor.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-11-14 23:43:48 -05:00
Anas Nashif
7dd19ea74d sanitycheck: filter by test fixtures
Support specifying a test fixture attached to a board to filter in/out
tests that require this fixture to be able to run a test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-14 23:42:45 -05:00
Michael Scott
36b93e121f gen_isr_tables: remove hard-coded max IRQ value of 32
In the MULTI_LEVEL_INTERRUPTS Kconfig we have a symbol for defining
the maximum IRQ per aggregator: MAX_IRQ_PER_AGGREGATOR

Instead of using a hard-coded value of 32 max irq per level,
let's use the value of MAX_IRQ_PER_AGGREGATOR

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-14 21:14:14 -05:00
Michael Scott
28fe29dd36 gen_isr_tables: fix check for CONFIG_3RD_LEVEL_INTERRUPTS
If CONFIG_3RD_LEVEL_INTERRUPTS is not enabled then we see the following
error during sw_isr_table generation:
Traceback (most recent call last):
  File "zephyr/arch/common/gen_isr_tables.py", line 291, in <module>
    main()
  File "zephyr/arch/common/gen_isr_tables.py", line 199, in main
    if syms["CONFIG_3RD_LEVEL_INTERRUPTS"]:
KeyError: 'CONFIG_3RD_LEVEL_INTERRUPTS'
ninja: build stopped: subcommand failed.

Fix the logic to look for the symbol instead of referencing it.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-14 21:14:14 -05:00
Himanshu Jha
817f4b374f coccinelle: Suppress reports/warnings for ext/
The following addition `depends on !(file in "ext")` allows
to exclude `ext/` warnings reported by coccinelle scripts.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-14 19:20:34 -05:00
Andy Ross
7aeeb92535 drivers/timer/xtensa_sys_timer: Add hook for old-style interrupt handling
We still have one platform using (for now) the pre-asm2 integration
where the timer interrupt was handled via custom assembly.  It calls a
function named "_timer_int_handler" always, not the one we register
with IRQ_CONNECT.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-14 19:08:27 -05:00
Andy Ross
23159cedec xtensa legacy: Fix stale use of removed kconfigs
The old xtensa layer had an unused/untested facility where it would
apparently try to slave a timer tick to an arbitrary interrupt.  The
legacy headers were still checking the kconfigs used to enable that
even though nothing wants it and the new driver has removed them,
breaking builds on platforms like S1000 that still use the older
layer.

Don't try to finess this as these files are going away.  Just make
them local preprocessor symbols and set them to the default values
they always had.

(Note: the feature doesn't sound like it would have been so bad,
actually.  We should probably crib that idea of having an
"external_tick" driver, but there's no reason for it to have been
arch-specific.)

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-14 19:08:27 -05:00
Andy Ross
d411514a5f xtensa: Don't call ISRs for disabled interrupts
Xtensa interrupts are handled generically, by testing a set of flagged
interrupts in the INTERRUPT register.  It's not possible to know
exactly which device "caused" an interrupt.

The entry code was dispatching correctly, but it was failing to test
the enable state in INTENABLE.  Such an interrupt will never "fire",
but it might still be flagged, and if we happen to end up handling an
interrupt of the same priority (due to some other device) the entry
handler would incorrectly invoke the disabled interrupt.

Found by dumb luck and a comedy of errors: the recent timer driver
change swapped the counter in use, which changed the interrupt number
to one shared with the I2C driver, whose early interrupts (odd that
this device is interrupting on boot when not in use, but whatever)
would then discover the OTHER timer counter had been flagged and try
to invoke an ISR for that other counter, which was the _irq_spurious()
spurious interrupt handler.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-14 19:08:27 -05:00
Andy Ross
953a81a194 esp32: Enable an early-boot printk hook
The firmware starts us with an already-initialized UART and a simple
ROM hook.  Use that as the default printk handler so we can log in
very early boot.  It will be overriden later (as it happens, by
another handler based on the same firmware hooks).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-14 19:08:27 -05:00
Andy Ross
923e1b60e7 misc/printk: Make the default char_out routine weak
Architecture init code and/or HAL layers often have a working
"putchar" routine available long before the Zephyr driver layer is
initialized.

Make the default printk() output a weak symbol, so it can be
overridden on these platforms.

Also remove the kconfig depedency on CONSOLE_HAS_DRIVER, as this is a
non-driver mechanism.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-14 19:08:27 -05:00
Marti Bolivar
c9a4058605 cmake: fix dts fixup file location for external SOC
The board is done correctly, but there's a missing SOC_DIR.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-14 23:32:23 +01:00
Armando Visconti
36a1a7c254 board/argonkey/dts: Configure i2c3 at 400KHz
As explained in issue #8915 the STM32F4xx SoC family I2C
does not work well in Standard mode (100KHz). So let's
configure i2c3 in Fast mode (400KHz).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-11-14 16:28:04 -05:00
Anas Nashif
14ba292870 xtensa: fix dts_fixup.h with new DT_ prefix
This fixes majority of drivers, however we still see build failures with
the interrupt handler.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-14 12:59:12 -05:00
Aurelien Jarno
16994088fd drivers: entropy: add Atmel SAM entropy generator driver
Tested on the Atmel SAM E70 Xplained board.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-14 12:58:49 -05:00
Kumar Gala
ff74f24bef samples: boards: Rename microbit dir to bbc_microbit
Have the sample directory match what we call the board name directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 12:41:12 -05:00
Ioannis Konstantelias
a933297ef7 boards: stm32l496g_disco: fix sublist identation
Fix identation so that the sublists appear as expected.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2018-11-14 12:07:47 -05:00
Ioannis Konstantelias
5a3ed5b09d boards: stm32l496g_disco: fix copy-paste typo
Change LPUART 1 pin mapping to match the User Manual's.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2018-11-14 12:07:47 -05:00
Anas Nashif
9c14767475 boards: xtensa: remove stray CONFIG_BOARD_XTENSA
BOARD_XTENSA was removed for Kconfig but was left in _defconfig, so
remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-14 08:56:16 -05:00
Radoslaw Koppel
9a1e7d06b0 samples: subsys: usb: hid-mouse: Align report descriptor
This commit fix the alignment of the report descriptor
to make it easier to read.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-14 08:53:55 -05:00
Radoslaw Koppel
f9be2c563d samples: subsys: usb: hid-mouse: Activate pull on switch pin
This commit would add the pull-up or pull-down on the switch pin and
makes it functional on the board where there is no external pull-up.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-14 08:53:55 -05:00
Erwan Gouriou
1e31faad06 dts: stm32f4: Fix clock settings for usart1
Clock mask was not set correctly for usart1 in stm32f4.dtsi

Fixes #11339

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-14 08:23:13 -05:00
Kumar Gala
f210d11970 boards: Remove including soc.h in board.h
We should let drivers or board code include soc.h directly so we can keep
board.h to local info for board specific code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 06:44:02 -06:00
Kumar Gala
758d5b14a9 boards: Remove board.h from boards that don't need it
These boards don't need board.h to work so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 06:44:02 -06:00
Andrew Boie
9d14874db1 kernel: expose device_get_binding() to user mode
User mode may need to use this API to get a handle on
devices by name, expose as a system call. We impose
a maximum name length as the system call handler needs
to make a copy of the string passed in from user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-13 19:06:05 -05:00
Savinay Dharmappa
f805343941 tests: boards: intel_s1000_crb: Add a test app to read/write from flash
patch test SPI flash on intel_s1000_crb board.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Savinay Dharmappa
bc4d0faae6 board: xtensa: intel_s1000_crb: Add macronix flash support
patch enables necessary configs to add macronix flash
support for intel_s1000_crb board.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Savinay Dharmappa
8c65c1f18c dts: bindings: slave: Add yaml file to support spi flash
add yaml file to support spi flash

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Savinay Dharmappa
cf58f83dd6 boards: xtensa: intel_s1000_crb: Enable SPI Master driver
patch enables SPI Master driver on intel_s1000_crb

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Savinay Dharmappa
eddfd537d2 arch: xtensa: Add I/O functions to read/write.
patch add I/O function to read / write from 16 bit
memory mapped registers

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Savinay Dharmappa
87e5493167 drivers: flash: add a generic spi nor flash driver
This driver is inspired from the w25qxxdv SPI NOR flash driver which was
already implementing the CFI (Common Flash Interface) for its purpose.
To handle other NOR flash a flash id table (as Linux do) which contains
the geometry for a few SPI NOR flash based on their JEDEC ID has been
introduced.
We currently support the following flash:
 - W25Q80
 - W25Q16
 - W25Q32
 - S25FL216K
 - MX25UM512

The read and write functions are able to handle more then one page at a
time and return the number of bytes read or write.
Also because every NOR flash expect to disable the write protection
before writing or erasing, the write enable command is now part of the
write and erase functions.

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Kumar Gala
128fef2c09 dts: Fix builds of arc EMSK & NSIM SoCs
With the DT_ prefix change we missed adding prefixes in dts_fixup.h
on snps_emsk & snps_nsim for ARC_ICCM_0_BASE_ADDRESS and
ARC_ICCM_0_SIZE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 18:47:16 -05:00
Andy Ross
39b2a09f38 drivers/timer: New xtensa timer with tickless support
Rewritten Xtensa CCOUNT driver along the lines of all the other new
drivers.  The new API permits much smaller code.

Notably: The Xtensa counter is a 32 bit up-counter with a comparator
register.  It's in some sense the archetype of this kind of timer as
it's the simplest of the bunch (everything else has quirks: NRF is
very slow and 24 bit, HPET has a runtime frequency detection, RISC-V
is 64 bit...).  I should have written this one first.

Note also that this includes a blacklist of the xtensa architecture on
the tests/driver/ipm test.  I'm getting spurious failures there where
a k_sem_take() call with a non-zero timeout is being made out of the
console output code in interrupt context.  This seems to have nothing
to do with the timer; I suspect it's because the old timer drivers
would (incorrectly!) call z_clock_announce() in non-interrupt context
in some contexts (e.g. "expiring really soon").  Apparently this test
(or something in the IPM or Xtensa console code) was somehow relying
on that on Xtensa.  But IPM is a Quark thing and there's no particular
reason to run this test there.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
f04f797c2b drivers/timer: New, tickless-capable RISC-V machine timer driver
Rewritten driver along the lines of all the other new drivers,
implementing the new timer API.  Structurally, the machine timer is an
up-counter with comparator, so it works broadly the same way HPET and
NRF do.  The quirk here is that it's a 64 bit counter, which needs a
little more care.

Unlike the other timer reworks, this driver has grown by a few lines
as it used to be very simple.  But in exchange, we get full tickless
support on the platform.

Fixes #10609 in the process (the 64 bit timer registers are unlatched
for sub-word transfers, so you have to use careful ordering).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
03f007edaf drivers/timer: Reworked NRF driver with tickless support
Reworked using the older hardware interface code, but with an
implementation of the new API only.  Much smaller & simpler.

As yet, tested (manually) only on a nrf52_pca10056 board.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
1c3051459b kernel/sched: Fix race in k_sched_time_slice_set()
If this function is itself interrupted by a timeslice event, the
slicing state can be corrupted.  Just re-use the scheduler lock
instead of using a new spinlock; this is a low-latency function that
won't deadlock.  Found by inspection.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
002a9f4cb7 drivers/timer/hpet: Completely new, simplified, tickless-capable driver
Rewritten along the lines of ARM SysTick.  Implements only the new,
simplified API.  MUCH smaller.  Works with tickless pervasively.  No
loss of functionality.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
9ff98f797a drivers/timer: Add more default stubs
Many drivers won't need to implement z_clock_idle_exit() or
sys_clock_disable(). Make those weak stubs too.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
c0a184c067 drivers/timer: Select tickless via driver kconfig flag
Add a TICKLESS_CAPABLE kconfig variable which is used by the kernel to
select tickless mode's default automatically on drivers that support
it (rather than having to set the default per-board).  Select it from
the ARM SysTick and Intel HPET drivers.

Also remove the old qemu_cortex_m3 default settings which this
replaces.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
ea35343eb1 tests/kernel/interrupt: Shrink very long k_busy_wait() argument
This test was written with an outrageously long timeout of 25 seconds.
That blows right through the 32 bit cycle counter on qemu_cortex_m3[1]
and produces an essentially random delay instead of the desired
number, causing a hang with the new SysTick driver in tickless mode.

Push the number down so it doesn't overflow.  The root cause, though,
is that k_busy_wait() can take arguments it can't handle.  It ought to
have an outer loop or something so that it can spin for INT_MAX
milliseconds correctly.

[1] Which has a 12MHz clock rate.  Many hardware implementations are
much faster still.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
Andy Ross
4b305e1a25 tests/kernel/context: Limit no-tick-during-irq-load to !TICKLESS
When TICKLESS_KERNEL is enabled, the current time in ticks is based on
a hardware counter and not interrupt delivery (which is the whole
point of tickless), so irq-locking does not prevent time from
advancing.  Disable this test in that configuration.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00