i.MX50: Right USBOH1_UTMI_CLK_VLD values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX50: Right USBOH1_UTMI_CLK_VLD values

Jump to solution
3,542 Views
norishinozaki
Contributor V

Hello Champs,

My customer is usig Host mode and looking at this register to see an input clock is on.

From USBOH1_UTMI_CLK_VLD table in RM page 3273, when the clock is on, they are expecting O_UTMIPHYCLK(5) to be 0 and H1_UTMIPHYCLK(6) to be 1.

However in ther customer boards, it becomes reverse, O_UTMIPHYCLK(5) is 1 and H1_UTMIPHYCLK(6) is 0.

Which is correct values when USB mode?

Best regards,

Nori Shinozaki

Labels (1)
1 Solution
3,099 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

View solution in original post

0 Kudos
Reply
30 Replies
3,100 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!
0 Kudos
Reply
2,805 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

Each of these bits from USBOH1_UTMI_CLK_VLD register correspond to each USB controller, as the i.MX50 has one OTG controller and one Host-only controller (H1):

usb imx50.png

So, the values of these read-only bits should match with your hardware configuration.


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hello Carlos,

I checked the two bits in USBOH1_UTMI_CLK_VLD with OBDS.

src/mx50/hardware.c

int is_utmi_clk_ready(void)

{

    while (!((*(volatile u32 *)USBOH1_UTMI_CLK_VLD) & (0x1 << 7))) ;    //host1 utmi clock is not OK?

    return 1;

}

This function is waitng for the bit 7 to be ready.

From RM, the bit 7 is for OTG PHY, not for HOST PHY.

I think the description of RM is reverse...

pastedImage_4.png

The above check passes anyway because this test program enables both PHYs as follows.

void usb_clock_enable(void)

{

    *(volatile u32 *)(CCM_CCGR2) |= 0x0C000000; //enable USBOH3_IPG_AHB

    *(volatile u32 *)(CCM_CCGR4) |= 0x00003C00; //enable PHY1 and PHY2 clock

    *(volatile u32 *)(USB_CLKONOFF_CTRL) = 0;   //enable AHB clock for HOST1 and OTG

}

So I modified to enable only HOST PHY(PHY1).

void usb_clock_enable(void)

{

    *(volatile u32 *)(CCM_CCGR2) |= 0x0C000000; //enable USBOH3_IPG_AHB

    *(volatile u32 *)(CCM_CCGR4) &= 0xFFFFCBFF; //enable PHY1 only clock

    *(volatile u32 *)(USB_CLKONOFF_CTRL) = 0x20000;   //enable AHB clock for HOST1 only

}

Then the host1 utmi clock check passed as well.

Seems like bit 7 is for HOST PHY.

I bet RM is wrong...

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,805 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

We will verify it in order to apply the proper changes if necessary.

Thanks a lot for your feedback.

Best regards!

/Carlos

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hello Carlos,

You mean we should follow OBDS, not Reference Manual?

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,805 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

No, I mean that we are going to review the software and the documentation, and apply the proper corrections (i.e. a RM update) according with the real chip behavior.

Thanks again for your feedback and best regards!

/Carlos

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hi Carlos,

Thanks! I see, I will wait for TIC to answer in quick.

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,805 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

Experts have also commented the following:

Based on your test I think both the RM and the BSP code is correct. Only the comment is wrong in the BSP:

while (!((*(volatile u32 *)USBOH1_UTMI_CLK_VLD) & (0x1 << 7))) ;    //host1 utmi clock is not OK?

That should be ...;  //OTG utmi clock is not OK?

You made a mistake in your test:

-------------------- Copied from your descrition above: ----------------

So I modified to enable only HOST PHY(PHY1). <<< PHY1 is the OTG PHY not the host1 PHY

void usb_clock_enable(void)

{

    *(volatile u32 *)(CCM_CCGR2) |= 0x0C000000; //enable USBOH3_IPG_AHB

    *(volatile u32 *)(CCM_CCGR4) &= 0xFFFFCBFF; //enable PHY1 only clock

    *(volatile u32 *)(USB_CLKONOFF_CTRL) = 0x20000;  //enable AHB clock for HOST1 only

}

Then the host1 utmi clock check passed as well.


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hello Carlos,

Thanks, let me summerize what we have found so far.

1. OTG PHY check

At reset, CCM_CCGR4=0x30000C00

In the reference manual, it must be 0x80000000.

However CCM_CCGR4[10:11](USB_PHY1=OTG) is ON already...

Also USBOH1_UTMI_CLK_VLD is 0x0, which should be 0x80 when USB_PHY1 is ON.

We clear CCM_CCGR4[10:11] then write 0x11 there, but USBOH1_UTMI_CLK_VLD stays 0x0.

2. HOST PHY check

Then we set 0x11 to CCM_CCGR4[12:13](USB_PHY2=HOST), to find out USBOH1_UTMI_CLK_VLD becomes 0x80, which shows only OTG PHY clock is ON in RM.

