Skip to content

Commit 608b421

Browse files
ozbenhmpe
authored andcommitted
powerpc/64: Hard code cache geometry on POWER8
All shipping firmware versions have it wrong in the device-tree Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 65e01f3 commit 608b421

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

arch/powerpc/kernel/setup_64.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,27 @@ static bool __init parse_cache_info(struct device_node *np,
472472

473473
void __init initialize_cache_info(void)
474474
{
475-
struct device_node *cpu, *l2, *l3 = NULL;
475+
struct device_node *cpu = NULL, *l2, *l3 = NULL;
476+
u32 pvr;
476477

477478
DBG(" -> initialize_cache_info()\n");
478479

479-
cpu = of_find_node_by_type(NULL, "cpu");
480+
/*
481+
* All shipping POWER8 machines have a firmware bug that
482+
* puts incorrect information in the device-tree. This will
483+
* be (hopefully) fixed for future chips but for now hard
484+
* code the values if we are running on one of these
485+
*/
486+
pvr = PVR_VER(mfspr(SPRN_PVR));
487+
if (pvr == PVR_POWER8 || pvr == PVR_POWER8E ||
488+
pvr == PVR_POWER8NVL) {
489+
/* size lsize blk sets */
490+
init_cache_info(&ppc64_caches.l1i, 0x8000, 128, 128, 32);
491+
init_cache_info(&ppc64_caches.l1d, 0x10000, 128, 128, 64);
492+
init_cache_info(&ppc64_caches.l2, 0x80000, 128, 0, 512);
493+
init_cache_info(&ppc64_caches.l3, 0x800000, 128, 0, 8192);
494+
} else
495+
cpu = of_find_node_by_type(NULL, "cpu");
480496

481497
/*
482498
* We're assuming *all* of the CPUs have the same

0 commit comments

Comments
 (0)