{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10904","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10904/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10904/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10904/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/10904","id":375018424,"node_id":"MDU6SXNzdWUzNzUwMTg0MjQ=","number":10904,"title":"Requirements for driver devices generation using device tree","user":{"login":"erwango","id":18574308,"node_id":"MDQ6VXNlcjE4NTc0MzA4","avatar_url":"https://avatars1.githubusercontent.com/u/18574308?v=4","gravatar_id":"","url":"https://api.github.com/users/erwango","html_url":"https://github.com/erwango","followers_url":"https://api.github.com/users/erwango/followers","following_url":"https://api.github.com/users/erwango/following{/other_user}","gists_url":"https://api.github.com/users/erwango/gists{/gist_id}","starred_url":"https://api.github.com/users/erwango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwango/subscriptions","organizations_url":"https://api.github.com/users/erwango/orgs","repos_url":"https://api.github.com/users/erwango/repos","events_url":"https://api.github.com/users/erwango/events{/privacy}","received_events_url":"https://api.github.com/users/erwango/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mbolivar","id":35088,"node_id":"MDQ6VXNlcjM1MDg4","avatar_url":"https://avatars3.githubusercontent.com/u/35088?v=4","gravatar_id":"","url":"https://api.github.com/users/mbolivar","html_url":"https://github.com/mbolivar","followers_url":"https://api.github.com/users/mbolivar/followers","following_url":"https://api.github.com/users/mbolivar/following{/other_user}","gists_url":"https://api.github.com/users/mbolivar/gists{/gist_id}","starred_url":"https://api.github.com/users/mbolivar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbolivar/subscriptions","organizations_url":"https://api.github.com/users/mbolivar/orgs","repos_url":"https://api.github.com/users/mbolivar/repos","events_url":"https://api.github.com/users/mbolivar/events{/privacy}","received_events_url":"https://api.github.com/users/mbolivar/received_events","type":"User","site_admin":false},"assignees":[{"login":"mbolivar","id":35088,"node_id":"MDQ6VXNlcjM1MDg4","avatar_url":"https://avatars3.githubusercontent.com/u/35088?v=4","gravatar_id":"","url":"https://api.github.com/users/mbolivar","html_url":"https://github.com/mbolivar","followers_url":"https://api.github.com/users/mbolivar/followers","following_url":"https://api.github.com/users/mbolivar/following{/other_user}","gists_url":"https://api.github.com/users/mbolivar/gists{/gist_id}","starred_url":"https://api.github.com/users/mbolivar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbolivar/subscriptions","organizations_url":"https://api.github.com/users/mbolivar/orgs","repos_url":"https://api.github.com/users/mbolivar/repos","events_url":"https://api.github.com/users/mbolivar/events{/privacy}","received_events_url":"https://api.github.com/users/mbolivar/received_events","type":"User","site_admin":false},{"login":"nashif","id":180017,"node_id":"MDQ6VXNlcjE4MDAxNw==","avatar_url":"https://avatars0.githubusercontent.com/u/180017?v=4","gravatar_id":"","url":"https://api.github.com/users/nashif","html_url":"https://github.com/nashif","followers_url":"https://api.github.com/users/nashif/followers","following_url":"https://api.github.com/users/nashif/following{/other_user}","gists_url":"https://api.github.com/users/nashif/gists{/gist_id}","starred_url":"https://api.github.com/users/nashif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nashif/subscriptions","organizations_url":"https://api.github.com/users/nashif/orgs","repos_url":"https://api.github.com/users/nashif/repos","events_url":"https://api.github.com/users/nashif/events{/privacy}","received_events_url":"https://api.github.com/users/nashif/received_events","type":"User","site_admin":false},{"login":"MaureenHelm","id":6172539,"node_id":"MDQ6VXNlcjYxNzI1Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/6172539?v=4","gravatar_id":"","url":"https://api.github.com/users/MaureenHelm","html_url":"https://github.com/MaureenHelm","followers_url":"https://api.github.com/users/MaureenHelm/followers","following_url":"https://api.github.com/users/MaureenHelm/following{/other_user}","gists_url":"https://api.github.com/users/MaureenHelm/gists{/gist_id}","starred_url":"https://api.github.com/users/MaureenHelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaureenHelm/subscriptions","organizations_url":"https://api.github.com/users/MaureenHelm/orgs","repos_url":"https://api.github.com/users/MaureenHelm/repos","events_url":"https://api.github.com/users/MaureenHelm/events{/privacy}","received_events_url":"https://api.github.com/users/MaureenHelm/received_events","type":"User","site_admin":false},{"login":"carlescufi","id":12450381,"node_id":"MDQ6VXNlcjEyNDUwMzgx","avatar_url":"https://avatars3.githubusercontent.com/u/12450381?v=4","gravatar_id":"","url":"https://api.github.com/users/carlescufi","html_url":"https://github.com/carlescufi","followers_url":"https://api.github.com/users/carlescufi/followers","following_url":"https://api.github.com/users/carlescufi/following{/other_user}","gists_url":"https://api.github.com/users/carlescufi/gists{/gist_id}","starred_url":"https://api.github.com/users/carlescufi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlescufi/subscriptions","organizations_url":"https://api.github.com/users/carlescufi/orgs","repos_url":"https://api.github.com/users/carlescufi/repos","events_url":"https://api.github.com/users/carlescufi/events{/privacy}","received_events_url":"https://api.github.com/users/carlescufi/received_events","type":"User","site_admin":false},{"login":"galak","id":16417047,"node_id":"MDQ6VXNlcjE2NDE3MDQ3","avatar_url":"https://avatars2.githubusercontent.com/u/16417047?v=4","gravatar_id":"","url":"https://api.github.com/users/galak","html_url":"https://github.com/galak","followers_url":"https://api.github.com/users/galak/followers","following_url":"https://api.github.com/users/galak/following{/other_user}","gists_url":"https://api.github.com/users/galak/gists{/gist_id}","starred_url":"https://api.github.com/users/galak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galak/subscriptions","organizations_url":"https://api.github.com/users/galak/orgs","repos_url":"https://api.github.com/users/galak/repos","events_url":"https://api.github.com/users/galak/events{/privacy}","received_events_url":"https://api.github.com/users/galak/received_events","type":"User","site_admin":false},{"login":"erwango","id":18574308,"node_id":"MDQ6VXNlcjE4NTc0MzA4","avatar_url":"https://avatars1.githubusercontent.com/u/18574308?v=4","gravatar_id":"","url":"https://api.github.com/users/erwango","html_url":"https://github.com/erwango","followers_url":"https://api.github.com/users/erwango/followers","following_url":"https://api.github.com/users/erwango/following{/other_user}","gists_url":"https://api.github.com/users/erwango/gists{/gist_id}","starred_url":"https://api.github.com/users/erwango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwango/subscriptions","organizations_url":"https://api.github.com/users/erwango/orgs","repos_url":"https://api.github.com/users/erwango/repos","events_url":"https://api.github.com/users/erwango/events{/privacy}","received_events_url":"https://api.github.com/users/erwango/received_events","type":"User","site_admin":false}],"milestone":null,"comments":26,"created_at":"2018-10-29T13:35:51Z","updated_at":"2018-10-31T14:09:43Z","closed_at":null,"author_association":"COLLABORATOR","body":"Aim of this issue is to settle on requirements for code generation solution that should be used to generate devices code for a driver configured by device tree. Most of the elements that will be listed here were discussed during OpenIoT 2018 in Edinburgh last week.\r\n\r\n* User's acceptance/Ease of use:\r\n  * Code generation solution should be easy to read and use. User should identify main elements and understand behavior with minimum effort.\r\n  * User should be able to easily map elements from the EDTS file to the code generation template\r\n  * Ideally, syntax should be easy to edit in IDE\r\n* Versatility:\r\n  * Code generation solution should fit to most of zephyr drivers, and at least in a first iteration work with all drivers using `DEVICE_AND_API_INIT` macro. \r\n* Ease of review:\r\n  * Solution should not bring significant overhead to the review process. It should be constrained and sufficiently defined so we don't loose time to comment on various possible ways on using the solution for a particular driver.\r\n* Maintainability:\r\n  * Code generation provided should be easy to maintain.\r\n* Doc:\r\n  * Solution should be fully documented\r\n* Implementation basics:\r\n  * Input: \r\n    * EDTS Python library API (cf https://github.com/zephyrproject-rtos/zephyr/pull/9876, and zephyr/topic-EDTS branch) exclusively. No use of the `edts.json` directly in order to avoid reliance on the JSON formatting \r\n    * Clean, non-templated `i2c_foo.c` file with the driver implementation (not used by the templating engine, here for completeness)\r\n    * Single template file `i2c_foo_devices.h.in` with the templated device structures.\r\n  * Output: \r\n    * Generated file : `i2c_foo_devices.h` in `build/zephyr/drivers/<driver>/`\r\n    * Included in `i2c_foo.c`( `#include i2c_foo_devices.h`)\r\n  * Invocation: Solution should be invoked from one liner, simple cmake macro:\r\n     `zephyr_library_sources_codegen_ifdef(CONFIG_I2C_STM32  i2c_ll_stm32.c)`\r\n  * Rendering \r\n    * Time: Needs to be rendered at `ninja` time\r\n    * Performance: Needs to render files one by one in parallel\r\n* Standalone:\r\n  * The tooling to take a device tree & yaml, plus some template description should not be zephyr specific or zephyr aware (ie any invocation of the tools should be able to exist and run outside of Zephyr)\r\n  * The integration (cmake) and templates helpers can be zephyr aware.\r\nNote: \r\n While being targeted in the long term, pinmux generation using device tree input is not addressed here. It is likely this is one element of the discussion, but aim of the ticket is to sum up what we know/want on driver devices."},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/434701347","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/10904#issuecomment-434701347","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10904","id":434701347,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDcwMTM0Nw==","user":{"login":"galak","id":16417047,"node_id":"MDQ6VXNlcjE2NDE3MDQ3","avatar_url":"https://avatars2.githubusercontent.com/u/16417047?v=4","gravatar_id":"","url":"https://api.github.com/users/galak","html_url":"https://github.com/galak","followers_url":"https://api.github.com/users/galak/followers","following_url":"https://api.github.com/users/galak/following{/other_user}","gists_url":"https://api.github.com/users/galak/gists{/gist_id}","starred_url":"https://api.github.com/users/galak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galak/subscriptions","organizations_url":"https://api.github.com/users/galak/orgs","repos_url":"https://api.github.com/users/galak/repos","events_url":"https://api.github.com/users/galak/events{/privacy}","received_events_url":"https://api.github.com/users/galak/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T14:09:43Z","updated_at":"2018-10-31T14:09:43Z","author_association":"CONTRIBUTOR","body":"> > Driver <> EDTS binding should be done using dts 'compatible' property.\r\n> \r\n> Must be detailed. 'compatible' is the same for all instances of a device.\r\n> \r\n> * How shall the instances of a device be bound? - by 'label', by 'address', by ???\r\n\r\nI assume you guys mean how we figure out what one would pass to device_get_binding()?  Or are we thinking about something else?"}}
{"actor":{"display_login":"galak"}}