However the fact is we can use the HOST USB port OK.

3. From above findings, we guess,

- The device is expecting USB_PHY1=OTG always be ON as a main USB controller.

- The bit 6 of USBOH1_UTMI_CLK_VLD is not used in the device.

4. What is USBOH1

We thought USBOH1 has a OTG core and a HOST core.

So 2xUSB Host configuration can be possible.

However when we set USB Host with reading RM, we don't know which USB core we are setting, a host in OTG or HOST?

Is it really possible to use 2xUSB Host?

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hello Carlos,

Any update?

The last repot was taken from customer's boards.

In i.MX50 Rev. D EVK and OBDS and u-boot, USBOH1_UTMI_CLK_VLD is 0x0 at PC=0 and it becomes 0x180 at the entry point.

Seems like the ROM code or IOMUX set the value in USBOH1_UTMI_CLK_VLD.

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,805 Views
CarlosCasillas
NXP Employee
NXP Employee

Hello Nori,

I'm waiting for a reply from the experts. In the mean time, could you please specify your other Thread or Service Request that you mentioned is being handled by the TIC?

Best regards!

/Carlos

0 Kudos
Reply
2,805 Views
norishinozaki
Contributor V

Hello Carlos,

Thanks for letting me know the status there.

That is SR#1-3911657723.

However I will close that SR and I'd like you to support this issue.

Best regards.

Nori Shinozaki

0 Kudos
Reply
2,812 Views
norishinozaki
Contributor V

Hi Carlos,

Could you update the experts' research so far?

When do they expect being to able to get the answer?

What makes them to take such a long time?

Sorry to urge you but we need any updates.

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,812 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

It seems that there are still some confusion and mixing of USB controllers, PHY's and clocks.

There are indeed 2 independent USB cores (controllers) in the i.MX50. One is the OTG core and the other is the HOST1 core.

The OTG core can operate in Host mode or in Device mode. The operating mode is selected by setting the CM  bits in the USBMODE register. Software sets these bits at the beginning of the initialization of the controller.

The Boot ROM uses the OTG controller for serial boot mode and thus this controller may be initialized to device mode by the Boot ROM. This is also why the USB_PHY1 is already ON. If you need it to operate in Host mode, just stop the controller (USBCMD[RS] = 0), reset the controller (USBCMD[RST]=1) and then set the USBMODE[CM] to 0b11 (host mode).

Regardless of the operating mode (host or device), the OTG controller will always use PHY1.

The HOST1 core is Host only. It cannot operate in device mode. The CM bits in the USBMODE register for this controller are fixed to HOST mode (0b10).

The Host1 controller will always use PHY2.

So you can have 2 host controllers on the i.MX50:

- Host1 is always host and always used PH2

- OTG must be set to host mode operation and it always uses PHY1


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,812 Views
norishinozaki
Contributor V

Hello Carlos,

Thanks!

In our findings, #1 is cleared, I had forgotten about the mfgtools...

1. The device is expecting USB_PHY1=OTG always be ON as a main USB controller.

2. The bit 6 of USBOH1_UTMI_CLK_VLD is not used in the device.

About, two USB cores/controllers, I understood there are 2 sets of core registers.

Please continue to look into #2.

We are expecting to get the answer during this week!

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,812 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Nori,

By "Number 2" you mean this?

2. HOST PHY check

Then we set 0x11 to CCM_CCGR4[12:13](USB_PHY2=HOST), to find out USBOH1_UTMI_CLK_VLD becomes 0x80, which shows only OTG PHY clock is ON in RM. However the fact is we can use the HOST USB port OK.

Best regards!

/Carlos

0 Kudos
Reply
2,812 Views
norishinozaki
Contributor V

Carlos,

Yes,  we think "The bit 6 of USBOH1_UTMI_CLK_VLD is not used in the device".

Then we would like to know the correct description of this register in the Reference Manual.

Best regards,

Nori Shinozaki

0 Kudos
Reply
2,812 Views
karina_valencia
NXP Apps Support
NXP Apps Support

richard_stulens​ can you share your comments on this case?

0 Kudos
Reply
2,812 Views
norishinozaki
Contributor V

Thanks Karina,

Richard, could you update anything you found so far?

When do you think you can provide us an answer?

Best regads,

Nori Shinozaki

0 Kudos
Reply
2,812 Views
richard_stulens
NXP Employee
NXP Employee

It looks like we have 2 threads for this issue.

Carlos, can you please close the other one.

OK, I had another look at the RM and noticed that I got fooled as well.

According to the RM, the CLK_VLD register has 9 bits.

Bit 7 is Host  PHY clock.

Bit 8 is OTG PHY clock.

So yes, bit 6 is not used. 0X80 will mean that the Host1 PHY is running.

Please check if this corresponds with your findings.

Best regards,

Richard

0 Kudos
Reply