Skip to contentSkip to conversation

sunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option

PATCH New Hans de Goede 2 participants 2 messages Oct 23, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option

Add a Kconfig option which users can select when they want to boot older kernels, e.g. the linux-sunxi 3.4 kernels. For now this just forces the pll5 "p" value to 1 (divide by 2) as that is what those kernels are hardcoded too, in the future this may enable further workarounds.

--
Changes in v2:
-s/CONFIG_OLD_KERNEL_COMPAT/CONFIG_OLD_SUNXI_KERNEL_COMPAT. -Move the code block setting P(1) for old kernels to where P gets cleared

---
 arch/arm/cpu/armv7/sunxi/dram.c | 4 ++++
 board/sunxi/Kconfig             | 7 +++++++
 2 files changed, 11 insertions(+)
arch/arm/cpu/armv7/sunxi/dram.c +4 -0
index 0cbcf57..3cf3cbf 100644
@@ -262,6 +262,10 @@ static void mctl_setup_dram_clock(u32 clk, u32 mbus_clk)
 	reg_val &= ~CCM_PLL5_CTRL_K_MASK;		/* set K to 0 (x1) */
 	reg_val &= ~CCM_PLL5_CTRL_N_MASK;		/* set N to 0 (x0) */
 	reg_val &= ~CCM_PLL5_CTRL_P_MASK;		/* set P to 0 (x1) */
+#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
+	/* Old kernels are hardcoded to P=1 (divide by 2) */
+	reg_val |= CCM_PLL5_CTRL_P(1);
+#endif
 	if (clk >= 540 && clk < 552) {
 		/* dram = 540MHz */
 		reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
board/sunxi/Kconfig +7 -0
index 121d7d0..fb650c0 100644
@@ -20,6 +20,13 @@ config SYS_SOC
 config FDTFILE
 	string "Default fdtfile env setting for this board"
 
+config OLD_SUNXI_KERNEL_COMPAT
+	boolean "Enable workarounds for booting old kernels"
+	default n
+	---help---
+	Set this to enable various workarounds for old kernels, this results in
+	sub-optimal settings for newer kernels, only enable if needed.
+
 config MMC0_CD_PIN
 	string "Card detect pin for mmc0"
 	default ""
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/1 sunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option

Quoted 6 lines · Hans de Goede

Add a Kconfig option which users can select when they want to boot older kernels, e.g. the linux-sunxi 3.4 kernels. For now this just forces the pll5 "p" value to 1 (divide by 2) as that is what those kernels are hardcoded too, in the future this may enable further workarounds.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141023/f0b08a0c/attachment.pgp>