diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-06-12 10:30:06 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-17 06:14:59 -0400 |
commit | 11ee5ac47b78d7e117c84147596a124ce6421a3a (patch) | |
tree | 2346d50c7cb7e6341c1d288547bf06b0a845a9db /drivers/iommu | |
parent | 643511b37eb72d831646bacafaeace1eeadf5a54 (diff) |
iommu/amd: Split enable_iommus() routine
Split the enable_iommus() routine so that a part of it can
run in early code.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index a5dbefb8e260..b82cf447724e 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -1379,7 +1379,7 @@ static void iommu_apply_resume_quirks(struct amd_iommu *iommu) | |||
1379 | * This function finally enables all IOMMUs found in the system after | 1379 | * This function finally enables all IOMMUs found in the system after |
1380 | * they have been initialized | 1380 | * they have been initialized |
1381 | */ | 1381 | */ |
1382 | static void enable_iommus(void) | 1382 | static void early_enable_iommus(void) |
1383 | { | 1383 | { |
1384 | struct amd_iommu *iommu; | 1384 | struct amd_iommu *iommu; |
1385 | 1385 | ||
@@ -1389,14 +1389,29 @@ static void enable_iommus(void) | |||
1389 | iommu_set_device_table(iommu); | 1389 | iommu_set_device_table(iommu); |
1390 | iommu_enable_command_buffer(iommu); | 1390 | iommu_enable_command_buffer(iommu); |
1391 | iommu_enable_event_buffer(iommu); | 1391 | iommu_enable_event_buffer(iommu); |
1392 | iommu_enable_ppr_log(iommu); | ||
1393 | iommu_enable_gt(iommu); | ||
1394 | iommu_set_exclusion_range(iommu); | 1392 | iommu_set_exclusion_range(iommu); |
1395 | iommu_enable(iommu); | 1393 | iommu_enable(iommu); |
1396 | iommu_flush_all_caches(iommu); | 1394 | iommu_flush_all_caches(iommu); |
1397 | } | 1395 | } |
1398 | } | 1396 | } |
1399 | 1397 | ||
1398 | static void enable_iommus_v2(void) | ||
1399 | { | ||
1400 | struct amd_iommu *iommu; | ||
1401 | |||
1402 | for_each_iommu(iommu) { | ||
1403 | iommu_enable_ppr_log(iommu); | ||
1404 | iommu_enable_gt(iommu); | ||
1405 | } | ||
1406 | } | ||
1407 | |||
1408 | static void enable_iommus(void) | ||
1409 | { | ||
1410 | early_enable_iommus(); | ||
1411 | |||
1412 | enable_iommus_v2(); | ||
1413 | } | ||
1414 | |||
1400 | static void disable_iommus(void) | 1415 | static void disable_iommus(void) |
1401 | { | 1416 | { |
1402 | struct amd_iommu *iommu; | 1417 | struct amd_iommu *iommu; |