r4957 - developers/werner/gta03/cam/patches

werner at docs.openmoko.org werner at docs.openmoko.org
Wed Mar 11 11:12:05 CET 2009


Author: werner
Date: 2009-03-11 11:12:04 +0100 (Wed, 11 Mar 2009)
New Revision: 4957

Added:
   developers/werner/gta03/cam/patches/add-real-camif-clock.patch
   developers/werner/gta03/cam/patches/rename-camera-clock.patch
   developers/werner/gta03/cam/patches/use-camera-clock.patch
Modified:
   developers/werner/gta03/cam/patches/series
Log:
Patches to recover from Qi's denial of clock surprise attack.
Fixed a misnomer as well.



Added: developers/werner/gta03/cam/patches/add-real-camif-clock.patch
===================================================================
--- developers/werner/gta03/cam/patches/add-real-camif-clock.patch	                        (rev 0)
+++ developers/werner/gta03/cam/patches/add-real-camif-clock.patch	2009-03-11 10:12:04 UTC (rev 4957)
@@ -0,0 +1,82 @@
+Add real CAMIF clock to S3C6410
+
+This patch adds the real "camif" clock (off HCLK.)
+
+Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+--- 
+
+Index: cam/arch/arm/plat-s3c64xx/s3c6400-clock.c
+===================================================================
+--- cam.orig/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-03-11 17:22:16.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-03-11 17:57:11.000000000 +0800
+@@ -622,6 +622,28 @@
+ 	.reg_divider	= S3C_CLK_DIV0,
+ };
+ 
++static struct clk *clkset_camif_list[] = {
++	&clk_h,
++};
++
++static struct clk_sources clkset_camif = {
++	.sources	= clkset_camif_list,
++	.nr_sources	= ARRAY_SIZE(clkset_camif_list),
++};
++
++static struct clksrc_clk clk_camif = {
++	.clk	= {
++		.name		= "camif",
++		.id		= -1,
++		.ctrlbit        = S3C_CLKCON_HCLK_CAMIF,
++		.enable		= s3c64xx_hclk_ctrl,
++		.set_parent	= s3c64xx_setparent_clksrc,
++	},
++	.shift		= 0,
++	.mask		= 0,
++	.sources	= &clkset_camif,
++};
++
+ /* Clock initialisation code */
+ 
+ static struct clksrc_clk *init_parents[] = {
+@@ -639,6 +661,7 @@
+ 	&clk_audio1,
+ 	&clk_irda,
+ 	&clk_camif,
++	&clk_camera,
+ };
+ 
+ static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
+@@ -740,6 +763,7 @@
+ 	&clk_audio1.clk,
+ 	&clk_irda.clk,
+ 	&clk_camera.clk,
++	&clk_camif.clk,
+ 	&clk_arm,
+ };
+ 
+Index: cam/arch/arm/plat-s3c/include/plat/clock.h
+===================================================================
+--- cam.orig/arch/arm/plat-s3c/include/plat/clock.h	2009-03-11 17:21:59.000000000 +0800
++++ cam/arch/arm/plat-s3c/include/plat/clock.h	2009-03-11 17:22:44.000000000 +0800
+@@ -81,6 +81,7 @@
+ 
+ /* S3C64XX specific functions and clocks */
+ 
++extern int s3c64xx_hclk_ctrl(struct clk *clk, int enable);
+ extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable);
+ 
+ /* Init for pwm clock code */
+Index: cam/arch/arm/plat-s3c64xx/clock.c
+===================================================================
+--- cam.orig/arch/arm/plat-s3c64xx/clock.c	2009-03-11 17:21:59.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/clock.c	2009-03-11 17:22:44.000000000 +0800
+@@ -89,7 +89,7 @@
+ 	return s3c64xx_gate(S3C_PCLK_GATE, clk, enable);
+ }
+ 
+-static int s3c64xx_hclk_ctrl(struct clk *clk, int enable)
++int s3c64xx_hclk_ctrl(struct clk *clk, int enable)
+ {
+ 	return s3c64xx_gate(S3C_HCLK_GATE, clk, enable);
+ }

