[PATCH] powerpc/64s: use ibm,tlbiel-congruence-classes-(hash|radix) dt property
Benjamin Herrenschmidt
benh at kernel.crashing.org
Sat Apr 22 18:02:10 AEST 2017
On Sat, 2017-04-22 at 10:58 +1000, Nicholas Piggin wrote:
> +static void __init init_mmu_tlb_sets_hash(unsigned long node)
> +{
> + const __be32 *ptr;
> +
> + ptr = of_get_flat_dt_prop(node, "ibm,tlbiel-congruence-classes-hash", NULL);
> + if (ptr)
> + cur_cpu_spec->tlb_sets_hash = be32_to_cpup(ptr);
> +}
> +
> +static void __init init_mmu_tlb_sets_radix(unsigned long node)
> +{
> + const __be32 *ptr;
> +
> + ptr = of_get_flat_dt_prop(node, "ibm,tlbiel-congruence-classes-radix", NULL);
> + if (ptr)
> + cur_cpu_spec->tlb_sets_radix = be32_to_cpup(ptr);
> +}
> #else
> #define init_mmu_slb_size(node) do { } while(0)
> +#define init_mmu_hash_sets(node) do { } while(0)
> +#define init_mmu_radix_sets(node) do { } while(0)
> #endif
Why 2 functions ? I would have done one checking both props :-)
Anothe thing to do is remove the assembly TLB flush from cpu_setup_power.S.
That happens too early anyway and do it later, at MMU init.
In fact, I wonder ... a lot of the stuff in there still requires us to more
or less know the PVR of the CPU. We could move the call to after we've done
the early DT parsing I reckon.
That way we can use arch level to set things like LPCR appropriately.
Cheers,
Ben.
More information about the Linuxppc-dev
mailing list