lkml.org 
[lkml]   [2008]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/34] AMD IOMMU: add functions for IOMMU hardware initialization from ACPI
On Thu, 26 Jun 2008 21:27:47 +0200 Joerg Roedel <joerg.roedel@amd.com> wrote:

> This patch adds functions to initialize the IOMMU hardware with information
> from ACPI and PCI.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
> arch/x86/kernel/amd_iommu_init.c | 125 ++++++++++++++++++++++++++++++++++++++
> 1 files changed, 125 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
> index 4c37abb..8ec48f1 100644
> --- a/arch/x86/kernel/amd_iommu_init.c
> +++ b/arch/x86/kernel/amd_iommu_init.c
> @@ -353,3 +353,128 @@ static void __init set_device_exclusion_range(u16 devid, struct ivmd_header *m)
> }
> }
>
> +static void __init init_iommu_from_pci(struct amd_iommu *iommu)
> +{
> + int bus = PCI_BUS(iommu->devid);
> + int dev = PCI_SLOT(iommu->devid);
> + int fn = PCI_FUNC(iommu->devid);
> + int cap_ptr = iommu->cap_ptr;
> + u32 range;
> +
> + iommu->cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_CAP_HDR_OFFSET);
> +
> + range = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET);
> + iommu->first_device = DEVID(MMIO_GET_BUS(range), MMIO_GET_FD(range));
> + iommu->last_device = DEVID(MMIO_GET_BUS(range), MMIO_GET_LD(range));
> +}
> +
> +static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
> + struct ivhd_header *h)
> +{
> + u8 *p = (u8 *)h;
> + u8 *end = p, flags = 0;
> + u16 dev_i, devid = 0, devid_start = 0, devid_to = 0;
> + u32 ext_flags = 0;
> + bool alias = 0;

Using `false' would be more conventional.

> + alias = 1;

`true'.

etc.




\
 
 \ /
  Last update: 2008-07-10 03:57    [W:0.411 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site