imx233 shutdown

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

imx233 shutdown

Jump to solution
1,530 Views
whitewool
Contributor I

Hi,

Im working on a mobile device based on imx233, using 2.6.31 Linux Kernel available with LTIB.

I'm developing the main application based on qt, which is the only interface with the user, no other applications, minimal kernel configuration.

For low power consumption the screen is blanked after 30 sec with no button pressure.

I also need usb host to connect an usb pen to the device but only when the user need to save data, usb can be down in normal uses.

This is the problem: I see that low freq profiles are allowed only when lcdif clock and usb clock usage are zero.

Browsing the code it seems to me that blanking the screen with echo 4 > /class /graphics/fb0/blank should bring lcdif clock usage count to 0.

I need help understand how to do this with usb, how to enable and then disable it in such a way that the clock usage count is zero, to be finally allowed to use low freq profiles.

Any help is appreciated I've still to learn about usb.

Thanks

Alberto

Labels (2)
0 Kudos
1 Solution
1,090 Views
GraceH
Senior Contributor II

Alberto,

usb_clk0 is used by usb host. If your product doesn't need usb host function, you don't need take care usb_clk0.

If your product need host function, you can refer MX28 implementation in the L2.6.35_1.1.0 release.

usb_clk0 is enabled when host driver is probed, it can only be disabled when host driver is removed.

So you need configure USB host driver as loadable module.

But in usb_dr.c of MX233 , only usbotg_init_ext is implemented to enable usb_clk

usbotg_uninit_ext is not implemented to disable usb_clk.

You need refer MX28 code to implement it.

Grace

View solution in original post

0 Kudos
7 Replies
1,090 Views
YixingKong
Senior Contributor IV

Alberto, if Grace answered your question, please click Correct Answer.

Thanks,

Yixing

0 Kudos
1,090 Views
whitewool
Contributor I

Hi Yixing, I just come back now, and it seems to me a nice answer. I'll browse mx28 code, modify the mx23 one and I'll test everything on the device. Be quite sure I'll set the answer when I've done.

Thanks to Grace and to you for your help

Alberto

0 Kudos
1,090 Views
YixingKong
Senior Contributor IV

Alberto, we have not seen your rely yet and assume the answer is correct. If it is not, please come back.

Thanks,

Yixing

0 Kudos
1,090 Views
whitewool
Contributor I

Dear Grace,

I developed a first set of modifications to the 2.6.31 code taking from 2.6.35 code, just limited to USB host enable/disable with ehci-hcd probe/remove.

I started from the 2.6.35 code as you suggested and tested it on 2.6.31 only, because on 2.6.35 I have strange boot problems at the moment, but it should work for mx233 2.6.35 also.

I could attach a link to my modified files if someone is interested or can give further hints, but I don't know if this is allowed, please let me know.

Anyway these are the results:

Low freq enable:

This seems to work because, with both screen blanked and ehci-hcd removed i can go 24 or 64 Mhz (really not because the system crashes for another bug, but the sw gate now is open).

Residual power consumption when enabling USB host.

Before these modifications 9mA current entered on modprobe ehci-hcd and never went away.

Now, probing and removing ehci-hcd, about 6 mA current is correctly added and removed, but still a minor 3mA current remains and never go back.

I'd like to understand about this residual power (this is an underwater device, must stay on as long as possible).

As far as I see when ehci-hcd is removed USB phy PLL nd UTMI clock should be stopped and the full USB logic clock should be gated. Have you idea of what is missing?

Another question: I'd like to understand by you if the full suspend/wakeup logic also could be ported to mx233.

Thanks

Alberto

.

0 Kudos
1,090 Views
whitewool
Contributor I

Dear Yixing,

you still didn't see my reply because the operation is not obvious to us, and need to be studied and tested, because we expected the thing to work and was not prepared to enter USB deep implementation.

I asked for some indication with my reply to Grace, and then I went ahead that way, but at the moment what I can see that that way don't work. The patch don't fully work, because when I disable usb host yes, I can use 24Mhz but the USB power is still there.

Furthermore going back to higher frequencies (261MHz) blocks the system as I say i this threadimx233 hang changing freq from 24MHz to 261MHz j and I can't really test if low freqs are usable before and after USB host enable/disable.

Now I had to setup a new Linux vm loading the imx28 2.6.35 ltib and set it for mx233 to see the full implementation for imx28, with all patches applied, and work on. But, another problem, the system don't boot (kernel panic) using the boot command: noinitrd console=ttyAM0,115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifs rw ip=none gpmi which with 2.6.31 worked perfectly, and again I'm stuck and far from being able to setup and test the solution.

So if the answer is that using mx28 implementation is ok, I hope to be able to say that it is correct.

0 Kudos
1,090 Views
YixingKong
Senior Contributor IV

Alberto, if the issue is still there, please continue the discussion thread with Grace.

Thanks, Yixing

GraceH

0 Kudos
1,091 Views
GraceH
Senior Contributor II

Alberto,

usb_clk0 is used by usb host. If your product doesn't need usb host function, you don't need take care usb_clk0.

If your product need host function, you can refer MX28 implementation in the L2.6.35_1.1.0 release.

usb_clk0 is enabled when host driver is probed, it can only be disabled when host driver is removed.

So you need configure USB host driver as loadable module.

But in usb_dr.c of MX233 , only usbotg_init_ext is implemented to enable usb_clk

usbotg_uninit_ext is not implemented to disable usb_clk.

You need refer MX28 code to implement it.

Grace

0 Kudos