<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/of_address.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-01-18T21:04:23+00:00</updated>
<entry>
<title>of: address: Add parent_bus_addr to struct of_pci_range</title>
<updated>2025-01-18T21:04:23+00:00</updated>
<author>
<name>Frank Li</name>
<email>Frank.Li@nxp.com</email>
</author>
<published>2024-11-19T19:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4dbf0155dfcfa65440b5f70d3e905261208b387e'/>
<id>urn:sha1:4dbf0155dfcfa65440b5f70d3e905261208b387e</id>
<content type='text'>
Add a new field called 'parent_bus_addr' to struct of_pci_range to use
when retrieving parent bus address information.

Refer to the diagram below to better understand that the bus fabric in
some systems (like i.MX8QXP) does not always use a 1:1 address map
between input and output.

Currently, many controller drivers use the cpu_addr_fixup() callback
that would often hardcode address translation directly in the code, e.g.,
"cpu_addr &amp; CDNS_PLAT_CPU_TO_BUS_ADDR" or "cpu_addr + BUS_IATU_OFFSET",
etc., even though those translations *should* be described via DT.

However, the cpu_addr_fixup() can be eliminated if DT correctly reflects
hardware behavior and drivers use 'parent_bus_addr' in struct of_pci_range.

            ┌─────────┐                    ┌────────────┐
 ┌─────┐    │         │ IA: 0x8ff8_0000    │            │
 │ CPU ├───►│   ┌────►├─────────────────┐  │ PCI        │
 └─────┘    │   │     │ IA: 0x8ff0_0000 │  │            │
  CPU Addr  │   │  ┌─►├─────────────┐   │  │ Controller │
0x7ff8_0000─┼───┘  │  │             │   │  │            │
            │      │  │             │   │  │            │   PCI Addr
0x7ff0_0000─┼──────┘  │             │   └──► IOSpace   ─┼────────────►
            │         │             │      │            │    0
0x7000_0000─┼────────►├─────────┐   │      │            │
            └─────────┘         │   └──────► CfgSpace  ─┼────────────►
             BUS Fabric         │          │            │    0
                                │          │            │
                                └──────────► MemSpace  ─┼────────────►
                        IA: 0x8000_0000    │            │  0x8000_0000
                                           └────────────┘

bus@5f000000 {
        compatible = "simple-bus";
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;1&gt;;
        ranges = &lt;0x80000000 0x0 0x70000000 0x10000000&gt;;

        pcie@5f010000 {
                compatible = "fsl,imx8q-pcie";
                reg = &lt;0x5f010000 0x10000&gt;, &lt;0x8ff00000 0x80000&gt;;
                reg-names = "dbi", "config";
                #address-cells = &lt;3&gt;;
                #size-cells = &lt;2&gt;;
                device_type = "pci";
                bus-range = &lt;0x00 0xff&gt;;
                ranges = &lt;0x81000000 0 0x00000000 0x8ff80000 0 0x00010000&gt;,
                         &lt;0x82000000 0 0x80000000 0x80000000 0 0x0ff00000&gt;;
	...
	};
};

In the diagram above, the 'parent_bus_addr' field in struct of_pci_range
can indicate internal address (IA) address information.

Link: https://lore.kernel.org/r/20241119-pci_fixup_addr-v8-1-c4bfa5193288@nxp.com
Signed-off-by: Frank Li &lt;Frank.Li@nxp.com&gt;
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Acked-by: Manivannan Sadhasivam &lt;manivannan.sadhasivam@linaro.org&gt;
</content>
</entry>
<entry>
<title>of/address: Constify of_busses[] array and pointers</title>
<updated>2024-10-15T13:58:36+00:00</updated>
<author>
<name>Rob Herring (Arm)</name>
<email>robh@kernel.org</email>
</author>
<published>2024-10-10T16:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d79616b04f0e08178ceb716a5d2ef60ab723d532'/>
<id>urn:sha1:d79616b04f0e08178ceb716a5d2ef60ab723d532</id>
<content type='text'>
The of_busses array is fixed, so it and all struct of_bus pointers can
be const.

Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20241010-dt-const-v1-7-87a51f558425@kernel.org
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Constify struct device_node function arguments</title>
<updated>2024-10-15T13:58:36+00:00</updated>
<author>
<name>Rob Herring (Arm)</name>
<email>robh@kernel.org</email>
</author>
<published>2024-10-10T16:27:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec8c2329da1a8695b3fc80ba67cad9dc75d9a3ec'/>
<id>urn:sha1:ec8c2329da1a8695b3fc80ba67cad9dc75d9a3ec</id>
<content type='text'>
Functions which don't change the refcount or otherwise modify struct
device_node can make struct device_node const.

Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20241010-dt-const-v1-3-87a51f558425@kernel.org
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/address: Add of_property_read_reg() helper</title>
<updated>2023-04-13T22:46:35+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-03-28T20:16:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff61bacd77f258bd2ed145efb69e5449b115d4fe'/>
<id>urn:sha1:ff61bacd77f258bd2ed145efb69e5449b115d4fe</id>
<content type='text'>
Add a helper, of_property_read_reg(), to read "reg" entries untranslated
address and size. This function is intended mainly for cases with an
untranslatable "reg" address (i.e. not MMIO). There's also a few
translatable cases such as address cells containing a bus chip-select
number.

