Date   

RFC: documenting licensing of imported components

Perez-Gonzalez, Inaky <inaky.perez-gonzalez@...>
 

Hello All

Please consider https://gerrit.zephyrproject.org/r/5355; it has been brought to our attention that the way we distribute kbuild and kconfig makes it look like it is Apache license, where it is actually original from the Linux kernel and thus covered by the GPL2.

This problem affects many other things we import/reuse into Zephyr, not making it necessarily a derivative work. This commit proposes a solution to it.

Thanks,


RFC Release Notes in Zephyr Kernel Tree

Perez Hernandez, Javier B <javier.b.perez.hernandez@...>
 

Hi!

I have a proposal to add the release notes 'release-notes.rst' in the
zephyr tree.
This document will have all the relevant changes to the kernel between
each version.

Please review proposal:
https://gerrit.zephyrproject.org/r/#/c/5351/

Commit:
https://gerrit.zephyrproject.org/r/#/c/5029/


Thanks!

Javier B. Perez


Daily JIRA Digest

donotreply@...
 

NEW JIRA items within last 24 hours: 2
[ZEP-1039] ARM Cortex-Mx context-switch optimizations
https://jira.zephyrproject.org/browse/ZEP-1039

[ZEP-1040] pwm_dw driver does not compile
https://jira.zephyrproject.org/browse/ZEP-1040


UPDATED JIRA items within last 24 hours: 2
[ZEP-817] Neighbor Discovery Optimization for IPv6 over 6LowPAN
https://jira.zephyrproject.org/browse/ZEP-817

[ZEP-1026] net/yaip/nbuf: net_nbuf_read does not handle the offset parameter correctly
https://jira.zephyrproject.org/browse/ZEP-1026


CLOSED JIRA items within last 24 hours: 2
[ZEP-972] (Fixed) Simplify the handling of power hooks and the API documentation
https://jira.zephyrproject.org/browse/ZEP-972

