当前位置:网站首页>高通平台 Camera 之 MCLK 配置
高通平台 Camera 之 MCLK 配置
2022-06-28 04:52:00 【bobuddy】
前言
MCLK 是主控芯片 提供给 cam sensor的正常工作的频率,
Qcom 平台一般未24MHz,由其他时钟源分频而来,实测在23.8MHz左右。
在打开相机的时候,才可以测到这个时钟。
cam snesor 可以使用平台提供的时钟或者自带时钟源,但软件上配置要一致。
平台时钟源频率可以修改,若没有可以新增一组。
硬件平台:msm8909、msm8953
软件平台:Android8.1、Android9.0
参考文档:
KBA_170619001341_3__Camera_How_to_change_MCLK_driv.pdf
目录
前言
调试 查看 cam mclk
调试 查看 mclk 频率
调试 修改 mclk 频率
调试 修改 mclk 驱动能力
调试 打开 mclk 相关的驱动 log
调试 查看 cam mclk
TIMER_CLK 指摄像头传感器所连接的PHY 接口的工作频率。
例如,PHY0 CAMSS_PHY0_CSI0PHYTIMER_CLK。
路径:
kernel/arch/arm/boot/dts/msm/msmXXXX-camera.dtsi
可以在上述文件中设置,其中XXX 指正在使用MSM 芯片组。
另外,也可在摄像头数据流传输期间确认,方法是通过adb shell 检查相应的时钟信息。
可通过命令提示窗口发出以下命令以确认PHY0 定时器时钟值: /* msm8909 Android5.0/8.0 */
指令:
adb root
adb remount
adb shell
cd /sys/kernel/debug/clk/gcc_camss_csi0phytimer_clk
cd /sys/kernel/debug/clk/gcc_camss_mclk0_clk/
cat measure
200000146
24000292
调试 查看 mclk 频率
camera 运行的时候,这个值就是 mclk的输出时钟频率(默认23800000)
adb shell cat sys/kernel/debug/clk/gcc_camss_mclk0_clk/measure
补充:
msm8909 默认 24M 具体配置在 kernel/drivers/clk/qcom/clock-gcc-8909.c
修改方式如下,例 修改为 27MHz
查看当前mclk的信息
adb shell
/sys/kernel/debug/clk/gcc_camss_mclk0_clk
echo 1 > enable // 让mclk直接输出camera正常工作频率的时钟
cat measure // 在camera 正常工作的时候 可以查看当前时钟频率
cat list_rates // 查看当前mclk支持的频率列表
调试 修改 mclk 频率
camera 修改默认 mclk 时钟配置 // msm8909
代码如:
Kernel 修改时钟源
kernel/drivers/clk/qcom/clock-gcc-8909.c
@@ -837,6 +837,12 @@ static struct rcg_clk camss_gp1_clk_src = {
static struct clk_freq_tbl ftbl_gcc_camss_mclk0_1_clk[] = {
F( 24000000, gpll2, 1, 1, 33),
+ F( 27000000, gpll0, 1, 2, 59),
+/* Begin: add by sys for set camera0 mclk 27MHz */
+ // set cma0_mclk 27MHz add by sys
+ // F(f, s, div, m, n)
+ // target clock=(source clock/div)*(M/N), 27=(800/1)*(2/59)
+/* End: add by sys for set camera0 mclk 27MHz */
F( 66670000, gpll0, 12, 0, 0),
F_END
};
vendor 修改 lib 驱动中的mclk 配置
/vendor/qcom/proprietary/mm-camera/mm-camera2/
media-controller/modules/sensors/sensor_libs/ov8865_hct/ov8865_hct_lib.c
@@ -143,7 +143,7 @@ static struct msm_sensor_power_setting power_setting[] = {
{
.seq_type = SENSOR_CLK,
.seq_val = SENSOR_CAM_MCLK,
- .config_val = 24000000,
+ .config_val = 27000000, //24000000,
.delay = 10,
},
调试 修改 mclk 驱动能力
/*sensors */
cam_sensor_mclk0_default: cam_sensor_mclk0_default {
/* MCLK0 */
mux {
/* CLK, DATA */
pins = "gpio26";
function = "cam_mclk";
};
config {
pins = "gpio26";
bias-disable; /* No PULL */
//* 2 mA */ /* change to 4mA, 2, 4, 6, 8, 10… max is 16mA*/
// 默认2ma,最大可修改为16ma
drive-strength = <2>; /* 2 MA */
};
};
调试 打开 mclk 相关的驱动 log
路径:
kernel\msm-4.9\drivers\media\platform\msm\camera_v2\common\cam_soc_api.c
代码如:
-#define CDBG(fmt, args...) pr_debug(fmt, ##args)
+#define CDBG(fmt, args...) pr_err(fmt, ##args)
边栏推荐
- A bit of knowledge - online resources on Chinese Learning
- Learning Tai Chi Maker - mqtt Chapter II (VI) mqtt wills
- Sword finger offer 49 Ugly number (three finger needling technique)
- 论文详读:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION
- 2022西式面点师(高级)考试试题模拟考试平台操作
- [CSP-J2020] 优秀的拆分
- Google Earth engine (GEE) - global flood database V1 (2000-2018)
- Difference between curdate() and now()
- The development of the Internet has promoted the emergence of a series of new models such as unbounded retail, digital retail and instant retail
- Audio and video technology development weekly
猜你喜欢

2022年G3锅炉水处理复训题库模拟考试平台操作

Matlab exercises -- basic data processing

Google Earth Engine(GEE)——全球洪水数据库 v1 (2000-2018年)

Audio and video technology development weekly

S32ds jump to defaultisr

Bitlock recovery occurs in win 10, and the blue screen error code is 0x1600007e

Where does the storm go? Whose pot is the weather forecast wrong?
![[csp-j2020] excellent splitting](/img/05/90f9cf71791b3cdc37073eaf5db989.png)
[csp-j2020] excellent splitting

Severe tire damage: the first rock band in the world to broadcast live on the Internet

Distributed transaction - Final consistency scheme based on message compensation (local message table, message queue)
随机推荐
Pager when importing text files from MySQL
Congratulations to myself, official account has more than ten thousand fans
The SQL of filincdc always reports this error when there are multiple tables. How can I solve it
Flexible IP network test tool -- x-launch
2022年G3锅炉水处理复训题库模拟考试平台操作
学习太极创客 — MQTT 第二章(六)MQTT 遗嘱
The number of small stores in Suning has dropped sharply by 428 in one year. Zhangkangyang, the son of Zhang Jindong, is the actual controller
Unity delegate
乔布斯在斯坦福大学的演讲稿——Follow your heart
DH parameters of robotics and derivation using MATLAB symbolic operation
Binary sort tree: BST
2022电力电缆判断题模拟考试平台操作
[CSP-J2020] 优秀的拆分
wordpress zibll子比主题6.4.1开心版 免授权
Meta universe standard forum established
Severe tire damage: the first rock band in the world to broadcast live on the Internet
Audio and video technology development weekly
Sword finger offer 47 Maximum gift value (DP)
One article explains in detail | those things about growth
mysql修改密码报错需要怎么做