<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Re: [PATCH V4] powerpc/prom: Export device tree physical address via proc</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Matthew McClintock wrote:<BR>
<BR>
> +static struct property flat_dt_start_prop = {<BR>
> +     .name = "linux,devicetree-start",<BR>
> +     .length = sizeof(phys_addr_t),<BR>
> +     .value =&flat_dt_start,<BR>
> +};<BR>
> +<BR>
> +static struct property flat_dt_end_prop = {<BR>
> +     .name = "linux,devicetree-end",<BR>
> +     .length = sizeof(phys_addr_t),<BR>
> +     .value =&flat_dt_end,<BR>
> +};<BR>
<BR>
I think Segher was suggesting that you use "linux,device-tree-xxx".<BR>
<BR>
> +<BR>
> +static int __init export_flat_device_tree_phys_addr(void)<BR>
> +{<BR>
> +     struct property *prop;<BR>
> +     struct device_node *node;<BR>
> +<BR>
> +     node = of_find_node_by_path("/chosen");<BR>
> +     if (!node)<BR>
> +             return -ENOENT;<BR>
> +<BR>
> +     prop = of_find_property(node, "linux,devicetree-start", NULL);<BR>
<BR>
Does this work?<BR>
<BR>
prop = of_find_property(node, flat_dt_start_prop.name, NULL);<BR>
<BR>
> +     if (prop)<BR>
> +             prom_remove_property(node, prop);<BR>
> +<BR>
> +     prop = of_find_property(node, "linux,devicetree-end", NULL);<BR>
> +     if (prop)<BR>
> +             prom_remove_property(node, prop);<BR>
> +<BR>
> +     flat_dt_start = virt_to_phys(initial_boot_params);<BR>
> +     flat_dt_end = virt_to_phys(initial_boot_params)<BR>
> +                             + initial_boot_params->totalsize;<BR>
<BR>
This is better, I think:<BR>
<BR>
        flat_dt_end = flat_dt_start + initial_boot_params->totalsize;<BR>
<BR>
--<BR>
Timur Tabi<BR>
Linux kernel developer<BR>
</FONT>
</P>

</BODY>
</HTML>