[ZEP-560] (Won't Do) full JIRA links in Gerrit comments get mangled
https://jira.zephyrproject.org/browse/ZEP-560


RESOLVED JIRA items within last 24 hours: 2
[ZEP-910] (Fixed) Adapt tickless idle for x86
https://jira.zephyrproject.org/browse/ZEP-910

[ZEP-909] (Fixed) Adapt tickless idle + power management for ARM
https://jira.zephyrproject.org/browse/ZEP-909


Daily Gerrit Digest

donotreply@...
 

NEW within last 24 hours:
- https://gerrit.zephyrproject.org/r/5267 : serial: Add driver for CMSDK APB UART
- https://gerrit.zephyrproject.org/r/5338 : mailmap: update with new emails
- https://gerrit.zephyrproject.org/r/5336 : Bluetooth: Add well known keys to storage API for legacy pairing
- https://gerrit.zephyrproject.org/r/5337 : tests: sensors: expand coverage with logging enabled
- https://gerrit.zephyrproject.org/r/5329 : Bluetooth: samples: Rename btusb to hci-usb
- https://gerrit.zephyrproject.org/r/5331 : Bluetooth: Track role change for BR/EDR connections
- https://gerrit.zephyrproject.org/r/5285 : unified/test: Fix issues affecting static idt application
- https://gerrit.zephyrproject.org/r/5330 : Bluetooth: L2CAP: Allow receiving fragmented buffers
- https://gerrit.zephyrproject.org/r/5284 : unified/test: Fix issues affecting stack canary applications
- https://gerrit.zephyrproject.org/r/5283 : unified/test: Fix issues affecting test_critical application
- https://gerrit.zephyrproject.org/r/5282 : unified/test: Fix issues affecting task test applications
- https://gerrit.zephyrproject.org/r/5290 : unified: Add alignment parameter to K_MSGQ_DEFINE()
- https://gerrit.zephyrproject.org/r/5332 : Bluetooth: SMP: Check for connection role before BR/EDR pairing
- https://gerrit.zephyrproject.org/r/5320 : iot/dns: Add support for the DNS Client API
- https://gerrit.zephyrproject.org/r/5323 : Bluetooth: A2DP: Set security level
- https://gerrit.zephyrproject.org/r/5292 : DRAFT net: yaip: Move net_buf data pool allocation to network iface
- https://gerrit.zephyrproject.org/r/5321 : iot/dns: Add DNS client sample app
- https://gerrit.zephyrproject.org/r/5319 : iot/dns: Remove legacy DNS client sample code
- https://gerrit.zephyrproject.org/r/5295 : iot/zoap: Add unit tests for block-wise transfers
- https://gerrit.zephyrproject.org/r/5255 : soc_beetle: Add support for ARM LTD Beetle SoC
- https://gerrit.zephyrproject.org/r/5294 : iot/zoap: Add support for block sized transfers
- https://gerrit.zephyrproject.org/r/5257 : samples: Add simple bringup application
- https://gerrit.zephyrproject.org/r/5259 : board_beetle: Enable gpio support on ARM LTD V2M Beetle
- https://gerrit.zephyrproject.org/r/5258 : gpio: Add ARM LTD CMSDK AHB GPIO driver
- https://gerrit.zephyrproject.org/r/5262 : pinmux: Add support for "runtime" pinmux on ARM LTD V2M Beetle
- https://gerrit.zephyrproject.org/r/5261 : pinmux: Add support for ARM LTD V2M Beetle Initialization
- https://gerrit.zephyrproject.org/r/5254 : MAINTAINERS: Add maintainer for ARM LTD V2M Beetle Board
- https://gerrit.zephyrproject.org/r/5260 : soc_beetle: Add clock_init support and soc registers definitions to Beetle
- https://gerrit.zephyrproject.org/r/5264 : samples: Add simple blinky application
- https://gerrit.zephyrproject.org/r/5265 : soc_beetle: Add system wide Pin definitions
- https://gerrit.zephyrproject.org/r/5256 : board_beetle: Add support for ARM LTD V2M Beetle Board
- https://gerrit.zephyrproject.org/r/5266 : soc_beetle: Add configuration for ARM LTD CMSDK APB UART
- https://gerrit.zephyrproject.org/r/5263 : board_beetle: Enable pinmux support on ARM LTD V2M Beetle
- https://gerrit.zephyrproject.org/r/5289 : unified: Remove unused K_MSGQ_SIZE() macro
- https://gerrit.zephyrproject.org/r/5269 : sanitycheck: Add support for ARM LTD V2M Beetle Board
- https://gerrit.zephyrproject.org/r/5286 : unified/test: Fix issues affecting XIP test applications
- https://gerrit.zephyrproject.org/r/5271 : unified/doc: Minor updates to event section of Kernel Primer
- https://gerrit.zephyrproject.org/r/5287 : unified/test: Fix issues affecting LIFO object test application
- https://gerrit.zephyrproject.org/r/5279 : unified: Enable legacy isr_task_id_get() & isr_task_priority_get()
- https://gerrit.zephyrproject.org/r/5288 : unified: Replace k_msgq_num_used_get() API
- https://gerrit.zephyrproject.org/r/5272 : unified/doc: Minor updates to thread sections in Kernel Primer
- https://gerrit.zephyrproject.org/r/5270 : unified/doc: Minor updates to message queues in Kernel Primer
- https://gerrit.zephyrproject.org/r/5280 : unified: Extend unified kernel sanity test coverage
- https://gerrit.zephyrproject.org/r/5268 : board_beetle: Enable CMSDK APB UART driver
- https://gerrit.zephyrproject.org/r/5273 : unified/doc: Update memory pools section of Kernel Primer
- https://gerrit.zephyrproject.org/r/5281 : unified: Add legacy DEFINE_TASK support
- https://gerrit.zephyrproject.org/r/5278 : unified: Remove unimplemented kernel workload APIs
- https://gerrit.zephyrproject.org/r/5277 : unified: Enable k_thread_suspend() and k_thread_resume() [DON'T MERGE]
- https://gerrit.zephyrproject.org/r/5291 : unified: Rename msgQ macro parameter names

UPDATED within last 24 hours:
- https://gerrit.zephyrproject.org/r/4555 : Bluetooth: HFP HF: SLC connection-Send/Parse BRSF
- https://gerrit.zephyrproject.org/r/4562 : Bluetooth: Sample: handsfree sample application
- https://gerrit.zephyrproject.org/r/5209 : sensors: use one single sys log config for sensors
- https://gerrit.zephyrproject.org/r/5109 : gpio: reduce Kconfigs and use consistent name for GPIOs
- https://gerrit.zephyrproject.org/r/5105 : quark_se_c1000: add debug support to openocd config
- https://gerrit.zephyrproject.org/r/5183 : Bluetooth: tester: Rework discovery procedure
- https://gerrit.zephyrproject.org/r/4649 : net: tests: Add TCP unit tests
- https://gerrit.zephyrproject.org/r/5231 : arch/arm: add initial support for Cortex-M0/M0+
- https://gerrit.zephyrproject.org/r/5190 : Bluetooth: IPSS: Remove ipss_listen
- https://gerrit.zephyrproject.org/r/4648 : net: yaip: Initial TCP commit
- https://gerrit.zephyrproject.org/r/4963 : samples: pwm: use new APIs and add more apps
- https://gerrit.zephyrproject.org/r/5077 : net: yaip: Fix net_nbuf_read corner cases
- https://gerrit.zephyrproject.org/r/4920 : lib: Add HTTP support for Zephyr
- https://gerrit.zephyrproject.org/r/5097 : iot/zoap: Add support for error 4.15
- https://gerrit.zephyrproject.org/r/5096 : zoap: Fix alignment of multiline function arguments
- https://gerrit.zephyrproject.org/r/4917 : iot/zoap: Port to the new network stack
- https://gerrit.zephyrproject.org/r/5194 : stm32l4: add initial soc support for stm32l4
- https://gerrit.zephyrproject.org/r/4796 : Bluetooth: L2CAP: Handle security procedure non successful path
- https://gerrit.zephyrproject.org/r/4795 : Bluetooth: L2CAP: Refactor handling connection response
- https://gerrit.zephyrproject.org/r/5228 : arp: Fix an issue with compiler optimization on Quark SE x86 core
- https://gerrit.zephyrproject.org/r/5171 : samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app.
- https://gerrit.zephyrproject.org/r/4933 : pwm: qmsi_shim: implement pwm driver required by new APIs
- https://gerrit.zephyrproject.org/r/4858 : drivers: pwm: re-design pwm API interfaces
- https://gerrit.zephyrproject.org/r/5175 : net:yaip: Solve style issues
- https://gerrit.zephyrproject.org/r/5137 : TEST: add changes to two different branches
- https://gerrit.zephyrproject.org/r/3114 : test: break doc
- https://gerrit.zephyrproject.org/r/4457 : DONT MERGE
- https://gerrit.zephyrproject.org/r/4541 : DONT MERGE
- https://gerrit.zephyrproject.org/r/5212 : net: yaip: Small simplififcation to net_nbuf_write
- https://gerrit.zephyrproject.org/r/27 : ci: test: checkpatch: warning space
- https://gerrit.zephyrproject.org/r/4883 : sanity: enable sanity multiple configuration
- https://gerrit.zephyrproject.org/r/5104 : unified: cache the next thread to run
- https://gerrit.zephyrproject.org/r/5103 : unified: use sys_dlist_peek_head_not_empty()
- https://gerrit.zephyrproject.org/r/5086 : build: Handle ALL_LIBS dependencies correctly
- https://gerrit.zephyrproject.org/r/5118 : eth: Add KSDK ENET driver.

MERGED within last 24 hours:
- https://gerrit.zephyrproject.org/r/5327 : tests: expand sensor build testing by enabling more sensors
- https://gerrit.zephyrproject.org/r/5312 : spi/k64: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5322 : samples: remove useless filters in testcase.ini
- https://gerrit.zephyrproject.org/r/5293 : sensors: cleanup duplicate includes
- https://gerrit.zephyrproject.org/r/5315 : adc/dw: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5335 : Bluetooth: tests: Add init config for BR/EDR SMP testing
- https://gerrit.zephyrproject.org/r/5310 : gpio/k64: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5313 : spi/k64: Make the driver configuration structure static.
- https://gerrit.zephyrproject.org/r/5318 : adc/ti: Make driver config structure static.
- https://gerrit.zephyrproject.org/r/5308 : grove/lcd_rgb: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5307 : serial/uart_k20: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5317 : adc/ti: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5309 : i2c/kdk: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5316 : adc/dw: Make driver config structure static.
- https://gerrit.zephyrproject.org/r/5311 : docs: Adjust driver documentation to show const config_info example.
- https://gerrit.zephyrproject.org/r/5314 : ipm: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5328 : Bluetooth: samples/btusb: Rename main c-file
- https://gerrit.zephyrproject.org/r/5297 : gpio/sch: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5300 : shared_irq: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5301 : gpio/stm32: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5298 : serial/uart_altera_jtag: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5296 : spi/dw: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5253 : kernel: boot banner requires early console, so select it
- https://gerrit.zephyrproject.org/r/5334 : Bluetooth: SMP: Fix build without signing support
- https://gerrit.zephyrproject.org/r/5333 : Bluetooth: SMP: Fix build without central role support
- https://gerrit.zephyrproject.org/r/5302 : serial/uart_stm32: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5299 : serial/uart_atmel_sam3: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5306 : gpio/qmsi: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5303 : serial/uart_stellaris: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5305 : serial/uart_nrf5: Make config_info pointers const.
- https://gerrit.zephyrproject.org/r/5304 : serial/uart_nrf5: Remove duplicate sys_clk_freq initialization.
- https://gerrit.zephyrproject.org/r/5325 : sensor: Fix Kconfig LSM9DS0_MFD I2C slave address type
- https://gerrit.zephyrproject.org/r/5326 : tests: Provide build test for sensor lsm9ds0_mfd
- https://gerrit.zephyrproject.org/r/5324 : net: yaip: Differentiate IPv6 event command and final event
- https://gerrit.zephyrproject.org/r/5275 : tests/net/nbuf: Fix wrong size to linearize() call
- https://gerrit.zephyrproject.org/r/5274 : tests/net: Exclude tests needing more RAM than available
- https://gerrit.zephyrproject.org/r/5276 : tests/net/nbuf: Fix invalid memory access
- https://gerrit.zephyrproject.org/r/5107 : samples: button: modify sample to work on more boards
- https://gerrit.zephyrproject.org/r/5208 : arm: remove exc_wrapper.S
- https://gerrit.zephyrproject.org/r/5211 : drivers: gpio: i2c: make logging depend on SYS_LOG
- https://gerrit.zephyrproject.org/r/5106 : boards: define user buttons and switches on boards
- https://gerrit.zephyrproject.org/r/5189 : Bluetooth: L2CAP: Allow sending fragmented buffers
- https://gerrit.zephyrproject.org/r/5188 : Bluetooth: L2CAP: Fix sending buffer with not enough space
- https://gerrit.zephyrproject.org/r/5238 : net: yaip: Add support for 6CO
- https://gerrit.zephyrproject.org/r/5239 : net: tests: Add sample 6CO context data to IPv6 RA test
- https://gerrit.zephyrproject.org/r/5240 : net: yaip: Add more inline helper functions in 6lowpan
- https://gerrit.zephyrproject.org/r/5241 : net: yaip: Add support for 6lo context based compression
- https://gerrit.zephyrproject.org/r/5242 : net: tests: Add 6lo context based unit tests
- https://gerrit.zephyrproject.org/r/5250 : net: yaip: Fix ND RA length
- https://gerrit.zephyrproject.org/r/5243 : net: yaip: Remove assert and return false in net_nbuf_write
- https://gerrit.zephyrproject.org/r/5251 : net: yaip: Re-order fields in net_nbuf struct
- https://gerrit.zephyrproject.org/r/5252 : net: yaip: Refactor nbuf data fragment detection
- https://gerrit.zephyrproject.org/r/5230 : arduino 101: Exposes spi 1 in pinmux
- https://gerrit.zephyrproject.org/r/5213 : gpio/nrf5: set and clear just the specific gpio pin


Re: Device driver configuration and driver_data distinction.

Tomasz Bursztyka
 

Hi Dan,


On Thu, Oct 6, 2016 at 4:06 AM, Tomasz Bursztyka
<tomasz.bursztyka(a)linux.intel.com
<mailto:tomasz.bursztyka(a)linux.intel.com>> wrote:

Hi Marcus,

I believe we did not make it const at the beginning due to PCI
enumeration on Galileo.
This was early days, and things changed then.


Pretty much this was the reason.

Actually there have been plans to move it to const, at least I
remember hearing such idea
from Daniel Kalowsky, for the same exact reasons you noted, it
might even be in the git history,
somewhere. But we were too busy to follow up at that time.


I believe we even did a move that changed it to const and then ran
into an issue with a specific compiler we were to support and reverted
out the change. Might have only been in a local topic branch though.
Thanks for the precision!
(Let's hope early stage of iamcu support was the culprit)

Tomasz


Re: CI infrastructure issues for FD.io and Zephyr Project

Andrew Grimberg <agrimberg@...>
 

These issues have now been taken care of.

-Andy-

On 10/06/2016 12:27 PM, Andrew Grimberg wrote:
Greetings folks,

As many of you may already be aware, we've been experiencing some issues
with the CI environments for both FD.io and Zephyr Project over the
course of the last couple of days.

The problems have been caused by a couple of different issues and our
cloud provider has appears to have resolved all but one of them at this
point.

The issue currently facing both environments is that the default gateway
v-router does not appear to be actually passing traffic the way it's
supposed to be. Because of this Jenkins is unable to presently
communicate with the cloud API for bringing new instances online. It
also means that it can't actually get to Gerrit. As such, presently
Jenkins is not seeing new changes come in.

We do not presently have an ETA on the resolution to this particular
issue. Once the routing issue is cleared the environments should start
operating again.

-Andy-
--
Andrew J Grimberg
Systems Administrator
Release Engineering Team Lead
The Linux Foundation


Re: Device driver configuration and driver_data distinction.

Marcus Shawcroft <marcus.shawcroft@...>
 

On 6 October 2016 at 19:41, Dan Kalowsky <dank(a)deadmime.org> wrote:


On Thu, Oct 6, 2016 at 4:06 AM, Tomasz Bursztyka
<tomasz.bursztyka(a)linux.intel.com> wrote:

Hi Marcus,

I believe we did not make it const at the beginning due to PCI enumeration
on Galileo.
This was early days, and things changed then.

Pretty much this was the reason.


Actually there have been plans to move it to const, at least I remember
hearing such idea
from Daniel Kalowsky, for the same exact reasons you noted, it might even
be in the git history,
somewhere. But we were too busy to follow up at that time.

I believe we even did a move that changed it to const and then ran into an
issue with a specific compiler we were to support and reverted out the
change. Might have only been in a local topic branch though.
PCI enumeration currently updates the pci_dev object in the various
config structures along with base_addr and irq_num, I propose to move
these objects from the config struct to the runtime struct.

Cheers
/Marcus


--
"Do you expect me to talk?"
"No Mr. Bond, I expect you to die."


CI infrastructure issues for FD.io and Zephyr Project

Andrew Grimberg <agrimberg@...>
 

Greetings folks,

As many of you may already be aware, we've been experiencing some issues
with the CI environments for both FD.io and Zephyr Project over the
course of the last couple of days.

The problems have been caused by a couple of different issues and our
cloud provider has appears to have resolved all but one of them at this
point.

The issue currently facing both environments is that the default gateway
v-router does not appear to be actually passing traffic the way it's
supposed to be. Because of this Jenkins is unable to presently
communicate with the cloud API for bringing new instances online. It
also means that it can't actually get to Gerrit. As such, presently
Jenkins is not seeing new changes come in.

We do not presently have an ETA on the resolution to this particular
issue. Once the routing issue is cleared the environments should start
operating again.

-Andy-

--
Andrew J Grimberg
Systems Administrator
Release Engineering Team Lead
The Linux Foundation


Re: Device driver configuration and driver_data distinction.

Dan Kalowsky
 

On Thu, Oct 6, 2016 at 4:06 AM, Tomasz Bursztyka <
tomasz.bursztyka(a)linux.intel.com> wrote:

Hi Marcus,

I believe we did not make it const at the beginning due to PCI enumeration
on Galileo.
This was early days, and things changed then.
Pretty much this was the reason.


Actually there have been plans to move it to const, at least I remember
hearing such idea
from Daniel Kalowsky, for the same exact reasons you noted, it might even
be in the git history,
somewhere. But we were too busy to follow up at that time.
I believe we even did a move that changed it to const and then ran into an
issue with a specific compiler we were to support and reverted out the
change. Might have only been in a local topic branch though.

--
"Do you expect me to talk?"
"No Mr. Bond, I expect you to die."


Re: RFC: Energy Management Support in Zephyr

Kamat, Sachin <sachin.kamat@...>
 

Hi Souvik,


Hello everybody,

I have been looking into the aspects of Charging & Battery Management in Zephyr
(aka Energy Management) via ZEP-1037.
<snip>

+/**
+ * @brief Query if Battery is present
+ *
+ * Called by the application & implemented by the platform drivers
+ *
+ * @param N/A
+ *
+ * @return true if battery is present and false otherwise */ bool
+em_batt_present(void);
+
Probably you could also have an API to check if charging is supported.


<snip>

+/**
+ * @brief Set the battery sampling interval
+ *
+ * Called by the application & implemented by the platform drivers

IMHO, even this parameter (like the charge and temp threshold) should be configured at board/device level and not left for user space applications to decide.


+ *
+ * @param interval Interval of sampling in ms
+ * @param type Type of Sample (Temperature/Charge)
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_batt_sampling_interval_set(int16_t interval,
+ enum em_sample_type type);
+
+/**
+ * @brief Get the battery sampling interval
+ *
+ * Called by the application & implemented by the platform drivers
+ *
+ * @param interval Pointer to interval of sampling in ms
+ * @param type Type of Sample (Temperature/Charge)
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_batt_sampling_interval_get(int16_t *interval,
+ enum em_sample_type type);
+
+/**
+ * @brief Get the number of configurable battery charge thresholds
+ *
+ * Get the number of battery charge thresholds that can be configured.
+ * When the battery charge level falls below each of these thresholds,
+ * an interrupt or callback is generated to the user to take actions.
+ * Max levels are 3 (Warning, Critical & Shutdown)

How is the number going to be different as you have already defined 3 levels in the structure?


+ * Called by the application & implemented by the platform drivers.
+ *
+ * @param num Pointer indicating no. of thresholds that can be
+configured
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_batt_num_charge_thresholds_get(int8_t *num);
+
+/**
<snip>

+/**
+ * @brief Disable Battery Charging
+ *
+ * Called by the application & implemented by the platform drivers.
+ *
+ * @param N/A
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_charging_disable(void);
+
+/**
+ * @brief Enable Battery Charging
+ *
+ * Called by the application & implemented by the platform drivers.
+ *
+ * @param N/A
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_charging_enable(void);
What is the use case for the applications to call disabling/enabling of battery charging?

+
+/**
+ * @brief Get the Charging Status
+ *
+ * Gives the following information:
+ * 1) Charger is connected or disconnected
+ * 2) Charger Type: Wall/USB/Wireless
+ * 3) Charging Status: Charging/Discharging/Maintenance Charging
What is maintenance charging?
Charging/discharging state could be inferred from charger status or vice versa and hence one of these 2 parameters could be avoided.


+ * Called by the application & implemented by the platform drivers.
+ *
+ * @param status pointer to struct containing the status
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_charging_get_status(struct em_charging_stat *status);
+
+/**
+ * @brief Register for a Notifier with the Driver Subsystem
+ *
+ * Notifier will get called whenever an event occurs.
+ * Calling may happen at fiber context so it is important that the
+callee
+ * does not undertake long duration work in same context. In case any
+long
+ * duration work is needed to be done, offloading using from fiber
+context
+ * using events etc. is recommended.
+ * Called by the application & implemented by the platform drivers.
+ *
+ * @param notifier
+ *
+ * @return 0 if success, negative error code for error */ int32_t
+em_register_notifier(struct em_notifier_t notifier); /* Assumes
+Callback implementation */
+
--
2.7.4


Re: Device driver configuration and driver_data distinction.

Iván Briano <ivan.briano at intel.com...>
 

On Thu, 06 Oct 2016 13:22:31 -0400, Benjamin Walsh wrote:
On Thu, Oct 06, 2016 at 07:04:42PM +0200, Tomasz Bursztyka wrote:
Hi Marcus,


Sound sane?
ACK from me at least.
Seconded.
Thirded.


Re: Device driver configuration and driver_data distinction.

Benjamin Walsh <benjamin.walsh@...>
 

On Thu, Oct 06, 2016 at 07:04:42PM +0200, Tomasz Bursztyka wrote:
Hi Marcus,


Sound sane?
ACK from me at least.
Seconded.


Re: Device driver configuration and driver_data distinction.

Tomasz Bursztyka
 

Hi Marcus,


Sound sane?
ACK from me at least.

Tomasz


Re: Device driver configuration and driver_data distinction.

Marcus Shawcroft <marcus.shawcroft@...>
 

On 6 October 2016 at 12:06, Tomasz Bursztyka
<tomasz.bursztyka(a)linux.intel.com> wrote:
Hi Marcus,

I believe we did not make it const at the beginning due to PCI enumeration
on Galileo.
This was early days, and things changed then.

Actually there have been plans to move it to const, at least I remember
hearing such idea
from Daniel Kalowsky, for the same exact reasons you noted, it might even be
in the git history,
somewhere. But we were too busy to follow up at that time.

So this would indeed be very welcome, if you want to propose a patch for it.
Note, however, that some device drivers may be using such configuration
structure wrongly.
(aka: accessing and changing its data). So you would probably need to change
things there as well.
Hi,

Thanks for the background information.

Switching to const config_info will require the following:
1) Update ~50 drivers with an explicit const in any pointers they
construct when accessing their config_info structure. This change is
safe to make even when struct device {} has a a non const *config_info
2) Update a small subset of the above 50 to make their config
structures static. Not strictly necessary, but seems like the right
thing to do for all those drivers that are self contained within one
file.
3) Update ~12 drivers that currently have RW data within their RO
config data structure. This should be a straight forward mechanical
move of each RW object within config to the corresponding driver_data
structure.
4) Update ~12 drivers to put explict const in any pointers they
construct when accessing config_info
5) Update device {} to make config_info const.
6) Update all ~60 odd drivers to add const to their config structure
definitions.

