Date   

Help for tests/benchmark/latency_measure run failed on Arduino Due board.

Rodger Lin
 

I built the test code at "tests/benchmark/latency_measure/microkernel" . It runs well using the qemu mode.
I want to try it on Arduino Due board, built it using:

make TEST=max BOARD=arduino_due

After the program runs on the Arduino Due board. I got the "failure" with some error items. Here is the result:

|-----------------------------------------------------------------------------|

| Nanokernel Latency Benchmark |

|-----------------------------------------------------------------------------|

| tcs = timer clock cycles: 1 tcs is 11 nsec |

|-----------------------------------------------------------------------------|

| 1- Measure time to switch from fiber to ISR execution |

| switching time is 156 tcs = 1857 nsec |

|-----------------------------------------------------------------------------|

| 2- Measure time to switch from ISR back to interrupted fiber |

| switching time is 117 tcs = 1392 nsec |

|-----------------------------------------------------------------------------|

| 3- Measure time from ISR to executing a different fiber (rescheduled) |

| switching time is 367 tcs = 4369 nsec |

|-----------------------------------------------------------------------------|

| 4- Measure average context switch time between fibers |

| Error: tick occurred |

|-----------------------------------------------------------------------------|

| 5- Measure average time to lock then unlock interrupts |

| Error: tick occurred |

|-----------------------------------------------------------------------------|

|-----------------------------------------------------------------------------|

| Microkernel Latency Benchmark |

|-----------------------------------------------------------------------------|

| tcs = timer clock cycles: 1 tcs is 11 nsec |

|-----------------------------------------------------------------------------|

| 1- Measure time to switch from ISR to back to interrupted task |

| switching time is 119 tcs = 1416 nsec |

|-----------------------------------------------------------------------------|

| 2- Measure time from ISR to executing a different task (rescheduled) |

| switch time is 694 tcs = 8261 nsec |

|-----------------------------------------------------------------------------|

| 3- Measure average time to signal a sema then test that sema |

| Average semaphore signal time 0 tcs = 0 nsec |

| Average semaphore test time 0 tcs = 0 nsec |

|-----------------------------------------------------------------------------|

| 4- Measure average time to lock a mutex then unlock that mutex |

| Average time to lock the mutex 504056 tcs = 6000668 nsec |

| Average time to unlock the mutex 587911 tcs = 6998948 nsec |

|-----------------------------------------------------------------------------|

| 5- Measure average context switch time between tasks using (task_yield) |

| Error: tick occurred |

|-----------------------------------------------------------------------------|

| E N D |

|-----------------------------------------------------------------------------|

===================================================================

PROJECT EXECUTION FAILED


Zephyr 1.2.0-rc1 tagged

Nashif, Anas
 

Hi,
Zephyr v1.2.0-rc1 has been tagged, merge window for major features is now closed. We are targeting a release of v1.2.0 end of this week.
Below you will find the changes since v1.1.0.

Regards,
Anas



Anas Nashif (22):
samples/tests: remove old message about standard security
sanitychecks: skip early_sleep test
Revert "microkernel: Add support for *_sleep() during initialization"
Revert "sanitychecks: skip early_sleep test"
Revert "tests: Add test for microkernel early sleep functionality"
pinmux: do not depend on GPIO
kernel: fix boot banner option
kconfig: remove optional flag for boards
kconfig: move ARM bootloader options to bootloader menu
kconfig: add power management options into a menu
kconfig: remove redundant EVENT_LOGGER option
kconfig: move IAMCU option under processor capabilities
kconfig: Do not put architecture in the title
build: support multiple defconfigs per board
ia32: compile with soft-float when using IAMCU ABI
qemu_x86_iamcu: remove board and use defconfig from qemu_x86
kconfig: move kernel options close together
kconfig: reorg ARM options and make things consistent
watchdog: use instance name instead of variable
sensors: Convert return codes to errno.h
samples: w25q80bl: configure sample with correct board
Zephyr 1.2.0-rc1

Andre Guedes (26):
rtc: Fix Kconfig
samples: uart: Test irq-based APIs
Remove unused macro UART_IOAPIC_FLAGS
uart: Introduce QMSI shim driver
uart: qmsi: Add baud rate configuration support
uart: qmsi: Support for line control and driver command
uart: qmsi: Add support for IRQ APIs
samples: Add STTS751 sample application
pinmux: Change returning type from pinmux.h APIs
device: Redefine DEV_* error codes
drivers: Replace DEV_OK by 0
drivers: Replace DEV_FAIL by -EIO
drivers: Replace DEV_INVALID_OP by -ENOTSUP
drivers: Replace DEV_INVALID_CONF by -EINVAL
drivers: Replace DEV_USED by -EBUSY
drivers: Replace DEV_NO_ACCESS by -EACCES
drivers: Replace DEV_NO_SUPPORT by -ENODEV
drivers: Replace DEV_NOT_CONFIG by -EPERM
drivers: Fix documentation from remaining APIs
drivers: qmsi: Fix gpio, i2c and wdt for D2000
uart: Enable QMSI driver for Quark D2000
device: Deprecate DEV_* error codes
arch: Convert returning codes to errno.h
test: Convert returning code to errno.h
counter: Fix returning code
gpio: Fix returning code from stm32 driver

Andrei Emeltchenko (37):
drivers/nble: Implement NBLE GATT discover response
Bluetooth: Increment start handle with next discovery
drivers/nble: Update RPC to Nordic BLE chip
drivers/nble: Remove unneeded forward declaration
drivers/nble: Rearrange header includes
drivers/nble: Rename gatt_discover to gatt_private
Bluetooth: Fix compare logic in ATT read rsp
drivers/nble: Implement GATT read request
Bluetooth/shell: Print handle in hex instead of decimal
Bluetooth/shell: Clear subscription on gatt_unsubscribe()
Bluetooth/sample: Fix exit after first indication sent
drivers/nble: Implement GATT write request
drivers/nble: Implement GATT write without response
drivers/nble: Implement GATT subscribe
drivers/nble: Update RPC to Nordic BLE
drivers/nble: Correct debug print statement
drivers/nble: Use hexadecimal format specifier
drivers/nble: Implement on_nble_gap_start_advertise_rsp()
drivers/nble: Implement bt_gatt_indicate()
drivers/nble: Return -ENOTCONN when LE connection not exist
drivers/nble: Fix using UUID for GATT discover
drivers/nble: Implement bt_conn_security()
drivers/nble: Add skeleton for handling SM events
drivers/nble: Implement bt_conn_auth_cb_register()
drivers/nble: Refactor DM configuration
drivers/nble: Implement on_nble_gap_sm_passkey_display_evt()
drivers/nble: Implement LE stop advertising
drivers/nble: Implement passkey entry event
drivers/nble: Update RPC to Nordic BLE firmware
drivers/nble: Update valid advertise parameters
drivers/nble: Check firmware version for compatibility
drivers/nble: Implement common response
drivers/nble: Move local bdaddr to nble structure
drivers/nble: Move auth callback to nble struct
drivers/nble: Re-enable advertising on disconnect
Bluetooth: Dereference NULL pointer after check
Bluetooth: Fix using uninitialized value

Andrew Boie (15):
arm: move irq_vector_table to common location
arm: remove SW_ISR_TABLE_STATIC_CUSTOM
arm: don't build sw_isr_table if disabled
arc: move vector and sw isr table to core code
arc: remove SW_ISR_TABLE_STATIC_CUSTOM
arc: remove CONFIG_SW_ISR_TABLE_BSP
ipm: add demo code for inter-processor mailboxes
ipm: correct prototype for ipm_send
iamcu: fix -fstack-protector
qemu_x86_iamcu: new board for QEMU with IAMCU ABI
HACK: qemu: change e_machine for IAMCU binaries
sanitycheck: enable qemu_x86_iamcu and prefer it over qemu_x86
app_kernel: fix test case scaling
sanitycheck: allow N platforms per arch to be run
sanitycheck: don't require arch.ini blocks for every platform

Arkadiusz Lichwa (17):
Bluetooth: Cleanup dependency build for LE/BREDR
Bluetooth: BR/EDR: Add pairing mode flag
Bluetooth: BR/EDR: Group interfaces in conn.c
Bluetooth: BR/EDR: Reuse link key if available
Bluetooth: BR/EDR: Mark P-192 EC link key as AUTHENTICATED
Bluetooth: BR/EDR: Validate remote requirements
Bluetooth: BR/EDR: Reply to IO Capability request
Bluetooth: BR/EDR: Handle User Confirmation Request event
Bluetooth: BR/EDR: Check security on SSP authentication
Bluetooth: BR/EDR: Set user mode flag on User Confirmation event
Bluetooth: BR/EDR: Handle User Passkey Notify event
Bluetooth: BR/EDR: Handle User Passkey Entry event
Bluetooth: BR/EDR: Set user mode flag on User Passkey Entry
Bluetooth: BR/EDR: Add no-bond keys flag
Bluetooth: Fix checkpatch error/warnings
Bluetooth: BR/EDR: Fix storing legacy link key
Bluetooth: BR/EDR: Refactor link key notify handler

Baohong Liu (6):
drivers: framework for a generic flash driver
drivers: WinBond SPI flash support
boards: arduino_101 : Enable SPI Flash
API: Add public counter API
drivers: Quark AON counter and timer support
samples: A test app for quark Always-on counter and timer

Benjamin Walsh (2):
doc: enforce 8-char tabs and 80-column width in coding standards
Revert "arch: arm: set the architecture via Kconfig"

Bogdan Davidoaia (7):
sensor: add slope threshold and duration attributes
sensor: move driver specific options to separate Kconfig files
sensor: add driver for BMA280 accelerometer
sensor: add isl29035 light sensor
sensor: add driver for SHT3xD sensors
sensor: add driver for HDC1008 temperature and humidity sensor
sensor: add driver for LIS3DH accelerometer

Dan Kalowsky (1):
arch: arm: move nmi to common location

Daniel Leung (33):
i2c: i2c_atmel_sam3: tweak the transfer flow for NACK and STOP
i2c: i2c_atmel_sam3: meet minimum timing requirements
samples: an app to use the APDS9960 RGB and Gesture sensor
uart: serial_ns16550: exclude driver data variables under #ifdef
uart: add ISR callback mechanism for UART drivers
doc: arduino_due: explain how to build the bossac tool ...
boards: make individual boards dependent on SoC selections
arch/x86: hide CPU family Kconfig options
arch/x86: limit floating point kconfig options to supported CPUs
arch: move kconfig SoC selection to top level
boards: add a menu surrounding board Kconfig
drivers/shared_irq: fix kconfig hierarchy
drivers/gpio_dw: fix kconfig dependencies
arm/fsl_frdm_k64f: fix kconfig hierarchy
serial: minor kconfig semantic changes
gpio: restructure Kconfig options
i2c: restructure kconfig options
spi: restructure kconfig options
pwm: restructure Kconfig options
aio: put driver kconfigs under submenus
clock_control/quark_se: fix default kconfig dependencies
clock_control/stm32f10x: move kconfigs into its submenu
adc: move each driver kconfig options into submenus
drivers: bluetooth: nble: restructures Bluetooth Kconfig options
arm/fsl_frdm_k64f: remove kconfig default "n" for PWM
kconfig: add a debug option to print defaults in menuconfig
kconfig: prefer default values that are defined later
kconfig: untangle ordering and dependencies
kconfig: add conditions to device init priority defaults
serial/k20: remove base addr, irq and clk freq from kconfig
serial/stellaris: remove base addr, irq and clk freq from kconfig
frdm_k64f: gpio: pinmux: remove base addr and irq from kconfig
spi/k64: remove SoC specific SPI constants from kconfig

Dmitriy Korovkin (7):
x86: Fix cache flush code dependencies
Kconfig: CPU_MIGHT_SUPPORT_CLFLUSH removal.
microkernel: Add support for *_sleep() during initialization
tests: Add test for microkernel early sleep functionality
kernel: Combine nano_timers and nano_timeouts
microkernel: Add support for *_sleep() during initialization
tests: Add test for microkernel early sleep functionality

Genaro Saucedo Tejada (5):
Fix typo on windows set up documentation.
doc: Remove SDK specific version numbers.
sys_log: Adds the common log API header
sys_log: Grove driver update to new logging API
kernel_event_logger: wrong parameters order on macro definition

Grzegorz Kolodziejczyk (3):
Bluetooth: tester: Add initial support for l2cap service
Bluetooth: tester: Add support for get supported l2cap commands
Bluetooth: tester: Add LE scan type flags and support

Iván Briano (1):
libc-hooks: Provide the 'open()' syscall

Jeff Blais (9):
arm: add generic memory-mapped I/O routines for Cortex-M
arm: Freescale K64 GPIO driver
pinmux: Expand the pin function/mode parameter size
arm: Freescale K64/FRDM-K64F Pinmux support
arm: Add GPIO interrupt/callback support for K64F
pwm: add 'set_phase' API
arm: K64F Pulse Width Modulation (PWM) support
arm: config settings for frdm_k64f internal clock dividers
arm: K64 SPI module driver

Jithu Joseph (2):
memory_pool_heap: malloc/free access over a heap memory pool
memory_pool: Refactor code into a helper function

Johan Hedberg (14):
flash: Use size_t & void * for the read/write parameters
flash: Reorder data & len parameters
libc: Move ssize_t definition to sys/types.h
libc: Add off_t definition
flash: Use off_t for offset parameters
Bluetooth: Fix print format for 4-byte opcodes
Bluetooth: Take advantage of hci_cmd_done() helper
Bluetooth: Call HCI_Reset synchronously to catch errors
Bluetooth: Add definition for vendor event code
Bluetooth: Move stack analysis helper to a global location
Bluetooth: Kconfig: Add missing BLUETOOTH_STACK_HCI dependencies
drivers/nble: Fix validation of advertising parameters
Bluetooth: Move extern "C" declaration to right place
Bluetooth: Clarify code comment

Juan Manuel Cruz (12):
debug: kernel's object tracing api
debug: sanity test for kernel object tracing
debug: expose thread monitor in object tracing header
debug: object tracing sanity test includes thread monitor.
debug: thread monitor allow to access more thread information
debug: adds object tracing capability to nano stack
debug: adds object tracing capability to ring buffers
debug: adds object tracing capability to microkernel events
debug: adds object tracing capability to microkernel timers
debug: add debug tracing support for task initialization
debug: add task tracing to sanity test
debug: fixes issue on debug tracing for pool struct

Jukka Rissanen (36):
net: 802.15.4: Do not print anything when packet is discarded
net: contiki: Fix debug prints for ICMPv6 echo request and reply
net: contiki: Print prefix information properly when debugging
net: contiki: Fix ICMPv6 error message debug print
cc2520: Generate a mac address in the driver
net: apps: Common routines used in qemu testing
net: apps: Change echo-server to use common testing header file
net: apps: Change echo-client to use common testing header file
net: tinydtls: Fix compile error if IPv4 was activated
net: User must provide storage for local IP address
net: coap: Fix compilation error
net: apps: Fix the loopback test application
net: apps: User can set the loopback test count
net: apps: Fix connectivity between echo-server and client
net: apps: Change dtls-server to use common testing header file
net: apps: Change dtls-client to use common testing header file
net: Kconfig debug option for debugging received and sent data
net: Allow user to activate 802.15.4 6lowpan frag debug
net: Allow user to activate 6lowpan compression debug
net: Allow user to activate 802.15.4 MAC layer debugging
net: Allow user to activate 802.15.4 packet framing debug
net: Add debug configuration for 802.15.4 network driver
net: contiki: Fix debug prints in MAC layer files
net: 802.15.4: User can select desired RDC plugin
net: rpl: Enable debugging via Kconfig
net: rpl: Fix compile error if ICMPv6 debugging is activated
net: rpl: Enable RPL ICMPv6 packet debugging via Kconfig
net: rpl: Enable objective function debugging via Kconfig
net: rpl: Enable timer debugging via Kconfig
net: rpl: Print the IPv6 prefix value when checking it
net: 6lowpan: Fix debug prints in compression and fragmentation
net: 6lowpan: Add more sanity checks in compression code
net: coap: Debug print was missing a parameter
net: 6lowpan: Check packet size before accepting fragment
net: contiki: Check IPv6 extension header length
sys_log: User can prevent extra newline to be printed

Laurentiu Palcu (1):
spi: dw: arc: add delay between writing DR strobe bit and reading FIFO

Leona Cook (9):
doc: Edit microkernel_mutexes.rst; add ReST syntax, clarifications.
doc: Edit microkernel_fifos for consistent .rst style and formatting.
doc: Edit nanokernel_tasks for consistency and ReST :dfn: syntax
doc: Edit microkernel_pipes for ReST syntax, readability, grammar
doc: Edit microkernel_task_irqs.rst for consistency in styling.
doc: Edit nanokernel_fibers for doc structure with rst, grammar
doc: Edit nanokernel_timers for proper ReST syntax, grammar, etc.
doc: Edit nanokernel_synchronization section
doc: Edit microkerenel_mailboxes for ReST syntax, content flow, readability

Luiz Augusto von Dentz (17):
Bluetooth: L2CAP: Handle of Reject command
Bluetooth: ATT: Handle Confirmations
Bluetooth: GATT: Add bt_gatt_indicate
Bluetooth: L2CAP: Add more descriptive documentation
Bluetooth: Add indication support for peripheral sample
Bluetooth: IPSP: Add missing primary service
Bluetooth: IPSS: Move sample service to gatt
Bluetooth: IPSS: Only register extra services if necessary
Bluetooth: GAP: Add service sample
Bluetooth: Fix header documentation of GATT service samples
Bluetooth: ATT: Notify if a disconnect happen while a request is pending
Bluetooth: peripheral_esp: Add support for using NBLE driver
Bluetooth: Make application samples to use GAP Service sample
Bluetooth: HRS: Add service sample
Bluetooth: DIS: Add service sample
Bluetooth: BAS: Add service sample
Bluetooth: CTS: Add service sample

Maciek Borzecki (33):
clock_control/Kconfig: fix quark_se dependencies
drivers/adc: fix QMSI ADC config options dependency
pwm: fix K64 PWM config options dependencies
st_stm32/stm32f1: introduce STM32F1x SoC family
clock_control/Kconfig: move quark_se entries to separate file
clock_control: extend API with clock rate query operation
clock_control/stm32f10x: introduce driver for STM32F10x RCC
pinmux/stm32: add common driver for STM32 pinmux
gpio/stm32: add common driver for STM32 GPIO
soc/stm32f1/gpio: implement GPIO support
soc/stm32f1/pinmux: implement STM32 pinmux integration
serial/stm32: add driver for STM32 UART
boards/stm32_mini_a15: add new board
samples/drivers/disco: add 'disco' sample program
boards/nucleo_f103rb: add new board
soc/stm32f1: add IRQ numbers listing
serial/stm32: add support for IRQ APIs
interupt_controller/stm32_exti: driver for STM32 EXTI controller
gpio/stm32: GPIO input with interrupts
soc/stm32f1: AFIO registers mapping
soc/stm32f1/gpio: implement MCU specific GPIO input interrupt integration
watchdog/iwdg_stm32: add driver for STM32 Independent Watchdog (IWDG)
samples/button: button input example
soc/stm32f1: add embedded flash registers mapping
clock_control/stm32f1: HSE support and PLL configuration cleanup
arm: access svc instruction using halfword load in svc_handler
boards/stm32_mimi_a15: enable 72MHz system clock by default
boards/nucleo_f103rb: enable 72MHz system clock by default
boards/nucleo_f103rb: default to 115200 for USART2 speed
boards/stm32_mini_a15: default to 115200 for USART1 speed
benchmark/latency: support for Cortex-M targets
benchmark/latency: reduce RAM requirements
gpio/stm32: fix build

Mariusz Skamra (4):
Bluetooth: tester: Refactor adding attributes to the GATT database
Bluetooth: tester: Return BTP error if requested unknown attr ID
Bluetooth: tester: Refactor Set Value command handler
Bluetooth: Fix validation of advertising parameters

Murtaza Alexandru (5):
sensor: add common magnetometer enum values
sensor: add driver for BMC150 magnetometer
sensor: add magnetometer generic polling sample
sensor: add full-scale attribute
sensor: add driver for LSM9DS0 gyroscope

Pawel Wodnicki (1):
doc: Edit gerrit_practices to correct command to install a precommit hook

Peter Mitsis (1):
printf: Limit width modifier to [0..MAXFLD]

Ramesh Thomas (2):
power_mgmt: Make names consistent with new RFC
power_mgmt: Add device power management support

Ravi kumar Veeramally (7):
net: apps: Add qemu support without monitor tool
net: coap: Use correct network buffer in registration
net: apps: Update CoAP apps to use net_testing header file
net: apps: Add prj_qemu.conf files for dtls apps
net: apps: Move Makefile.ipstack to common folder
net: contiki: Enable uip packet queue debugging via Kconfig
net: contiki: Improve uip_packetqueue debug statements

Roger Lendenmann (1):
Bluetooth: Fix latency versus timeout check

Sergio Rodriguez (3):
pwm: QMSI PWM driver
adc: QMSI ADC driver
aio: QMSI analog comparator driver

Shaul Triebitz (2):
pci: Fix PCI header initialization
net: contiki: Fix application layer data offset

Simon Desfarges (3):
arc_timer: fix wrong programmed limit when entering idle
arc_timer: fix tickless idle
arc_timer: assert that counter always lower than limit

Szymon Janc (19):
Bluetooth: SMP: Add support for debug ECDH keys
Fix uart_pipe_send documentation
Bluetooth: Use bt_auth_cancel for pairing cancel
Bluetooth: Add HCI defines for BR/EDR discovery
Bluetooth: Kconfig: Fix max HCI event length if BR/EDR is enabled
Bluetooth: Add HCI commands definitions for BR/EDR connections
Bluetooth: Add support for outgoing BR/EDR connections
boards: Fix override of HPET timer interrupt trigger
Bluetooth: shell: Add support for outgoing BR/EDR connections
Bluetooth: Fix HCI EIR event definition
Bluetooth: Add name resolving HCI commands definitions
Bluetooth: Build keys support if BR/EDR is enabled
Bluetooth: Compile only required parts of keys support
Bluetooth: Provide more config options to init sample
Bluetooth: shell: Make cmd_gatt_mread static
Bluetooth: Add initial support for BR/EDR discovery
Bluetooth: Add support for notifying of BR/EDR inquiry results
Bluetooth: shell: Add support for BR/EDR discovery
Bluetooth: Add support for resolving BR/EDR names

Tomasz Bursztyka (2):
drivers: gpio: Align the style all over the drivers
include: misc: Add a utility macro to generate a bit mask

Vinicius Costa Gomes (18):
pinmux: Fix using wrong variable name
pinmux: Convert return codes to errno.h
k64f: Fix indentation in the K64F pinmux driver
k64f: Move pinmux specific code to pinmux.c
pinmux: Move the Arduino 101 board to the pinmux model
pinmux: Move the Arduino Due board to the pinmux model
k64f: Fix mixing GPIO and pinmux concepts
pinmux: Move the Galileo board to the pinmux model
pinmux: Move the Freescale FRDM K64F board to the pinmux model
pinmux: Move the Quark D2000 board to the pinmux model
pinmux: Move the Quark SE devboard to the pinmux model
pinmux_dev: Add the pinmux_dev driver for Atmel SAM3X
pinmux_dev: Add driver for Freescale FRDM K64F
pinmux_dev: Add driver for Galileo board
pinmux_dev: Add Quark MCU generic driver
pinmux_dev: Add driver using QMSI library
pinmux: Move STM32 boards to the pinmux model
pinmux_dev: Adds the STM32 pinmux dev driver

Vlad Dogaru (8):
Introduce new sensor API
Add infrastructure for sensor drivers
sensor: Add driver for MCP9808 temperature sensor
samples: Add sample app for MCP9808 sensor
sensor: Add threshold trigger support for MCP9808
sensor: Add sx9500 SAR proximity driver
samples: Add sample app for sx9500 sensor driver
sensor: add driver for BMP280

Vlad Lungu (4):
net: 802.15.4: Make MAC driver configurable, select nullmac as default
net: contiki: Initialize uip_last_tx_status(mbuf) before use
net: contiki: move neighbor_list to struct l2_buf
net: contiki: Fix net_buf lifecycle

Yannis Damigos (6):
samples:philosophers:Reformated 80-column width, 80-chars tabs
drivers: gpio: Move STM32 gpio driver under its own submenu
drivers: gpio: Make K64 gpio submenu available only for K64 soc
drivers: pwm: Make K64 pwm submenu available only for K64 soc
drivers: spi: Make K64 spi submenu available only for K64 soc
drivers: pinmux: Restructure kconfig options

d0u9 (1):
zephyr-env.sh: Add a note to indicate the required version of zsh

