现在的位置: 首页 > 综合 > 正文

cmmb driver

2013年12月11日 ⁄ 综合 ⁄ 共 5950字 ⁄ 字号 评论关闭

CMMB driver

****************fw_filename:存在以下表中。
    smscore_fw_lkup[8][6]     -------------smscore_fw_lkup[7][4]-----------mode: 7(CMMB), type: 4(VENICE)
    sms_board[16]        ---------------sms_board[12]-------------------SMS1XXX_BOARD_SIANO_VENICE

**********固件下载,以下代码(/drivers/base/Firmware_class.c的request_firmware函数,得到固件大小和地址)中name传入参数是固件的文件名。

    for (builtin = __start_builtin_fw; builtin != __end_builtin_fw;
         builtin++) {
        if (strcmp(name, builtin->name))
            continue;
        dev_info(device, "firmware: using built-in firmware %s/n",
             name);
        firmware->size = builtin->size;
        firmware->data = builtin->data;
        return 0;
    }

**********Smscoreapi.c

smscore_load_firmware_from_file();
smscore_load_firmware_family2();

**************************************************************************************************************************************
static struct usb_driver smsusb_driver = {
    .name = "smsusb",
    .probe = smsusb_probe,
    .disconnect = smsusb_disconnect,
    .suspend = smsusb_suspend,
    .resume = smsusb_resume,
    .id_table = smsusb_id_table,
};       

            ->
smsusb_probe        ->
smsusb_init_device    ->
smscore_start_device
    smscore_set_device_mode();

        smscore_load_firmware_from_file();
            smscore_load_firmware_family2();
        smscore_init_device();

    smscore_configure_board();

    smscore_notify_callbacks();
        smscore_device_notifyee_t * ->hotplug    =smsdvb_hotplug();    由module_init->smscore_module_init->smsdvb_register->smscore_register_hotplug注册
           
    smscore_init_ir

