Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373563
b: refs/heads/master
c: 235dacb
h: refs/heads/master
i:
  373561: eaa5e23
  373559: 5900b7e
v: v3
  • Loading branch information
Joerg Roedel committed Apr 19, 2013
1 parent 76fbd0f commit f2eaaac
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31cff67f6b00456cac8890e8fd97694cadc754b8
refs/heads/master: 235dacbc795bb7ccf69db8ad9ff1587314cf857d
38 changes: 38 additions & 0 deletions trunk/drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ enum iommu_init_state {
IOMMU_INIT_ERROR,
};

/* Early ioapic and hpet maps from kernel command line */
#define EARLY_MAP_SIZE 4
static struct devid_map __initdata early_ioapic_map[EARLY_MAP_SIZE];
static struct devid_map __initdata early_hpet_map[EARLY_MAP_SIZE];
static int __initdata early_ioapic_map_size;
static int __initdata early_hpet_map_size;

static enum iommu_init_state init_state = IOMMU_START_STATE;

static int amd_iommu_enable_interrupts(void);
Expand Down Expand Up @@ -738,6 +745,31 @@ static int __init add_special_device(u8 type, u8 id, u16 devid, bool cmd_line)
return 0;
}

static int __init add_early_maps(void)
{
int i, ret;

for (i = 0; i < early_ioapic_map_size; ++i) {
ret = add_special_device(IVHD_SPECIAL_IOAPIC,
early_ioapic_map[i].id,
early_ioapic_map[i].devid,
early_ioapic_map[i].cmd_line);
if (ret)
return ret;
}

for (i = 0; i < early_hpet_map_size; ++i) {
ret = add_special_device(IVHD_SPECIAL_HPET,
early_hpet_map[i].id,
early_hpet_map[i].devid,
early_hpet_map[i].cmd_line);
if (ret)
return ret;
}

return 0;
}

/*
* Reads the device exclusion range from ACPI and initializes the IOMMU with
* it
Expand Down Expand Up @@ -774,6 +806,12 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
u32 dev_i, ext_flags = 0;
bool alias = false;
struct ivhd_entry *e;
int ret;


ret = add_early_maps();
if (ret)
return ret;

/*
* First save the recommended feature enable bits from ACPI
Expand Down

0 comments on commit f2eaaac

Please sign in to comment.