Kconfig | 2 +-
Kconfig.zephyr | 10 +
Makefile | 5 +-
Makefile.inc | 2 +-
arch/Kconfig | 24 +-
arch/arc/Kconfig | 34 +-
arch/arc/core/Makefile | 3 +
arch/arc/core/irq_vector_table.c | 53 +
arch/arc/core/offsets/offsets.c | 4 +-
arch/arc/core/sw_isr_table.S | 64 ++
arch/arc/core/thread.c | 7 +
arch/arc/include/nano_private.h | 15 +-
arch/arc/soc/quark_se_ss/Kbuild | 2 -
arch/arc/soc/quark_se_ss/Kconfig | 225 ----
arch/arc/soc/quark_se_ss/Kconfig.defconfig | 261 +++++
arch/arc/soc/quark_se_ss/Kconfig.soc | 1 +
arch/arc/soc/quark_se_ss/irq_vector_table.c | 53 -
arch/arc/soc/quark_se_ss/soc_config.c | 4 +-
arch/arc/soc/quark_se_ss/sw_isr_table.S | 64 --
arch/arm/Kconfig | 64 +-
arch/arm/Makefile | 6 -
arch/arm/core/cortex_m/Kconfig | 39 +-
arch/arm/core/cortex_m/Makefile | 6 +-
arch/arm/core/cortex_m/irq_vector_table.c | 53 +
arch/arm/core/cortex_m/nmi_on_reset.S | 39 +
arch/arm/core/cpu_idle.S | 6 +-
arch/arm/core/isr_wrapper.S | 4 +-
arch/arm/core/offsets/offsets.c | 4 +-
arch/arm/core/swap.S | 2 +-
arch/arm/core/thread.c | 8 +
arch/arm/include/nano_private.h | 17 +-
arch/arm/soc/atmel_sam3/Kbuild | 4 +-
arch/arm/soc/atmel_sam3/Kconfig | 105 +-
arch/arm/soc/atmel_sam3/Kconfig.defconfig | 116 ++
arch/arm/soc/atmel_sam3/Kconfig.soc | 1 +
arch/arm/soc/atmel_sam3/Makefile | 3 +-
arch/arm/soc/atmel_sam3/irq_vector_table.c | 69 --
arch/arm/soc/atmel_sam3/nmi_on_reset.S | 39 -
arch/arm/soc/atmel_sam3/soc.c | 7 +-
arch/arm/soc/fsl_frdm_k64f/Kbuild | 3 -
arch/arm/soc/fsl_frdm_k64f/Kconfig | 163 +--
arch/arm/soc/fsl_frdm_k64f/Kconfig.defconfig | 204 ++++
arch/arm/soc/fsl_frdm_k64f/Kconfig.soc | 1 +
arch/arm/soc/fsl_frdm_k64f/Makefile | 4 +-
arch/arm/soc/fsl_frdm_k64f/irq_vector_table.c | 84 --
arch/arm/soc/fsl_frdm_k64f/nmi_on_reset.S | 39 -
arch/arm/soc/fsl_frdm_k64f/soc.c | 22 +-
arch/arm/soc/fsl_frdm_k64f/soc.h | 74 ++
arch/arm/soc/fsl_frdm_k64f/soc_config.c | 13 +-
arch/arm/soc/st_stm32/Kconfig | 23 +
arch/arm/soc/st_stm32/Kconfig.defconfig | 1 +
arch/arm/soc/st_stm32/Kconfig.soc | 25 +
arch/arm/soc/st_stm32/stm32f1/Kbuild | 4 +
.../soc/st_stm32/stm32f1/Kconfig.defconfig.family | 51 +
.../st_stm32/stm32f1/Kconfig.defconfig.stm32f103rb | 31 +
.../st_stm32/stm32f1/Kconfig.defconfig.stm32f103ve | 31 +
arch/arm/soc/st_stm32/stm32f1/Kconfig.soc.family | 28 +
arch/arm/soc/st_stm32/stm32f1/Makefile | 7 +
arch/arm/soc/st_stm32/stm32f1/flash_registers.h | 61 ++
arch/arm/soc/st_stm32/stm32f1/gpio_registers.h | 115 ++
arch/arm/soc/st_stm32/stm32f1/linker.cmd | 19 +
arch/arm/soc/st_stm32/stm32f1/rcc_registers.h | 123 +++
arch/arm/soc/st_stm32/stm32f1/soc.c | 66 ++
arch/arm/soc/st_stm32/stm32f1/soc.h | 92 ++
arch/arm/soc/st_stm32/stm32f1/soc_config.c | 102 ++
arch/arm/soc/st_stm32/stm32f1/soc_gpio.c | 200 ++++
arch/arm/soc/st_stm32/stm32f1/soc_irq.h | 105 ++
arch/arm/soc/st_stm32/stm32f1/soc_registers.h | 25 +
arch/arm/soc/ti_lm3s6965/Kbuild | 3 -
arch/arm/soc/ti_lm3s6965/Kconfig | 114 +-
arch/arm/soc/ti_lm3s6965/Kconfig.defconfig | 95 ++
arch/arm/soc/ti_lm3s6965/Makefile | 3 +-
arch/arm/soc/ti_lm3s6965/irq_vector_table.c | 84 --
arch/arm/soc/ti_lm3s6965/nmi_on_reset.S | 39 -
arch/arm/soc/ti_lm3s6965/soc.c | 7 +-
arch/arm/soc/ti_lm3s6965/soc.h | 14 +
arch/arm/soc/ti_lm3s6965/soc_config.c | 2 +-
arch/x86/Kconfig | 94 +-
arch/x86/core/cache.c | 7 +-
arch/x86/core/cache_s.S | 4 -
arch/x86/core/crt0.S | 10 +-
arch/x86/core/i386_sysV_abi/intstub.S | 14 +-
arch/x86/core/i386_sysV_abi/thread.c | 8 +
arch/x86/core/iamcu_abi/intstub.c | 12 +-
arch/x86/core/iamcu_abi/swap.c | 7 +-
arch/x86/core/offsets/offsets.c | 4 +-
arch/x86/include/advidle.h | 134 ---
arch/x86/include/nano_private.h | 16 +-
arch/x86/soc/atom/Kconfig | 137 ---
arch/x86/soc/atom/Kconfig.defconfig | 128 +++
arch/x86/soc/ia32/Kconfig | 137 ---
arch/x86/soc/ia32/Kconfig.defconfig | 128 +++
arch/x86/soc/ia32/Kconfig.soc | 1 +
arch/x86/soc/ia32/Makefile | 4 +-
arch/x86/soc/quark_d2000/Kconfig | 250 -----
arch/x86/soc/quark_d2000/Kconfig.defconfig | 262 +++++
arch/x86/soc/quark_d2000/soc.h | 6 +-
arch/x86/soc/quark_se/Kconfig | 370 +------
arch/x86/soc/quark_se/Kconfig.defconfig | 497 +++++++++
arch/x86/soc/quark_se/Kconfig.soc | 2 +
arch/x86/soc/quark_se/soc.c | 8 +-
arch/x86/soc/quark_se/soc.h | 8 -
arch/x86/soc/quark_se/soc_config.c | 2 +-
arch/x86/soc/quark_x1000/Kconfig | 364 -------
arch/x86/soc/quark_x1000/Kconfig.defconfig | 424 ++++++++
arch/x86/soc/quark_x1000/Kconfig.soc | 3 +
boards/Kconfig | 3 +-
boards/arduino_101/Kconfig | 32 -
boards/arduino_101/Kconfig.board | 3 +-
boards/arduino_101/Kconfig.defconfig | 49 +
boards/arduino_101/Makefile | 1 -
boards/arduino_101/pinmux.c | 367 -------
boards/arduino_101_sss/Kconfig | 7 -
boards/arduino_101_sss/Kconfig.board | 3 +-
boards/arduino_101_sss/Kconfig.defconfig | 7 +
boards/arduino_due/Kconfig | 37 -
boards/arduino_due/Kconfig.board | 3 +-
boards/arduino_due/Kconfig.defconfig | 37 +
boards/arduino_due/Makefile | 1 -
boards/arduino_due/pinmux_due.c | 438 --------
boards/basic_cortex_m3/Kconfig | 7 -
boards/basic_cortex_m3/Kconfig.board | 3 +-
boards/basic_cortex_m3/Kconfig.defconfig | 7 +
boards/basic_minuteia/Kconfig | 7 -
boards/basic_minuteia/Kconfig.board | 3 +-
boards/basic_minuteia/Kconfig.defconfig | 7 +
boards/basic_minuteia/basic_atom_defconfig | 1 -
boards/basic_minuteia/basic_minuteia_defconfig | 2 -
boards/frdm_k64f/Kconfig | 13 -
boards/frdm_k64f/Kconfig.board | 3 +-
boards/frdm_k64f/Kconfig.defconfig | 13 +
boards/frdm_k64f/frdm_k64f_defconfig | 1 +
boards/galileo/Kconfig | 129 ---
boards/galileo/Kconfig.board | 3 +-
boards/galileo/Kconfig.defconfig | 162 +++
boards/galileo/Makefile | 1 -
boards/galileo/galileo_pinmux.c | 784 --------------
boards/minnowboard/Kconfig | 7 -
boards/minnowboard/Kconfig.board | 3 +-
boards/minnowboard/Kconfig.defconfig | 7 +
boards/minnowboard/minnowboard_defconfig | 1 -
boards/nucleo_f103rb/Kconfig.board | 20 +
boards/nucleo_f103rb/Kconfig.defconfig | 23 +
boards/nucleo_f103rb/Makefile | 5 +
boards/nucleo_f103rb/board.c | 16 +
boards/nucleo_f103rb/board.h | 22 +
boards/nucleo_f103rb/nucleo_f103rb_defconfig | 47 +
boards/qemu_cortex_m3/Kconfig | 7 -
boards/qemu_cortex_m3/Kconfig.board | 3 +-
boards/qemu_cortex_m3/Kconfig.defconfig | 7 +
boards/qemu_x86/Kconfig | 7 -
boards/qemu_x86/Kconfig.board | 3 +-
boards/qemu_x86/Kconfig.defconfig | 7 +
boards/qemu_x86/qemu_x86_defconfig | 1 -
boards/qemu_x86/qemu_x86_iamcu_defconfig | 20 +
boards/quark_d2000_crb/Kconfig | 8 -
boards/quark_d2000_crb/Kconfig.board | 3 +-
boards/quark_d2000_crb/Kconfig.defconfig | 17 +
boards/quark_d2000_crb/Makefile | 1 -
boards/quark_d2000_crb/pinmux.c | 293 -----
boards/quark_se_devboard/Kconfig | 51 -
boards/quark_se_devboard/Kconfig.board | 3 +-
boards/quark_se_devboard/Kconfig.defconfig | 63 ++
boards/quark_se_devboard/Makefile | 1 -
boards/quark_se_devboard/pinmux.c | 356 -------
boards/quark_se_sss_devboard/Kconfig | 7 -
boards/quark_se_sss_devboard/Kconfig.board | 3 +-
boards/quark_se_sss_devboard/Kconfig.defconfig | 7 +
boards/stm32_mini_a15/Kconfig.board | 20 +
boards/stm32_mini_a15/Kconfig.defconfig | 23 +
boards/stm32_mini_a15/Makefile | 5 +
boards/stm32_mini_a15/board.c | 15 +
boards/stm32_mini_a15/board.h | 22 +
boards/stm32_mini_a15/stm32_mini_a15_defconfig | 41 +
doc/board/arduino_due.rst | 62 +-
doc/collaboration/code/coding_style.rst | 8 +-
doc/collaboration/code/gerrit_practices.rst | 7 +-
doc/getting_started/installation_linux.rst | 26 +-
doc/getting_started/installation_win.rst | 2 +-
doc/kernel/microkernel/microkernel_fifos.rst | 51 +-
doc/kernel/microkernel/microkernel_mailboxes.rst | 136 +--
doc/kernel/microkernel/microkernel_mutexes.rst | 107 +-
doc/kernel/microkernel/microkernel_pipes.rst | 108 +-
doc/kernel/microkernel/microkernel_task_irqs.rst | 83 +-
doc/kernel/nanokernel/nanokernel_fibers.rst | 112 +-
.../nanokernel/nanokernel_synchronization.rst | 38 +-
doc/kernel/nanokernel/nanokernel_tasks.rst | 40 +-
doc/kernel/nanokernel/nanokernel_timers.rst | 59 +-
drivers/802.15.4/cc2520.c | 28 +-
drivers/802.15.4/cc2520_arch.h | 2 +-
drivers/Kconfig | 6 +-
drivers/Makefile | 4 +
drivers/adc/Kconfig | 88 +-
drivers/adc/Makefile | 3 +
drivers/adc/adc_dw.c | 4 +-
drivers/adc/adc_qmsi.c | 285 +++++
drivers/adc/adc_ti_adc108s102.c | 16 +-
drivers/aio/Kconfig | 31 +-
drivers/aio/Makefile | 3 +
drivers/aio/aio_dw_comparator.c | 21 +-
drivers/aio/aio_qmsi_comparator.c | 192 ++++
drivers/bluetooth/Kconfig | 43 +-
drivers/bluetooth/h4.c | 11 +-
drivers/bluetooth/h5.c | 15 +-
drivers/clock_control/Kconfig | 53 +-
drivers/clock_control/Kconfig.quark_se | 72 ++
drivers/clock_control/Kconfig.stm32f10x | 124 +++
drivers/clock_control/Makefile | 1 +
drivers/clock_control/quark_se_clock_control.c | 9 +-
drivers/clock_control/stm32f10x_clock.c | 329 ++++++
drivers/console/Kconfig | 28 -
drivers/console/ipm_console_receiver.c | 8 +-
drivers/console/ipm_console_sender.c | 6 +-
drivers/console/ram_console.c | 2 +-
drivers/console/uart_console.c | 11 +-
drivers/console/uart_pipe.c | 8 +-
drivers/counter/Kconfig | 65 ++
drivers/counter/Makefile | 4 +
drivers/counter/counter_qmsi_aon.c | 70 ++
drivers/counter/counter_qmsi_aonpt.c | 146 +++
drivers/ethernet/eth_dw.c | 4 +-
drivers/flash/Kconfig | 84 ++
drivers/flash/Makefile | 1 +
drivers/flash/spi_flash_w25qxxdv.c | 375 +++++++
drivers/flash/spi_flash_w25qxxdv.h | 35 +
drivers/flash/spi_flash_w25qxxdv_defs.h | 127 +++
drivers/gpio/Kconfig | 672 +-----------
drivers/gpio/Kconfig.atmel_sam3 | 24 +-
drivers/gpio/Kconfig.dw | 292 +++++
drivers/gpio/Kconfig.k64 | 139 +++
drivers/gpio/Kconfig.mmio | 164 +++
drivers/gpio/Kconfig.pcal9535a | 155 +++
drivers/gpio/Kconfig.qmsi | 77 ++
drivers/gpio/Kconfig.sch | 87 ++
drivers/gpio/Kconfig.stm32 | 55 +
drivers/gpio/Makefile | 2 +
drivers/gpio/gpio_atmel_sam3.c | 70 +-
drivers/gpio/gpio_dw.c | 73 +-
drivers/gpio/gpio_k64.c | 432 ++++++++
drivers/gpio/gpio_k64.h | 53 +
drivers/gpio/gpio_mmio.c | 81 +-
drivers/gpio/gpio_mmio.h | 14 +-
drivers/gpio/gpio_pcal9535a.c | 102 +-
drivers/gpio/gpio_pcal9535a.h | 2 +-
drivers/gpio/gpio_qmsi.c | 76 +-
drivers/gpio/gpio_sch.c | 62 +-
drivers/gpio/gpio_stm32.c | 274 +++++
drivers/gpio/gpio_stm32.h | 95 ++
drivers/grove/Kconfig | 22 +-
drivers/grove/lcd_rgb.c | 43 +-
drivers/i2c/Kconfig | 278 +----
drivers/i2c/Kconfig.atmel_sam3 | 24 +-
drivers/i2c/Kconfig.dw | 193 ++++
drivers/i2c/Kconfig.qmsi | 68 ++
drivers/i2c/Kconfig.quark_se_ss | 80 ++
drivers/i2c/i2c_atmel_sam3.c | 140 ++-
drivers/i2c/i2c_dw.c | 44 +-
drivers/i2c/i2c_qmsi.c | 32 +-
drivers/i2c/i2c_quark_se_ss.c | 37 +-
drivers/interrupt_controller/Kconfig | 3 +
drivers/interrupt_controller/Kconfig.stm32 | 75 ++
drivers/interrupt_controller/Makefile | 2 +
drivers/interrupt_controller/exti_stm32.c | 281 +++++
drivers/interrupt_controller/exti_stm32.h | 88 ++
drivers/ipm/ipm_quark_se.c | 4 +-
drivers/nble/Kconfig | 19 +-
drivers/nble/conn.c | 68 +-
drivers/nble/conn_internal.h | 2 +-
drivers/nble/gap.c | 324 +++++-
drivers/nble/gap_internal.h | 808 ++++----------
drivers/nble/gatt.c | 719 ++++++++++++-
drivers/nble/gatt_internal.h | 481 ++-------
drivers/nble/rpc_deserialize.c | 5 +-
drivers/nble/rpc_functions_to_ble_core.h | 42 +-
drivers/nble/rpc_functions_to_quark.h | 33 +-
drivers/nble/rpc_serialize.c | 5 +-
drivers/nble/stubs.c | 3 +
drivers/nble/uart.c | 14 +-
drivers/pci/pci_interface.c | 2 +-
drivers/pinmux/Kconfig | 19 +-
drivers/pinmux/Kconfig.k64 | 64 ++
drivers/pinmux/Kconfig.stm32 | 33 +
drivers/pinmux/Makefile | 16 +
drivers/pinmux/dev/Kconfig | 77 ++
drivers/pinmux/dev/Makefile | 12 +
drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c | 133 +++
drivers/pinmux/dev/pinmux_dev_frdm_k64f.c | 58 +
drivers/pinmux/dev/pinmux_dev_galileo.c | 109 ++
drivers/pinmux/dev/pinmux_dev_qmsi.c | 77 ++
drivers/pinmux/dev/pinmux_dev_quark_mcu.c | 143 +++
drivers/pinmux/dev/pinmux_dev_stm32.c | 87 ++
drivers/pinmux/frdm_k64f/pinmux_board_frdm_k64f.c | 99 ++
drivers/pinmux/frdm_k64f/pinmux_k64.c | 164 +++
drivers/pinmux/frdm_k64f/pinmux_k64.h | 288 +++++
drivers/pinmux/galileo/pinmux_board_galileo.c | 128 +++
drivers/pinmux/galileo/pinmux_galileo.c | 594 +++++++++++
drivers/pinmux/galileo/pinmux_galileo.h | 46 +
drivers/pinmux/pinmux.h | 4 +-
.../pinmux/quark_mcu/pinmux_board_arduino_101.c | 169 +++
.../quark_mcu/pinmux_board_quark_d2000_crb.c | 111 ++
.../pinmux/quark_mcu/pinmux_board_quark_se_dev.c | 154 +++
drivers/pinmux/quark_mcu/pinmux_quark_mcu.h | 73 ++
drivers/pinmux/sam3x/pinmux_board_arduino_due.c | 304 ++++++
drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c | 51 +
drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c | 51 +
drivers/pinmux/stm32/pinmux_stm32.c | 108 ++
drivers/pinmux/stm32/pinmux_stm32.h | 290 +++++
drivers/pinmux/stm32/pinmux_stm32f1.h | 34 +
drivers/pwm/Kconfig | 75 +-
drivers/pwm/Kconfig.dw | 52 +
drivers/pwm/Kconfig.k64 | 509 +++++++++
drivers/pwm/Kconfig.pca9685 | 69 ++
drivers/pwm/Kconfig.qmsi | 44 +
drivers/pwm/Makefile | 4 +
drivers/pwm/pwm_dw.c | 26 +-
drivers/pwm/pwm_k64_ftm.c | 902 ++++++++++++++++
drivers/pwm/pwm_k64_ftm.h | 185 ++++
drivers/pwm/pwm_pca9685.c | 28 +-
drivers/pwm/pwm_pca9685.h | 2 +-
drivers/pwm/pwm_qmsi.c | 178 ++++
drivers/rtc/Kconfig | 1 -
drivers/rtc/rtc_dw.c | 6 +-
drivers/rtc/rtc_qmsi.c | 10 +-
drivers/sensor/Kconfig | 65 ++
drivers/sensor/Kconfig.bma280 | 201 ++++
drivers/sensor/Kconfig.bmc150_magn | 151 +++
drivers/sensor/Kconfig.bmp280 | 132 +++
drivers/sensor/Kconfig.hdc1008 | 101 ++
drivers/sensor/Kconfig.isl29035 | 225 ++++
drivers/sensor/Kconfig.lis3dh | 229 ++++
drivers/sensor/Kconfig.lsm9ds0_gyro | 158 +++
drivers/sensor/Kconfig.mcp9808 | 101 ++
drivers/sensor/Kconfig.sht3xd | 186 ++++
drivers/sensor/Kconfig.sx9500 | 109 ++
drivers/sensor/Makefile | 20 +
drivers/sensor/sensor.c | 57 +
drivers/sensor/sensor_bma280.c | 217 ++++
drivers/sensor/sensor_bma280.h | 177 ++++
drivers/sensor/sensor_bma280_trigger.c | 255 +++++
drivers/sensor/sensor_bmc150_magn.c | 769 ++++++++++++++
drivers/sensor/sensor_bmc150_magn.h | 174 +++
drivers/sensor/sensor_bmp280.c | 236 +++++
drivers/sensor/sensor_bmp280.h | 120 +++
drivers/sensor/sensor_hdc1008.c | 144 +++
drivers/sensor/sensor_hdc1008.h | 43 +
drivers/sensor/sensor_isl29035.c | 202 ++++
drivers/sensor/sensor_isl29035.h | 159 +++
drivers/sensor/sensor_isl29035_trigger.c | 178 ++++
drivers/sensor/sensor_lis3dh.c | 171 +++
drivers/sensor/sensor_lis3dh.h | 138 +++
drivers/sensor/sensor_lis3dh_trigger.c | 140 +++
drivers/sensor/sensor_lsm9ds0_gyro.c | 487 +++++++++
drivers/sensor/sensor_lsm9ds0_gyro.h | 258 +++++
drivers/sensor/sensor_mcp9808.c | 116 ++
drivers/sensor/sensor_mcp9808.h | 102 ++
drivers/sensor/sensor_mcp9808_trigger.c | 203 ++++
drivers/sensor/sensor_sht3xd.c | 207 ++++
drivers/sensor/sensor_sht3xd.h | 124 +++
drivers/sensor/sensor_sht3xd_trigger.c | 235 ++++
drivers/sensor/sensor_sx9500.c | 194 ++++
drivers/sensor/sensor_sx9500.h | 83 ++
drivers/sensor/sensor_sx9500_trigger.c | 166 +++
drivers/serial/Kconfig | 10 +-
drivers/serial/Kconfig.atmel_sam3 | 2 +-
drivers/serial/Kconfig.k20 | 120 ---
drivers/serial/Kconfig.qmsi | 67 ++
drivers/serial/Kconfig.stellaris | 77 +-
drivers/serial/Kconfig.stm32 | 122 +++
drivers/serial/Makefile | 5 +
drivers/serial/uart_atmel_sam3.c | 4 +-
drivers/serial/uart_k20.c | 164 ++-
drivers/serial/uart_k20.h | 26 +
drivers/serial/uart_ns16550.c | 111 +-
drivers/serial/uart_nsim.c | 8 +-
drivers/serial/uart_qmsi.c | 383 +++++++
drivers/serial/uart_stellaris.c | 119 ++-
drivers/serial/uart_stellaris.h | 26 +
drivers/serial/uart_stm32.c | 444 ++++++++
drivers/serial/uart_stm32.h | 169 +++
drivers/shared_irq/Kconfig | 4 +-
drivers/shared_irq/shared_irq.c | 14 +-
drivers/spi/Kconfig | 480 +--------
drivers/spi/Kconfig.dw | 237 +++++
drivers/spi/Kconfig.intel | 189 ++++
drivers/spi/Kconfig.k64 | 93 ++
drivers/spi/Kconfig.qmsi | 113 ++
drivers/spi/Makefile | 1 +
drivers/spi/spi_dw.c | 24 +-
drivers/spi/spi_dw_quark_se_ss_regs.h | 1 +
drivers/spi/spi_intel.c | 20 +-
drivers/spi/spi_k64.c | 1117 ++++++++++++++++++++
drivers/spi/spi_k64_priv.h | 173 +++
drivers/spi/spi_qmsi.c | 18 +-
drivers/timer/arcv2_timer0.c | 32 +-
drivers/timer/cortex_m_systick.c | 12 +-
drivers/timer/sys_clock_init.c | 2 +-
drivers/watchdog/Kconfig | 2 +
drivers/watchdog/Kconfig.stm32 | 64 ++
drivers/watchdog/Makefile | 1 +
drivers/watchdog/iwdg_stm32.c | 124 +++
drivers/watchdog/iwdg_stm32.h | 86 ++
drivers/watchdog/wdt_dw.c | 6 +-
drivers/watchdog/wdt_qmsi.c | 4 +-
include/adc.h | 2 +-
include/arch/arm/arch.h | 2 +
include/arch/arm/cortex_m/nmi.h | 33 +
include/arch/arm/cortex_m/sys_io.h | 60 ++
include/bluetooth/bluetooth.h | 64 ++
include/bluetooth/conn.h | 51 +-
include/bluetooth/driver.h | 10 +-
include/bluetooth/gatt.h | 39 +
include/bluetooth/hci.h | 131 +++
include/bluetooth/l2cap.h | 20 +-
include/clock_control.h | 31 +-
include/counter.h | 141 +++
include/device.h | 183 +++-
include/display/grove_lcd.h | 2 +-
.../drivers/clock_control/stm32_clock_control.h | 28 +
.../drivers/clock_control/stm32f1_clock_control.h | 62 ++
include/drivers/console/uart_console.h | 2 -
include/drivers/console/uart_pipe.h | 11 +-
include/drivers/spi/spi_k64.h | 78 ++
include/flash.h | 133 +++
include/gpio.h | 29 -
include/i2c.h | 20 +-
include/init.h | 6 +
include/ipm.h | 2 +-
include/microkernel/base_api.h | 31 +-
include/microkernel/memory_pool.h | 30 +
include/microkernel/ticks.h | 7 +-
include/misc/debug/object_tracing.h | 106 ++
include/misc/debug/object_tracing_common.h | 143 +++
include/misc/kernel_event_logger.h | 4 +-
include/misc/ring_buffer.h | 6 +
include/misc/stack.h | 73 ++
include/misc/sys_log.h | 204 ++++
include/misc/util.h | 2 +
include/nanokernel.h | 98 +-
include/net/l2_buf.h | 8 +
include/net/net_socket.h | 6 +-
include/pinmux.h | 20 +-
include/power.h | 145 +++
include/pwm.h | 73 +-
include/sensor.h | 346 ++++++
include/spi.h | 32 +-
include/sys_clock.h | 1 -
include/uart.h | 52 +-
kernel/Kconfig | 91 +-
kernel/microkernel/Kconfig | 11 +-
kernel/microkernel/include/micro_private.h | 1 +
kernel/microkernel/include/micro_private_types.h | 11 +-
kernel/microkernel/k_idle.c | 52 +-
kernel/microkernel/k_memory_pool.c | 110 +-
kernel/microkernel/k_task.c | 12 +-
kernel/microkernel/k_ticker.c | 15 +-
kernel/microkernel/k_timer.c | 21 +-
kernel/nanokernel/Kconfig | 7 +
kernel/nanokernel/Makefile | 4 +-
kernel/nanokernel/device.c | 18 +
kernel/nanokernel/idle.c | 30 +-
kernel/nanokernel/include/timeout_q.h | 101 +-
kernel/nanokernel/include/wait_q.h | 15 +-
kernel/nanokernel/nano_fifo.c | 3 +-
kernel/nanokernel/nano_init.c | 8 +-
kernel/nanokernel/nano_lifo.c | 3 +-
kernel/nanokernel/nano_sema.c | 3 +-
kernel/nanokernel/nano_sleep.c | 6 +-
kernel/nanokernel/nano_stack.c | 2 +
kernel/nanokernel/nano_sys_clock.c | 40 +-
kernel/nanokernel/nano_timer.c | 264 +++--
lib/libc/minimal/include/bits/ssize_t.h | 35 -
lib/libc/minimal/include/sys/types.h | 30 +-
lib/libc/minimal/source/stdout/prf.c | 9 +-
lib/libc/newlib/libc-hooks.c | 5 +
misc/Kconfig | 82 ++
net/bluetooth/Kconfig | 49 +-
net/bluetooth/Makefile | 5 +-
net/bluetooth/att.c | 15 +-
net/bluetooth/conn.c | 533 ++++++++--
net/bluetooth/conn_internal.h | 10 +-
net/bluetooth/gatt.c | 118 ++-
net/bluetooth/hci_core.c | 676 +++++++++++-
net/bluetooth/hci_core.h | 8 +-
net/bluetooth/keys.c | 37 +-
net/bluetooth/keys.h | 12 +-
net/bluetooth/l2cap.c | 26 +-
net/bluetooth/smp.c | 108 +-
net/bluetooth/smp.h | 2 +-
net/bluetooth/smp_null.c | 4 +
net/bluetooth/stack.h | 73 --
net/ip/Kconfig | 53 +
net/ip/Kconfig.debug | 77 ++
net/ip/Makefile | 17 +-
net/ip/contiki/contiki-conf.h | 9 +
net/ip/contiki/ip/tcpip.c | 4 +-
net/ip/contiki/ip/uip-packetqueue.c | 11 +-
net/ip/contiki/ipv6/uip-ds6.c | 4 +-
net/ip/contiki/ipv6/uip-icmp6.c | 12 +-
net/ip/contiki/ipv6/uip6.c | 6 +
net/ip/contiki/mac/csma.c | 18 +-
net/ip/contiki/mac/framer-802154.c | 22 +-
net/ip/contiki/mac/framer-nullmac.c | 19 +-
net/ip/contiki/mac/handler-802154.c | 4 +-
net/ip/contiki/mac/nullrdc.c | 6 +-
net/ip/contiki/mac/sicslowmac/sicslowmac.c | 25 +-
net/ip/contiki/os/sys/timer.c | 13 +-
net/ip/contiki/rpl/rpl-dag.c | 7 +-
net/ip/contiki/rpl/rpl-ext-header.c | 4 +-
net/ip/contiki/rpl/rpl-icmp6.c | 9 +-
net/ip/contiki/rpl/rpl-mrhof.c | 4 +-
net/ip/contiki/rpl/rpl-of0.c | 4 +-
net/ip/contiki/rpl/rpl-timers.c | 4 +-
net/ip/contiki/rpl/rpl.c | 4 +-
net/ip/contiki/sicslowpan/sicslowpan_compression.c | 35 +-
.../contiki/sicslowpan/sicslowpan_fragmentation.c | 69 +-
net/ip/er-coap/er-coap-context.c | 4 +-
net/ip/er-coap/er-coap-engine.c | 2 +-
net/ip/er-coap/er-coap-observe-client.c | 2 +-
net/ip/ip_buf.c | 6 +-
net/ip/l2_buf.c | 3 +
net/ip/net_context.c | 21 +-
net/ip/net_core.c | 9 +-
net/ip/net_driver_15_4.c | 11 +-
net/ip/tinydtls/dtls.c | 2 +-
samples/bluetooth/beacon/prj_nble.conf | 2 +
samples/bluetooth/gatt/bas.c | 81 ++
samples/bluetooth/gatt/bas.h | 22 +
samples/bluetooth/gatt/cts.c | 122 +++
samples/bluetooth/gatt/cts.h | 22 +
samples/bluetooth/gatt/dis.c | 72 ++
samples/bluetooth/gatt/dis.h | 21 +
samples/bluetooth/gatt/gap.c | 71 ++
samples/bluetooth/gatt/gap.h | 21 +
samples/bluetooth/gatt/hrs.c | 93 ++
samples/bluetooth/gatt/hrs.h | 22 +
samples/bluetooth/gatt/ipss.c | 268 +++++
samples/bluetooth/gatt/ipss.h | 23 +
samples/bluetooth/ipsp/src/Makefile | 3 +-
samples/bluetooth/ipsp/src/ipss.c | 260 -----
samples/bluetooth/ipsp/src/ipss.h | 21 -
samples/bluetooth/ipsp/src/main.c | 2 +-
samples/bluetooth/peripheral/prj_nble.conf | 2 +
samples/bluetooth/peripheral/src/Makefile | 5 +-
samples/bluetooth/peripheral/src/main.c | 272 +----
samples/bluetooth/peripheral_csc/src/Makefile | 4 +-
samples/bluetooth/peripheral_csc/src/main.c | 115 +-
samples/bluetooth/peripheral_dis/prj.conf | 1 +
samples/bluetooth/peripheral_dis/src/Makefile | 4 +-
samples/bluetooth/peripheral_dis/src/main.c | 45 +-
samples/bluetooth/peripheral_esp/Makefile | 2 +-
samples/bluetooth/peripheral_esp/README | 4 +
samples/bluetooth/peripheral_esp/prj_nble.conf | 6 +
samples/bluetooth/peripheral_esp/src/Makefile | 4 +-
samples/bluetooth/peripheral_esp/src/main.c | 97 +-
samples/bluetooth/peripheral_esp/testcase.ini | 8 +
samples/bluetooth/peripheral_hr/prj_nble.conf | 2 +
samples/bluetooth/peripheral_hr/src/Makefile | 5 +-
samples/bluetooth/peripheral_hr/src/main.c | 165 +--
samples/bluetooth/peripheral_sc_only/src/Makefile | 4 +-
samples/bluetooth/peripheral_sc_only/src/main.c | 34 +-
.../cpp_synchronization/microkernel/prj_x86.conf | 1 -
samples/cpp_synchronization/nanokernel/prj.conf | 1 -
samples/drivers/adc/src/adc.c | 2 +-
samples/drivers/aon_counter/Makefile | 5 +
samples/drivers/aon_counter/aon.config | 6 +
samples/drivers/aon_counter/readme.txt | 101 ++
samples/drivers/aon_counter/src/Makefile | 1 +
samples/drivers/aon_counter/src/main.c | 166 +++
samples/drivers/aon_counter/testcase.ini | 5 +
samples/drivers/button/Makefile | 6 +
samples/drivers/button/README.txt | 41 +
samples/drivers/button/prj.conf | 1 +
samples/drivers/button/prj.mdef | 5 +
samples/drivers/button/src/Makefile | 1 +
samples/drivers/button/src/main.c | 64 ++
samples/drivers/disco/Makefile | 6 +
samples/drivers/disco/README.txt | 42 +
samples/drivers/disco/prj.conf | 1 +
samples/drivers/disco/prj.mdef | 5 +
samples/drivers/disco/src/Makefile | 1 +
samples/drivers/disco/src/main.c | 49 +
samples/drivers/i2c_fujitsu_fram/src/main.c | 8 +-
samples/drivers/i2c_lsm9ds0/src/main.c | 8 +-
samples/drivers/i2c_stts751/Makefile | 6 +
samples/drivers/i2c_stts751/README | 7 +
samples/drivers/i2c_stts751/prj.conf | 1 +
samples/drivers/i2c_stts751/src/Makefile | 1 +
samples/drivers/i2c_stts751/src/main.c | 93 ++
samples/drivers/sensor_apds9960/Makefile | 6 +
samples/drivers/sensor_apds9960/prj_arc.conf | 8 +
samples/drivers/sensor_apds9960/src/Makefile | 1 +
samples/drivers/sensor_apds9960/src/main.c | 283 +++++
samples/drivers/sensor_apds9960/testcase.ini | 6 +
samples/drivers/spi_test/src/spi.c | 4 +
samples/drivers/uart/prj.config | 1 +
samples/drivers/uart/src/main.c | 70 +-
samples/drivers/w25q80bl/Makefile | 2 +-
samples/drivers/w25q80bl/README | 6 +
samples/drivers/w25q80bl/prj.conf | 2 +
samples/drivers/w25q80bl/src/main.c | 14 +-
samples/drivers/watchdog/src/main.c | 4 +-
samples/hello_world/microkernel/prj.conf | 1 -
samples/ipm/ipm_demo_arc/Makefile | 6 +
samples/ipm/ipm_demo_arc/prj.conf | 10 +
samples/ipm/ipm_demo_arc/prj.mdef | 11 +
samples/ipm/ipm_demo_arc/src/Makefile | 5 +
samples/ipm/ipm_demo_arc/src/hello.c | 102 ++
samples/ipm/ipm_demo_lmt/Makefile | 6 +
samples/ipm/ipm_demo_lmt/prj.conf | 9 +
samples/ipm/ipm_demo_lmt/prj.mdef | 13 +
samples/ipm/ipm_demo_lmt/src/Makefile | 5 +
samples/ipm/ipm_demo_lmt/src/hello.c | 143 +++
.../kernel_event_logger/microkernel/prj_arm.conf | 2 +-
.../kernel_event_logger/microkernel/prj_x86.conf | 2 +-
samples/net/coap_observe_client/Makefile | 9 +-
samples/net/coap_observe_client/prj_802154.conf | 12 +
samples/net/coap_observe_client/prj_arm.conf | 11 -
samples/net/coap_observe_client/prj_slip.conf | 13 +
samples/net/coap_observe_client/prj_x86.conf | 11 -
samples/net/coap_observe_client/src/Makefile | 7 +-
.../coap_observe_client/src/coap-observe-client.c | 76 +-
samples/net/coap_server/Makefile | 6 +-
samples/net/coap_server/prj_slip.conf | 2 +
samples/net/coap_server/src/Makefile | 7 +-
samples/net/coap_server/src/coap-server.c | 81 +-
samples/net/common/Makefile.ipstack | 96 ++
samples/net/common/net_testing.h | 136 +++
samples/net/dtls_client/Makefile | 3 +-
samples/net/dtls_client/prj_qemu.conf | 13 +
samples/net/dtls_client/prj_slip.conf | 6 +-
samples/net/dtls_client/src/Makefile | 5 +
samples/net/dtls_client/src/dtls-client.c | 77 +-
samples/net/dtls_server/Makefile | 6 +-
samples/net/dtls_server/prj_qemu.conf | 13 +
samples/net/dtls_server/prj_slip.conf | 4 +-
samples/net/dtls_server/src/Makefile | 7 +-
samples/net/dtls_server/src/dtls-server.c | 69 +-
samples/net/echo_client/Makefile | 2 +-
samples/net/echo_client/prj_qemu.conf | 2 +
samples/net/echo_client/prj_slip.conf | 2 +
samples/net/echo_client/src/Makefile | 7 +-
samples/net/echo_client/src/echo-client.c | 93 +-
samples/net/echo_server/Makefile | 2 +-
samples/net/echo_server/Makefile.ipstack | 91 --
samples/net/echo_server/prj_qemu.conf | 2 +
samples/net/echo_server/prj_slip.conf | 2 +
samples/net/echo_server/src/Makefile | 7 +-
samples/net/echo_server/src/echo-server.c | 95 +-
samples/net/loopback_test/Makefile | 6 +-
samples/net/loopback_test/prj.conf | 5 +
samples/net/loopback_test/prj.mdef | 4 +-
samples/net/loopback_test/prj_10000.conf | 6 +
samples/net/loopback_test/prj_arm.conf | 3 -
samples/net/loopback_test/prj_x86.conf | 3 -
samples/net/loopback_test/src/network.c | 181 ++--
samples/nfc/nfc_hello/src/main.c | 8 +-
samples/philosophers/microkernel/src/phil.h | 9 +-
samples/philosophers/microkernel/src/phil_fiber.c | 17 +-
samples/philosophers/microkernel/src/phil_task.c | 10 +-
samples/power/power_hooks/prj.conf | 4 +-
samples/power/power_hooks/src/main.c | 2 +-
samples/power/power_mgr/README.txt | 17 +-
samples/power/power_mgr/prj.conf | 6 +-
samples/power/power_mgr/src/main.c | 102 +-
samples/sensor/bmp280/Makefile | 5 +
samples/sensor/bmp280/prj.conf | 11 +
samples/sensor/bmp280/src/Makefile | 1 +
samples/sensor/bmp280/src/main.c | 50 +
samples/sensor/magn_polling/Makefile | 6 +
samples/sensor/magn_polling/README.txt | 3 +
samples/sensor/magn_polling/prj.conf | 13 +
samples/sensor/magn_polling/src/Makefile | 1 +
samples/sensor/magn_polling/src/main.c | 73 ++
samples/sensor/mcp9808/Makefile | 6 +
samples/sensor/mcp9808/README.txt | 1 +
samples/sensor/mcp9808/prj.conf | 14 +
samples/sensor/mcp9808/src/Makefile | 1 +
samples/sensor/mcp9808/src/main.c | 84 ++
samples/sensor/sx9500/Makefile | 6 +
samples/sensor/sx9500/README.txt | 5 +
samples/sensor/sx9500/prj.conf | 16 +
samples/sensor/sx9500/src/Makefile | 1 +
samples/sensor/sx9500/src/main.c | 93 ++
samples/synchronization/microkernel/prj.conf | 1 -
scripts/kconfig/menu.c | 16 +
scripts/kconfig/symbol.c | 29 +
scripts/qemu-machine-hack.py | 11 +
scripts/sanity_chk/arches/x86.ini | 5 +-
scripts/sanitycheck | 58 +-
scripts/sysgen | 56 +-
tests/benchmark/app_kernel/Makefile | 12 +-
tests/benchmark/app_kernel/prj_atom.conf | 13 -
tests/benchmark/app_kernel/prj_fp.conf | 11 +
tests/benchmark/app_kernel/prj_minuteia.conf | 6 -
tests/benchmark/app_kernel/prj_no_fp.conf | 6 +
tests/benchmark/boot_time/microkernel/Makefile | 1 +
tests/benchmark/boot_time/nanokernel/Makefile | 1 +
tests/benchmark/footprint/microkernel/README.txt | 3 -
.../benchmark/footprint/microkernel/float/arm.conf | 2 +-
.../benchmark/footprint/microkernel/float/x86.conf | 2 +-
tests/benchmark/footprint/microkernel/max/arm.conf | 2 +-
tests/benchmark/footprint/microkernel/max/x86.conf | 2 +-
tests/benchmark/footprint/nanokernel/README.txt | 3 -
.../benchmark/latency_measure/microkernel/prj.conf | 2 -
.../benchmark/latency_measure/microkernel/prj.mdef | 4 +-
.../microkernel/src/nano_ctx_switch.c | 2 +-
.../latency_measure/microkernel/src/nano_int.c | 2 +-
.../microkernel/src/nano_int_to_fiber.c | 2 +-
.../microkernel/src/nano_int_to_fiber_sem.c | 2 +-
.../microkernel/src/test_asm_inline_gcc.h | 20 +-
.../latency_measure/microkernel/src/utils.c | 1 -
.../benchmark/latency_measure/nanokernel/prj.conf | 2 -
tests/benchmark/sys_kernel/microkernel/prj.conf | 2 -
.../sys_kernel/nanokernel/prj_console.conf | 2 -
tests/bluetooth/init/prj_0.conf | 2 +
tests/bluetooth/init/prj_1.conf | 3 +
tests/bluetooth/init/prj_10.conf | 9 +
tests/bluetooth/init/prj_11.conf | 12 +
tests/bluetooth/init/prj_12.conf | 11 +
tests/bluetooth/init/prj_13.conf | 11 +
tests/bluetooth/init/prj_14.conf | 7 +
tests/bluetooth/init/prj_15.conf | 7 +
tests/bluetooth/init/prj_16.conf | 8 +
tests/bluetooth/init/prj_17.conf | 22 +
tests/bluetooth/init/prj_18.conf | 4 +
tests/bluetooth/init/prj_19.conf | 4 +
tests/bluetooth/init/prj_2.conf | 3 +
tests/bluetooth/init/prj_3.conf | 5 +
tests/bluetooth/init/prj_4.conf | 4 +
tests/bluetooth/init/prj_5.conf | 4 +
tests/bluetooth/init/prj_6.conf | 5 +
tests/bluetooth/init/prj_7.conf | 6 +
tests/bluetooth/init/prj_8.conf | 7 +
tests/bluetooth/init/prj_9.conf | 8 +
tests/bluetooth/init/testcase.ini | 106 +-
tests/bluetooth/shell/prj_nble.conf | 2 +
tests/bluetooth/shell/src/Makefile | 3 +-
tests/bluetooth/shell/src/main.c | 216 +++-
tests/bluetooth/tester/btp_spec.txt | 1 +
tests/bluetooth/tester/prj_nble.conf | 2 +
tests/bluetooth/tester/src/Makefile | 2 +-
tests/bluetooth/tester/src/bttester.c | 5 +
tests/bluetooth/tester/src/bttester.h | 18 +-
tests/bluetooth/tester/src/gap.c | 6 +-
tests/bluetooth/tester/src/gatt.c | 469 ++++----
tests/bluetooth/tester/src/l2cap.c | 50 +
tests/kernel/test_early_sleep/Makefile | 6 +
tests/kernel/test_early_sleep/README.txt | 51 +
tests/kernel/test_early_sleep/prj.conf | 1 +
tests/kernel/test_early_sleep/prj.mdef | 10 +
tests/kernel/test_early_sleep/src/Makefile | 3 +
tests/kernel/test_early_sleep/src/early_sleep.c | 269 +++++
tests/kernel/test_early_sleep/testcase.ini | 2 +
tests/kernel/test_ipm/src/ipm_dummy.c | 2 +-
tests/kernel/test_obj_tracing/microkernel/Makefile | 6 +
.../kernel/test_obj_tracing/microkernel/README.txt | 18 +
tests/kernel/test_obj_tracing/microkernel/prj.mdef | 24 +
.../test_obj_tracing/microkernel/prj_arm.conf | 2 +
.../test_obj_tracing/microkernel/prj_x86.conf | 5 +
.../test_obj_tracing/microkernel/src/Makefile | 3 +
.../microkernel/src/object_monitor.c | 146 +++
.../kernel/test_obj_tracing/microkernel/src/phil.h | 18 +
.../test_obj_tracing/microkernel/src/phil_fiber.c | 111 ++
.../test_obj_tracing/microkernel/src/phil_task.c | 75 ++
.../test_obj_tracing/microkernel/testcase.ini | 2 +
tests/kernel/test_obj_tracing/nanokernel/Makefile | 6 +
.../kernel/test_obj_tracing/nanokernel/README.txt | 18 +
.../test_obj_tracing/nanokernel/prj_arc.conf | 2 +
.../test_obj_tracing/nanokernel/prj_arm.conf | 2 +
.../test_obj_tracing/nanokernel/prj_x86.conf | 5 +
.../test_obj_tracing/nanokernel/testcase.ini | 2 +
.../kernel/test_tickless/microkernel/prj_arm.conf | 2 +-
.../kernel/test_tickless/microkernel/prj_x86.conf | 2 +-
tests/kernel/test_xip/microkernel/prj.conf | 1 -
tests/kernel/test_xip/nanokernel/prj_arm.conf | 1 -
tests/kernel/test_xip/nanokernel/prj_x86.conf | 1 -
zephyr-env.sh | 3 +
777 files changed, 37859 insertions(+), 12153 deletions(-)


