-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert SAM SoC drivers to DT_INST #23107
Comments
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Durant the process to convert Atmel drivers to use DT_INST_ defines was detected the necessity of a hardware instance identificator. Some drivers need configure port pins, clocks, DMA etc. This will track the hw instance on the DT_INST_x_ independent of the 'x' value. This will keep simple the conversion this add a new non mandatory property called <id>. The driver that need these feature need add 'required=true' on the dts/binding/driver and complement any device tree with proper value. Examples: foo0: foo@1000 { compatible = "man,foo-drv"; id = <0>; status="disabled"; }; foo1: foo@1001 { compatible = "man,foo-drv"; id = <1>; }; barn: bar@2001 { compatible = "man,bar-drv"; id = <10>; }; barm: bar@3001 { compatible = "man,bar-drv"; id = <20>; }; Will generate: DT_INST_0_MAN_FOO_DRV_ID=1 DT_INST_0_MAN_BAR_DRV_ID=10 DT_INST_1_MAN_BAR_DRV_ID=20 It is intent to be used as below to propagate the hardware id on all driver defines. DRV_FOO_DEVICE_INIT(0, DT_INST_0_MAN_FOO_DRV_ID); A good driver example that need this definition: static const struct drv_foo_dev_cfg drv##n##_sam_config = { \ .regs = (Drv *)DT_INST_##n##_MAN_DRV_FOO_BASE_ADDRESS, \ .pin_rx = PIN_FOO##m##_RXD, \ .pin_tx = PIN_FOO##m##_TXD, \ } If 'm' isn't defined the driver will invariably configure the wrong pins and communication won't happen. This can't be derived by node name for many reasons. For instance. the above DT snip defined 'barn' and 'barm' that have a name without number and an unusual value. It represents two instances of bar that shouldn't assume values other than defined on the id property. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use DT_INST_ defines. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve are you able to get back to look at conversions for SAM now that we have the new DT macro's in place. Here's what I have (the # is count of DT_ references that need modification, or a rough estimate).
|
Hi @galak, I can take look at weekend and try update full list. I saw tons of DT_INST moving and probably lots of SAM related. |
Thanks. All the DT_INST conversions should be complete. This work now would be moving away from something like |
Convert driver to use new device tree macros. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use new device tree macros. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
Convert driver to use new device tree macros. see zephyrproject-rtos#23107 Signed-off-by: Gerson Fernando Budke <[email protected]>
@galak I believe is almost done with Atmel SAM/SAM0. Drivers converted however not define the global DT_DRV_COMPAT: Drivers without DT support: |
I'm not sure it makes sense in this case, but ok if you want to submit a PR for it.
Done. |
Atmel SoC DT_INST migration was concluded. |
Is your enhancement proposal related to a problem? Please describe.
This is to keep tracking of drivers to DT_INST related to Atmel SoCs. The worked started with #22806.
Describe the solution you'd like
Move/Create DT_INST for below driver list:
SoC:
Boards:
Others:
Pinctrl:
Feature #24236 #24319
Issues:
#23281 fixed by #23289
#23415 fixed by #23427
#24399 fixed by #24401
The text was updated successfully, but these errors were encountered: