From 120e279f2f0b314ce6fe096d7d35aa4b00bac0b3 Mon Sep 17 00:00:00 2001 From: Chen Xinke Date: Fri, 1 Jun 2018 15:04:07 +0800 Subject: [PATCH] Fix LS7A PCIE IRQ number allocation bug found by AQ. Change-Id: I208a0a3e5c1d924bd941ce985c63ee205c9878d8 --- Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c b/Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c index fb01e551..d8a58f3d 100644 --- a/Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c +++ b/Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c @@ -1290,12 +1290,27 @@ void ls_pcie_interrupt_fixup(void) } /*PCIE*/ - for(i = 0;i < 12;i++) { + /*PCIE F0/F1*/ + for(i = 0;i < 6;i++) { dev = _pci_make_tag(0, 9 + i, 0); val = _pci_conf_read(dev, 0x00); if ( val != 0xffffffff) // device on the slot _pci_conf_write8(dev, 0x3c, base + 32 + i); } + /*PCIE G0/G1*/ + for(i = 0;i < 4;i++) { + dev = _pci_make_tag(0, 15 + i, 0); + val = _pci_conf_read(dev, 0x00); + if ( val != 0xffffffff) // device on the slot + _pci_conf_write8(dev, 0x3c, base + 40 + i); + } + /*PCIE H*/ + for(i = 0;i < 2;i++) { + dev = _pci_make_tag(0, 19 + i, 0); + val = _pci_conf_read(dev, 0x00); + if ( val != 0xffffffff) // device on the slot + _pci_conf_write8(dev, 0x3c, base + 38 + i); + } } extern struct efi_memory_map_loongson g_map;