RFC: Method for PM app to detect if any device is busy before deciding to use deep sleep policy

Thomas, Ramesh
 

Problem Statement:
--------------------------
Entering deep sleep states during pending device transactions can cause
transaction inconsistencies.

Why this is a problem:
-----------------------------
When deep sleep state is entered, peripheral blocks are shutdown losing
state. If a transfer was ongoing when the block was turned off then the
state of the transaction would be left in an irrecoverably error state.
e.g. if the SPI block loses power when a SPI flash write was happening,
then parts of the flash memory would have been erased and written with
incomplete data.

When kernel idle task calls _sys_soc_suspend(), PM policy may decide to
enter deep sleep and calls .suspend() functions of devices. If a device
is busy at this point, one option for the driver is to return -EBUSY.
However, if it is discovered that a device is busy, after having
suspended several devices, then it could be suboptimal to roll back the
already suspended devices, or spend time retrying to get the busy
device to suspend.

Due to kernel idling logic which involves timer expiry calculations that
should not be interrupted, the kernel idle task disables interrupt
before going to idle. Since _sys_soc_suspend() is called in this context
with interrupts disabled, for it to block for too long, waiting for
devices to free up, would be disruptive to system scheduling.

What should be done:
------------------------------
A method for devices to register a busy state as follows:-