All of this is mechanical, most trivial, some slightly more involved.
The hard part is likely to be figuring out how to make sure everything
modified gets compiled / tested as appropriate. Each of these steps
can be executed individually and incrementally without breaking the
tree.

3) Is not as difficult as it might first appear since each driver
instance has a RO config structure and a RW driver data structure, it
is essentially a trivial exercise of moving objects from one structure
to the other.

Sound sane?

Cheers
/Marcus


Daily JIRA Digest

donotreply@...
 

NEW JIRA items within last 24 hours: 2
[ZEP-1038] Hard real-time interrupt support
https://jira.zephyrproject.org/browse/ZEP-1038

[ZEP-1036] net/yaip: ARP requests error
https://jira.zephyrproject.org/browse/ZEP-1036


UPDATED JIRA items within last 24 hours: 2
[ZEP-917] Add abort handler support
https://jira.zephyrproject.org/browse/ZEP-917

[ZEP-975] DNS client port to new IP stack
https://jira.zephyrproject.org/browse/ZEP-975


CLOSED JIRA items within last 24 hours: 3
[ZEP-668] (Duplicate) Quark SE: Add support for suspend and resume ARC Sensor subsystem when SoC enters/exits Sleep state
https://jira.zephyrproject.org/browse/ZEP-668

