diff mbox series

[U-Boot] PCI: Document pciauto_region_allocate()

Message ID 20180514205005.15760-1-tuomas.tynkkynen@iki.fi
State Accepted
Commit 5ce9aca8a61c6991b2ed6944f0c07c0015578d25
Delegated to: Tom Rini
Headers show
Series [U-Boot] PCI: Document pciauto_region_allocate() | expand

Commit Message

Tuomas Tynkkynen May 14, 2018, 8:50 p.m. UTC
Add a doc comment for pciauto_region_allocate().

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
---
This patch depends on [PATCH 2/2] PCI: autoconfig: Don't allocate 64-bit
addresses to 32-bit only resources.
---
 include/pci.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Simon Glass May 15, 2018, 6:28 p.m. UTC | #1
On 15 May 2018 at 06:50, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> wrote:
> Add a doc comment for pciauto_region_allocate().
>
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
> ---
> This patch depends on [PATCH 2/2] PCI: autoconfig: Don't allocate 64-bit
> addresses to 32-bit only resources.
> ---
>  include/pci.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini May 28, 2018, 7:12 p.m. UTC | #2
On Mon, May 14, 2018 at 11:50:05PM +0300, Tuomas Tynkkynen wrote:

> Add a doc comment for pciauto_region_allocate().
> 
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/include/pci.h b/include/pci.h
index 127d3c6a6f..8e27cbfaf1 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -680,6 +680,19 @@  extern int pci_write_config_dword(pci_dev_t dev, int where, u32 val);
 void pciauto_region_init(struct pci_region *res);
 void pciauto_region_align(struct pci_region *res, pci_size_t size);
 void pciauto_config_init(struct pci_controller *hose);
+
+/**
+ * pciauto_region_allocate() - Allocate resources from a PCI resource region
+ *
+ * Allocates @size bytes from the PCI resource @res. If @supports_64bit is
+ * false, the result will be guaranteed to fit in 32 bits.
+ *
+ * @res:		PCI region to allocate from
+ * @size:		Amount of bytes to allocate
+ * @bar:		Returns the PCI bus address of the allocated resource
+ * @supports_64bit:	Whether to allow allocations above the 32-bit boundary
+ * @return 0 if successful, -1 on failure
+ */
 int pciauto_region_allocate(struct pci_region *res, pci_size_t size,
 			    pci_addr_t *bar, bool supports_64bit);