From aee444f453f38e53f3e2ac54b560707616767869 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Mon, 22 Apr 2013 16:03:11 -0700 Subject: exynos5250: ungate the product ID register This makes sure that the product ID (PRO_ID) register can be read when the OS kernel is figuring out what kind of CPU it's running on. For historical reference, the original U-Boot code seems to have worked basically by accident here. The hardware has a quirk where by reading the value before gating the IP block keeps the value persistent. U-Boot reads the chip ID early on to distinguish between chip family, but we do not mix code the same way so we do not read the chip ID. Since the value has been read before the clock gating happens, the value remains available for the kernel to use during the decompression stage. We don't want to rely on that behavior when using coreboot. Instead the kernel should gate unused IPs. (credit to Gabe for finding symptom in the kernel) Change-Id: Iaa21e6e718b9000b5558f568020f393779fd208e Signed-off-by: Gabe Black Signed-off-by: David Hendricks Reviewed-on: http://review.coreboot.org/3121 Reviewed-by: Ronald G. Minnich Reviewed-by: Stefan Reinauer Tested-by: build bot (Jenkins) --- src/cpu/samsung/exynos5250/clock_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/samsung/exynos5250/clock_init.c b/src/cpu/samsung/exynos5250/clock_init.c index c94cadfbd4..0989b88bb5 100644 --- a/src/cpu/samsung/exynos5250/clock_init.c +++ b/src/cpu/samsung/exynos5250/clock_init.c @@ -416,7 +416,12 @@ void clock_gate(void) CLK_SPI2_MASK | CLK_SPI0_MASK); - /* CLK_GATE_IP_PERIS */ + /* + * CLK_GATE_IP_PERIS + * Note: Keep CHIPID_APBIF ungated to ensure reading the product ID + * register (PRO_ID) works correctly when the OS kernel determines + * which chip it is running on. + */ clrbits_le32(&clk->gate_ip_peris, CLK_RTC_MASK | CLK_TZPC9_MASK | CLK_TZPC8_MASK | @@ -427,8 +432,7 @@ void clock_gate(void) CLK_TZPC3_MASK | CLK_TZPC2_MASK | CLK_TZPC1_MASK | - CLK_TZPC0_MASK | - CLK_CHIPID_MASK); + CLK_TZPC0_MASK); /* CLK_GATE_BLOCK */ clrbits_le32(&clk->gate_block, CLK_ACP_MASK); -- cgit v1.2.3