From e4c3b484a4cdc5e3bfb0332f47adaaff827f62ab Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 15 Feb 2011 20:41:45 -0800 Subject: [PATCH 01/10] ARM: PL310: Add power control register definition Change-Id: Ia1f759aab15a241e8e29447622cd1e2998fa745c Signed-off-by: Todd Poynor --- arch/arm/include/asm/hardware/cache-l2x0.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index 787c06ada555..d62847df3df5 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h @@ -54,6 +54,7 @@ #define L2X0_LINE_TAG 0xF30 #define L2X0_DEBUG_CTRL 0xF40 #define L2X0_PREFETCH_OFFSET 0xF60 +#define L2X0_PWR_CTRL 0xF80 #ifndef __ASSEMBLY__ extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask); From 996d8ccfe7ee48dabe8f46358159985e0a410c08 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Wed, 16 Feb 2011 12:25:36 -0800 Subject: [PATCH 02/10] ARM: tegra: Enable PL310 dynamic clock gating The cache controller will stop its clock when idle after several clock cycles. Change-Id: Ifc9997d4e7fd4f1e3c6129bac2fd42f8995a069e Signed-off-by: Todd Poynor --- arch/arm/mach-tegra/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 5283a17f3d2b..b1275e7207f8 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -89,6 +89,7 @@ void __init tegra_init_cache(void) writel(0x331, p + L2X0_TAG_LATENCY_CTRL); writel(0x441, p + L2X0_DATA_LATENCY_CTRL); writel(7, p + L2X0_PREFETCH_OFFSET); + writel(2, p + L2X0_PWR_CTRL); l2x0_init(p, 0x7C480001, 0x8200c3fe); #endif From 91406b03fa4add49db13e55c3220911be55d9883 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 15 Feb 2011 11:48:42 -0800 Subject: [PATCH 03/10] ARM: Cortex-A9: Enable dynamic clock gating Enable dynamic high level clock gating for Cortex-A9 CPUs, as described in 2.3.3 "Dynamic high level clock gating" of the Cortex-A9 TRM. This may cut the clock of the integer core, system control block, and Data Engine in certain conditions. Add ARM errata 720791 to avoid corrupting the Jazelle instruction stream on earlier Cortex-A9 revisions. Change-Id: I48e51d907e593f26982ea91b0a811553f68e3c86 Signed-off-by: Todd Poynor --- arch/arm/Kconfig | 10 ++++++++++ arch/arm/mm/proc-v7.S | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9c26ba7244fb..34c5f56a91e0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1115,6 +1115,16 @@ config ARM_ERRATA_743622 visible impact on the overall performance or power consumption of the processor. +config ARM_ERRATA_720791 + bool "ARM errata: Dynamic high-level clock gating corrupts the Jazelle instruction stream" + depends on CPU_V7 + help + This option enables the workaround for the 720791 Cortex-A9 + (r1p0..r1p2) erratum. The Jazelle instruction stream may be + corrupted when dynamic high-level clock gating is enabled. + This workaround disables gating the Core clock when the Instruction + side is waiting for a Page Table Walk answer or linefill completion. + endmenu source "arch/arm/common/Kconfig" diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 197f21bed5e9..f5e22615a1fe 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -238,6 +238,16 @@ __v7_setup: 2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number teq r0, r10 bne 3f + cmp r6, #0x10 @ power ctrl reg added r1p0 + mrcge p15, 0, r10, c15, c0, 0 @ read power control register + orrge r10, r10, #1 @ enable dynamic clock gating + mcrge p15, 0, r10, c15, c0, 0 @ write power control register +#ifdef CONFIG_ARM_ERRATA_720791 + teq r5, #0x00100000 @ only present in r1p* + mrceq p15, 0, r10, c15, c0, 2 @ read "chicken power ctrl" reg + orreq r10, r10, #0x30 @ disable core clk gate on + mcreq p15, 0, r10, c15, c0, 2 @ instr-side waits +#endif #ifdef CONFIG_ARM_ERRATA_742230 cmp r6, #0x22 @ only present up to r2p2 mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register From bb2a3184bc3c7d1500a1fc6691d83e318e89f61c Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Thu, 24 Feb 2011 16:24:37 -0800 Subject: [PATCH 04/10] ARM: tegra: PL310 restore dynamic clock gating on resume Tegra 2.6.36 code needs to restore PL310 dynamic clock gating upon resume from a power event. As of 2.6.39 the PL310 is re-init'ed from scratch upon resume, and this patch can be dropped. Change-Id: I8c1fb1add3c3cfcffff58fab642b84d8d5a7a90a Signed-off-by: Todd Poynor --- arch/arm/mach-tegra/cortex-a9.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-tegra/cortex-a9.S b/arch/arm/mach-tegra/cortex-a9.S index 91d787f2adcb..1ca815d0fab8 100644 --- a/arch/arm/mach-tegra/cortex-a9.S +++ b/arch/arm/mach-tegra/cortex-a9.S @@ -536,6 +536,8 @@ ENTRY(__cortex_a9_l2x0_restart) str r6, [r9, #L2X0_DATA_LATENCY_CTRL] str r7, [r9, #L2X0_PREFETCH_OFFSET] str r4, [r9, #L2X0_AUX_CTRL] + mov r4, #0x2 @ L2X0_DYNAMIC_CLK_GATING_EN + str r4, [r9, #L2X0_PWR_CTRL] cmp r0, #0 beq __reenable_l2x0 From cf030d95bbf4a4bbd9049e5590953ea30a814cb5 Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Mon, 3 Jan 2011 17:26:25 -0800 Subject: [PATCH 05/10] [ARM] tegra: hdmi nvhdcp driver Device /dev/nvhdcpX is used to manage NVHDCP on framebuffer /dev/fbX. These devices are created on hdmi driver initialition when it is attached to dc. Currently only one nvhdcp device may be created. An ioctl interface is in video/nvhdcp.h Check for repeaters and store repeater info. userspace application queries this status to authenticate the connection. When authentication fails, auto-renegotiate every 1.75 seconds. Give up after 5 failed attempts, reset after hotplug or policy change. use TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND in tegra_dc_out.flags in board panel configuration to select a different default policy at probe. Currently only TEGRA_DC_OUT_NVHDCP_POLICY_ALWAYS_ON is supported. Change-Id: I0db66fc86096b98d2604544061721d291523de75 Reviewed-by: Jon Mayo Tested-by: Jon Mayo Reviewed-by: Phillip Smith Reviewed-by: Yu-Huan Hsu Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/include/mach/dc.h | 10 +- drivers/video/tegra/dc/Makefile | 3 +- drivers/video/tegra/dc/hdmi.c | 42 +- drivers/video/tegra/dc/hdmi.h | 6 + drivers/video/tegra/dc/hdmi_reg.h | 18 + drivers/video/tegra/dc/nvhdcp.c | 1230 +++++++++++++++++++++++++ drivers/video/tegra/dc/nvhdcp.h | 29 + include/video/nvhdcp.h | 91 ++ 8 files changed, 1421 insertions(+), 8 deletions(-) create mode 100644 drivers/video/tegra/dc/nvhdcp.c create mode 100644 drivers/video/tegra/dc/nvhdcp.h create mode 100644 include/video/nvhdcp.h diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index f5a64cba61ae..9bd26194f0c9 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -73,9 +73,13 @@ struct tegra_dc_out { int (*disable)(void); }; -#define TEGRA_DC_OUT_HOTPLUG_HIGH (0 << 1) -#define TEGRA_DC_OUT_HOTPLUG_LOW (1 << 1) -#define TEGRA_DC_OUT_HOTPLUG_MASK (1 << 1) +/* bits for tegra_dc_out.flags */ +#define TEGRA_DC_OUT_HOTPLUG_HIGH (0 << 1) +#define TEGRA_DC_OUT_HOTPLUG_LOW (1 << 1) +#define TEGRA_DC_OUT_HOTPLUG_MASK (1 << 1) +#define TEGRA_DC_OUT_NVHDCP_POLICY_ALWAYS_ON (0 << 2) +#define TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND (1 << 2) +#define TEGRA_DC_OUT_NVHDCP_POLICY_MASK (1 << 2) #define TEGRA_DC_ALIGN_MSB 0 #define TEGRA_DC_ALIGN_LSB 1 diff --git a/drivers/video/tegra/dc/Makefile b/drivers/video/tegra/dc/Makefile index eb39d5d28e92..4567eba8cb93 100644 --- a/drivers/video/tegra/dc/Makefile +++ b/drivers/video/tegra/dc/Makefile @@ -1,4 +1,5 @@ obj-y += dc.o obj-y += rgb.o obj-y += hdmi.o -obj-y += edid.o \ No newline at end of file +obj-y += nvhdcp.o +obj-y += edid.o diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index cebcdc35d889..8b8afe22254d 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -31,11 +31,14 @@ #include #include +#include