yashsingh1/xdaforums huggingface dataset:
[T-Mobile LG G2x] sickkside13:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Hey guys why don't we start first with ICS and then JB

ATRIX HD running BATAKANG 1.10
[T-Mobile LG G2x] SefEXE:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

I'm gonna go out on a limb and say it wouldn't matter either way. Like as far as this issue goes, we could try to solve one or the other, but its the same answer.
[T-Mobile LG G2x] Mazout360:
Because that won't change anything. Both are using the same kernel, and this kernel can't communicate with the radio.

Why are you still searching for GPIOs ? I thought PV0/PV1 for RESET and PWR_ON were "confirmed" as per the service manual (they are the same for the p990 anyways)
[T-Mobile LG G2x] Gazooo:
Sorry I'm a little bit of a noob here. So we had 10.1 hackfest where radio worked but there was no hardware acceleration.. Now the lg source for the p990 dropped two months ago and now we have full hardware acceleration but no working radio?

They are the same kernel? If it really is a lost cause could we just scrap the hardware acceleration and put out a nightly 10.1 like the hackrest was before? It would be nice to have all the bugs fixed even if we would have no video recording etc.
[T-Mobile LG G2x] Core Memory:
Because the software is manipulating the setup of the hardware. GPIO can be set in various modes including input or output. setting a GPIO pin as output when it is supposed to be input will put a voltage on the line which may/will cause hardware damage.
[T-Mobile LG G2x] apolkosnik:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

This is depressing, we need an armchair development thread.

If you have an idea just set up the build environment and start writing code, it's really easy once you have your pseudo-code written down.

You can prove that it can be done.
[T-Mobile LG G2x] Core Memory:
We need to find a software tool or debug code. Fully decompiling the LG RIL is also very important.
[T-Mobile LG G2x] xp99:
Yes no working radio on the P999. The radio works just fine on the P990. And yes they both use the same kernel.

We only got a working port of the P990, that's why the radio works. There never was a working port released of the P999. The port of the P990 was ported to the P999. That got hardware acceleration working with general ICS/JB stability. But because the P999 uses a different radio, that's why it is not working right now.

No one wants a 10.1 with no hardware acceleration. Especially since ICS/JB requires hardware acceleration to work. There are other topics working on it, you can search for it.

The bugs were there because of the non-existent hardware acceleration. You won't fix em now unless you get hardware acceleration.
[T-Mobile LG G2x] Mazout360:
I got the decompiling output from IDA Pro if you want it. Because there are many dependencies outside of the library itself, it is hardly readable though.
[T-Mobile LG G2x] Core Memory:
Is it fully decompiled? Send me a PM with a download link and I'll look at it.
[T-Mobile LG G2x] xBIGREDDx:
In board-nvodm.c, there is:

#define MDM_POWER_ON 't' - 'a', 1
#define MDM_RESET 't' - 'a', 0

However, that's only in a function called star_shutdown_prepare(), and if I set it to print debug messages when it tries to acquire that pin handle, I don't ever see it in dmesg, so it might not actually ever run.