[ZEP-656] (Duplicate) QMSI shim driver: Comparator: Implement suspend and resume callbacks
https://jira.zephyrproject.org/browse/ZEP-656

[ZEP-660] (Duplicate) QMSI shim driver: DMA: Implement suspend and resume callbacks
https://jira.zephyrproject.org/browse/ZEP-660


RESOLVED JIRA items within last 24 hours: 1
[ZEP-724] (Fixed) build on windows failed: 'make: execvp: uname: File or path name too long'
https://jira.zephyrproject.org/browse/ZEP-724


Daily Gerrit Digest

donotreply@...
 

NEW within last 24 hours:
- https://gerrit.zephyrproject.org/r/5241 : net: yaip: Add support for 6lo context based compression
- https://gerrit.zephyrproject.org/r/5238 : net: yaip: Add support for 6CO
- https://gerrit.zephyrproject.org/r/5239 : net: tests: Add sample 6CO context data to IPv6 RA test
- https://gerrit.zephyrproject.org/r/5213 : gpio/nrf5: set and clear just the specific gpio pin
- https://gerrit.zephyrproject.org/r/5252 : net: yaip: Refactor nbuf data fragment detection
- https://gerrit.zephyrproject.org/r/5251 : net: yaip: Re-order fields in net_nbuf struct
- https://gerrit.zephyrproject.org/r/5194 : stm32l4: add initial soc support for stm32l4
- https://gerrit.zephyrproject.org/r/5250 : net: yaip: Fix ND RA length
- https://gerrit.zephyrproject.org/r/5243 : net: yaip: Remove assert and return false
- https://gerrit.zephyrproject.org/r/5242 : net: tests: Add 6lo context based unit tests
- https://gerrit.zephyrproject.org/r/5240 : net: yaip: Add more inline helper functions in 6lowpan
- https://gerrit.zephyrproject.org/r/5228 : net: yaip: arp: Fix an issue with compiler optimization on Arduino 101
- https://gerrit.zephyrproject.org/r/5232 : driver: Fixed Atmel SAM3 serial driver.
- https://gerrit.zephyrproject.org/r/5230 : arduino 101: Exposes spi 0 in pinmux
- https://gerrit.zephyrproject.org/r/5209 : sensors: use one single sys log config for sensors
- https://gerrit.zephyrproject.org/r/5231 : arch/arm: add initial support for Cortex-M0/M0+
- https://gerrit.zephyrproject.org/r/5218 : arm: move atomic operations selection to the Cortex-M Kconfig
- https://gerrit.zephyrproject.org/r/5224 : unified: clean-up timeout code for unpending a thread
- https://gerrit.zephyrproject.org/r/5227 : unified: cleanup kernel initialization
- https://gerrit.zephyrproject.org/r/5212 : net: yaip: Small simplififcation to net_nbuf_write
- https://gerrit.zephyrproject.org/r/5219 : unified: have __ticks_to_ms() return 0 when no system clock
- https://gerrit.zephyrproject.org/r/5223 : unified: streamline "timeout add" internal interfaces.
- https://gerrit.zephyrproject.org/r/5226 : unified: remove last instances of struct tcs
- https://gerrit.zephyrproject.org/r/5222 : unified/mem_pool: use K_NO_WAIT, not TICKS_NONE
- https://gerrit.zephyrproject.org/r/5225 : unified: remaining timeout cleanup
- https://gerrit.zephyrproject.org/r/5221 : unified: streamline "timeout abort" internal interface
- https://gerrit.zephyrproject.org/r/5220 : unified/legacy: disable clock-based work_q APIs when no system clock
- https://gerrit.zephyrproject.org/r/5216 : flash/nrf5: support non word-aligned write
- https://gerrit.zephyrproject.org/r/5217 : samples/soc_flash_nrf5: test non-word aligned writes
- https://gerrit.zephyrproject.org/r/5215 : drivers/exti_stm32: fix clear pending exti
- https://gerrit.zephyrproject.org/r/5214 : exti/stm32: fix driver data handling
- https://gerrit.zephyrproject.org/r/5211 : drivers: gpio: i2c: make logging depend on SYS_LOG
- https://gerrit.zephyrproject.org/r/5210 : unified: move code from nanokernel into unified kernel
- https://gerrit.zephyrproject.org/r/5208 : arm: remove exc_wrapper.S
- https://gerrit.zephyrproject.org/r/5205 : stm32l4: add pinconf settings for I2C
- https://gerrit.zephyrproject.org/r/5201 : stm32lx: add u(s)art driver for the L series
- https://gerrit.zephyrproject.org/r/5200 : stm32l4: add pinconf for USARTs
- https://gerrit.zephyrproject.org/r/5206 : stm32lx: add i2c driver for the L series
- https://gerrit.zephyrproject.org/r/5207 : nucleo_l476rg: add board support
- https://gerrit.zephyrproject.org/r/5197 : stm32_exti: add support for controllers with more than 32 lines
- https://gerrit.zephyrproject.org/r/5199 : stm32l4: add pinmux for USARTs
- https://gerrit.zephyrproject.org/r/5198 : stm32l4: add exti support
- https://gerrit.zephyrproject.org/r/5196 : stm32l4: add gpio support for l4
- https://gerrit.zephyrproject.org/r/5203 : pinmux/stm32: add support for pinmux of port h
- https://gerrit.zephyrproject.org/r/5191 : net: Respect ether_type field.
- https://gerrit.zephyrproject.org/r/5204 : pinmux/stm32: add pinmux definition for i2c
- https://gerrit.zephyrproject.org/r/5202 : pinmux/stm32: add support for up to 16 alternate functions
- https://gerrit.zephyrproject.org/r/5195 : stm32l4: add clock control driver

