Skip to content
Snippets Groups Projects
Commit 33770583 authored by Simon Glass's avatar Simon Glass Committed by Bin Meng
Browse files

x86: Change irq_already_routed to a local variable


This avoids using BSS before SDRAM is set up in SPL.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent a0c75f90
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
#include <asm/pci.h> #include <asm/pci.h>
#include <asm/pirq_routing.h> #include <asm/pirq_routing.h>
static bool irq_already_routed[16]; static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap,
bool irq_already_routed[])
static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap)
{ {
int i, link; int i, link;
u8 irq = 0; u8 irq = 0;
...@@ -55,9 +54,11 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num) ...@@ -55,9 +54,11 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num)
{ {
unsigned char irq_slot[MAX_INTX_ENTRIES]; unsigned char irq_slot[MAX_INTX_ENTRIES];
unsigned char pirq[CONFIG_MAX_PIRQ_LINKS]; unsigned char pirq[CONFIG_MAX_PIRQ_LINKS];
bool irq_already_routed[16];
int i, intx; int i, intx;
memset(pirq, 0, CONFIG_MAX_PIRQ_LINKS); memset(pirq, 0, CONFIG_MAX_PIRQ_LINKS);
memset(irq_already_routed, '\0', sizeof(irq_already_routed));
/* Set PCI IRQs */ /* Set PCI IRQs */
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
...@@ -83,7 +84,8 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num) ...@@ -83,7 +84,8 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num)
/* yet not routed */ /* yet not routed */
if (!pirq[link]) { if (!pirq[link]) {
irq = pirq_get_next_free_irq(dev, pirq, bitmap); irq = pirq_get_next_free_irq(dev, pirq, bitmap,
irq_already_routed);
pirq[link] = irq; pirq[link] = irq;
} else { } else {
irq = pirq[link]; irq = pirq[link];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment