GPIO state in qemu

James Feist james.feist at linux.intel.com
Tue Sep 10 02:20:26 AEST 2019


On 9/6/19 11:05 AM, Joel Stanley wrote:
> At the osfc hackathon today James and I were talking about Qemu's new 
> support for modelling GPIOs. Here's some documentation on how it can be 
> used.
> 
> To set a pin's state in the monitor:
> 
> qom-set gpio gpioA0 true
> 
> To do the equivalent in code:
> 
> object_property_set_bool(OBJECT(&s->gpio), true, "gpioA0", &error_abort);

I'm trying to use object_property_set_bool in hw/arm/aspeed.c in an 
i2c_init block and I'm noticing by the time uboot is reached that the 
registers are reset back to the default. If I use qom-set it seems to 
work correctly. Where is the correct place to put the 
object_property_set_bool so that it doesn't get reset by the time it's 
ready to be read? Does AspeedBoardConfig need a gpio_init as well as an 
i2c_init?

Thanks,

-James



> 
> Thanks Rashmica for writing the model and Cedric for the tips.
> 
> Cheers,
> 
> Joel
> 
> 


More information about the openbmc mailing list