UPDATED within last 24 hours:
- https://gerrit.zephyrproject.org/r/5118 : eth: Add KSDK ENET driver.
- https://gerrit.zephyrproject.org/r/5077 : net: yaip: Fix net_nbuf_read corner cases
- https://gerrit.zephyrproject.org/r/5183 : Bluetooth: tester: Rework discovery procedure
- https://gerrit.zephyrproject.org/r/5006 : enc28j60: Adapt driver for YAIP
- https://gerrit.zephyrproject.org/r/4795 : Bluetooth: L2CAP: Refactor handling connection response
- https://gerrit.zephyrproject.org/r/4796 : Bluetooth: L2CAP: Handle security procedure non successful path
- https://gerrit.zephyrproject.org/r/5190 : Bluetooth: IPSS: Make ipss_listen depend on CONFIG_NETWORKING_WITH_BT
- https://gerrit.zephyrproject.org/r/4917 : iot/zoap: Port to the new network stack
- https://gerrit.zephyrproject.org/r/5188 : Bluetooth: L2CAP: Fix sending buffer with not enough space
- https://gerrit.zephyrproject.org/r/5189 : Bluetooth: L2CAP: Allow sending fragmented buffers
- https://gerrit.zephyrproject.org/r/5175 : net:yaip: Solve style issues
- https://gerrit.zephyrproject.org/r/5051 : enc28j60: Modify echo server sample to support enc28j60
- https://gerrit.zephyrproject.org/r/5164 : enc28j60: Modify echo client sample to support enc28j60
- https://gerrit.zephyrproject.org/r/3312 : drivers/crypto: TinyCrypt shim driver
- https://gerrit.zephyrproject.org/r/3313 : samples/drivers/crypto: crypto sample app
- https://gerrit.zephyrproject.org/r/3311 : include/crypto: Crypto abstraction header
- https://gerrit.zephyrproject.org/r/5102 : unified: un-comment k_thread_[suspend|resume|abort_handler_set]
- https://gerrit.zephyrproject.org/r/5101 : dlist: add sys_dlist_peek_head_not_empty()
- https://gerrit.zephyrproject.org/r/5104 : unified: cache the next thread to run
- https://gerrit.zephyrproject.org/r/5103 : unified: use sys_dlist_peek_head_not_empty()
- https://gerrit.zephyrproject.org/r/5100 : unified/arm: fix saving of registers in __pendsv()
- https://gerrit.zephyrproject.org/r/4883 : sanity: enable sanity multiple configuration
- https://gerrit.zephyrproject.org/r/4635 : serial: make nrf5 driver more generic, prepare for nrf51
- https://gerrit.zephyrproject.org/r/4454 : net/yaip: Separate SLIP support into TAP and TUN options
- https://gerrit.zephyrproject.org/r/4455 : drivers/slip: Fix circular dependency on NET_SLIP
- https://gerrit.zephyrproject.org/r/5171 : samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app.
- https://gerrit.zephyrproject.org/r/22 : ci: test: checkpatch: error braces
- https://gerrit.zephyrproject.org/r/5187 : net: dhcpv4: Adjust debug diagnostic wording.
- https://gerrit.zephyrproject.org/r/5186 : net: dhcpv4: Issue an NET_INFO when dhcpv4 allocates an IP.
- https://gerrit.zephyrproject.org/r/5184 : net: dhcpv4: Implement XID
- https://gerrit.zephyrproject.org/r/5185 : net: dhcpv4: Add received message debug.