a)A bit field array with one bit per device will be used to store the
transaction status of each device.

b) "device_get_busy_list()" API will be called by PM app to retrieve a
pointer to the bit field array in (a) and use it to track device busy
status. Based on the transaction status of devices, PM app can decide
whether to enter deep sleep or any PM policy.

c) Device drivers will call "device_set_busy(struct device*)" API to
register beginning of a transaction that should not be interrupted by
deep sleep.

d) Device drivers will call "device_clear_busy(struct device*)" API to
clear the busy status of the device.


RFC: extend sanitycheck testcase filtering expressiveness

Boie, Andrew P
 

Problem statement:

Test case filtering in sanitycheck's testcase.ini files allows
sanitycheck to exclude certain test cases that are incompatible with
particular architectures, boards, or the presence or absence of Kconfig
options.

The goal of this mechanism is to allow the testcases to scale up to many
different boards without having to do constant gardening of the testcase
configuration files. I imagine a future where Zephyr supports dozens, if
not hundreds of microcontrollers and we want to ensure that we have good
test coverage on all these boards.

This is currently done in testcase.ini with the following directives:

arch_whitelist = <list of arches, such as x86, arm, arc>
Set of architectures that this test case should only be run for.

arch_exclude = <list of arches, such as x86, arm, arc>
Set of architectures that this test case should not run on.

platform_whitelist = <list of platforms>
Set of platforms that this test case should only be run for.

platform_exclude = <list of platforms>
Set of platforms that this test case should not run on.

config_whitelist = <list of config options>
Config options can either be config names like CONFIG_FOO which
match if the configuration is defined to any value, or key/value
pairs like CONFIG_FOO=bar which match if it is set to a specific
value. May prepend a '!' to invert the match.

This current scheme is less than ideal for several reasons, enumerated
below:

1. config_whitelist is very limited in expressiveness.

1a. You cannot do numerical comparisons, for example I can't currently
filter out a large footprint test by saying that CONFIG_RAM_SIZE
must be equal to or greater than some value. You can only test for
equality or if the config option is defined. This was somewhat
vexing when trying to add the new nucleo_f103rb board to sanity
checks as it has very little RAM.

1b. All the items in config_whitelist are ANDed together. You cannot
specify boolean OR relationship, do any kind of grouping with
parenthesis, or use NOT except on individual items. You can only
do very simple stuff.

1c. There is no way to tie config_whitelist in with the current arch
or platform. For example, test_tickless is currently improperly
specified. The true semantics of the test is that it works on
all x86, is unimplemented on ARC, and it supports two different
SOC types on ARM: CONFIG_SOC_ATMEL_SAM3, CONFIG_SOC_FSL_FRDM_K64F

Currently we have in its testcase.ini:

[test]
tags = core
config_whitelist = !CONFIG_SOC_TI_LM3S6965_QEMU

This currently only works for a few reasons that do not scale.

* The test is automatically excluded on ARC because of no
microkernel support (which may change in the future)
* This test runs on all x86, because currently we exclude
targets that have a particular SOC, which is a bad way to
do it as you will need to keep adding more ARM SOCs to the
list as they are introduced to the tree, such as
SOC_STM32F103RB. If I instead expressed all the CONFIG_SOC_*
on the ARM side that the test *is* compatible with, there's
no way to tell it that it's also good to run on all X86.

What we should be saying is something more like, "run on all
x86 boards, or those ARM boards which have a particular SOC
supported in the code". In the language developed for this
proposal, we would have:

filter = ARCH == "x86" or (ARCH == "arm" and
(CONFIG_SOC_FSL_FRDM_K64F or CONFIG_SOC_ATMEL_SAM3))

2. platform_whitelist or platform_exclude is the *worst* way to filter
testcases, as it simply doesn't scale. You have to keep adding new
boards to these lists as they are introduced to the Zephyr tree, which
is not fun to manage in a hypothetical optimistic future where Zephyr
takes off and we have dozens or even hundreds of supported boards in the
tree.

If possible, it's much better to filter on board *features* through
config_whitelist, as these typically do not require more changes to the
testcase.ini as more boards are added.

For example, we have a lot of bluetooth tests which have a
platform_whitelist with "arduino_101". This means the test will only run
on that board. It may be better to indicate that the test can run on any
Quark SE board with compatible Bluetooth hardware; on cursory inspection
these tests seem to be specific to the bluetooth chip in use and not
even the SOC.



Proposed solution:

We need a more expressive language for filtering test cases. I propose a
simple boolean expression language with the following grammar:

expression ::= expression "and" expression
| expression "or" expression
| "not" expression
| "(" expression ")"
| symbol "==" constant
| symbol "!=" constant
| symbol "<" number
| symbol ">" number
| symbol ">=" number
| symbol "<=" number
| symbol "in" list
| symbol

list ::= "[" list_contents "]"

list_contents ::= constant
| list_contents "," constant

constant ::= number
| string

When symbols are encountered, they are looked up in an environment
dictionary. In sanitycheck the environment will initially consist of:

{
ARCH : <architecture>,
PLATFORM : <platform>,
<all CONFIG_* key/value pairs in the test's generated defconfig>
}

We can later augment this with additional interesting metadata if we
want. For example I was thinking of ways we could integrate some
footprint information for large tests.

For the case where

expression ::= symbol

it evaluates to true if the symbol is defined to a non-empty string.

For all comparison operators, if the config symbol is undefined, it will
be treated as a 0 (for > < >= <=) or an empty string "" (for == != in).
For numerical comparisons it doesn't matter if the environment stores
the value as an integer or string, it will be cast appropriately.

Operator precedence, starting from lowest to highest:

or (left associative)
and (left associative)
not (right associative)
all comparison operators (non-associative)

In testcase.ini the 'config_whitelist' directive will be removed and
replaced with 'filter' directives containing one of these expressions.
arch_whitelist, arch_exclude, platform_whitelist, platform_exclude
are all syntactic sugar for these expressions. For instance

arch_exclude = x86 arc

Is the same as:

filter = not ARCH in ["x86", "arc"]


Implementation details:

Writing a parser by hand is a pain and prone to bugs. The best way to do
a language like this is to use a LR parser generator like lex/yacc.
There exists an open source library called PLY which does lex/yacc for
Python, it has been around for a long time and works very well:

http://www.dabeaz.com/ply/index.html

The sample implementation I have drops a copy of PLY directly in the
Zephyr source tree since its license is compatible and this will result
in the least pain for users as they won't have to do anything. If this
is unacceptable we can either find a way to stick it in the SDK, or add
it to the list of workstation dependencies (either have the user install
with pip or their distribution's package manager. Fedora appears to have
PLY installed by default).

Except for the case mentioned above with test_tickless, I haven't yet
gone through all the testcase.ini to ensure that the filtering done is
optimal. However I do have an implementation of the language which can
be looked at below:

Add PLY sources to tree
https://gerrit.zephyrproject.org/r/1075

Implement expression parser
https://gerrit.zephyrproject.org/r/1076

Integrate expression parser into sanitycheck
https://gerrit.zephyrproject.org/r/1077

Fix test_tickless filtering expression
https://gerrit.zephyrproject.org/r/1078

In addition to sanitycheck it is hoped that the expression language
could be generally useful for other scripts which need to do yes/no
filtering based on values in an environment.

--
Andrew Boie
Staff Engineer - EOS Zephyr
Intel Open Source Technology Center


Re: FRDM-K64 PWM BUS Fault

Maciek Borzecki <maciek.borzecki@...>
 

On Wed, Mar 23, 2016 at 4:01 PM, Anders Dam Kofoed <adk(a)accipio.dk> wrote:
Hi all,

I am trying to use the PWM output on the K64 board. I have taken the sample/drivers/pwm_dw/src/main.c and modified it to use the CONFIG_PWM_K64_FTM_0_DEV_NAME and removed the CONFIG_PWM_DW=y from the prj.conf. Compiles without errors or warnings. Using the latest 0.75 SDK and zephyr-project code I get this on the terminal when running it:

PWM demo app
***** BUS FAULT *****
Executing thread ID (thread): 0x20001b28
Faulting instruction address: 0x00000b78
Imprecise data bus error
Fatal fault in task ! Aborting task.
Full assembly listing in written to outdir/zephyr.lst. Having the
address of instruction that trigger the fault, try looking it up in
the listing and see if there's something obviously wrong. The assembly
will be mixed with C, you can try a debug build to get an unoptimized
version which should be a bit easier to look at . If nothing in
particular stands out, you can always try gdb.

---
prj.conf:
---
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_NANO_TIMERS=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_GPIO=y
CONFIG_PWM=y
---

CODE:
---
#include <zephyr.h>

#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT printf
#else
#include <misc/printk.h>
#define PRINT printk
#endif

#include <device.h>
#include <pwm.h>
#include <sys_clock.h>

/* about 1 ms */
#define MIN_PERIOD 32000

/* about 1 second */
#define MAX_PERIOD 32000000

#define SLEEPTICKS SECONDS(4)

void main(void)
{
struct nano_timer timer;
void *timer_data[1];
struct device *pwm_dev;
uint32_t period;
uint8_t dir;

nano_timer_init(&timer, timer_data);

PRINT("PWM demo app\n");

pwm_dev = device_get_binding(CONFIG_PWM_K64_FTM_0_DEV_NAME);
if (!pwm_dev) {
PRINT("Cannot find %s!\n", CONFIG_PWM_K64_FTM_0_DEV_NAME);
}

period = MAX_PERIOD;
dir = 0;

while (1) {
pwm_pin_set_values(pwm_dev, 0, period, period);
//pwm_pin_set_duty_cycle(pwm_dev, 0, 40);

if (dir) {
period *= 2;

if (period > MAX_PERIOD) {
dir = 0;
period = MAX_PERIOD;
}
} else {
period /= 2;

if (period < MIN_PERIOD) {
dir = 1;
period = MIN_PERIOD;
}
}

nano_timer_start(&timer, SLEEPTICKS);
nano_timer_test(&timer, TICKS_UNLIMITED);
}
}

I have found another way to do what I want so no rush. Just wanted to state that it's not working.

Kind regards
Anders Dam Kofoed


--
Maciek Borzecki


Re: FRDM-K64 PWM BUS Fault

Kalowsky, Daniel <daniel.kalowsky@...>
 

I'd encourage you to file a JIRA/bug so that we can track this and get someone looking at it.

-----Original Message-----
From: Anders Dam Kofoed [mailto:adk(a)accipio.dk]
Sent: Wednesday, March 23, 2016 8:01 AM
To: devel(a)lists.zephyrproject.org
Subject: [devel] FRDM-K64 PWM BUS Fault

Hi all,

I am trying to use the PWM output on the K64 board. I have taken the
sample/drivers/pwm_dw/src/main.c and modified it to use the
CONFIG_PWM_K64_FTM_0_DEV_NAME and removed the
CONFIG_PWM_DW=y from the prj.conf. Compiles without errors or
warnings. Using the latest 0.75 SDK and zephyr-project code I get this on the
terminal when running it:

PWM demo app
***** BUS FAULT *****
Executing thread ID (thread): 0x20001b28
Faulting instruction address: 0x00000b78
Imprecise data bus error
Fatal fault in task ! Aborting task.

---
prj.conf:
---
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_NANO_TIMERS=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_GPIO=y
CONFIG_PWM=y
---

CODE:
---
#include <zephyr.h>

#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT printf
#else
#include <misc/printk.h>
#define PRINT printk
#endif

#include <device.h>
#include <pwm.h>
#include <sys_clock.h>

/* about 1 ms */
#define MIN_PERIOD 32000

/* about 1 second */
#define MAX_PERIOD 32000000

#define SLEEPTICKS SECONDS(4)

void main(void)
{
struct nano_timer timer;
void *timer_data[1];
struct device *pwm_dev;
uint32_t period;
uint8_t dir;

nano_timer_init(&timer, timer_data);

PRINT("PWM demo app\n");

pwm_dev =
device_get_binding(CONFIG_PWM_K64_FTM_0_DEV_NAME);
if (!pwm_dev) {
PRINT("Cannot find %s!\n",
CONFIG_PWM_K64_FTM_0_DEV_NAME);
}

period = MAX_PERIOD;
dir = 0;

while (1) {
pwm_pin_set_values(pwm_dev, 0, period, period);
//pwm_pin_set_duty_cycle(pwm_dev, 0, 40);

if (dir) {
period *= 2;

if (period > MAX_PERIOD) {
dir = 0;
period = MAX_PERIOD;
}
} else {
period /= 2;

if (period < MIN_PERIOD) {
dir = 1;
period = MIN_PERIOD;
}
}

nano_timer_start(&timer, SLEEPTICKS);
nano_timer_test(&timer, TICKS_UNLIMITED);
}
}

I have found another way to do what I want so no rush. Just wanted to state
that it's not working.

Kind regards
Anders Dam Kofoed


FRDM-K64 PWM BUS Fault

Anders Dam Kofoed <adk@...>
 

Hi all,

I am trying to use the PWM output on the K64 board. I have taken the sample/drivers/pwm_dw/src/main.c and modified it to use the CONFIG_PWM_K64_FTM_0_DEV_NAME and removed the CONFIG_PWM_DW=y from the prj.conf. Compiles without errors or warnings. Using the latest 0.75 SDK and zephyr-project code I get this on the terminal when running it:

PWM demo app
***** BUS FAULT *****
Executing thread ID (thread): 0x20001b28
Faulting instruction address: 0x00000b78
Imprecise data bus error
Fatal fault in task ! Aborting task.

---
prj.conf:
---
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_NANO_TIMERS=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_GPIO=y
CONFIG_PWM=y
---

CODE:
---
#include <zephyr.h>

#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT printf
#else
#include <misc/printk.h>
#define PRINT printk
#endif

#include <device.h>
#include <pwm.h>
#include <sys_clock.h>

/* about 1 ms */
#define MIN_PERIOD 32000

/* about 1 second */
#define MAX_PERIOD 32000000

#define SLEEPTICKS SECONDS(4)

void main(void)
{
struct nano_timer timer;
void *timer_data[1];
struct device *pwm_dev;
uint32_t period;
uint8_t dir;

nano_timer_init(&timer, timer_data);

PRINT("PWM demo app\n");

pwm_dev = device_get_binding(CONFIG_PWM_K64_FTM_0_DEV_NAME);
if (!pwm_dev) {
PRINT("Cannot find %s!\n", CONFIG_PWM_K64_FTM_0_DEV_NAME);
}

period = MAX_PERIOD;
dir = 0;

while (1) {
pwm_pin_set_values(pwm_dev, 0, period, period);
//pwm_pin_set_duty_cycle(pwm_dev, 0, 40);

if (dir) {
period *= 2;

if (period > MAX_PERIOD) {
dir = 0;
period = MAX_PERIOD;
}
} else {
period /= 2;

if (period < MIN_PERIOD) {
dir = 1;
period = MIN_PERIOD;
}
}

nano_timer_start(&timer, SLEEPTICKS);
nano_timer_test(&timer, TICKS_UNLIMITED);
}
}

I have found another way to do what I want so no rush. Just wanted to state that it's not working.

Kind regards
Anders Dam Kofoed


Re: RFC: Use error codes from errno.h

Andre Guedes <andre.guedes@...>
 

Hi Daniel, thanks for your feedback!

See some comments inline:

Quoting Dan Kalowsky (2016-03-21 14:10:43)
Hi, trying the webmail reply for a first time. Be gentle.

Hi all,

Quoting Andre Guedes (2016-03-03 16:43:24)

Do we have a consensus about this?

After the "errno-drivers" patchset, DEV_* codes will be used only at
'board'
and 'arch' layers. Actually, all occurrences of DEV_* codes in board/ are
from pinmux drivers. These drivers are going to be landed in drivers/ soon
(patches are under review on gerrit) so they will already be replaced by -E*
codes. This means that only a few files from arch/ will be using DEV_* codes.

If we have a consensus, the next steps are:
1) Replace DEV_* occurrences in arch/ (and boards/ if applicable);
+1
Patch sent to gerrit.


2) Deprecate DEV_* (just add a comment in device.h saying: DEV_* are deprecate,
use errno.h codes instead.
+1 I would argue this should step 1. This can be and should be merged in before the close of the release window this week. So get this done ASAP.
Fine by me. Patch sent to gerrit. There is no dependency so it can be merged
before any other patch.


3) Remove DEV_* codes.

Since 3) might break external applications, we should apply it during a major
release I guess.
I'd wait until the start of the next release cycle to make this change. It will give a long window of opportunity to update.
Fine by me too. I also sent a patch removing the DEV_* codes to gerrit, but
we can wait until the next merge window is open to apply it.

BTW, while we don't remove DEV_* codes, we have to be extra careful to avoid
new code is merged using DEV_* instead of -E*. I just noticed this occurred
with aon counters and gpio_stm32 drivers. Patches fixing this on gerrit.

Regards,

Andre


RFC: 2/5 System Device Driver Modifications (Revised v1.2)

Thomas, Ramesh
 

[Rev 1.2 - Added a parameter to .suspend() and .resume() functions
indicating the power policy used by the PMA. This parameter will help
driver take policy based optimized actions. Described in detail at the
end]

[Revised v1.1 incorporating feedbacks. The changes are shown at the
end]

Problem Statement:
Not all Zephyr kernel drivers provide the same interfaces.

Why this is a problem:
-----------------------------
The Zephyr kernel currently has devices that are essential for core OS
functions (such as APICs and timers), but provide no public API means
for accessing them. Without any consistent method to access device
drivers on the platform, it becomes very difficult to achieve power
targets.

What should be done:
-----------------------------
1) Each native Zephyr kernel driver and shim driver (such as QMSI) shall
support:

a) uint32_t suspend() - routine that will move any required device state
data
to RAM* with the following valid return values:
- DEV_OK
- DEV_BUSY
- DEV_FAIL

b) uint32_t resume() - routine that will retrieve any device state data
from
RAM* with the following valid return values:

- DEV_OK
- DEV_FAIL

2) Provide a name recognized by the device_get_binding() function, this
includes what are currently thought to be drivers such as timers,
IOAPIC, and LOAPIC.

*The power management process is not expected to power down system RAM
(it will most likely stay in selective suspend).

The size of the device data is dependent upon an individual device, and
therefore the system integrator must be wary of the number of devices
being utilized.

Device suspend flow:
Device Drivers at suspend shall:
- Device state shall be saved to memory and maintained across a PM event
- Turning off the device clock
- Return appropriate error code

Device resume flow:
Device Drivers at resume shall:
- Restore to state saved in memory
- Turn on the device clock
- Return appropriate error code

The drivers may skip the saving/restoring and device re-initialization
steps, if the power policy used by the PMA is not expected to cause the
devices to lose state.

Device domain experts will be needed to implement the proper methods for
suspending and resuming each device.

----New additions-------
Following 2 macros would be added to allow device drivers to implement
the .suspend() and .resume() hooks described in #1 above.

A device ops structure holds the .suspend() and .resume() which is
included inside each device's device structure:

struct device_ops example_dev_ops = {
.suspend = example_suspend,
.resume = example_resume
};

Two new macros would be created that drivers use instead of DEVICE_INIT
and SYS_INIT if they implement the .suspend and .resume functions. For
devices using non-PM macros, a default dev_ops will be assigned that
does nothing (so app need not check if dev_ops != NULL).

a) DEVICE_INIT_PM(dev_name, drv_name, init_fn, &example_dev_ops, data,
cfg_info, level, prio);

b) SYS_INIT_PM(name, init_fn, &example_dev_ops, level, prio);

SYS_INIT_PM also added the "name" argument so PMA can call
the .suspend/.resume for devices like APICs that need to do
suspend/resume operations. The methods that retrieve the pointer to the
device structure of any device requires the device to be assigned a name
unlike the SYS_INIT macro which assigns a "" as the name for devices.

All this will be inside DEVICE_POWER_MANAGEMENT Kconfig flag.

----Rev 1.2 changes-------
The .suspend and .resume functions described in #1 would be passed a
parameter indicating the policy used by the PMA. Depending on the
policy, the driver may take different actions during .suspend
and .resume calls. This is because, unless the policy causes the
devices to lose state, the device driver need not save/restore state.

This helps reduce wake latency in states that do not need save/restore
and reinitialization of devices.

The policies described in RFC 5/5 in detail are listed below:
1. PM_SOC_LPS - Devices do not lose state
2. PM_SOC_DS - Devices may lose state
3. PM_SOC_DEVICE_SUSPEND_ONLY - Devices do not lose state


Re: RFC: Use error codes from errno.h

Kalowsky, Daniel <daniel.kalowsky@...>
 

Hi, trying the webmail reply for a first time. Be gentle.

Hi all,

Quoting Andre Guedes (2016-03-03 16:43:24)

Do we have a consensus about this?

After the "errno-drivers" patchset, DEV_* codes will be used only at
'board'
and 'arch' layers. Actually, all occurrences of DEV_* codes in board/ are
from pinmux drivers. These drivers are going to be landed in drivers/ soon
(patches are under review on gerrit) so they will already be replaced by -E*
codes. This means that only a few files from arch/ will be using DEV_* codes.

If we have a consensus, the next steps are:
1) Replace DEV_* occurrences in arch/ (and boards/ if applicable);
+1

2) Deprecate DEV_* (just add a comment in device.h saying: DEV_* are deprecate,
use errno.h codes instead.
+1 I would argue this should step 1. This can be and should be merged in before the close of the release window this week. So get this done ASAP.

3) Remove DEV_* codes.

Since 3) might break external applications, we should apply it during a major
release I guess.
I'd wait until the start of the next release cycle to make this change. It will give a long window of opportunity to update.


[PATCH 3/3] arc_timer: assert that counter always lower than limit

Desfarges, Simon <simon.desfarges@...>
 

From: Simon Desfarges <simon.desfarges(a)intel.com>

ASSERT are put each time the timer0 limit register or the timer0 count register
is modified.

Change-Id: I38684d57803de285f4e26c68b449c71396e4c750
Tracked-On: https://jira.ndg.intel.com/browse/FIRE-4213
Signed-off-by: Simon Desfarges <simon.desfarges(a)intel.com>
---
drivers/timer/arcv2_timer0.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c
index ca25fea..db353de 100644
--- a/drivers/timer/arcv2_timer0.c
+++ b/drivers/timer/arcv2_timer0.c
@@ -60,6 +60,7 @@
#include <sys_clock.h>
#include <drivers/system_timer.h>
#include <stdbool.h>
+#include <misc/__assert.h>

/*
* A board support package's board.h header must provide definitions for the
@@ -173,6 +174,10 @@ void _timer_int_handler(void *unused)

#if defined(CONFIG_TICKLESS_IDLE)
timer0_limit_register_set(cycles_per_tick - 1);
+ __ASSERT_EVAL({},
+ uint32_t timer_count = timer0_count_register_get(),
+ timer_count <= (cycles_per_tick - 1),
+ "timer_count: %d, limit %d\n", timer_count, cycles_per_tick - 1);

_sys_idle_elapsed_ticks = 1;
#endif
@@ -233,6 +238,10 @@ void _timer_idle_enter(int32_t ticks)
if (status & _ARC_V2_TMR_CTRL_IP) {
straddled_tick_on_idle_enter = true;
}
+ __ASSERT_EVAL({},
+ uint32_t timer_count = timer0_count_register_get(),
+ timer_count <= programmed_limit,
+ "timer_count: %d, limit %d\n", timer_count, programmed_limit);
}

/*
@@ -250,6 +259,10 @@ void _timer_idle_exit(void)
if (straddled_tick_on_idle_enter) {
/* Aborting the tickless idle due to a straddled tick. */
straddled_tick_on_idle_enter = false;
+ __ASSERT_EVAL({},
+ uint32_t timer_count = timer0_count_register_get(),
+ timer_count <= programmed_limit,
+ "timer_count: %d, limit %d\n", timer_count, programmed_limit);
return;
}

@@ -269,6 +282,10 @@ void _timer_idle_exit(void)
update_accumulated_count();
_sys_clock_tick_announce();

+ __ASSERT_EVAL({},
+ uint32_t timer_count = timer0_count_register_get(),
+ timer_count <= programmed_limit,
+ "timer_count: %d, limit %d\n", timer_count, programmed_limit);
return;
}

@@ -288,6 +305,11 @@ void _timer_idle_exit(void)
*/
timer0_limit_register_set(cycles_per_tick - 1);
timer0_count_register_set(current_count % cycles_per_tick);
+
+ __ASSERT_EVAL({},
+ uint32_t timer_count = timer0_count_register_get(),
+ timer_count <= (cycles_per_tick - 1),
+ "timer_count: %d, limit %d\n", timer_count, cycles_per_tick-1);
}
#else
static void tickless_idle_init(void) {}
--
1.9.1


[PATCH 2/3] arc_timer: fix tickless idle

Desfarges, Simon <simon.desfarges@...>
 

From: Simon Desfarges <simon.desfarges(a)intel.com>

When exiting from tickless idle uppon an external IRQ, the TICK timer
is set to fire at next TICK boundary. The current algorithm can lead
to a point that timer0_count register is higher than the timer0_limit
register.

In this situation the next TICK will fire after the counter has
wrapped and performed another cycle (~133 seconds).

This condition appears when the counter reaches the limit after the
Interrupt Pending flag is checked. At this point the counter is
automatically wrapped to 0, but is set just next to the limit to fire
at next TICK boundary by SW. At exit of the _timer_idle_exit function,
the timer handler is called, and sets the limit to 1 TICK. At this
point the situation is:
- limit register == 1 TICK
- count register is just below the old limit register and higher than
1 TICK

To fix this issue, at _timer_idle_exit, the limit register is always
set to 1 TICK and the count register set such as the next TICK fires
on time.

Change-Id: Ifa002809d426aa04109592e53d2b02a224f51101
Tracked-On: https://jira.ndg.intel.com/browse/FIRE-4213
Signed-off-by: Simon Desfarges <simon.desfarges(a)intel.com>
---
drivers/timer/arcv2_timer0.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c
index 46c4612..ca25fea 100644
--- a/drivers/timer/arcv2_timer0.c
+++ b/drivers/timer/arcv2_timer0.c
@@ -276,9 +276,6 @@ void _timer_idle_exit(void)
* A non-timer interrupt occurred. Announce any
* ticks that have elapsed during the tickless idle.
*/
-
- uint32_t remaining_cycles = programmed_limit - current_count;
-
_sys_idle_elapsed_ticks = current_count / cycles_per_tick;
if (_sys_idle_elapsed_ticks > 0) {
update_accumulated_count();
@@ -289,11 +286,8 @@ void _timer_idle_exit(void)
* Ensure the timer will expire at the end of the next tick in case
* the ISR makes any tasks and/or fibers ready to run.
*/
-
- if (remaining_cycles >= cycles_per_tick) {
- timer0_count_register_set(programmed_limit -
- ((remaining_cycles - 1) % cycles_per_tick) - 1);
- }
+ timer0_limit_register_set(cycles_per_tick - 1);
+ timer0_count_register_set(current_count % cycles_per_tick);
}
#else
static void tickless_idle_init(void) {}
--
1.9.1


[PATCH 1/3] arc_timer: fix wrong programmed limit when entering idle

Desfarges, Simon <simon.desfarges@...>
 

From: Simon Desfarges <simon.desfarges(a)intel.com>

The timer counts from 0 to programmed_limit included.

Change-Id: Ifc8585210c319f5452fafc911d4f6d72c4b91eaa
Tracked-On: https://jira.ndg.intel.com/browse/FIRE-4213
Signed-off-by: Simon Desfarges <simon.desfarges(a)intel.com>
---
drivers/timer/arcv2_timer0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c
index 932ceac..46c4612 100644
--- a/drivers/timer/arcv2_timer0.c
+++ b/drivers/timer/arcv2_timer0.c
@@ -220,7 +220,7 @@ void _timer_idle_enter(int32_t ticks)
}

programmed_ticks = ticks;
- programmed_limit = (programmed_ticks * cycles_per_tick);
+ programmed_limit = (programmed_ticks * cycles_per_tick) - 1;

timer0_limit_register_set(programmed_limit);

--
1.9.1


Re: FRDM-K64 GPIO driver name

Idupsle <idupsle@...>
 

diff --git a/drivers/gpio/gpio_k64.c b/drivers/gpio/gpio_k64.c
index 2d6a355..011eb52 100644
--- a/drivers/gpio/gpio_k64.c
+++ b/drivers/gpio/gpio_k64.c
@@ -111,6 +111,9 @@ static int gpio_k64_config(struct device *dev, int
access_op,
}
}

+ /* Ensure pin is configured as GPIO */
+ setting |= K64_PINMUX_FUNC_GPIO;
+
/* write pull-up/-down and, if set, interrupt configuration
settings */

