This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DS90UB954-Q1: SOF Freeze

Part Number: DS90UB954-Q1
Other Parts Discussed in Thread: ALP

Tool/software:

高通845芯片的linux系统,摄像头驱动为软件i2c操作的,不用954和953时可出图像。

现在添加了954和953连接摄像头后,i2c配置完954,953后可访问摄像头I2C,但是运行摄像头驱动软件后,显示SOF freeze。

int main(int argc, char *argv[])
{
if (Hardware::PC())
{
printf("exiting, camerad is not meant to run on PC\n");
return 0;
}

int ret = util::set_realtime_priority(53);
assert(ret == 0);
ret = util::set_core_affinity({6});
assert(ret == 0 || Params().getBool("IsOffroad")); // failure ok while offroad due to offlining cores

// camerad_thread();
LOGE("-- UB954 TEST --");

LOGE("-- Opening devices");
// video0 is req_mgr, the target of many ioctls
cameras.video0_fd = HANDLE_EINTR(open("/dev/v4l/by-path/platform-soc:qcom_cam-req-mgr-video-index0", O_RDWR | O_NONBLOCK));
assert(cameras.video0_fd >= 0);
LOGE("opened video0");

// video1 is cam_sync, the target of some ioctls
cameras.cam_sync_fd = HANDLE_EINTR(open("/dev/v4l/by-path/platform-cam_sync-video-index0", O_RDWR | O_NONBLOCK));
assert(cameras.cam_sync_fd >= 0);
LOGE("opened video1 (cam_sync)");

// looks like there'cameras only one of these
cameras.isp_fd = open_v4l_by_name_and_index("cam-isp");
assert(cameras.isp_fd >= 0);
LOGE("opened isp");

// query icp for MMU handles
LOGE("-- Query ICP for MMU handles");
struct cam_isp_query_cap_cmd isp_query_cap_cmd = {0};
struct cam_query_cap_cmd query_cap_cmd = {0};
query_cap_cmd.handle_type = 1;
query_cap_cmd.caps_handle = (uint64_t)&isp_query_cap_cmd;
query_cap_cmd.size = sizeof(isp_query_cap_cmd);
ret = do_cam_control(cameras.isp_fd, CAM_QUERY_CAP, &query_cap_cmd, sizeof(query_cap_cmd));
assert(ret == 0);
LOGE("using MMU handle: %x", isp_query_cap_cmd.device_iommu.non_secure);
LOGE("using MMU handle: %x", isp_query_cap_cmd.cdm_iommu.non_secure);
cameras.device_iommu = isp_query_cap_cmd.device_iommu.non_secure;
cameras.cdm_iommu = isp_query_cap_cmd.cdm_iommu.non_secure;

// subscribe
LOG("-- Subscribing");
struct v4l2_event_subscription sub = {0};
sub.type = V4L_EVENT_CAM_REQ_MGR_EVENT;
sub.id = V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS;
ret = HANDLE_EINTR(ioctl(cameras.video0_fd, VIDIOC_SUBSCRIBE_EVENT, &sub));
LOGE("req mgr subscribe: %d", ret);

sensor_fd = open_v4l_by_name_and_index("cam-sensor-driver", 1);
assert(sensor_fd >= 0);
LOGE("TIAN opened sensor for %d", 1);

// init memorymanager for this camera
mm.init(cameras.video0_fd);

LOGE("-- Probing sensor %d", 1);
ret = sensors_init(0x60, 0x1E);
if (ret != 0)
{
LOGE("init failed----");
return 0;
}

// create session
struct cam_req_mgr_session_info session_info = {};
ret = do_cam_control(cameras.video0_fd, CAM_REQ_MGR_CREATE_SESSION, &session_info, sizeof(session_info));
LOGE("get session: %d 0x%X", ret, session_info.session_hdl);
session_handle = session_info.session_hdl;

// access the sensor
LOGE("-- Accessing sensor");
auto sensor_dev_handle_ = device_acquire(sensor_fd, session_handle, nullptr);
assert(sensor_dev_handle_);
sensor_dev_handle = *sensor_dev_handle_;
LOGE("acquire sensor dev");

LOGE("-- Configuring sensor");

ret = i2c_compare(0x00, 0x60);
ret = i2c_write(0x4C, 0x01); // select port 0,依赖与硬件设计
ret = i2c_write(0x0C, 0x01); // enable port0
ret = i2c_write(0x6D, 0x7C);
ret = i2c_write(0x58, 0x5E); //i2c PASS-THROUGH 该寄存器直接导致I2c是否能通过954透传给953或者sensor
ret = i2c_write(0x5C, 0x30); //953 i2c addr
ret = i2c_write(0x5D, 0x6C); // sensor ox03c10 i2c addr
ret = i2c_write(0x65, 0x6C); // sensor i2c addr
ret = i2c_write(0x20, 0x20); //FWD_CTL1 很重要,Forwarding enabled for RX Port 0
ret = i2c_write(0x70, 0x1E);
ret = i2c_write(0x33, 0x03); //4 lanes
ret = i2c_compare(0x04, 0xCF);

ret = sensors_init(0x30, 0x73);
if (ret != 0)
{
ret = sensors_init(0x30, 0x33);
if (ret != 0)
{
LOGE("init failed----");
return 0;
}
}

ret = i2c_compare(0x00, 0x30);
ret = i2c_write(0x0E, 0xF0); //enable gpio out
ret = i2c_write(0x0D, 0x00); //gpio out LOW
ret = i2c_write(0x06, 0x81); //HS 16 M=1
ret = i2c_write(0x07, 0x05); //N=5
ret = i2c_write(0x03, 0x5A); //很重要,异步模式CSI-2 Non-synchronous external clock Mode
ret = i2c_write(0x02, 0x73); //continues clock ,4 lane
ret = i2c_write(0x0D, 0x04); //gpio HIGH 0x03c10 sensor 使能
}
这是954和953的配置,摄像头驱动软件与不添加954、953之前一样。
报错信息:
[ 1012.459062] CAM_INFO: CAM-SENSOR: cam_sensor_match_id: 666 TIAN read id: 0x5803 expected id 0x5803:
[ 1012.459078] CAM_INFO: CAM-SENSOR: cam_sensor_driver_cmd: 823 Probe success,slot:0,slave_addr:0x6c,sensor_id:0x5803
[ 1012.459325] CAM_INFO: CAM-SENSOR: cam_sensor_driver_cmd: 896 CAM_ACQUIRE_DEV Success, sensor_id:0x5803,sensor_slave_addr:0x6c
[ 1017.698105] CAM_ERR: CAM-CRM: __cam_req_mgr_process_sof_freeze: 1168 SOF freeze for session 11403776 link 0x330104
[ 1017.698151] CAM_INFO: CAM-ISP: cam_ife_csid_sof_irq_debug: 2683 SOF freeze: CSID SOF irq enabled
  • 摄像头为 OX03C10

  • Hi Lijun,

    Can you explain what the question is here? The SOF freeze shown here does not tie back to the SerDes behavior as presented. 

    Best,

    Zoe

  • Resolution is 1928x1208, and the image below shows the status of ALP, but it reports "SOF Freeze." I would like to know if it is due to an incorrect setting of a register on the 954 or 953.

  • Hi Lijun, 

    What mode of the 953 is being used here? In the screenshot, the back channel rate is showing as 2.5Mbps which is used for DVP mode. 

    Would you be able to provide a complete register dump of the UB954 main page registers to clarify the system set up here? This can be collected by going to the registers tab and selecting display registers on the right side. 

    Best,

    Zoe

  • [REGISTERS]
    Device = ALP Nano 1 - DS90UB954, Connector 1
    Comments = ""
    Date = 12/06/2024
    Time = 15:12:59
    Reg = 0,0x0000,0x60
    Reg = 0,0x0001,0x00
    Reg = 0,0x0002,0x1E
    Reg = 0,0x0003,0x20
    Reg = 0,0x0004,0xCF
    Reg = 0,0x0005,0x01
    Reg = 0,0x0006,0x00
    Reg = 0,0x0007,0xFE
    Reg = 0,0x0008,0x1C
    Reg = 0,0x0009,0x10
    Reg = 0,0x000A,0x7A
    Reg = 0,0x000B,0x7A
    Reg = 0,0x000C,0x81
    Reg = 0,0x000D,0x09
    Reg = 0,0x000E,0x08
    Reg = 0,0x000F,0x7F
    Reg = 0,0x0010,0x00
    Reg = 0,0x0011,0x00
    Reg = 0,0x0012,0x00
    Reg = 0,0x0013,0x00
    Reg = 0,0x0014,0x00
    Reg = 0,0x0015,0x00
    Reg = 0,0x0016,0x00
    Reg = 0,0x0017,0x00
    Reg = 0,0x0018,0x00
    Reg = 0,0x0019,0x00
    Reg = 0,0x001A,0x00
    Reg = 0,0x001B,0x00
    Reg = 0,0x001C,0x00
    Reg = 0,0x001D,0x00
    Reg = 0,0x001E,0x04
    Reg = 0,0x001F,0x02
    Reg = 0,0x0020,0x20
    Reg = 0,0x0021,0x01
    Reg = 0,0x0022,0x00
    Reg = 0,0x0023,0x00
    Reg = 0,0x0024,0x00
    Reg = 0,0x0025,0x00
    Reg = 0,0x0026,0x00
    Reg = 0,0x0027,0x00
    Reg = 0,0x0028,0x00
    Reg = 0,0x0029,0x00
    Reg = 0,0x002A,0x00
    Reg = 0,0x002B,0x00
    Reg = 0,0x002C,0x00
    Reg = 0,0x002D,0x00
    Reg = 0,0x002E,0x00
    Reg = 0,0x002F,0x00
    Reg = 0,0x0030,0x00
    Reg = 0,0x0031,0x00
    Reg = 0,0x0032,0x00
    Reg = 0,0x0033,0x03
    Reg = 0,0x0034,0x40
    Reg = 0,0x0035,0x01
    Reg = 0,0x0036,0x00
    Reg = 0,0x0037,0x01
    Reg = 0,0x0038,0x00
    Reg = 0,0x0039,0x00
    Reg = 0,0x003A,0x00
    Reg = 0,0x003B,0x01
    Reg = 0,0x003C,0x14
    Reg = 0,0x003D,0x6F
    Reg = 0,0x003E,0x00
    Reg = 0,0x003F,0x40
    Reg = 0,0x0040,0x00
    Reg = 0,0x0041,0xA7
    Reg = 0,0x0042,0x71
    Reg = 0,0x0043,0x01
    Reg = 0,0x0044,0x00
    Reg = 0,0x0045,0x00
    Reg = 0,0x0046,0x00
    Reg = 0,0x0047,0x00
    Reg = 0,0x0048,0x00
    Reg = 0,0x0049,0x00
    Reg = 0,0x004A,0x00
    Reg = 0,0x004B,0x12
    Reg = 0,0x004C,0x01
    Reg = 0,0x004D,0x03
    Reg = 0,0x004E,0x0C
    Reg = 0,0x004F,0x30
    Reg = 0,0x0050,0x01
    Reg = 0,0x0051,0x00
    Reg = 0,0x0052,0x00
    Reg = 0,0x0053,0x03
    Reg = 0,0x0054,0x03
    Reg = 0,0x0055,0x00
    Reg = 0,0x0056,0x00
    Reg = 0,0x0057,0x00
    Reg = 0,0x0058,0x5E
    Reg = 0,0x0059,0x00
    Reg = 0,0x005A,0x00
    Reg = 0,0x005B,0x30
    Reg = 0,0x005C,0x30
    Reg = 0,0x005D,0x6C
    Reg = 0,0x005E,0x00
    Reg = 0,0x005F,0x00
    Reg = 0,0x0060,0x00
    Reg = 0,0x0061,0x00
    Reg = 0,0x0062,0x00
    Reg = 0,0x0063,0x00
    Reg = 0,0x0064,0x00
    Reg = 0,0x0065,0x6C
    Reg = 0,0x0066,0x00
    Reg = 0,0x0067,0x00
    Reg = 0,0x0068,0x00
    Reg = 0,0x0069,0x00
    Reg = 0,0x006A,0x00
    Reg = 0,0x006B,0x00
    Reg = 0,0x006C,0x00
    Reg = 0,0x006D,0x7C
    Reg = 0,0x006E,0x88
    Reg = 0,0x006F,0x88
    Reg = 0,0x0070,0x1E
    Reg = 0,0x0071,0x2C
    Reg = 0,0x0072,0xE4
    Reg = 0,0x0073,0x04
    Reg = 0,0x0074,0xBE
    Reg = 0,0x0075,0x0B
    Reg = 0,0x0076,0x4C
    Reg = 0,0x0077,0xC5
    Reg = 0,0x0078,0x00
    Reg = 0,0x0079,0x01
    Reg = 0,0x007A,0x0C
    Reg = 0,0x007B,0xFF
    Reg = 0,0x007C,0x81
    Reg = 0,0x007D,0x00
    Reg = 0,0x007E,0x00
    Reg = 0,0x007F,0x00
    Reg = 0,0x00A0,0x02
    Reg = 0,0x00A1,0x0F
    Reg = 0,0x00A2,0x00
    Reg = 0,0x00A3,0x00
    Reg = 0,0x00A4,0x08
    Reg = 0,0x00A5,0x4A
    Reg = 0,0x00A7,0x00
    Reg = 0,0x00A8,0x00
    Reg = 0,0x00A9,0x00
    Reg = 0,0x00AA,0x00
    Reg = 0,0x00AB,0x00
    Reg = 0,0x00AC,0x00
    Reg = 0,0x00AD,0x00
    Reg = 0,0x00AE,0x00
    Reg = 0,0x00AF,0x00
    Reg = 0,0x00B0,0x00
    Reg = 0,0x00B1,0x04
    Reg = 0,0x00B2,0x07
    Reg = 0,0x00B3,0x08
    Reg = 0,0x00B4,0x25
    Reg = 0,0x00B5,0x00
    Reg = 0,0x00B6,0x18
    Reg = 0,0x00B7,0x00
    Reg = 0,0x00B8,0x8C
    Reg = 0,0x00B9,0x33
    Reg = 0,0x00BA,0x83
    Reg = 0,0x00BB,0x74
    Reg = 0,0x00BC,0x80
    Reg = 0,0x00BD,0x00
    Reg = 0,0x00BE,0x00
    Reg = 0,0x00BF,0x00
    Reg = 0,0x00D0,0x00
    Reg = 0,0x00D2,0x94
    Reg = 0,0x00D3,0x05
    Reg = 0,0x00D4,0x60
    Reg = 0,0x00D5,0xF2
    Reg = 0,0x00D6,0x00
    Reg = 0,0x00D7,0x02
    Reg = 0,0x00D8,0x00
    Reg = 0,0x00D9,0x00
    Reg = 0,0x00DA,0x00
    Reg = 0,0x00DB,0x00
    Reg = 0,0x00DC,0x00
    Reg = 0,0x00DD,0x00
    Reg = 0,0x00DE,0x00
    Reg = 0,0x00DF,0x00
    Reg = 0,0x00F0,0x5F
    Reg = 0,0x00F1,0x55
    Reg = 0,0x00F2,0x42
    Reg = 0,0x00F3,0x39
    Reg = 0,0x00F4,0x35
    Reg = 0,0x00F5,0x34
    Reg = 0,0x00F8,0x00
    Reg = 0,0x00F9,0x00
    Reg = 0,0x00FA,0x00
    Reg = 0,0x00FB,0x00
    
    [REGISTERS]
    Device = ALP Nano 1 - DS90UB953, Connector 1
    Comments = ""
    Date = 12/06/2024
    Time = 15:13:44
    Reg = 0,0x0000,0x30
    Reg = 0,0x0001,0x00
    Reg = 0,0x0002,0x73
    Reg = 0,0x0003,0x5A
    Reg = 0,0x0004,0x00
    Reg = 0,0x0005,0x03
    Reg = 0,0x0006,0x81
    Reg = 0,0x0007,0x05
    Reg = 0,0x0008,0xFE
    Reg = 0,0x0009,0x1E
    Reg = 0,0x000A,0x10
    Reg = 0,0x000B,0x7F
    Reg = 0,0x000C,0x7F
    Reg = 0,0x000D,0x04
    Reg = 0,0x000E,0xF0
    Reg = 0,0x0010,0x00
    Reg = 0,0x0011,0x00
    Reg = 0,0x0013,0x00
    Reg = 0,0x0014,0x00
    Reg = 0,0x0015,0x20
    Reg = 0,0x0017,0x3C
    Reg = 0,0x0018,0x80
    Reg = 0,0x0019,0x62
    Reg = 0,0x001A,0x62
    Reg = 0,0x001B,0x62
    Reg = 0,0x001C,0x00
    Reg = 0,0x001D,0x00
    Reg = 0,0x001E,0x00
    Reg = 0,0x0020,0x00
    Reg = 0,0x0021,0x00
    Reg = 0,0x0022,0x00
    Reg = 0,0x0023,0x00
    Reg = 0,0x0024,0x00
    Reg = 0,0x0031,0x20
    Reg = 0,0x0032,0x09
    Reg = 0,0x0033,0x04
    Reg = 0,0x0035,0x10
    Reg = 0,0x0037,0x60
    Reg = 0,0x0039,0x00
    Reg = 0,0x003A,0x00
    Reg = 0,0x003B,0x00
    Reg = 0,0x003C,0x00
    Reg = 0,0x003D,0x00
    Reg = 0,0x003E,0x00
    Reg = 0,0x003F,0x00
    Reg = 0,0x0040,0x00
    Reg = 0,0x0041,0x00
    Reg = 0,0x0042,0x00
    Reg = 0,0x0043,0x00
    Reg = 0,0x0044,0x00
    Reg = 0,0x0045,0x00
    Reg = 0,0x0046,0x00
    Reg = 0,0x0047,0x00
    Reg = 0,0x0048,0x00
    Reg = 0,0x0049,0x00
    Reg = 0,0x0050,0x20
    Reg = 0,0x0051,0xC0
    Reg = 0,0x0052,0x67
    Reg = 0,0x0053,0x00
    Reg = 0,0x0054,0x00
    Reg = 0,0x0055,0xFF
    Reg = 0,0x0056,0xFF
    Reg = 0,0x0057,0x00
    Reg = 0,0x0058,0x07
    Reg = 0,0x0059,0x07
    Reg = 0,0x005A,0x07
    Reg = 0,0x005C,0x01
    Reg = 0,0x005D,0x00
    Reg = 0,0x005E,0x22
    Reg = 0,0x005F,0x06
    Reg = 0,0x0060,0x00
    Reg = 0,0x0061,0x2C
    Reg = 0,0x0062,0x4C
    Reg = 0,0x0063,0x0B
    Reg = 0,0x0064,0x01
    Reg = 0,0x00B0,0x04
    Reg = 0,0x00B1,0x4A
    Reg = 0,0x00B2,0x3F
    Reg = 0,0x00F0,0x5F
    Reg = 0,0x00F1,0x55
    Reg = 0,0x00F2,0x42
    Reg = 0,0x00F3,0x39
    Reg = 0,0x00F4,0x35
    Reg = 0,0x00F5,0x33
    

    thank you

  • Hi Lijun, 

    From a configuration aspect, I don't see any errors here and CSI pass is asserted based on the register dump that was provided. Does the SOF freeze reported mean there is no active data being input to the SoC? 

    In the register dump that was provided, there are CSI errors and CRC errors being reported here. These errors may occur during initialization of the devices and are recommended to be cleared once initialization is completed. 

    I recommend confirming the SoC is configured to expect 4 lane CSI-2 data at 800Mbps in continuous clock mode. No calibration is enabled on the deserializer side. 

    Best,

    Zoe