summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuneet Saxena <puneets@nvidia.com>2012-01-20 15:31:55 +0530
committerPuneet Saxena <puneets@nvidia.com>2012-02-07 02:05:29 -0800
commitf116864a29c5b29ed5b63c6aafc93442ba35f483 (patch)
treeeb6d7b7521f88e75f13bb0ef8429a18708228c9b
parentfbe8695649c2302a6513ebb4a24b3ce2d17c9e96 (diff)
video: tegra: Change the clock settings for LCD driver
As clock source for graphics related clocks is different for Tegra2 and Tegra3, define it under platform specific directories. BUG=chromium-os:23496 TEST=Build ok for Cardhu, Waluigi and Seaboard. Tested on Waluigi. Original work by - Mayuresh Kulkarni <mkulkarni@nvidia.com> Change-Id: I6cee11df5e75eaf3836565c4fa4f3ab3e45d8cac Signed-off-by: Puneet Saxena <puneets@nvidia.com> Reviewed-on: https://gerrit.chromium.org/gerrit/14700
-rw-r--r--arch/arm/cpu/armv7/tegra2/Makefile1
-rw-r--r--arch/arm/cpu/armv7/tegra2/display.c35
-rw-r--r--arch/arm/cpu/armv7/tegra3/Makefile2
-rw-r--r--arch/arm/cpu/armv7/tegra3/display.c40
-rw-r--r--arch/arm/include/asm/arch-tegra/display.h3
-rw-r--r--drivers/video/tegra.c15
6 files changed, 82 insertions, 14 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/Makefile b/arch/arm/cpu/armv7/tegra2/Makefile
index 76457d9cf6..0c1f989de1 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -37,6 +37,7 @@ COBJS-y := board.o pinmux.o sys_info.o
COBJS-$(CONFIG_TEGRA2_LP0) += warmboot.o
COBJS-$(CONFIG_TEGRA2_LP0) += warmboot_avp.o
+COBJS-$(CONFIG_VIDEO_TEGRA) += display.o
SOBJS := $(SOBJS-y)
COBJS := $(COBJS-y)
diff --git a/arch/arm/cpu/armv7/tegra2/display.c b/arch/arm/cpu/armv7/tegra2/display.c
new file mode 100644
index 0000000000..eb28dd3062
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/display.c
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2011
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <common.h>
+#include <asm/clocks.h>
+#include <asm/arch/clock.h>
+
+void display_clk_init(void)
+{
+ /* TODO: Put this into the FDT when we have clock support there */
+ clock_start_periph_pll(PERIPH_ID_3D, CLOCK_ID_MEMORY, CLK_300M);
+ clock_start_periph_pll(PERIPH_ID_2D, CLOCK_ID_MEMORY, CLK_300M);
+ clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_PERIPH, CLK_144M);
+ clock_start_periph_pll(PERIPH_ID_DISP1, CLOCK_ID_CGENERAL, CLK_600M);
+ clock_start_periph_pll(PERIPH_ID_PWM, CLOCK_ID_SFROM32KHZ, CLK_32768);
+}
diff --git a/arch/arm/cpu/armv7/tegra3/Makefile b/arch/arm/cpu/armv7/tegra3/Makefile
index 0fe1db2a93..3a4bc802c5 100644
--- a/arch/arm/cpu/armv7/tegra3/Makefile
+++ b/arch/arm/cpu/armv7/tegra3/Makefile
@@ -29,6 +29,8 @@ LIB = $(obj)lib$(SOC).o
COBJS-y := board.o pinmux.o sys_info.o
+COBJS-$(CONFIG_VIDEO_TEGRA) += display.o
+
COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
diff --git a/arch/arm/cpu/armv7/tegra3/display.c b/arch/arm/cpu/armv7/tegra3/display.c
new file mode 100644
index 0000000000..8f67af77fc
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra3/display.c
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2011
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <common.h>
+#include <asm/clocks.h>
+#include <asm/arch/clock.h>
+
+void display_clk_init(void)
+{
+ /* TODO: Put this into the FDT when we have clock support there */
+ clock_start_periph_pll(PERIPH_ID_VI, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_3D, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_2D, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_CGENERAL, CLK_114M);
+ clock_start_periph_pll(PERIPH_ID_3D2, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_EPP, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_VDE, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_MPE, CLOCK_ID_CGENERAL, CLK_228M);
+ clock_start_periph_pll(PERIPH_ID_DISP1, CLOCK_ID_PERIPH, CLK_408M);
+ clock_start_periph_pll(PERIPH_ID_PWM, CLOCK_ID_PERIPH, CLK_3_1875M);
+}
diff --git a/arch/arm/include/asm/arch-tegra/display.h b/arch/arm/include/asm/arch-tegra/display.h
index 758dd3b0af..140f416ac9 100644
--- a/arch/arm/include/asm/arch-tegra/display.h
+++ b/arch/arm/include/asm/arch-tegra/display.h
@@ -47,4 +47,7 @@ struct fdt_lcd;
/* Register a new display based on the given configuration */
void tegra2_display_register(struct fdt_lcd *config);
+ /* Initialize platform specific display clocks */
+void display_clk_init(void);
+
#endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 38b3ba69c2..78f6360416 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -22,8 +22,6 @@
#include <common.h>
#include <lcd.h>
#include <fdt_decode.h>
-#include <asm/clocks.h>
-#include <asm/arch/clock.h>
#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch-tegra/power.h>
@@ -74,17 +72,6 @@ char lcd_cursor_enabled; /* set initial value to false */
ushort lcd_cursor_width;
ushort lcd_cursor_height;
-
-static void clk_init(void)
-{
- /* TODO: Put this into the FDT when we have clock support there */
- clock_start_periph_pll(PERIPH_ID_3D, CLOCK_ID_MEMORY, CLK_300M);
- clock_start_periph_pll(PERIPH_ID_2D, CLOCK_ID_MEMORY, CLK_300M);
- clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_PERIPH, CLK_144M);
- clock_start_periph_pll(PERIPH_ID_DISP1, CLOCK_ID_CGENERAL, CLK_600M);
- clock_start_periph_pll(PERIPH_ID_PWM, CLOCK_ID_SFROM32KHZ, CLK_32768);
-}
-
#if defined(CONFIG_TEGRA2)
/*
* The PINMUX macro is used per board to setup the pinmux configuration.
@@ -133,7 +120,7 @@ struct pingroup_config pinmux_cros_1[] = {
/* Initialize the Tegra LCD panel and controller */
void init_lcd(struct fdt_lcd *config)
{
- clk_init();
+ display_clk_init();
power_enable_partition(POWERP_3D);
tegra2_display_register(config);
}