(EDIT: It does look like it's PV0/PV1 everywhere else though, as you said.)

Also, I threw a bunch of debug prints in some random GPIO pin acquires, and also in ones that looked relevant. I left out a few for devices that aren't causing problems. I attached the full dmesg as well as the same file with just the GPIO lines.

Also attached are two files I made with grep that show all the GPIO Pin Acquires in the kernel. I didn't attach debug prints to the ones that are declared inline with the acquire, because you can see right there what the pin is.

The debug messages list Port: and Pin:, where the Port number is actually a letter, so 0=A, 1=B, etc.

MRDY for the mdm6600 comes out as Port:20 Pin:6, which makes it PU6.

Now for a question: from what I can tell, nVidia wrote a whole system for interacting with GPIO that was used in the GingerBread builds (nvodm_query and all that), and then got rid of that for the ICS builds and they're just using linux built-in gpio functions? Is that correct?

(EDIT: The kernel source I used was CM7)
[T-Mobile LG G2x] apolkosnik:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Absolute awesomeness, thanks man!
[T-Mobile LG G2x] xBIGREDDx:
Now that I sort of know what's going on, I re-read Mazout's summary post.

Is there any reason we couldn't just bring up the old drivers and blobs alongside the new kernel? It would be somewhat messy, but if it hasn't been tried already and there are no immediately obvious problems I might have a go at it.
[T-Mobile LG G2x] Mazout360:
You can give it a try, but you might be better off starting from the g-slate as it already uses linux functions (see my github).

The problem with forwardporting nvidia's functions is that you'll end up adding a lot of files and headers and were not even sure of the exact cause of this issue. You will need to merge the whole GB odm-kit kernel in the JB version only to handle the radio, and I don't know if that may cause compatibility issues.

Again, we tried many different drivers all with the same results, so it might simply be a wrong setting here after all...

I'll send it to you later today, I don't have it right now
[T-Mobile LG G2x] Core Memory:
In the P999 service manual schematic, for the MDM6600 (U302) connections, there's:

IPC_SRDY1 -> (TP307) pin Y24 = XO_OUT_D0_EN/GPIO_99

IPC_MRDY1 <- (TP308) pin W24 = XO_OUT_A0_EN/GPIO_98

IPC_SRDY2 -> (TP312) pin T15 = UICC_DM/GPIO_52

IPC_MRDY2 <- (TP313) pin Y25 = UICC_DP/GPIO_51
[T-Mobile LG G2x] Mazout360:
MDM6600 in the P990 service manual ?
[T-Mobile LG G2x] apolkosnik:
How's that? Any magical init bits other than AT commands?
[T-Mobile LG G2x] apolkosnik:
Next on the list might be to re-check all the clocks and the PMUs.
[T-Mobile LG G2x] Mazout360:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

I couldn't find anything interesting there yet...though the call for PTS nodes seems to come from lge-ril indeed and it's similar for the gslate version. I'll send you the output too.

Yes that's a good idea..I already verified that but I might've missed something.

Still, there's no STAR_TMUS specific settings for the radio clocks/PMU in the GB kernel.
[T-Mobile LG G2x] Rafase282:
Is it any better than the PA?

What changes did you do to the rom?

The last I was trying was to see if the /system/lib/hw/ files would work without the kernel which they did not. So if you could please try getting the files that are missing, about two from the p990 cm10. One is about the hwa and the other one is sound i think. So just add that and replace the boot.img to see if it works. I would test it myself but I need to advance on a paper and I'm trying to refrain from neglecting it but I want to get this working badly too.

I have attached the files I was talking about.
[T-Mobile LG G2x] Rafase282:
That is the only cm10 we have available. Unless you want to aim for ICS. In that case we would be using their stock so kernel might have to be different and this guide could be used. how to port stock roms
[T-Mobile LG G2x] DankoFGL:
Mayne we can try to boot cm9 stock and after working cm9 we try cm10

Enviado desde mi LG-P999 usando Tapatalk 2
[T-Mobile LG G2x] johnwazhere:
Great

Great to see some development. tried the kernel2.zip on pa cm10 and aokp, just stays on the lg boot logo
[T-Mobile LG G2x] Mazout360:
Well there's definitely something wrong with the kernel...I will try to recompile it tomorrow using P999 defconfig just to make sure it's not the cause of the issue.

Maybe we should try to adjust the hackfest to work on this kernel by reverting the fixes on github that arcee did to make it boot using the older CM7 kernel.

Also, what happened with the boot.img containing the ramdisk ? did it boot past the first LG logo ? was there any sign of touchscreen response or whatever ?
[T-Mobile LG G2x] noahk423:
I read that the kernel is only to be used with stock ics...
[T-Mobile LG G2x] King-Nai:
This file should work, just add into it the zImage and hw files as you need to.

Doesn't respond to being touched. The kernel just doesn't work. Please do use the P999 defconfig! I'll join in on the building tomorrow night and then again this weekend. Which defconfig did you use?
[T-Mobile LG G2x] kepapas:
You guys should just do ics stable and then move to jb

g2x mokee os
[T-Mobile LG G2x] n30wav3:
Rafase I maybe wrong but I think we are reading the whole thing wrong. The files in /lib/hw are only the files that contain the hw (hardware) expect of the device. I.e the sensors, the lights , the audio speaker , mic, GPS, camera, Bluetooth, power... there is nothing graphics here..... also these are all those things which is controlled by the gpio.h file.... the one like which is present in the marsgod kernel... so obviously these depend on the kernel that's why it didn't work without the kernel u tried...... I would rather replace files in the /lib/egl/ folder as the files there seems more related to opengl els and Tegra hardware... please check.... I think what we can also do right now is replace a rather bigger chunk of files in cm10 hackfest from p990 cm10 and keep testing it on hackfest kernel... leaving only the ones we think would depend on partition structure, radio and ril... this way we can gradually mix the two roms and may pin point the exact files that depends on kernel

EDIT: yup I Googled it. These are the files that should directly be responsible for graphics. Although m not sure 2D or 3D.... also there is a slight file size difference in libGLES_android.so b/w cm7 and hackfest ... others seems same

On the other hand I think the files in /hw/ folder should move with the kernel whenever we are trying the kernel from stock ics or p990 cm10 although the problem is the sensors and light files might be different
[T-Mobile LG G2x] DankoFGL:
So, why not to try stock ics first? A ported stock ics from i don't know, another tegra 2 device and try with this kernel?

Enviado desde mi LG-P999 usando Tapatalk 2
[T-Mobile LG G2x] noahk423:
Yep, stock ics is what I would guess to look first for something compatible. Then move on to other things. The su660 sources were for the stock ics rom anyways.
[T-Mobile LG G2x] johnwazhere:
yes the screen is responsive on aokp
[T-Mobile LG G2x] Mazout360:
I'll be compiling another kernel image which should be compatible with CM10, if everything goes right I'll post it here for you guys to try it out later
[T-Mobile LG G2x] BigDig:
idea

I think it would be easier to make port from the stock ICS port that Tonyp made for the o2x users. Maybe if we try to include our kernel and partition it right it should work on our phone too! http://xdaforums.com/showthread.php?t=1959545
[T-Mobile LG G2x] Волк:
I just wanted to throw in my two cents worth (which is about all I can contribute): I remembered that Bene mentioned something about how to make an ICS kernel work for JB, info which is above my level but you guys here may benefit. His post is here

http://xdaforums.com/showthread.php?p=31229402
[T-Mobile LG G2x] fduong97:
so does this work on CM9 AOKP?
[T-Mobile LG G2x] johnwazhere:
i tried AOKP didnt work
[T-Mobile LG G2x] apolkosnik:
Gee...

copy the devices/lge/p990 to p999, adjust filenames, and then replace p990 to p999 inside the files... copy kernel into devices/lge/p999/ then follow the instructions in that thread.

This is how you build cm10 for p990:

http://xdaforums.com/showthread.php?t=1971645
[T-Mobile LG G2x] n30wav3:
Uh.... WAT :eek:
[T-Mobile LG G2x] bakedpatato:
If it was that easy RC would've done that a long time ago...
[T-Mobile LG G2x] xBIGREDDx:
I took a look around and there are enough conflicting files that would have to be worked around that I've already bailed on the idea. It would probably be less work to get it done differently anyway.
[T-Mobile LG G2x] Core Memory:
Sorry, I meant in the P999 service manual.

---------- Post added at 05:19 PM ---------- Previous post was at 05:04 PM ----------

Incorrect answer removed, I didn't read close enough.
[T-Mobile LG G2x] apolkosnik:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Could you make some more logs this time around when you switch to airplane mode and then switch back.
[T-Mobile LG G2x] xBIGREDDx:
Sure. Any other devices you'd like the GPIO for, while I'm in there? Or other parts of the 6600 code?
[T-Mobile LG G2x] apolkosnik:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Nah, that should be fine... Just try to do them separately, and check if the radio works after switching back from airplane mode. Thanks!
[T-Mobile LG G2x] xBIGREDDx:
The only kernel log entries created when I turned airplane mode off and back on were these:

<4>[ 104.460450] rin_nd_close - line : 440
<4>[ 140.905592] powerkey_interrupt_handler
<4>[ 140.918780] POWERKEY press
<4>[ 141.728214] powerkey_interrupt_handler
<4>[ 141.728277] powerkey_interrupt_handler
<4>[ 141.728332] powerkey_interrupt_handler
<4>[ 141.738751] POWERKEY release
<4>[ 163.256452] rin_nd_open - line : 455

The powerkey lines are just where I long-pushed the power button to get to the settings menu.

The logs I posted earlier were only the GPIO handle acquires; I'll put some debug on the GPIO state changes for the mdm and the pv0/pv1 and post back.

EDIT: The rin_nd_close and rin_nd_open functions come from drivers/star/rindrv.c. Also here's rindrv.h.

EDIT2: There's a debug flag in rindrv.c, I've turned it on and will recompile.
[T-Mobile LG G2x] xBIGREDDx:
OK, here is the new log. The debug output from rindrv seems to show every radio transaction, so there's a pretty big chunk of that in the middle. Then Airplane mode on at 66 seconds, back off at 100 seconds.
[T-Mobile LG G2x] Mazout360:
Could you try enabling debug for TS0710/MDM6600/MUIC/FOTA also ?
[T-Mobile LG G2x] apolkosnik:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Good call Mazout360
[T-Mobile LG G2x] Core Memory:
Here's some discussion including RC's comments when this similarly happened with CM7.1 for the G2x/P999.

Problem:

http://code.google.com/p/cyanogenmo...ad.txt&token=e48604543066a5f0c8c367ea63d32d87

Discussion:

http://code.google.com/p/cyanogenmod/issues/detail?id=4234
[T-Mobile LG G2x] apolkosnik:
Core Memory, you seem to be reading between my verses :)
[T-Mobile LG G2x] xBIGREDDx:
Here. The TS0710 really likes to print things.

I sent adb reboot and when it came back up I started the log. After the phone showed a data connection I did airplane mode for a bit and the brought it back and stopped the log a little after data started again. I didn't load any web pages or anything because that really floods the log.

Also the log is in 2 parts (file size limits here) so I left a few lines of overlap.
[T-Mobile LG G2x] apolkosnik:
Interesting piece... especially the part I've marked in red... Radio gets functional either at the point where [BL] power-on happens, or the empty printk line happens.

<4>[ 13.697957] ifx_spi_open - buff size = 3068

<6>[ 13.698283] TS07.10: ts_ldisc_open executed

<4>[ 13.698291] TS07.10: CPU0: frame_nodes_lock [waiting...]

<4>[ 13.698299] TS07.10: CPU0: frame_nodes_lock [locked]

<4>[ 13.698306] TS07.10: CPU0: frame_nodes_lock [unlocked]

<4>[ 13.698312] TS07.10: spi_write_sema: down

<4>[ 13.698319] TS07.10: CPU0: frame_nodes_lock [waiting...]

<4>[ 13.698326] TS07.10: CPU0: frame_nodes_lock [locked]

<4>[ 13.698333] TS07.10: CPU0: frame_nodes_lock [unlocked]

<4>[ 13.698338] TS07.10: spi_write_sema: downDTT: T = 45, Range = 1 (-64 : 60)

