mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
xen/arm: gic: Allow the base address to be 0
0 is a valid physical address and dt_device_get_address would return an error if a problem during the retrieving happen. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Zoltan Kiss <zoltan.kiss@huawei.com>
This commit is contained in:
1 parent
6e59102559
commit
c1fde0dcd4
3 files changed
+10
-10
No files matched your search
@@ -680,19 +680,19 @@ static int __init hip04gic_init(void)
|
||||
const struct dt_device_node *node = gicv2_info.node;
|
||||
|
||||
res = dt_device_get_address(node, 0, &gicv2.dbase, NULL);
|
||||
if ( res || !gicv2.dbase )
|
||||
if ( res )
|
||||
panic("GIC-HIP04: Cannot find a valid address for the distributor");
|
||||
|
||||
res = dt_device_get_address(node, 1, &gicv2.cbase, NULL);
|
||||
if ( res || !gicv2.cbase )
|
||||
if ( res )
|
||||
panic("GIC-HIP04: Cannot find a valid address for the CPU");
|
||||
|
||||
res = dt_device_get_address(node, 2, &gicv2.hbase, NULL);
|
||||
if ( res || !gicv2.hbase )
|
||||
if ( res )
|
||||
panic("GIC-HIP04: Cannot find a valid address for the hypervisor");
|
||||
|
||||
res = dt_device_get_address(node, 3, &gicv2.vbase, NULL);
|
||||
if ( res || !gicv2.vbase )
|
||||
if ( res )
|
||||
panic("GIC-HIP04: Cannot find a valid address for the virtual CPU");
|
||||
|
||||
res = platform_get_irq(node, 0);
|
||||
|
||||
@@ -666,19 +666,19 @@ static int __init gicv2_init(void)
|
||||
const struct dt_device_node *node = gicv2_info.node;
|
||||
|
||||
res = dt_device_get_address(node, 0, &gicv2.dbase, NULL);
|
||||
if ( res || !gicv2.dbase )
|
||||
if ( res )
|
||||
panic("GICv2: Cannot find a valid address for the distributor");
|
||||
|
||||
res = dt_device_get_address(node, 1, &gicv2.cbase, NULL);
|
||||
if ( res || !gicv2.cbase )
|
||||
if ( res )
|
||||
panic("GICv2: Cannot find a valid address for the CPU");
|
||||
|
||||
res = dt_device_get_address(node, 2, &gicv2.hbase, NULL);
|
||||
if ( res || !gicv2.hbase )
|
||||
if ( res )
|
||||
panic("GICv2: Cannot find a valid address for the hypervisor");
|
||||
|
||||
res = dt_device_get_address(node, 3, &gicv2.vbase, NULL);
|
||||
if ( res || !gicv2.vbase )
|
||||
if ( res )
|
||||
panic("GICv2: Cannot find a valid address for the virtual CPU");
|
||||
|
||||
res = platform_get_irq(node, 0);
|
||||
|
||||
@@ -1198,7 +1198,7 @@ static int __init gicv3_init(void)
|
||||
}
|
||||
|
||||
res = dt_device_get_address(node, 0, &gicv3.dbase, NULL);
|
||||
if ( res || !gicv3.dbase )
|
||||
if ( res )
|
||||
panic("GICv3: Cannot find a valid distributor address");
|
||||
|
||||
if ( (gicv3.dbase & ~PAGE_MASK) )
|
||||
@@ -1230,7 +1230,7 @@ static int __init gicv3_init(void)
|
||||
uint64_t rdist_base, rdist_size;
|
||||
|
||||
res = dt_device_get_address(node, 1 + i, &rdist_base, &rdist_size);
|
||||
if ( res || !rdist_base )
|
||||
if ( res )
|
||||
panic("GICv3: No rdist base found for region %d\n", i);
|
||||
|
||||
rdist_regs[i].base = rdist_base;
|
||||
|
||||