Added: developers/werner/gta03/cam/patches/rename-camera-clock.patch
===================================================================
--- developers/werner/gta03/cam/patches/rename-camera-clock.patch	                        (rev 0)
+++ developers/werner/gta03/cam/patches/rename-camera-clock.patch	2009-03-11 10:12:04 UTC (rev 4957)
@@ -0,0 +1,53 @@
+Rename CAMERA clock
+
+Identifiers related to the "camera" clock were mis-named as camif.
+This patch renames them.
+
+Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+--- 
+
+Index: cam/arch/arm/plat-s3c64xx/s3c6400-clock.c
+===================================================================
+--- cam.orig/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-03-11 17:21:59.000000000 +0800
++++ cam/arch/arm/plat-s3c64xx/s3c6400-clock.c	2009-03-11 17:22:16.000000000 +0800
+@@ -595,16 +595,16 @@
+ 	.reg_divider	= S3C_CLK_DIV2,
+ };
+ 
+-static struct clk *clkset_camif_list[] = {
++static struct clk *clkset_camera_list[] = {
+ 	&clk_h2,
+ };
+ 
+-static struct clk_sources clkset_camif = {
+-	.sources	= clkset_camif_list,
+-	.nr_sources	= ARRAY_SIZE(clkset_camif_list),
++static struct clk_sources clkset_camera = {
++	.sources	= clkset_camera_list,
++	.nr_sources	= ARRAY_SIZE(clkset_camera_list),
+ };
+ 
+-static struct clksrc_clk clk_camif = {
++static struct clksrc_clk clk_camera = {
+ 	.clk	= {
+ 		.name		= "camera",
+ 		.id		= -1,
+@@ -617,7 +617,7 @@
+ 	},
+ 	.shift		= 0,
+ 	.mask		= 0,
+-	.sources	= &clkset_camif,
++	.sources	= &clkset_camera,
+ 	.divider_shift	= S3C6400_CLKDIV0_CAM_SHIFT,
+ 	.reg_divider	= S3C_CLK_DIV0,
+ };
+@@ -739,7 +739,7 @@
+ 	&clk_audio0.clk,
+ 	&clk_audio1.clk,
+ 	&clk_irda.clk,
+-	&clk_camif.clk,
++	&clk_camera.clk,
+ 	&clk_arm,
+ };
+ 

Modified: developers/werner/gta03/cam/patches/series
===================================================================
--- developers/werner/gta03/cam/patches/series	2009-03-10 13:59:39 UTC (rev 4956)
+++ developers/werner/gta03/cam/patches/series	2009-03-11 10:12:04 UTC (rev 4957)
@@ -1,14 +1,5 @@
-# cleanup
-cleanup-camera-driver.patch
-cleanup-camif.patch
-cleanup-4xa_sensor.patch
-
-# reissue
-#add-64xx-cam-clock.patch
-
-# for Ben
-#fix-s3c64xx_roundrate_clksrc.patch
-#fix-s3c6400-clock-shift.patch
-
-#fix-camera-clock.patch
-#camera-adjust-mclk.patch
+#hack-s3c_device_usb.patch
+rename-camera-clock.patch
+add-real-camif-clock.patch
+defer-camera-powerup.patch
+use-camera-clock.patch

Added: developers/werner/gta03/cam/patches/use-camera-clock.patch
===================================================================
--- developers/werner/gta03/cam/patches/use-camera-clock.patch	                        (rev 0)
+++ developers/werner/gta03/cam/patches/use-camera-clock.patch	2009-03-11 10:12:04 UTC (rev 4957)
@@ -0,0 +1,27 @@
+Index: cam/drivers/media/video/s3c_camera_driver.c
+===================================================================
+--- cam.orig/drivers/media/video/s3c_camera_driver.c	2009-03-11 16:58:55.000000000 +0800
++++ cam/drivers/media/video/s3c_camera_driver.c	2009-03-11 17:03:50.000000000 +0800
+@@ -1749,6 +1749,7 @@
+ {
+ 	struct resource *res;
+ 	camif_cfg_t *codec, *preview;
++	struct clk *camif_clock;
+ 
+ 	/* Initialize fimc objects */
+ 	codec = s3c_camif_get_fimc_object(CODEC_MINOR);
+@@ -1795,6 +1796,14 @@
+ 	    PHYS_OFFSET + (MEM_SIZE - RESERVED_MEM) + YUV_MEM;
+ 	preview->pp_virt_buf = ioremap_nocache(preview->pp_phys_buf, RGB_MEM);
+ 
++	camif_clock = clk_get(&pdev->dev, "camif");
++	if (IS_ERR(camif_clock)) {
++		dev_err(&pdev->dev,
++		    "Failed to find camera interface clock source\n");
++		return PTR_ERR(cam_clock);
++	}
++	clk_enable(camif_clock);
++
+ 	/* Device init */
+ 	s3c_camif_init();
+ 	s3c_camif_init_codec(codec);




More information about the commitlog mailing list