[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080709184917.fba68fd0.akpm@linux-foundation.org>
Date: Wed, 9 Jul 2008 18:49:17 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Joerg Roedel <joerg.roedel@....com>
Cc: tglx@...utronix.de, mingo@...hat.com, linux-kernel@...r.kernel.org,
iommu@...ts.linux-foundation.org, bhavna.sarathy@....com,
Sebastian.Biemueller@....com, robert.richter@....com,
joro@...tes.org
Subject: Re: [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@....com> wrote:
> This patch adds functions to initialize the IOMMU hardware with information
> from ACPI and PCI.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@....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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists