1 頁 (共 1 頁)

01020678 Does fm_qsoc_pathes apply correctly in 8960?

發表於 : 2013年 4月 7日, 22:17
admin
Subject

Does fm_qsoc_pathes apply correctly in 8960?



Description

Dear Qualcomm support team,

We find when we run the FM test by fmconfig or QRCT, the system property 'hw.fm.init' is never set to 1.
It seems that FM firmware and Qsoc calibration data can't download succeeded.

If we enable FM by Qualcomm FM application, the system property 'hw.fm.init' would set to 1.
The log in 'init.qcom.fm.sh' shows 'FM QSoC calibration and firmware download succeeded'
But the fm_qsoc_pathes doesn't run completely, it returns after Open Riva_fm_cal Failed, calibraion is not performed and firmware doesn't download either.

Even if firmware doesn't download, FM radio still can work normally, we can hear the FM station.
So we want to know if fm_qsoc_patches is needed? Or how to make it work correctly?

Thank you.

Re: 01020678 Does fm_qsoc_pathes apply correctly in 8960?

發表於 : 2013年 4月 7日, 22:43
admin
Comment

Created By: Vic Wei (11/28/2012 3:26 AM)
Dear customer,
Please see my comment inline.

I want to confirm two things.
1. Does the log you mentioned at 11/26/2012 7:37 PM indicates that FM init succeeded?
I find that the files I provide to you at 11/22 (fmconfig_klog.txt,fmconfig.txt) also have such logs in them, so FM already init succeeded before you give me the patch, right?

<VicWei> You are seeing initialization is always successful no matter you turn on from UI or fmconfig. And I believe the log you shared to us is along with patch applied.

2. I want to know where is the code which actually applies download firmware.
In MSM8960/WCN3660 architecture, FM/BT/WLAN firmware are included in wcnss.b0x and downloaded in modem system bootup.

Thank you.




Created By: James Chiu (11/28/2012 2:57 AM)
Dear Vic,

I want to confirm two things.
1. Does the log you mentioned at 11/26/2012 7:37 PM indicates that FM init succeeded?
I find that the files I provide to you at 11/22 (fmconfig_klog.txt,fmconfig.txt) also have such logs in them, so FM already init succeeded before you give me the patch, right?
2. I want to know where is the code which actually applies download firmware.

Thank you.




Created By: Vic Wei (11/26/2012 7:37 PM)
Dear customer,
Thanks so much for contacting Qualcomm.
You refer to logcat log. Before radio-iris driver involve, we are using init.qcom.fm.sh script to initialize FM directly via SMD port. And it will be the same process between operating on UI or fmconfig.

....
01-02 00:02:36.726: I/qcom-fm(1945): /system/etc/init.qcom.fm.sh: In FM shell Script
01-02 00:02:36.736: I/qcom-fm(1946): /system/etc/init.qcom.fm.sh: mode: normal
01-02 00:02:36.736: I/qcom-fm(1947): /system/etc/init.qcom.fm.sh: isAnalog:
01-02 00:02:36.746: I/qcom-fm(1948): /system/etc/init.qcom.fm.sh: Transport : smd
01-02 00:02:36.766: I/qcom-fm(1949): /system/etc/init.qcom.fm.sh: Version : 197632
01-02 00:02:36.776: I/qcom-fm(1951): /system/etc/init.qcom.fm.sh: inserting the radio transport module
01-02 00:02:37.817: I/klogd(315): [ 187.331451] iris_radio: fm enabled response 0
01-02 00:02:37.817: I/klogd(315): [ 187.331451] : hci_cc_fm_enable_rsp
01-02 00:02:37.837: I/klogd(315): [ 187.359011] iris_radio: hci_fm_disable_recv_req: opcode for FM RX disable: 4c02
01-02 00:02:37.857: I/klogd(315): [ 187.367587] iris_radio: hci_cc_fm_disable_rsp: Disabled event from soc 0
01-02 00:02:37.867: I/qcom-fm(1956): /system/etc/init.qcom.fm.sh: FM QSoC calibration and firmware download succeeded
....

Thanks,
Vic Wei




Created By: James Chiu (11/26/2012 5:50 PM)
Dear Vic,

>From your log, calibration and firmware file are downloaded successfully.
You mean in msm8960, FM needs to do calibration and download firmware, right?
Would you please tell me the key word in the log, what log indicate the firmware downloaded successfully? So that I could check it myself in our ftm.

Besides, due to I find that download firmware seems not to be done in 'fm_qsoc_patches.c' (No related message show in log), I want to know where is the code which actually applies download firmware?

Thank you
James Chiu

Thank you .
James Chiu




