diff mbox

[7/7] hw/misc/platform_devices: Add platform_bus_base to PlatformDevtreeData

Message ID 1404716892-15600-8-git-send-email-eric.auger@linaro.org
State New
Headers show

Commit Message

Auger Eric July 7, 2014, 7:08 a.m. UTC
The base address of the platform bus sometimes is used to build the
<reg> property.

---

Actually I did not succeed in doing it another way with Calxeda xgmac.
If someone knows how to do without, please advise.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
 hw/misc/platform_devices.c         | 1 +
 include/hw/misc/platform_devices.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Alexander Graf July 8, 2014, 1:53 p.m. UTC | #1
On 07.07.14 09:08, Eric Auger wrote:
> The base address of the platform bus sometimes is used to build the
> <reg> property.
>
> ---
>
> Actually I did not succeed in doing it another way with Calxeda xgmac.
> If someone knows how to do without, please advise.

Not sure I understand. The "regs" properties live inside the parent's 
"ranges". So in device tree the only thing that should be aware of the 
bus offset is the platform bus node, no?


Alex
Auger Eric July 23, 2014, 3:39 p.m. UTC | #2
On 07/08/2014 03:53 PM, Alexander Graf wrote:
> 
> On 07.07.14 09:08, Eric Auger wrote:
>> The base address of the platform bus sometimes is used to build the
>> <reg> property.
>>
>> ---
>>
>> Actually I did not succeed in doing it another way with Calxeda xgmac.
>> If someone knows how to do without, please advise.
> 
> Not sure I understand. The "regs" properties live inside the parent's
> "ranges". So in device tree the only thing that should be aware of the
> bus offset is the platform bus node, no?
yes I full agree with you as I mentioned in a previous email. I tried to
use <offset> instead of <range> but I never succeeded in making it work.
Maybe a syntax issue, ... I need to spend some more time on it/ get some
help and fix that ...

BR

Eric
> 
> 
> Alex
>
diff mbox

Patch

diff --git a/hw/misc/platform_devices.c b/hw/misc/platform_devices.c
index a054606..f194b1d 100644
--- a/hw/misc/platform_devices.c
+++ b/hw/misc/platform_devices.c
@@ -54,6 +54,7 @@  void platform_bus_create_devtree(PlatformParams *params, void *fdt,
     data.fdt = fdt;
     data.mpic = mpic;
     data.irq_start = irq_start;
+    data.platform_bus_base = addr;
     data.node = node;
 
     container = container_get(qdev_get_machine(), "/peripheral");
diff --git a/include/hw/misc/platform_devices.h b/include/hw/misc/platform_devices.h
index ab79346..6d228ca 100644
--- a/include/hw/misc/platform_devices.h
+++ b/include/hw/misc/platform_devices.h
@@ -11,6 +11,7 @@  typedef struct PlatformDevtreeData {
     const char *mpic;
     int irq_start;
     const char *node;
+    hwaddr platform_bus_base;
 } PlatformDevtreeData;
 
 typedef struct {