Link: https://lore.kernel.org/r/20230328-dt-address-helpers-v1-5-e2456c3e77ab@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/address: Add of_range_count() helper</title>
<updated>2023-04-13T22:46:35+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-03-28T20:15:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b50c788a56964a900ebcc817c8a5ad35ddad87b6'/>
<id>urn:sha1:b50c788a56964a900ebcc817c8a5ad35ddad87b6</id>
<content type='text'>
Some users need a count of the number of ranges entries before
iterating over the entries. Typically this is for allocating some data
structure based on the size. Add a helper, of_range_count(), to get the
count. The helper must be called with an struct of_range_parser
initialized by of_range_parser_init().

Link: https://lore.kernel.org/r/20230328-dt-address-helpers-v1-4-e2456c3e77ab@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/address: Add of_range_to_resource() helper</title>
<updated>2023-04-13T22:46:35+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-03-28T20:15:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c75a79491835c50ca61938ae1ebd3ba5598f7410'/>
<id>urn:sha1:c75a79491835c50ca61938ae1ebd3ba5598f7410</id>
<content type='text'>
A few users need to convert a specific "ranges" entry into a struct
resource. Add a helper to similar to of_address_to_resource(). The
existing of_pci_range_to_resource() helper isn't really PCI specific,
so it can be used with the CONFIG_PCI check dropped.

Link: https://lore.kernel.org/r/20230328-dt-address-helpers-v1-2-e2456c3e77ab@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Introduce of_translate_dma_region()</title>
<updated>2023-01-25T10:48:27+00:00</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2023-01-20T17:42:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e251c21372c07694f547afe3c9828f7f6ef01267'/>
<id>urn:sha1:e251c21372c07694f547afe3c9828f7f6ef01267</id>
<content type='text'>
This function is similar to of_translate_dma_address() but also reads a
length in addition to an address from a device tree property.

Reviewed-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Link: https://lore.kernel.org/r/20230120174251.4004100-2-thierry.reding@gmail.com
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>of/address: introduce of_address_count() helper</title>
<updated>2022-10-16T22:58:54+00:00</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2022-10-08T11:56:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=16988c742968d5ceb2e832a57bd277f51f0a59d7'/>
<id>urn:sha1:16988c742968d5ceb2e832a57bd277f51f0a59d7</id>
<content type='text'>
Introduce of_address_count() helper to count the IO resources
instead of open-coding it.

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://lore.kernel.org/r/20221008115617.3583890-2-yangyingliang@huawei.com
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: address: Use IS_ENABLED() for !CONFIG_PCI</title>
<updated>2021-06-03T01:59:29+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2021-05-27T19:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3c0dc75774b488770f33598109161040d291367'/>
<id>urn:sha1:c3c0dc75774b488770f33598109161040d291367</id>
<content type='text'>
Convert address.c to use IS_ENABLED() instead of ifdefs for the
public PCI functions. This simplifies the ifdefs in of_address.h.

Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Link: https://lore.kernel.org/r/20210527194547.1287934-4-robh@kernel.org
</content>
</entry>
<entry>
<title>of: Merge of_get_address() and of_get_pci_address() implementations</title>
<updated>2021-06-03T01:59:28+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2021-05-27T19:45:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=050a2c62dfc7d9ef457405f6ab4b715e9a2e32d7'/>
<id>urn:sha1:050a2c62dfc7d9ef457405f6ab4b715e9a2e32d7</id>
<content type='text'>
of_get_address() and of_get_pci_address() are the same implementation
except of_get_pci_address() takes the PCI BAR number rather than an
index. Modify the of_get_address() implementation to work on either
index or BAR and provide wrapper functions for the existing functions.

Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Link: https://lore.kernel.org/r/20210527194547.1287934-3-robh@kernel.org
</content>
</entry>
</feed>
