History log of /fuchsia/zircon/system/dev/board/qemu/test/parent.c
Revision Date Author Comments
# c2d72d26 26-Sep-2018 Suraj Malhotra <surajmalhotra@google.com>

[qemu][test] Migrate to use mmio_buffer_t.

Tested: Compiles.
Change-Id: Iae3245763c75ebf74ede3c28db7af0eb4238e95d


# b007bc43 20-Aug-2018 Gurjant Kalsi <gkalsi@google.com>

[pdev] Fix RpcGetBti bug

RpcGetBti now returns the BTI for the correct device.
Previously the root device's own BTIs were being returned.

TEST: Added test to the qemu test driver and verified that devices
always get the BTIs intended for them.

Change-Id: Ic1563e16a3956dbeeb4caf5224c737fc3c24ab4d


# 5cfd5b91 07-Aug-2018 Mike Voydanoff <voydanoff@google.com>

[dev][platform-bus] Provide platform bus resources platform device children

Currently the platform bus allows creating a list of platform devices,
each running in a separate devhost.
These devices are provided by the bus with various resources
(MMIO buffers, interrupt handles, GPIOs, I2C channels, etc).
However we have use cases where a platform device may have child devices
that also need resources from the platform bus.

This change allows children of platform devices to access platform bus resources.
To do this, the board driver can pass a list of child devices via the pbus_dev_t
structure passed via pbus_device_add(). These children can also have children,
allowing for a tree of platform devices in the same devhost, rather than just one.
To facilitate this, a platform device must use a new platform device protocol
pdev_device_add() to create the child device rather than calling the DDK
device_add() directly.
The behavior of pdev_device_add() is the same as device_add(), except it inserts
a layer between the parent and child device to allow device_get_protocol()
to return protocols that are implemented by the platform bus
(for example, ZX_PROTOCOL_PLATFORM_DEV, ZX_PROTOCOL_GPIO, etc.)
This allows the children of of platform devices to also be platform devices,
while simultaneously allowing access to the protocol(s) implemented by the
parent device.

This change also adds four drivers to the qemu build to test this new functionality.
The qemu-bus board driver adds a platform device called "parent".
"parent" then creates a child device called "child-1", which in turn has
two children called "child-2" and "child-3".
All of these devices are platform devices and all four of the corresponding drivers
test to make sure that they can access the platform device protocol and map
their own unique MMIO regions.

TEST: manual testing on qemu, vim2 and gauss

Change-Id: Iaa4cd2afb06512dd0a9f9e06ca91c84c348e352f