if (access_op == GPIO_ACCESS_BY_PIN) {
Hi, quite well, with your patch, I got the output! Now I'm wondering how I can
manually set the pins to FUNC_GPIO = K64_PINMUX_ALT_1 = (0x1 << 8).
If I write something like

#include <device.h>
#include <gpio.h>
#include <sys_io.h>
#include <pinmux.h>
#include <zephyr.h>

#define GPIO_1 CONFIG_PINMUX_K64_GPIO_B_NAME
void main(void)
{
struct device *gpio_dev_1;
gpio_dev_1 = device_get_binding(GPIO_1);
uint32_t set = (0x1<<8);
pinmux_pin_set(gpio_dev_1,22, set);

int set_res = 0;
int* set_res_ptr = 0;
pinmux_pin_get(gpio_dev_1, 22, set_res_ptr);
printk("Pin 22 is set to: %u \n",set_res);

while(1){}
}

Nothing happens. Debugging tells me, that the command
pinmux_pin_set(gpio_dev_1,22, set)
is not executed at all. It should call:
static int _fsl_k64_set_pin(struct device *dev, uint32_t pin_id,
uint32_t func)
but doesn't.
pinmux_pin_get() Executes as excepted.
Any clue, why?


Re: FRDM-K64 PRINT not working

Anders Dam Kofoed <adk@...>
 

Got it working using minicom and no flowcontrol...


Re: FRDM-K64 GPIO driver name

Anders Dam Kofoed <adk@...>
 

Hi Maureen and Idups

I got UART output (printf) working using minicom. Don't know what the difference between screen and minicom is but using minicom I set it to not use flowcontrol 115200 8N1 and it worked...

## GPIO
Also, GPIO interrupt is working just fine. However, as @Maureen writes above, the PCR has not setup PTB22 as default. The pins are configured in an arduino style configuration as default:
zephyr-project/arch/arm/soc/fsl_frdm_k64f/soc_config.c

So using these pins as input or output GPIO works just fine.

Thanks for your inputs.
Kind regards
Anders


Re: RFC: 5/5 Provide interfaces for Power Management Applications Policies (Revised)

Thomas, Ramesh
 

(Revised and incorporated feedbacks. The term "Tickless Idle" was found
confusing to be used to refer to a PM policy. That is a specific term
used for an optimized kernel idling mechanism saving power and is
independent of the infrastructure described in this RFC. The particular
power policy that this RFC is referring to is renamed to
DEVICE_SUSPEND_ONLY. In this policy, the PMA only suspends devices and
does not do any CPU or SOC PM operations and lets kernel do its normal
idle processing)

Problem Statement:
Add OS infrastructure to enable application-based power management
policies, which is architecture independent, supports microkernel and
nanokernel and the interface clearly identifies the policy based action
taken.

Why is this a problem:
-----------------------------
Currently the kernel has hooks for a power management application to be
notified of a suspend (_sys_soc_suspend) and resume (_sys_soc_resume)
operation that only operate within the microkernel and only on X86
architectures.

This creates an inconsistent interface for all architectures to expand
and easily implement a power management application across multiple
architectures. This also creates a requirement for using the
microkernel only, while some of our supported platforms work with only a
nanokernel (i.e. Quark D2000).

During Deep Sleep, devices lose power and state with no consistent
methods to allow a PMA to enforce devices to save and restore states.
This stops core functions of the Application that depend on devices
being powered on, configured, and ready to operate.

What should be done:
-----------------------------
The Zephyr kernel is not looking to implement power management policies.
Instead, the kernel shall provide interfaces for a system integrator to
utilize and create their own Power Management Application (PMA) that can
enforce any policies needed.

This will be accomplished by providing an OS power-management
infrastructure that has an architecture independent interface. The
Zephyr kernel will provide notification methods in both the Microkernel
and Nanokernel for the PMA when the OS is about to enter and exit system
idle. Currently the Zephyr kernel has support for this notification
only on X86 through the _sys_soc_suspend() and _sys_soc_resume()
functions. Expanding the scope of these functions to include the ARM
and ARC architectures, support both the Nanokernel and Microkernel, and
provide a more detailed return codes would be the first steps. The
kernel will continue to provide the determination on how much time to
spend idle (number of ticks), passing this information along to the PMA.

When kernel is about to go idle, the kernel itself will disable
interrupts. The kernel will then call the _sys_soc_suspend() function,
notifying the PMA of the operation. Included in the notification are
the maximum number of ticks that the system can be set idle for. The
PMA will then determine what policies can be executed within the
allotted time frame.

Currently the kernel expects the _sys_soc_suspend() to return one of
the following values:
- PM_NOT_HANDLED - The PMA did not put the CPU to LPS or the SOC to
Deep Sleep.

- PM_HANDLED - The PMA was able to put the CPU to LPS or the SOC to Deep
Sleep.

The proposal is to replace _sys_soc_suspend() return values to provide a
clear action based indicator of the policies the PMA implements:
- PM_SOC_LPS - Indicating that the PMA was successful at pushing the CPU
into a low power state.

- PM_SOC_DS - Indicating that the PMA was successful at pushing the SOC
into the Deep Sleep state

- PM_SOC_DEVICE_SUSPEND_ONLY - Indicating that the PMA has accomplished
any device suspend operations. This does not include any CPU or SOC
power operations.

- PM_SOC_NOT_HANDLED - Indicating the PMA was not able to accomplish any
action in the time allotted by the kernel.

As policy decisions are the realm of the PMA, the kernel will now
provide a method for the PMA to get the current list of devices enabled
for the application. This will allow the PMA to walk the device list
and determine any policy decisions based upon the available tick count,
call the device’s suspend() routine, and deal with any possible failures
in the process.

All of these operations have any expressed latency requirement of NONE.

Writing a PMA:
---------------------
Writing a Power Management Application to enforce policies will
implement the API described below.

Upon startup, the PMA will already be registered as the handler for
_sys_soc_suspend() and _sys_soc_resume() through compile time linking.
The first act of the PMA will be to retrieve the known list of devices
through the device_list_get() function. Because the PMA is part of the
application, it is expected to start after all system devices have been
initialized. Thus the list of devices is not expected to change once
the application has begun.

The device_list_get() function will return the start and end pointers to
the current enabled devices. It is up to the PMA to walk this list and
how to determine the best mechanism to store/process this list. It is
up to the system integrator to verify the amount of time each device
requires for a power cycle, and ensure this time fits within the
allotted time provided by the kernel. This time value is highly
dependent upon each specific device used in the final platform and SOC.

When entering the PMA through the _sys_soc_suspend() function, the PMA
can select between multiple scenarios.

Case 1:
*The time allotted is too short for any power management.*

In this case, the PMA will leave interrupts disabled, and return the
code
PM_SOC_NOT_HANDLED. This will allow the Zephyr kernel to continue on
the idle loop selected at compile time.

Case 2:
*The time allotted is enough for some devices to be suspended.*

a) If everything suspends correctly, the PMA will:
1) Scan through the devices that meet the criteria
2) Call each device’s suspend() function
3) If the time allotted is enough to put the CPU into a LPS the PMA
will:
i) Push the CPU to the LPS re-enabling interrupts at the same
time.
ii) Return PM_SOC_LPS

4) If the time allotted is not enough for CPU or SOC operations, the
PMA
will:
i) Return PM_SOC_DEVICE_SUSPEND_ONLY

b) If a device fails to suspend, the PMA will:
1) If the device is not essential to the suspend process, as
determined by
the system integrator, the PMA can choose to ignore the failure
2) If the device is essential to the suspend process, as determined
by the
system integrator, the PMA shall return PM_SOC_NOT_HANDLED.

Case 3:
*The time allotted is enough for all devices to be suspended.*

a) If everything suspends correctly, the PMA will:
1) Call each device’s suspend() function
2) If the time allotted is enough to put the CPU into a LPS the PMA
will:
i) Push the CPU to the LPS re-enabling interrupts at the same
time.
ii) Return PM_SOC_LPS
3) If the time allotted is enough to put the SOC into Deep Sleep, the
PMA
will:
i) Push the SOC to Deep Sleep
ii) Return PM_SOC_DS
iii) Re-enable interrupts
4) If the time allotted is not enough for CPU or SOC operations, the
PMA
will:
i) Return PM_SOC_DEVICE_SUSPEND_ONLY

b) If a device fails to suspend, the PMA will:
1) If the device is not essential to the suspend process, as
determined by
the system integrator, the PMA can choose to ignore the failure
2) If the device is essential to the suspend process, as determined
by the
system integrator, the PMA shall return PM_SOC_NOT_HANDLED.



PMA: Power Manager Application
ISR: Interrupt Service Routine
DSO: Device Suspend Only

Proposed PMA DSO Entry:
+---------+ +-----+ +---------+ +-----+
| Events | | ISR | | Kernel | | PMA |
+---------+ +-----+ +---------+ +-----+
| | | ----------\ |
| | |-| Compute | |
| | | | idle | |
| | | | ticks | |
| | | |---------| |
| | | -----------\ |
| | |-| Schedule | |
| | | | next | |
| | | | event | |
| | | |----------| |
| | | |
| | | _sys_soc_suspend(ticks) |
| | |--------------------------->|
| | | -----------\ |
| | | | Select |-|
| | | | policy | |
| | | | based on | |
| | | | ticks | |
| | | |----------| |
| | | -----------\ |
| | | | Execute |-|
| | | | DSO | |
| | | | policy | |
| | | |----------| |
| | | |
| | | PM_SOC_DEVICE_SUSPEND_ONLY |
| | |<---------------------------|
| | | |
| | | CPU |
| | | idle wait |
| | |---------- |
| | | | |
| | |<--------- |
| | | |


Proposed PMA DSO Exit:
+---------+ +-----+ +---------+ +-----+
| Events | | ISR | | Kernel | | PMA |
+---------+ +-----+ +---------+ +-----+
| | | |
| intr | | |
|-------->| | |
| | | |
| | process interrupt | |
| |----------------------->| |
| | | |
| | | _sys_soc_resume() |
| | |--------------------->|
| | | -----------\ |
| | | | Execute |-|
| | | | DSO | |
| | | | exit | |
| | | | policy | |
| | | |----------| |
| | | |
| | | return to kernel |
| | |<---------------------|
| | | |
| | return to ISR | |
| |<-----------------------| |
| | -------------\ | |
| |-| re-compute | | |
| | | Tickless | | |
| | | timeouts | | |
| | |------------| | |
| | -----------\ | |
| |-| schedule | | |
| | | next | | |
| | | task | | |
| | |----------| | |
| | | |


Re: RFC: 2/5 System Device Driver Modifications (Revised)

Thomas, Ramesh
 

[Revised incorporating feedbacks. The changes are shown at the end]

Problem Statement:
Not all Zephyr kernel drivers provide the same interfaces.

Why this is a problem:
-----------------------------
The Zephyr kernel currently has devices that are essential for core OS
functions (such as APICs and timers), but provide no public API means
for accessing them. Without any consistent method to access device
drivers on the platform, it becomes very difficult to achieve power
targets.

What should be done:
-----------------------------
1) Each native Zephyr kernel driver and shim driver (such as QMSI) shall
support:

a) uint32_t suspend() - routine that will move any required device state
data
to RAM* with the following valid return values:
- DEV_OK
- DEV_BUSY
- DEV_FAIL

b) uint32_t resume() - routine that will retrieve any device state data
from
RAM* with the following valid return values:

- DEV_OK
- DEV_FAIL

2) Provide a name recognized by the device_get_binding() function, this
includes what are currently thought to be drivers such as timers,
IOAPIC, and LOAPIC.

*The power management process is not expected to power down system RAM
(it will most likely stay in selective suspend).

The size of the device data is dependent upon an individual device, and
therefore the system integrator must be wary of the number of devices
being utilized.

Device suspend flow:
Device Drivers at suspend shall:
- Device state shall be saved to memory and maintained across a PM event
- Turning off the device clock
- Return appropriate error code

Device resume flow:
Device Drivers at resume shall:
- Restore to state saved in memory
- Turn on the device clock
- Return appropriate error code

Device domain experts will be needed to implement the proper methods for
suspending and resuming each device.

----New additions-------
Following 2 macros would be added to allow device drivers to implement
the .suspend() and .resume() hooks described in #1 above.

A device ops structure holds the .suspend() and .resume() which is
included inside each device's device structure:

struct device_ops example_dev_ops = {
.suspend = example_suspend,
.resume = example_resume
};

Two new macros would be created that drivers use instead of DEVICE_INIT
and SYS_INIT if they implement the .suspend and .resume functions. For
devices using non-PM macros, a default dev_ops will be assigned that
does nothing (so app need not check if dev_ops != NULL).

a) DEVICE_INIT_PM(dev_name, drv_name, init_fn, &example_dev_ops, data,
cfg_info, level, prio);

b) SYS_INIT_PM(name, init_fn, &example_dev_ops, level, prio);

SYS_INIT_PM also added the "name" argument so PMA can call
the .suspend/.resume for devices like APICs that need to do
suspend/resume operations. The methods that retrieve the pointer to the
device structure of any device requires the device to be assigned a name
unlike the SYS_INIT macro which assigns a "" as the name for devices.

All this will be inside DEVICE_POWER_MANAGEMENT Kconfig flag.


Re: RFC: 1/5 Consistent naming of PM Kconfig flags (Revised)

Thomas, Ramesh
 

[Revised incorporating feedbacks so far]

Problem Statement:
Power management Kconfig flags are not consistent and hierarchy is not
clear

Why this is a problem:
-----------------------------
The names include terms like “ADVANCED” which are not meaningful to
current implementation. Names do not specifically identify features that
are enabled by the flag. There are redundancies and overlaps in flags
and the hierarchy is not clear.

What should be done:
------------------------------
Change as follows :

ADVANCED_POWER_MANAGEMENT -> SYS_POWER_MANAGEMENT (turn on the basics
of power management)

ADVANCED_IDLE -> SYS_POWER_LPS (enables the kernel
for Low power state)
-> SYS_POWER_DEEP_SLEEP (enables the kernel for
Deep Sleep)

New addition -> DEVICE_POWER_MANAGEMENT (enables device power
management infrastructure)

ADVANCED_IDLE_SUPPORTED -> SYS_POWER_LPS_SUPPORTED (enables
SYS_POWER_LPS option)
-> SYS_POWER_DEEP_SLEEP_SUPPORTED (enables
SYS_POWER_DEEP_SLEEP option)

The new flags with the dependency hierarchy will be as follows:

SYS_POWER_MANAGEMENT
|
|___SYS_POWER_LPS
|
|___SYS_POWER_DEEP_SLEEP
|
|___DEVICE_POWER_MANAGEMENT


STM32/STM32F1 patchset v13

Maciek Borzecki <maciek.borzecki@...>
 

Hi,

I have posted version 13 of the patchset. As usual the series is
avaialable in my github repo https://github.com/bboozzoo/zephyr/ in
branch bboozzoo/stm32f10x-for-upstream-v13.

Changelog
=========

- addressed cosmetic comments

- updated pinmux driver to use struct pin_config instead of a custom
wrapper

- added support for HSE (high speed external oscillator) as clock
input for PLL or directly for SYSCLK, this allows for using much
higher SYSCLK values, up to 72MHz

- added register mapping for embedded flash controller; this change is
required by HSE and higher SYSCLK support, as flash access latency
needs to be configured for higher values of system clock

- svc_handler unaligned access fix; I would like to ask ARM experts to
look at this change, by no means I consider myself such expert. The
problem was identified when running latency benchmarks. The
benchmarks enable IRQ offloading, what enables previously unused
code paths in svc_handler. When the code attempts to access svc
parameter (which is not 4 byte aligned), unaligned access exception
occurs.


New Changes:
https://gerrit.zephyrproject.org/r/966 soc/stm32f1: add embedded
flash registers mapping
https://gerrit.zephyrproject.org/r/967 clock_control/stm32f1: HSE
support and PLL configuration cleanup
https://gerrit.zephyrproject.org/r/968 arm: access svc instruction
using halfword load in svc_handler


Updated Changes:
https://gerrit.zephyrproject.org/r/649 pinmux/stm32: add common
driver for STM32 pinmux
https://gerrit.zephyrproject.org/r/650 serial/stm32: add driver for
STM32 UART
https://gerrit.zephyrproject.org/r/651 gpio/stm32: add common driver
for STM32 GPIO
https://gerrit.zephyrproject.org/r/652 boards/stm32_mini_a15: add
new board
https://gerrit.zephyrproject.org/r/653 samples/drivers/disco: add
'disco' sample program
https://gerrit.zephyrproject.org/r/713 soc/stm32f1/gpio: implement
GPIO support
https://gerrit.zephyrproject.org/r/714 soc/stm32f1/pinmux: implement
STM32 pinmux integration
https://gerrit.zephyrproject.org/r/715 boards/nucleo_f103rb: add new
board
https://gerrit.zephyrproject.org/r/915 soc/stm32f1: add IRQ numbers
listing
https://gerrit.zephyrproject.org/r/916 serial/stm32: add support for
IRQ APIs
https://gerrit.zephyrproject.org/r/917
interupt_controller/stm32_exti: driver for STM32 EXTI controller
https://gerrit.zephyrproject.org/r/918 gpio/stm32: GPIO input with
interrupts
https://gerrit.zephyrproject.org/r/919 soc/stm32f1: AFIO registers
mapping
https://gerrit.zephyrproject.org/r/920 soc/stm32f1/gpio: implement
MCU specific GPIO input interrupt integration
https://gerrit.zephyrproject.org/r/921 watchdog/iwdg_stm32: add
driver for STM32 Independent Watchdog (IWDG)
https://gerrit.zephyrproject.org/r/922 samples/button: button input
example

Cheers,
--
Maciek Borzecki

7421 - 7440 of 7817