<4>[ 15.797220] [BL] Power On

<4>[ 17.700203]

<4>[ 17.700206] TS07.10: CPU1: [0] dlci: frame_nodes_lock [waiting...]

<4>[ 17.700216] TS07.10: CPU1: [0] dlci: frame_nodes_lock [locked]

<4>[ 17.700225] TS07.10: CPU1: [0] dlci: frame_nodes_lock [unlocked]

<4>[ 17.700233] TS07.10: spi_write_sema: up [++frames_to_send_counter=1]

<4>[ 17.700248] TS07.10: return retval=6

<4>[ 17.700257] TS07.10: CPU0: frame_nodes_lock [waiting...]

<4>[ 17.700267] TS07.10: CPU0: frame_nodes_lock [locked]

<4>[ 17.700275] TS07.10: CPU0: frame_nodes_lock [unlocked]

<4>[ 17.700283] TS07.10: writing to SPI start [i=0; --frames_to_send_counter=0]ifx_spi_send_and_receive_data 1095: TX(0010) : ifx_spi_send_and_receive_data 1118: RX(0174) :

<6>[ 17.723774]

<6>[ 17.723778] TS07.10: UIH packet received

<6>[ 17.723784]

<6>[ 17.723786] TS07.10: Short UIH pkt received

<6>[ 17.723793]
[T-Mobile LG G2x] Mazout360:
Maybe the empty printk has something to do with it, but [BL] is for the backlight driver...maybe the screen was turned on during that moment :p
[T-Mobile LG G2x] xBIGREDDx:
The empty printk is probably coming from the function mux_flush_buffer in ts0710_mux_p999.c. (Link should take you to line 1680)
[T-Mobile LG G2x] apolkosnik:
One interesting thing I picked up in drivers/star/star_powerkey.c ... take a look at s_modemCheck. It translates to port = 'h'-'a'; pin=2; -> PH2... It seems that it's used to suspend the modem, but it's not showing up in anything beyond Gingerbread.
[T-Mobile LG G2x] Core Memory:
It's probably been moved as with other things. Take a look at the O2X/P990 code to see where the equivalent is for that phone.
[T-Mobile LG G2x] xBIGREDDx:
That's actually coming out of star_bl.c.

