提交 286ede65 编写于 作者: M Mario Six 提交者: Simon Glass

drivers: core: Add translation in live tree case

The function dev_read_addr calls ofnode_get_addr_index in the live tree
case, which does not apply bus translations to the address read from the
device tree. This results in illegal addresses on boards that rely on
bus translations being applied.

Fix this situation by applying bus translations in the live tree case as
well.
Signed-off-by: NMario Six <mario.six@gdsys.cc>
Tested-by: NStephen Warren <swarren@nvidia.com>
上级 fa9335a8
......@@ -205,8 +205,13 @@ fdt_addr_t ofnode_get_addr_index(ofnode node, int index)
&flags);
if (!prop_val)
return FDT_ADDR_T_NONE;
na = of_n_addr_cells(ofnode_to_np(node));
return of_read_number(prop_val, na);
if (IS_ENABLED(CONFIG_OF_TRANSLATE)) {
return of_translate_address(ofnode_to_np(node), prop_val);
} else {
na = of_n_addr_cells(ofnode_to_np(node));
return of_read_number(prop_val, na);
}
} else {
return fdt_get_base_address(gd->fdt_blob,
ofnode_to_offset(node));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册