[PATCH linux dev-4.10] aspeed_g5_defconfig: add CONFIG_OF_DYNAMIC.
Michael Ellerman
mpe at ellerman.id.au
Wed Aug 9 23:00:46 AEST 2017
Mykola Kostenok <c_mykolak at mellanox.com> writes:
>> -----Original Message-----
>> From: joel.stan at gmail.com [mailto:joel.stan at gmail.com] On Behalf Of Joel >> Stanley
>>
>> Can you explain what you're wanting to do here?
>>
>> I've added some of our device tree experts to cc so they can offer advice.
>
> Hi, Joel.
>
> We have now patchset supporting our CPLD device in upstream review.
> There we have support for dynamic (hotplug) devices, like PSUs, FANs, ASIC, etc.
>
...
>
> They all sets with the state "disabled", and driver activates it with the below calls, when related hotplug event is received in interrupt handler:
>
> static struct property mlxreg_core_device_dis = {
> .name = MLXREG_CORE_PROP_STATUS,
> .value = MLXREG_CORE_PROP_DISABLED,
> .length = sizeof(MLXREG_CORE_PROP_DISABLED),
> };
>
> static void mlxreg_core_dev_enable(struct device_node *np) {
> /* Enable and create device. */
> of_update_property(np, &mlxreg_core_device_en); }
>
> static void mlxreg_core_dev_disable(struct device_node *np) {
> /* Disable and unregister platform device. */
> of_update_property(np, &mlxreg_core_device_dis);
> of_node_clear_flag(np, OF_POPULATED);
> }
>
> For that we must have OF_DYNAMIC set, and last one required OF_UNITEST.
But are you actually changing the structure of the device tree at run time?
If all you're doing is using of_update_property() to change the status
property I don't think you need OF_DYNAMIC.
cheers
More information about the openbmc
mailing list