There's a line, //#define AP_SUSPEND_STATUS in star_powerkey that is commented out, so all of the s_modemCheck stuff never runs. But the same code is in star_bl. Actually in the source I have the PH2 define isn't even in star_powerkey, so I assume maybe you meant star_bl? Either way, I'm confused why there's any reason for the power key or the backlight driver to be checking on the modem.

Also, it is in fact running, for what that's worth:

<4>[ 10.119390] gpioDebug: drivers/star/star_bl.c : star_aat2870_probe Line: 1281
<4>[ 10.119399] gpioDebug: s_modemCheck.pinHandle Port: 7 , Pin: 2
[T-Mobile LG G2x] n30wav3:
Re: CM10.1 based ROM #7 - Works: Camera, HWA, wifi, sdcard, Broken: radio, batt indic

Ok m ready to make a fool of myself here I usually check out the progress made by u guys here... anyway... so just to MAYBE help u out

power key and backlight checking on the modem..... isn't this sounds more like wifi policy for wifi modem.... facepalm if u think this deserves that :p ...
[T-Mobile LG G2x] Mazout360:
This is simply a power management policy to reenable the radio if it went to sleep while the screen is being turned on using the home key. You're wasting your time searching around backlight/homekey drivers.
[T-Mobile LG G2x] apolkosnik:
Well, your power management policy is not done beyond Gingerbread, since I'm trying to figure out the delta between anything that touches radio it's worth a shot. Last night, I've rolled and tested 4 test builds (kernel and complete ROM) to see if anything changes if I'll set it early in the baseband init, and to change the default to test that and the radio is not really responsive.

<6>[13:02:17 18:23:39.220] spi_statistic_cb_func ended ...(16, 5)

<6>[13:02:17 18:23:49.220] spi_statistic_cb_func: statistics_count=17, spi_h_st

ate=5

<6>[13:02:17 18:23:49.220] spi Tx : prev 1 curr 1 flg=0

<6>[13:02:17 18:23:49.220] spi Rx : prev 0 curr 0 flg=0 spi_h_state=5

<6>[13:02:17 18:23:49.220] spi_statistic_cb_func ended ...(17, 5)

<6>[13:02:17 18:23:59.220] spi_statistic_cb_func: statistics_count=18, spi_h_st

ate=5

<6>[13:02:17 18:23:59.220] spi Tx : prev 1 curr 1 flg=0

<6>[13:02:17 18:23:59.220] spi Rx : prev 0 curr 0 flg=0 spi_h_state=5

<6>[13:02:17 18:23:59.220] spi_statistic_cb_func ended ...(18, 5)

I welcome any constructive ideas that we can test. Unless you'd rather buy two of my G2x'es off me :).
[T-Mobile LG G2x] Core Memory:
Let's not argue, we're all trying to solve this aggravating technical puzzle.
[T-Mobile LG G2x] King-Nai:
I suspect someone has checked the pin and port here? https://github.com/Mazout360/lge-kernel-gb/blob/master/arch/arm/mach-tegra/board-nvodm.c#L2103

Remember, for the Gpio, it's multiplied by 8. https://github.com/Mazout360/lge-ke...rm/mach-tegra/nvrm/io/common/nvrm_gpio.c#L136

My few cents here
[T-Mobile LG G2x] Core Memory:
One more cent:

http://lxr.free-electrons.com/source/arch/arm/mach-tegra/gpio-names.h
[T-Mobile LG G2x] Core Memory:
Linux/include/asm-generic/gpio.h

http://lxr.free-electrons.com/source/include/asm-generic/gpio.h?v=2.6.36#L26
[T-Mobile LG G2x] King-Nai:
Well, the naming convention goes 'v'-'a'. Aka, port V. 'v'-'a' = 21. 21*8 = 168

Then you just add the pin number there. But going back to my original question. Has someone printk'd the port and pin numbers at that line?

https://github.com/Mazout360/lge-kernel-star/blob/master/arch/arm/mach-tegra/gpio-names.h#L191
[T-Mobile LG G2x] xBIGREDDx:
That line doesn't even run; it's under #ifndef CONFIG_MACH_STAR_TMUS and since this is the STAR_TMUS that whole if block gets skipped. Also I did put a printk there and it never prints.

EDIT: Also if you look at the code, the address comes from NvOdmPeripheralGetGuid which pulls addresses from the database here, in this case from the GUID star-spi which leads us to 'u' - 'a', 6 listed at SRDY1. But it doesn't matter because it never gets called.
[T-Mobile LG G2x] King-Nai:
Still, MRDY and SRDY are switch here: https://github.com/Mazout360/lge-kernel-star/blob/master/drivers/spi/spi_mdm6600.c#L715

Looking here: https://github.com/CyanogenMod/lge-...ery_discovery_starsmartphone_addresses.h#L508

Which could be a big issue.....
[T-Mobile LG G2x] Mazout360:
Oh yes indeed thanks for pointing that out!

Yet I already tried several combinations without results...IMO there's something wrong elsewhere too

EDIT: fixed.

EDIT2: Hey by the way, to confirm that there's a GPIO problem here, you can try compiling the GB kernel without the right GPIO settings and see if it reproduces the pts loop bug.
[T-Mobile LG G2x] xBIGREDDx:
Well, I broke something (boot looping), and I haven't taken the time to figure out what I did, but this goes to show I should probably be using some sort of version control. So all the debug prints I added are gone, but most of them were just trashing the log so not a huge loss.

Anyway, I rebuilt my gb kernel off the source and made sure it worked. Then I switched the MRDY1 and SRDY1 in the starsmartphone_addresses database and it broke not only the radio, but the battery meter. That makes sense because the battery meter ("fuel gauge") talks through the modem. So if your CM10 has functioning battery meter I don't think we're necessarily having a GPIO problem, or even an SPI problem. Unless the battery data comes over the UART connection?

Other thoughts: I'm not seeing anywhere in the modem driver where it actually pulls the SRDY pin from the database, or the MRDY2/SRDY2 for that matter. The SRDY pins get configured instead in drivers/spi/tegra_spi_slave.c and I think the Tegra assumes that if MRDY1 then MRDY2 also.

In that direction of things, it looks to me like the Tegra is acting as Slave SPI, and the mdm6600 as Master SPI. Does that sound right to you?

EDIT: Logs attached. If you split-diff in Vim or whatever your favorite text editor is, you can clearly see where things break.

Oh also I didn't swap MRDY2 and SRDY2, only MRDY1 and SRDY1, but that was enough to break everything anyway.
[T-Mobile LG G2x] King-Nai:
Which did you switch?
[T-Mobile LG G2x] TheEnternal:
Red, that makes sense, since the battery and radio were broken together, I believe the battery fix was a work around if I'm not mistaken