diff mbox

[U-Boot,15/23] x86: irq: Get irq_router's bdf via dm_pci_get_bdf()

Message ID 1454319658-17431-16-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 819133d9f591bfc187218342702b2ff69eecca25
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng Feb. 1, 2016, 9:40 a.m. UTC
There is no need to parse PCH's <reg> property as we have already
a DM PCI API dm_pci_get_bdf() that can handle this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/cpu/irq.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Simon Glass Feb. 1, 2016, 4:20 p.m. UTC | #1
On 1 February 2016 at 02:40, Bin Meng <bmeng.cn@gmail.com> wrote:
> There is no need to parse PCH's <reg> property as we have already
> a DM PCI API dm_pci_get_bdf() that can handle this.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/cpu/irq.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested on Minnowmax:
Tested-by: Simon Glass <sjg@chromium.org>
Bin Meng Feb. 3, 2016, 4:33 a.m. UTC | #2
On Tue, Feb 2, 2016 at 12:20 AM, Simon Glass <sjg@chromium.org> wrote:
> On 1 February 2016 at 02:40, Bin Meng <bmeng.cn@gmail.com> wrote:
>> There is no need to parse PCH's <reg> property as we have already
>> a DM PCI API dm_pci_get_bdf() that can handle this.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/cpu/irq.c | 9 +--------
>>  1 file changed, 1 insertion(+), 8 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Tested on Minnowmax:
> Tested-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86/master, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index 0b36ace..cc0297f 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -86,26 +86,19 @@  static inline void fill_irq_info(struct irq_info *slot, int bus, int device,
 static int create_pirq_routing_table(struct udevice *dev)
 {
 	const void *blob = gd->fdt_blob;
-	struct fdt_pci_addr addr;
 	int node;
 	int len, count;
 	const u32 *cell;
 	struct irq_routing_table *rt;
 	struct irq_info *slot, *slot_base;
 	int irq_entries = 0;
-	int parent;
 	int i;
 	int ret;
 
 	node = dev->of_offset;
-	parent = dev->parent->of_offset;
-	ret = fdtdec_get_pci_addr(blob, parent, FDT_PCI_SPACE_CONFIG,
-				  "reg", &addr);
-	if (ret)
-		return ret;
 
 	/* extract the bdf from fdt_pci_addr */
-	irq_router.bdf = addr.phys_hi & 0xffff00;
+	irq_router.bdf = dm_pci_get_bdf(dev->parent);
 
 	ret = fdt_find_string(blob, node, "intel,pirq-config", "pci");
 	if (!ret) {