diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/setup.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 36df46eaba24..dd2545fc9947 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -499,6 +499,39 @@ static void __init find_and_init_phbs(void) | |||
499 | of_pci_check_probe_only(); | 499 | of_pci_check_probe_only(); |
500 | } | 500 | } |
501 | 501 | ||
502 | static void pseries_setup_rfi_flush(void) | ||
503 | { | ||
504 | struct h_cpu_char_result result; | ||
505 | enum l1d_flush_type types; | ||
506 | bool enable; | ||
507 | long rc; | ||
508 | |||
509 | /* Enable by default */ | ||
510 | enable = true; | ||
511 | |||
512 | rc = plpar_get_cpu_characteristics(&result); | ||
513 | if (rc == H_SUCCESS) { | ||
514 | types = L1D_FLUSH_NONE; | ||
515 | |||
516 | if (result.character & H_CPU_CHAR_L1D_FLUSH_TRIG2) | ||
517 | types |= L1D_FLUSH_MTTRIG; | ||
518 | if (result.character & H_CPU_CHAR_L1D_FLUSH_ORI30) | ||
519 | types |= L1D_FLUSH_ORI; | ||
520 | |||
521 | /* Use fallback if nothing set in hcall */ | ||
522 | if (types == L1D_FLUSH_NONE) | ||
523 | types = L1D_FLUSH_FALLBACK; | ||
524 | |||
525 | if (!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) | ||
526 | enable = false; | ||
527 | } else { | ||
528 | /* Default to fallback if case hcall is not available */ | ||
529 | types = L1D_FLUSH_FALLBACK; | ||
530 | } | ||
531 | |||
532 | setup_rfi_flush(types, enable); | ||
533 | } | ||
534 | |||
502 | static void __init pSeries_setup_arch(void) | 535 | static void __init pSeries_setup_arch(void) |
503 | { | 536 | { |
504 | set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); | 537 | set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); |
@@ -515,7 +548,9 @@ static void __init pSeries_setup_arch(void) | |||
515 | 548 | ||
516 | fwnmi_init(); | 549 | fwnmi_init(); |
517 | 550 | ||
518 | /* By default, only probe PCI (can be overriden by rtas_pci) */ | 551 | pseries_setup_rfi_flush(); |
552 | |||
553 | /* By default, only probe PCI (can be overridden by rtas_pci) */ | ||
519 | pci_add_flags(PCI_PROBE_ONLY); | 554 | pci_add_flags(PCI_PROBE_ONLY); |
520 | 555 | ||
521 | /* Find and initialize PCI host bridges */ | 556 | /* Find and initialize PCI host bridges */ |