Created By: Vic Wei (11/26/2012 1:12 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
From your log, calibration and firmware file are downloaded successfully.
In your test mode, it should run the same script and supposedly do the same thing.
We will mainline this change.
Thanks,
Vic Wei




Created By: James Chiu (11/26/2012 1:09 AM)
Dear Vic,

Please refer to the log in attachment.

Thank you .
James Chiu




Created By: Vic Wei (11/26/2012 1:08 AM)
Thank you for your new attachment info. We will study and get back to you later




Created By: Vic Wei (11/26/2012 12:01 AM)
Dear customer,
I got your point.
But I supposed that "fmconfig" can be run at user mode as well. Am I right?
If yes, you should be able to get logcat log to confirm that.
Is it possible to share logcat log running user mode?
Thanks,
Vic Wei




Created By: James Chiu (11/25/2012 11:51 PM)
Dear Vic,

>Do you run "fmconfig" instead of using FM from UI?
Yes, I run fmconfig in our ftm image, which is a simplified system image.
>And could you please also share logcat log?
There is no adb in our ftm, all the logs are in the attachment.
If you think the log is incomplete, would you please tell me what log you expect is lacked?
What is the key word we can see if FM enable successfully?

Thank you.
James Chiu




Created By: Vic Wei (11/25/2012 11:38 PM)
Dear customer,
Do you run "fmconfig" instead of using FM from UI?
And could you please also share logcat log?
Thanks,
Vic Wei




Created By: James Chiu (11/25/2012 11:27 PM)
Dear Vic,

This patch seems to fix the blocking problem while disabling FM.
I don't know if it is related to FM init sequence, because the kernel log looks the same as without patched.
Please check the log in attachment and provide your comment.
Does fm init successfully?

Thank you.




Created By: Vic Wei (11/23/2012 6:54 AM)
Dear customer,
Could you please try attached patch then get back to us?
Thanks,
Vic Wei




Created By: Vic Wei (11/22/2012 11:21 PM)
Dear customer,
We are checking the log now and will update to you later.
Thanks,
Vic Wei




Created By: James Chiu (11/22/2012 10:07 PM)
Dear Vic,

Please refer to the log in attachment.

Thank you .
James Chiu




Created By: Vic Wei (11/22/2012 2:24 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
We still recommend to download calibration/firmware in your test mode.
So we need to figure out why fmconfig would get the failed message.
Could you please add FMDERR statements in kernel driver and get related logs to us?

1. kernel/drivers/media/radio/radio-iris.c

static void hci_cc_fm_disable_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
__u8 status = *((__u8 *) skb->data);
struct iris_device *radio = video_get_drvdata(video_get_dev());

+ FMDERR("%s: Disabled event from soc %d\n", __func__, status);
if (status)
return;
if (radio->mode != FM_CALIB) {
iris_q_event(radio, IRIS_EVT_RADIO_DISABLED);
+ FMDERR("%s: disabled event queued\n", __func__);
}

radio_hci_req_complete(hdev, status);
}

static void hci_cc_fm_enable_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_fm_conf_rsp *rsp = (void *)skb->data;
struct iris_device *radio = video_get_drvdata(video_get_dev());

+ FMDERR("fm enabled response %d\n: %s", rsp->status, __func__);
if (rsp->status)
return;
if (radio->mode != FM_CALIB) {
iris_q_event(radio, IRIS_EVT_RADIO_READY);
+ FMDERR("RAEDY EVENT queued in event buffer %s\n", __func__);
}

radio_hci_req_complete(hdev, rsp->status);
}

static int hci_fm_disable_recv_req(struct radio_hci_dev *hdev,
unsigned long param)
{
__u16 opcode = 0;

opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_DISABLE_RECV_REQ);
+ FMDERR("%s: opcode for FM RX disable: %x\n", __func__, opcode);
return radio_hci_send_cmd(hdev, opcode, 0, NULL);
}

2. kernel/drivers/media/radio/radio-iris-transport.c

static int radio_hci_smd_send_frame(struct sk_buff *skb)
{
int len = 0;
int i;

len = smd_write(hs.fm_channel, skb->data, skb->len);
if (len < skb->len) {
FMDERR("Failed to write Data %d", len);
kfree_skb(skb);
return -ENODEV;
}
for(i = 0; i < len; i++) {
+ FMDERR("%s data at byte %d: is %x\n", __func__, i, skb->data);
}
kfree_skb(skb);
return 0;
}

Thanks,
Vic Wei




Created By: James Chiu (11/21/2012 11:42 PM)
Dear Vic,

>>Why is it different from your previous log?
Please refer to my comment at 11/15/2012 6:51 PM, I found out the mistake in Fmhalcmd.c and fix it, the difference between the log is due to the mistake in Fmhalcmd.c

Besides, the log bellow
--
01-02 00:00:58.391: I/qcom-fm(1509): /system/etc/init.qcom.fm.sh: FM QSoC calibration and firmware download succeeded
--
It simply indicates the return value from fm_qsoc_patches is zero, but we care about what is done in ' fm_qsoc_patches' , does FM's initailization is completed if the return value is zero?
I find the it return zero after 'do_riva_calibration' is done, so the following code which is used to download FM firmware, is not applied.
That's why I ask the question at 11/15/2012 6:51 PM, to confirm if download firmware is necessary.

>>Could you please share another kernel log again?
I don't understand what kernel log you need, I'm asking about the FM's feature, by Qualcomm' s design behavior, what are the expected steps of Qualcomm's FM in 8960? I guess a document which introduce Qualcomm's FM structure and init flow may be a good solution.
If the kernel log is necessary, please tell me the kernel log you need is in which modules, radio-iris or smd? Shall I enable some debug message?

Thank you
James Chiu




Created By: Vic Wei (11/21/2012 6:03 AM)
Dear customer,
Thanks so much for contacting Qualcomm.

Could you please share another kernel log again?

Thanks,
Vic Wei




Created By: Vic Wei (11/21/2012 5:59 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
From fmconfig.txt logcat log, we are seeing calibration and firmware are downloaded successfully.
....
01-02 00:00:58.391: I/qcom-fm(1509): /system/etc/init.qcom.fm.sh: FM QSoC calibration and firmware download succeeded
....

Why is it different from your previous log?

Thanks,
Vic Wei




Created By: James Chiu (11/20/2012 6:33 PM)
Dear Vic,

Please refer attachment for logs.
Would you please tell me the flow of fm init on MSM8960 with transport SMD?
We want to know the steps in detail.

Thank you.
James Chiu




Created By: Vic Wei (11/18/2012 11:51 PM)
Dear customer,
Thanks so much for contacting Qualcomm.
Could you please share kernel log along with using fmconfig tool?
Thanks,
Vic Wei




Created By: James Chiu (11/18/2012 10:53 PM)
Dear Vic,

Our platform is MSM8960




Created By: Vic Wei (11/18/2012 9:43 PM)
Dear customer,
Thanks so much for contacting Qualcomm.
Could we know if your platform is MSM8960 or MSM8227 or MSM7627A?
We see these three platforms mentioned in this case.
Thanks,
Vic Wei




Created By: James Chiu (11/15/2012 6:51 PM)
Dear Vic,

I find out why fmconfig failed to apply 'fm_qsoc_patches', it doesnt set the property 'hw.fm.version' that leads to the parametor get lost in init.qcom.fm.sh

Now we want to know whether we only need to apply 'do_riva_calibration' if our HCI transport type is smd.
If we don't need to download firmware, then we can remove some un-used library to reduce the size of our FTM image.
Please help to confirm if download firmware need not to do when hci transport is smd.

Thank you.
James Chiu




Created By: Vic Wei (11/15/2012 2:30 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
Would please enable this debug message in vendor/qcom/proprietary/fm/patch_downloader/fm_qsoc_patches.c?

-FILE* debug_file=NULL;
+FILE* debug_file=stderr;

Thanks,
Vic Wei




Created By: James Chiu (11/14/2012 10:32 PM)
Dear Vic,

Please refer to attachemnt for the logs.
BTW, I want to know why you need to confirm the boot up log.
Dose 'fm_qsoc_patches' to be applied during device boot up?
I find the 'Riva_fm_cal ' does not exist after boot up, it is gained after 'fm_qsoc_patches ' is applied.(after fm_dl service starts)

Is the step of ''do_riva_calibration' necessary for FM?

Thank you.
James Chiu




Created By: Vic Wei (11/14/2012 2:14 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
Could you please help to take the log for fmconfig in the beginning of system boot-up?
Then we can make sure fm initialization is just called once.
Thanks,
Vic Wei




Created By: James Chiu (11/13/2012 5:14 PM)
Dear Vic,

Per your comment, FM needs to do the calibration at first time, right?
But we find if enable FM from the FM test tool 'fmconfig', it would not do the calibration.
Since we use 'fmconfig' to run our FTM to verify FM funtionality, we are afraid that without doing calibration would impact the test result.
Is the calibration in fm_qsoc_patches necessary?

Thank you.
James Chiu




Created By: Vic Wei (11/13/2012 3:49 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
This behavior is correct. Since system download FM patch first time, we would check and never download again once turn on FM second time.
Thanks,
Vic Wei




Created By: James Chiu (11/12/2012 6:14 PM)
Dear Vic,

Please refer to attachemnt for the logs.
Correct my comment about enable FM from Qualcomm application, it would open Riva_fm_cal success at the first time and apply the function 'do_riva_calibration'.
If disable FM and then enable again, the 'Riva_fm_cal' would open failed.

Please help to clarify the behavior of 'fm_qsoc_pathes'

Thank you.
James Chiu




Created By: Vic Wei (11/12/2012 6:39 AM)
Dear customer,
Thanks so much for contacting Qualcomm.
Could you pleases provide the log?
Thanks,
Vic Wei