*****************其中module_init是系统启动时运行的,其编译时会根据你的配置文件决定一些代码是否编译(#ifdef)
配置文件如下:

#
# Siano module components
#
CONFIG_SMS_DVB3_SUBSYS=y
# CONFIG_SMS_DVB5_S2API_SUBSYS is not set
CONFIG_SMS_HOSTLIB_SUBSYS=y
CONFIG_SMS_NET_SUBSYS=y
CONFIG_SMS_USB_DRV=y
# CONFIG_SMS_SDIO_DRV is not set

************************log如下:

<6>[25813.315000] usb 1-3: new high speed USB device using imapx200_usbhost20 and address 11
<6>[25813.450000] usb 1-3: configuration #1 chosen from 1 choice
<6>[25813.460000] smsusb_probe: interface number 0
<6>[25813.465000] smsusb_probe: endpoint 0 81 02 512
<6>[25813.470000] smsusb_probe: endpoint 1 02 02 512
<6>[25813.475000] smsusb_init_device: smsusb_init_device: in_ep = 81, out_ep = 02
<6>[25813.480000] smscore_register_device: allocated 50 buffers
<6>[25813.485000] smscore_register_device: core device 0xc9dade00 created, mode -1 devpath usb/1-3
<4>[25813.490000] set board id:12
<6>[25813.495000] smsusb_init_device: smsusb_start_streaming(...).
<4>[25813.500000] smsusb_start_streaming(...) end
<4>[25813.505000] smscore_start_device begin
<4>[25813.505000] smscore_set_device_mode mode:7
<7>[25813.510000] smscore_set_device_mode: set device mode to 7
<7>[25813.510000] smscore_onresponse:
<7>[25813.510000] data rate 62 bytes/secs
<7>[25813.510000] smscore_onresponse: MSG_SMS_GET_VERSION_EX_RES id 255 prots 0x0 ver 4.1
<7>[25813.515000] smscore_get_fw_filename: trying to get fw name from sms_boards board_id 12 mode 7
<7>[25813.515000] smscore_get_fw_filename: cannot find fw name in sms_boards, getting from lookup table mode 7 type 4
<6>[25813.515000] usb 1-3: firmware: using built-in firmware siano/cmmb_smd_D0_12mhz.inp
<6>[25813.520000] smscore_load_firmware_from_file: read fw siano/cmmb_smd_D0_12mhz.inp, buffer size=0x17af8
<6>[25813.525000] smscore_load_firmware_family2: loading fw to addr 0x40260 size 0x17aec
<7>[25813.630000] smscore_load_firmware_family2: sending MSG_SMS_SWDOWNLOAD_TRIGGER_REQ
<7>[25813.630000] smscore_onresponse: MSG_SMS_SWDOWNLOAD_TRIGGER_RES
<7>[25814.030000] smscore_load_firmware_family2: rc=0, postload=0x(null)
<6>[25814.030000] smscore_set_device_mode: firmware download success
<7>[25814.035000] smscore_onresponse: MSG_SMS_INIT_DEVICE_RES
<6>[25814.035000] smscore_start_device: set device mode succeeded
<4>[25814.040000] mode:7............
<3>[25814.040000] smsdvb_hotplug: line: 724: SMS Device mode is not set for DVB operation.
<6>[25814.045000] smschar_hotplug: entering 1
<6>[25814.050000] smschar_hotplug: create device 0
<4>[25814.055000] major:251 - minor:0
<4>[25814.055000] cdev add rc:0
<6>[25814.060000] smschar_hotplug: create device 1
<4>[25814.065000] major:251 - minor:1
<4>[25814.065000] cdev add rc:0
<6>[25814.070000] smschar_hotplug: create device 2
<4>[25814.075000] major:251 - minor:2
<4>[25814.075000] cdev add rc:0
<6>[25814.080000] smschar_hotplug: create device 3
<4>[25814.085000] major:251 - minor:3
<4>[25814.085000] cdev add rc:0
<6>[25814.090000] smschar_hotplug: create device 4
<4>[25814.095000] major:251 - minor:4
<4>[25814.095000] cdev add rc:0
<6>[25814.100000] smschar_hotplug: create device 5
<4>[25814.105000] major:251 - minor:5
<4>[25814.105000] cdev add rc:0
<6>[25814.110000] smschar_hotplug: create device 6
<4>[25814.115000] major:251 - minor:6
<4>[25814.115000] cdev add rc:0
<6>[25814.120000] smschar_hotplug: create device 7
<4>[25814.125000] major:251 - minor:7
<4>[25814.125000] cdev add rc:0
<6>[25814.130000] smschar_hotplug: create device 8
<4>[25814.135000] major:251 - minor:8
<4>[25814.135000] cdev add rc:0
<6>[25814.140000] smschar_hotplug: create device 9
<4>[25814.145000] major:251 - minor:9
<4>[25814.145000] cdev add rc:0
<6>[25814.150000] smschar_hotplug: create device 10
<4>[25814.155000] major:251 - minor:10
<4>[25814.155000] cdev add rc:0
<6>[25814.160000] smschar_hotplug: create device 11
<4>[25814.165000] major:251 - minor:11
<4>[25814.165000] cdev add rc:0
<6>[25814.170000] smschar_hotplug: create device 12
<4>[25814.175000] major:251 - minor:12
<4>[25814.175000] cdev add rc:0
<6>[25814.180000] smschar_hotplug: create device 13
<4>[25814.185000] major:251 - minor:13
<4>[25814.190000] cdev add rc:0
<6>[25814.190000] smschar_hotplug: create device 14
<4>[25814.195000] major:251 - minor:14
<4>[25814.200000] cdev add rc:0
<6>[25814.200000] smschar_hotplug: create device 15
<4>[25814.205000] major:251 - minor:15
<4>[25814.210000] cdev add rc:0
<6>[25814.210000] smschar_hotplug: create device 16
<4>[25814.215000] major:251 - minor:16
<4>[25814.220000] cdev add rc:0
<6>[25814.220000] smschar_hotplug: exiting, rc 0
<7>[25814.225000] smscore_register_client: register new client 0xc6422800 DT=699 ID=1
<6>[25814.225000] smsnet_hotplug: success
<6>[25814.230000] smscore_init_ir: IR port has not been detected
<6>[25814.235000] smscore_start_device: device c9dade00 started, rc 0
<6>[25814.240000] smsusb_init_device: device c6421800 created
<6>[25814.245000] smsusb_probe: rc 0

抱歉!评论已关闭.