MERGED within last 24 hours:
- https://gerrit.zephyrproject.org/r/5229 : kernel: event logger needs ring buffer
- https://gerrit.zephyrproject.org/r/5236 : net: yaip: ethernet: Drop the packet early when relevant
- https://gerrit.zephyrproject.org/r/5237 : net: yaip: ethernet: Set ll_reserve only when ready
- https://gerrit.zephyrproject.org/r/5192 : sensors: do not use choice for I2C address
- https://gerrit.zephyrproject.org/r/5193 : stm32: make SRAM/FLASH base address generic to soc
- https://gerrit.zephyrproject.org/r/5160 : net: yaip: events: Fix a mix up between code and command
- https://gerrit.zephyrproject.org/r/5180 : net: yaip: Fix buffer leak in 6lowpan compression
- https://gerrit.zephyrproject.org/r/5182 : net: tests: Decrease the required buffers count
- https://gerrit.zephyrproject.org/r/5181 : net: yaip: Fix buffer leak in ieee802154 fragmentation
- https://gerrit.zephyrproject.org/r/5179 : sensors: HDC1000: check for manufacturer and device IDs
- https://gerrit.zephyrproject.org/r/4634 : drivers/gpio: nrf5: Use generic GPIO base naming
- https://gerrit.zephyrproject.org/r/5176 : samples: remove useless printf/printk wrappers
- https://gerrit.zephyrproject.org/r/5178 : sensors: use one init priority config for all sensors
- https://gerrit.zephyrproject.org/r/5173 : Bluetooth: Fix Kconfig typo
- https://gerrit.zephyrproject.org/r/5161 : Bluetooth: HCI: Add OpCode definition for setting page timeout
- https://gerrit.zephyrproject.org/r/4511 : unified/doc: Kernel primer for unified kernel


