* bcm2835: device tree for mbox-driven devices in upstream
@ 2012-09-21 4:40 Stephen Warren
0 siblings, 0 replies; only message in thread
From: Stephen Warren @ 2012-09-21 4:40 UTC (permalink / raw)
To: Simon Arlott, popcornmix
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
As background for those not familiar with the BCM2835 SoC, many aspects
of the HW are controlled by firmware running on the VideoCore processor
that exists alongside the ARM CPU, and communication to that core is via
a "mailbox" interface, with SW-defined/implemented messages. The mailbox
interface defines so-called channels, and on each channel a certain
format of messages and protocol is expected.
The existing downstream rpi-split branch uses the following structure
for regulators implemented using the firmware mailbox interface:
vc_mbox: mbox {
compatible = "broadcom,bcm2835-mbox";
reg = <0xB880 0x40>;
interrupts = <0 1>;
#channel-cells = <1>;
};
power {
compatible = "broadcom,bcm2835-power-mgr", "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
/* This is assuming the old dedicated channel 0 for power */
broadcom,vc-mailbox = <&vc_mbox 0>;
reg_sd: regulator@0 {
compatible = "broadcom,bcm2835-power-dev";
reg = <0>;
};
reg_usbhcd: regulator@3 {
compatible = "broadcom,bcm2835-power-dev";
reg = <3>;
};
};
display {
compatible = "broadcom,bcm2835-fb";
/* This is assuming the old dedicated channel 1 for fb */
broadcom,vc-mailbox = <&vc_mbox 1>;
};
Thinking about this a bit, I see:
a) A parallel between the mailbox node/device and the virtual buses used
by hypervisors for para-virtualized devices.
b) The devices that implement communication across the mailbox API are
logically children of the mailbox device, being addressed/controlled via
the bus.
As such, I think it'd make more sense to rework the device tree along
the following lines while upstreaming the code:
vc_mbox: mbox {
compatible = "broadcom,bcm2835-mbox";
reg = <0xB880 0x40>;
interrupts = <0 1>;
channels {
#address-cells = <1>;
#size-cells = <0>;
channel@2 {
/* This is the mbox channel ID */
reg = <2>;
uart {
/* MBOX-based virtual UART */
compatible = "broadcom,bcm2835-mbox-vuart";
};
};
channel@8 {
/*
* This is the mbox channel ID. Here we assume the new
* property mailbox channel for most devices; see my
* previous email.
*/
reg = <8>;
/*
* Multiple independant ojects may communicate over the same
* channel, for the protocol on some channels at least.
*/
reg_sd: sd {
compatible = "broadcom,bcm2835-mbox-power";
};
reg_usbhcd: usbhcd {
compatible = "broadcom,bcm2835-mbox-power";
};
display {
compatible = "broadcom,bcm2835-mbox-fb";
};
};
};
};
Does anyone have any comments/suggestions on this?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-09-21 4:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21 4:40 bcm2835: device tree for mbox-driven devices in upstream Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).