Re: Device driver configuration and driver_data distinction.

Andy Ross
 

Marcus Shawcroft wrote (on Thursday, October 06, 2016 8:26AM):
Andy, I think we are talking about to different structures
Ah, gotcha. Yeah, you're totally right. The only trick I can see
with merging this would be verifying that no existing drivers are
accidentally exploiting that missing const to mutate their config
structs.

Andy


Re: Device driver configuration and driver_data distinction.

Marcus Shawcroft <marcus.shawcroft@...>
 

On 6 October 2016 at 15:58, Andy Ross <andrew.j.ross(a)intel.com> wrote:
Marcus Shawcroft wrote (on Thursday, October 06, 2016 3:18AM):
This design make sense from the perspective that the read only config
data *could* be const and placed in flash only, hence lowering
pressure on sram.

However, it is not possible to make a drivers config structure const
because include/device.h defines struct device_config with a non const
*config_info
Actually it goes into the ROM data section anyway, despite the lack of
const. This is controlled in device.h by declaring the device_config
struct to be in the "devconfig.init" section. This then is placed by
the linker script (one per arhicecture right now, sigh) into the
ROMable region, right before the compiler-managed .rodata (which of
course *is* the stuff that depends on const).

The lack of const is (well, should be) just a missed opportunity for
compiler warnings. But AFAICT it's wrong and should be fixed.
Andy, I think we are talking about to different structures, given:

static struct gpio_k64_config gpio_k64_E_cfg = {
.gpio_base_addr = GPIO_K64_E_BASE_ADDR,
.port_base_addr = PORT_K64_E_BASE_ADDR,
};
DEVICE_AND_API_INIT(gpio_k64_E, CONFIG_GPIO_K64_E_DEV_NAME, gpio_k64_E_init,
&gpio_data_E, &gpio_k64_E_cfg,
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);


The gpio_k64_E_cfg structure is placed in the data section and copied
to RAM from FLASH at startup.

2000007c l O datas 00000008 gpio_k64_E_cfg

Making in const (and dealing with the *config_info discussed above), gives:
00003b20 l O rodata 00000008 gpio_k64_E_cfg

Cheers
/Marcus


Re: Device driver configuration and driver_data distinction.

Andy Ross
 

Marcus Shawcroft wrote (on Thursday, October 06, 2016 3:18AM):
This design make sense from the perspective that the read only config
data *could* be const and placed in flash only, hence lowering
pressure on sram.

However, it is not possible to make a drivers config structure const
because include/device.h defines struct device_config with a non const
*config_info
Actually it goes into the ROM data section anyway, despite the lack of
const. This is controlled in device.h by declaring the device_config
struct to be in the "devconfig.init" section. This then is placed by
the linker script (one per arhicecture right now, sigh) into the
ROMable region, right before the compiler-managed .rodata (which of
course *is* the stuff that depends on const).

The lack of const is (well, should be) just a missed opportunity for
compiler warnings. But AFAICT it's wrong and should be fixed.

Andy


Re: Device driver configuration and driver_data distinction.

Jon Medhurst (Tixy) <tixy@...>
 

On Thu, 2016-10-06 at 11:18 +0100, Marcus Shawcroft wrote:
The DEVICE_INIT() macro and associated driver framework provides for
each driver instance to have two data structures, the config structure
and the driver_data structure.

Documentation in docs/drivers/drivers.rst indicates that the
configuration structure is for read only, build time configured data,
while the driver_data structure is for dynamic state.

This design make sense from the perspective that the read only config
data *could* be const and placed in flash only, hence lowering
pressure on sram.

However, it is not possible to make a drivers config structure const
because include/device.h defines struct device_config with a non const
*config_info, hence passing a const config structure to DEVICE_INIT()
generates a diagnostic/error.
I too wondered the same, as my first instinct was to declare these const
along with other structures like the various API function tables and
strings used for device names. But the compiler soon alerted me to the
fact that Zephy APIs seem to have an allergy to 'const' :-)

I don't know if the widespread use of sections and linker scripts
actually ends up putting a lot of these things into read-only memory
anyway, or if these all really do end up wasting RAM.

--
Tixy

6961 - 6980 of 8638