yashsingh1/xdaforums huggingface dataset:
[T-Mobile LG G2x] Naberus:
Its not really that the nodes are closed - its that the driver itself can't talk via the serial interface to the thing its trying to drive in order to provide a device node. (Ts0710->ldisc->device)

When the ts0710 first fires up, its at the same time as the mdm6600 and ifx, so i'd imagine its still something in the plumbing.

(Since the GB RIL uses the /dev/pts* nodes, I thought the GB kernel *was* using the kernel MUX??)
[T-Mobile LG G2x] Mazout360:
Oh I see...

Mdm6600, ifx_n721 (in GB) and ts0710 are indeed loaded one after another but I don't know if it has something to do with our problem...they are simply configured to load like that I think.

..and yes it uses MUX but if you compare it to the base driver (the one you could find in a motorola device repo since this modem is usually found in motorola phones) LG used a LGE_KERNEL_MUX config to change some settings, changing the original "mux" node to a "pts" node. I wonder if using a RIL lib blob from another device using the newer ts0710mux could actually fix radio and RIL :confused:

EDIT : @Naberus I tried your debug build..very useful and smooth btw... and it returns warning: `rild' uses 32-bit capabilities (legacy support in use), why is that ?

EDIT2 : Using a TSMUX driver from another device with it's RIL blobs doesn't work either.
[T-Mobile LG G2x] Naberus:
That may be, but on my phone the following dumps out of the kernel with the same timestamp one right after the other, so I at least have to dig around in the code to confirm either way:

<6>[07:02:01 03:45:29.450] mdm6600(23-mar-12): ifx_spi_open called

<6>[07:02:01 03:45:29.450] ts_ldisc_open opening tty(-805470208)

<6>[07:02:01 03:45:29.450] ts0710mux(23-mar-12): ts_ldisc_open executed

Edit: @Mazout360: you were right. I don't think they're related. The above just happens (I think) because the ril opens /dev/ttyspi0 and /dev/pts1 around the same time.

It is super-useful to know that there might be "stock" Motorola code floating around to look at.

I won't even guess at this point about RIL stuff though, but binaries scare me.

If it's smooth, it wasn't me, I swear! ;)

I saw that warning, but I'm only familiar with what that warning means in the context of more standard Linux - it's an issue with libcap. I don't know what effect it would have with the RIL, but it doesn't seem to affect the part I care about right now. (The rild binary is one built and installed from CM source, so I wonder if that error comes from a dynamically loaded binary.)
[T-Mobile LG G2x] King-Nai:
I have a hunch. Or, do were even run the code here?: https://github.com/CyanogenMod/lge-...2-ics/arch/arm/mach-tegra/board-nvodm.c#L2014

Try changing arch/arm/mach-tegra/lge/star/board-star.c:354 on the bitbucket

To
[T-Mobile LG G2x] Naberus:
I'm not sure if the P999 needs that code for the cell radio to work - that's for registration of a TDMB device, which (if I'm getting the right thing) is digital TV reception. Please correct me if I'm wrong.

It's sort of along the right lines though (unregistered devices), because now that I'm looking through the dmesg of both GB and ICS/JB kernels, I don't see anything about the tegra SPI slave being registered in the newer kernel... And I believe that happens to be required for the ts0710 to work.

The 2.6.39 kernel doesn't like to define CONFIG_DUAL_SPI for P999 (only for BSSQ), but dual spi is used in the GB kernel... So one wonders if there's an unconfigured SPI slave.

Bah... I babble a lot - is this crap useful to anyone, or should I shut up? (Or maybe start a new thread so I'm not polluting adam's thread?)
[T-Mobile LG G2x] King-Nai:
I mean the whole registering of the mdm6600 part.

Here we go: arch/arm/mach-tegra/lge/star/board-star-baseband.c

Chang that to:

The bus nums did not match.

https://github.com/CyanogenMod/lge-...2-ics/arch/arm/mach-tegra/board-nvodm.c#L1794

Make sure that dual SPI is configured.
[T-Mobile LG G2x] nickleo642000:
here is googles git hub for mdm6600 drivers for tegra 2

https://android.googlesource.com/ke...51cfdb20f846283a/drivers/usb/serial/mdm6600.c

android / kernel/tegra

clone https://android.googlesource.com/kernel/tegra

Kernel tree for NVIDIA Tegra family SOICs on Android.

Branches

android-tegra-moto-2.6.36

android-tegra-moto-2.6.39

android-tegra-moto-2.6.39-ics-mr1

android-tegra-moto-2.6.39-jb-mr0

android-tegra3-grouper-3.1-jb-fr1

android-tegra3-grouper-3.1-jb-fr2

android-tegra3-grouper-3.1-jb-mr0

android-tegra3-grouper-3.1-jb-mr1

android-tegra3-grouper-3.1-jb-mr1-fr

master
[T-Mobile LG G2x] King-Nai:
That's for USB, thanks though
[T-Mobile LG G2x] Naberus:
I had already tried several alternate bus/chip numbers yesterday (e.g. the ones in struct spi_board_info tegra_spi_board_info[] from board-nvodm.c@2017).

I just tried the IFX numbering too - same nothing.

That specific line would not be active for P999 because it is #if'ed out by the preprocessor a few lines above:

#if defined(CONFIG_SPI_TEGRA) && !defined(CONFIG_SPI_MDM6600)
[T-Mobile LG G2x] Core Memory:
Here's another variation from http://pastebin.com/Nd6etQhr:

> #ifdef CONFIG_MACH_STAR_P999

> #ifdef CONFIG_DUAL_SPI

> static struct spi_board_info __initdata spi_bus2_devices_info[] = {

> {

> .modalias = "mdm6600",

> .bus_num = 1,

> .chip_select = 1,

> .mode = SPI_MODE_1,

> .max_speed_hz = 24000000,

> .controller_data = &tegra_spi_slave_device2,

> .irq = 0,

> .platform_data = 0,

> },

> };

> #endif

> #endif
[T-Mobile LG G2x] Naberus:
That's unmodified v30a source, not really a variation.
[T-Mobile LG G2x] Mazout360:
Guys I think you're not concentrating on the right code...The drivers gets initialized properly and it doesn't seem, from past tries, that changing board settings does anything interesting...As for dual spi settings there's indeed some coding concerning this in the GB kernel but by looking at the P999 tech sheets there's is no dual SPI..I might be wrong there though but I didn't see anything. For the tegra slave driver the useful part of it in the GB kernel has been moved into another driver's source code (MDM6600 I think) that's why it's not there anymore, yet there is a "spi_slave_tegra" driver that gets loaded with TS0710MUX instead, but there might not be any debug messages being output from it that's why you don't see it in the dmesg (just a theory I didn't check yet).
[T-Mobile LG G2x] Core Memory:
You've probably already looked at these but, here's Vork's and rmcc's ICS githubs which has mdm6600 code in it:

https://bitbucket.org/Vork/lge-kernel-star/src/f1a261d39845/arch/arm/mach-tegra/board-nvodm.c

https://github.com/CyanogenMod/lge-...2-ics/arch/arm/mach-tegra/board-nvodm.c#L1794

Neither of them has .platform_data = 0, in

//20100613-1, , add spi slave [START]

#if defined(CONFIG_SPI_MDM6600)

#include <linux/spi/spi.h>

static struct spi_board_info tegra_spi_board_info[] __initdata = {

{

.modalias = "mdm6600",

.bus_num = 1,

.chip_select = 0,

.mode = SPI_MODE_1,

.max_speed_hz = 24000000,

// .platform_data = NULL,//����

.irq = 0,

},

//20100809-1, , Add SPI2 for AP-CP IPC [START]

#ifdef CONFIG_DUAL_SPI

{

.modalias = "mdm6600",

.bus_num = 2,

.chip_select = 0,

.mode = SPI_MODE_1,

.max_speed_hz = 24000000,

// .platform_data = NULL,//����

.irq = 0,

},

#endif

//20100809, , Add SPI2 for AP-CP IPC [END]

};
[T-Mobile LG G2x] Mazout360:
Okay I think I made some progress...

Here's my kmsg :

EDIT : Fixed probe error in dual spi mode

And my radio log cat :

Now I am concerned about two debug logs, which are ( 108): mainLoop 3.3 Current errno: Invalid argument, err:-1 and <4>[70:01:01 01:21:42.693] mdm6600: probe of spi1.1 failed with error -16 (EDIT not anymore :p)...I think I can fix the probe issue, but I'd really like to know what's the source code of that da** mainloop 3 because it always causes issues.
[T-Mobile LG G2x] Naberus:
I don't get that. I'm still stuck on the /dev/pts1 thing....

W/RILSWITCH( 108): RIL SWITCH STARTED
D/KIPC ( 108): KIPC_Init()
D/KIPC ( 108): Address is 127.0.0.1, Port is 45211
D/KIPC ( 108): Binding...
D/KIPC ( 108): listening...
D/KIPC ( 108): accepting...
D/RILSWITCH( 108): RIL ARG 0: /system/bin/rild
D/RILSWITCH( 108): RIL ARG 1: -d
D/RILSWITCH( 108): RIL ARG 2: /dev/ttyspi0
D/RILSWITCH( 108): Calling rilInit() for vendor RIL
I/RIL ( 108): Opening tty device /dev/ttyspi0
D/RIL ( 108): mainLoop 1. Current errno: Success
D/RIL ( 108): lge-ril: main loop routine start
D/RIL ( 108): mainLoop 2. Current errno: Success
D/RIL ( 108): mainLoop 3. Current errno: Success
D/RILSWITCH( 108): Calling rilInit() for GAN RIL
E/RIL ( 108): fd of /dev/ttyspi0 is 18
D/RIL ( 108): mainLoop 3. Current errno: Success
D/RIL ( 108): mainLoop 3.1 Current errno: Success
D/RIL ( 108): mainLoop 3.2 Current errno: Success
D/RIL ( 108): mainLoop 3.3 Current errno: Success, err:0
D/RIL ( 108): lge-ril: Device path = /dev/ttyspi0
D/RIL ( 108): end of if ( fd > 0 )...
D/RIL ( 108): mainLoop 6. Current errno: Success
D/RIL ( 108): end of if (s_device_path != NULL)...
D/RIL ( 108): end of while (fd < 0)...
D/RIL ( 108): mainLoop 7.Current errno: Success
D/RIL ( 108): ainLoop: RAT is set to WCDMA
D/RIL ( 108): lge_ril: RIL_STATE_NEEDS_INITIALIZATION
D/RILSWITCH( 108): Vendor RIL requests timed callback
D/RIL ( 108): initializeVendorRIL START
D/RIL ( 108): initializeVendorRIL: product RAT = 1
D/RIL ( 108): lge_ril: RIL_STATE_INITIALIZATION
D/RIL ( 108): initializeVendorRIL: USE_ONE_DLC NOT DEFINED
D/RIL ( 108): lge-ril: mainLoop: Opening DLC devices...
D/RIL ( 108): Device /dev/pts1 is not open (No such device). Retrying until success
[T-Mobile LG G2x] Mazout360:
Yes I got these too. Have you set back DUAL_SPI ? it was missing in the /drivers/spi/Kconfig. You may need to adjust the bus in board-star-baseband too. Then, I got the mainloop 3.3 issue.

Don't you think it should call /dev/pts/1 instead of /dev/pts1 ? That's been bugging me for a while but we can't do anything about that...

MDM6600 keeps calling ifx_spi_open too..I'll try to add some debug comments to see why it never gets completed.
[T-Mobile LG G2x] King-Nai:
What changes did you make to finally get the mdm6600 to probe? Try making similar changes to the mux. If you ls /dev/pts/ how many devices do you get?
[T-Mobile LG G2x] Mazout360:
I debugged ifx_spi_open and everything seems in order...it never returns -ENODEV, tries to open ttyspi0 and spi_data->users++ == 0.

In single SPI it should probe. In dual SPI set both chip_select=0 and you will have bus_num = 1 and bus_num = 2 for the other. SPI_MODE is always set to 1.

If I ls /dev/pts/, I get two results (0 and 1) so I was wrong. Though, ls /dev/pts* returns pts1, pts2, pts3... and 0 and 1, so the nodes ARE there...

Could it be a problem with the board-star-pinmux settings ?
[T-Mobile LG G2x] King-Nai:
So, it never probes in dual? It still should. Anyway, looking through code, the dual is for EDGE/HSPA+. I have those changes yet it still won't probe for some reason.

Which of these is run?

It should be the first looking at old code. Also, the mux isn't registered with a termios like the old code. Just some diffs I see.

Edit: Yup, I still get -1 on ttyspi0.
[T-Mobile LG G2x] Mazout360:
Yes it probes in dual, read my last post.

This is an error. One should refer to N_TS0710 and the other one to N_GSM0710. GSM0710 is an older syntax to be used on non-LGE_MUX boards and N_GSM as tty driver. I already tried using N_GSM but it doesn't change anything.
[T-Mobile LG G2x] King-Nai:
Got spi working, anyway, the mux_tx thread does start.

If you turn on debugging on tsmux and mdm6600 you get this error:
[T-Mobile LG G2x] Mazout360:
What do you mean by "turn on debugging" ? Changing the debug level ?

Is this ioctl function vital ? it doesn't even exist in the older drivers
[T-Mobile LG G2x] King-Nai:
Yea, just changed the debug level, easiest way to turn on debugging.
[T-Mobile LG G2x] apolkosnik:
As defined in include/asm-generic/ioctls.h

#define TCGETS 0x5401

#define TCSETS 0x5402

There was a thread on these:

Take a look here http://lkml.indiana.edu/hypermail/linux/kernel/0411.3/0944.html
[T-Mobile LG G2x] Mazout360:
I'll take a look into that.

I activated all debug messages and changed all the outputs as printk's for MDM6600 and ts0710. Here's what I got :

...and it goes on and on with the two last messages.

EDIT : TS0710 doesn't allocate memory for the mux in mux_open. Is this normal ?

EDIT2 : Recoded the driver from scrap (google repos) to adapt on the p999, still a no go. Getting "Tty open when line discipline not active" issues even though the ldisc shows in /proc/tty/ldiscs.
[T-Mobile LG G2x] King-Nai:
Put kprints in the ldisc function, they never get called. I found that out yesterday. The ldisc open allocates memory I believe.
[T-Mobile LG G2x] Naberus:
So, I have a potential source of the problem. It could be nothing, but it seems significant to me.

I've traced the send_sabm timeout to a call to spi_sync in the MDM6600 code. spi_sync is a synchronous call to the spi interfaces which should perform the transfer. It never returns. (Find spi_sync in spi_mdm6600.c, put a printk before and one after and it never prints the second.) This is what's causing the open (ENODEV) failure on /dev/pts1. (I'm reasonably certain that device node is correct BTW, as the /dev/ptsX nodes are the ones provided by the ts0710.)

Back to the SPI... In the 2.6.32 (GB) kernel, the function that passes the message over the SPI is called ifx_spi_sync_read_write in drivers/spi/spi_mdm6600.c. In the 2.6.39 (ICS) kernel, the equivalent function is called ifx_spi_sync_data in drivers/spi/spi_mdm6600.c. The interesting thing is that the GB kernel *splits* the message in two and sends it over both SPIs "simultaneously". The ICS kernel does not do this at all, at least not directly in ifx_spi_sync_data.

I'm wondering if the baseband *expects* the data to be split and sent over the two interfaces to reconstruct it. (Or maybe the packet size is not the right size when not split.) I.e. it thinks it's only receiving half the message so never replies, causing the transfer fail and never return.

I have no proof of any of the above, because I'm just guessing at what the baseband is doing based on the code I can see... So take that with a grain of salt.
[T-Mobile LG G2x] Mazout360:
That's quite possible...I was wondering why they changed the data receive/send by a data sync function and how this could affect how the baseband will react to it. I didn't venture into recoding everything in two separate functions though as this will be complicated.
[T-Mobile LG G2x] joeyxl:
That's odd, is that a coding practice across all GB kernels? If so maybe another dev has run into this and has a solution.
[T-Mobile LG G2x] Core Memory:
Vork's spi_mdm6600.c for ICS kernel uses the prior scheme: https://bitbucket.org/Vork/lge-kernel-star/src/bd181218f959/drivers/spi/spi_mdm6600.c?at=ics

I suppose that it is from GB.

---------- Post added at 06:53 PM ---------- Previous post was at 06:37 PM ----------

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62
[T-Mobile LG G2x] Core Memory:
I've been looking at the spi history log of Cyanogenmod and found that they got assistance from various sources including Qualcomm. If you look in http://code.metager.de/source/history/CyanogenMod/Kernel/drivers/spi/

you will find the person's name and email address. How about trying what Cyanogenmod does, the worst than can happen is no response.
[T-Mobile LG G2x] Mazout360:
Guys, forget the other mdm6600 sources you may find. GB's (inc. hackfest) MDM driver doesn't have compatible gpio functions and almost all the other devices have a USB serial MDM6600 driver which is also not compatible. It's fixable but it's more trouble nonetheless.

@Naberus I looked at the base driver from google sources and on devices with a similar architecture and it seems that the 2.6.39 based driver has only a sync data function and no variations of it...I already changed this function to make it work like the one on GB and the same pts1 issue occurred...it seems like it works like that because the SPI is considered as "dual" and thus splits the packets in two. If you are sure the hang occurs in the spi_sync function, it's a good starting point...or the function doesn't work because the nodes doesn't answer and the problem is still elsewhere...

Do you have an idea why it is not called ? the ldisc gets registered and the mux are there...what part of the code is causing the hang ?
[T-Mobile LG G2x] Naberus:
Seriously people. Pasting search results isn't helping. Don't post it unless you can *read* the code and believe it might help, or there's some other indication that it might be useful (e.g. a commit message like "fix dual SPI compatibility in jellybean kernel"). Otherwise, if it's something from the gingerbread kernel - we've seen it, or at least know how to search for it.

I have indeed been working on reimplementing the "dual" functionality as implemented by the GB kernel. It makes me angry.

The GB kernel:

- "fakes" init of the second SPI in spi_mdm6600.c; The first gets initialized, the second sort of piggybacks off the first.

- splits messages (as you point out) between the two SPIs. It does this by sending an async on the first, a sync on the second, then waiting for the first.

I've written code that does this in the ICS kernel, but I'm still not getting a response off one of the SPIs (the async). The fact that I can't debug the other end of the transmission is extremely frustrating.

Edit: async transfer never returns, sync transfer returns -22 (EINVAL).

Anyway, my thrashing around in the kernel is available in my github - the "ts0710" branch. Radio still doesn't work.
[T-Mobile LG G2x] mk2rimar:
sa serrai vraiment debile que sa fonctione Mazout360
[T-Mobile LG G2x] bakedpatato:
My assumption is that this kernel does not rely on nvrm_daemon while CM10 hackfest does...no idea how to rectify that.
[T-Mobile LG G2x] Rafase282:
I cant remember how to get fastboot mode for the g2x. Either way the zimage needs to be turned into a boot.img to begin with.
[T-Mobile LG G2x] nycelitemaster:
Exactly what i said before we need updated kernel and drivers we dont have nvrm deamon anymore. Old builds utilize that.

Sent via G2X-SINGH-UI
[T-Mobile LG G2x] DankoFGL:
Actually that could work..

Using old unofficial cm10 without any "tweaks" from the hackfest...

I don't know much of this, but i think that old cm10 is cleaner and unmodded than hackfest...

Enviado desde mi LG-P999 usando Tapatalk 2
[T-Mobile LG G2x] daygen4545:
I can't remember how to get into fastboot, but i used to compile kernels for the samsung intercept, and this guide helped tons with decompiling boot imgs, and to compile the zimage into a boot.img, am i right on saying you need an initramfs to go with it?
[T-Mobile LG G2x] King-Nai:
When creating the boot.img, make sure to add --base 0x10000000 to the mkbootimg command or it won't work. Also, the /dev/ names have changed. Try creating aliases to the old ones for the new kernel to work? Just a thought.

The original ICS booting on this device actually used a CM7 kernel. I know because I swapped the ICS kernel with the CM7 kernel to get it to boot. So I think older builds won't make much of a difference. It's most likely just the kernel.

Edit: mkbootimg --kernel zImage --ramdisk ramdisk -o boot.img --base 0x10000000

Found at: http://simply-android.com/discussion/1283/how-to-unpack-and-repack-boot.img-for-g2x/p1
[T-Mobile LG G2x] peshal:
Alright here is the boot.img compiled using cm 7 ramdisk and kernel provided by OP . use at your own risk

https://docs.google.com/open?id=0B3scOEaV-Qj5MVNCdlFxR2g5Unc
[T-Mobile LG G2x] n30wav3:
Whether it works or not it doesn't matter.... u have just made my day with ur enthusiasm.... this is what this g2x community need now.... gonna try it in an hour after reaching home... thanks again
[T-Mobile LG G2x] Rafase282:
I hate how windows is not case sensitive so I have to switch to linux to put the img file into a zip to flash it. I will try later on tonight.
[T-Mobile LG G2x] kepapas:
Let's get this going guys I wish I could help but I have a wallet

g2x mokee os
[T-Mobile LG G2x] GeneralCrocket:
Thanks for giving the G2x community hope, guys.

How do I flash the .img? I feel like I should know this considering I've been flashing stuff for a while now. I'm embarrassed. :D
[T-Mobile LG G2x] n30wav3:
Its not flashable... right now... u can push this file using adb .... I have dual boot so I can move it but right now m setting up my android environment... so I will try after few mins
[T-Mobile LG G2x] King-Nai:
It's a bit large it seems. It's about 1mb bigger than my current boot.img from the hackfest. I have an update zip I will try it out shortly.
[T-Mobile LG G2x] n30wav3:
Bigger rom bigger kernel :D well its just a guess considering 500 MB stock ics rom is not a small one .... when gb was less than half of it
[T-Mobile LG G2x] Rafase282:
Don't feel bad. I myself can remeber how to get into fastboot mode so I have to go back to linux to move the img into a zipfile once im done with windows. I use evernote for my classes so lately I have been in windows more often.
[T-Mobile LG G2x] King-Nai:
I just tried it, it doesn't boot :(

Doesn't get past the first LG logo, doesn't show up as USB. Doing the same thing as the original ICS did.

You should be able to just drop your zImage and wireless.ko file in this zip and it'll generate the boot.img for you when you install update from sd.
[T-Mobile LG G2x] Rafase282:
What rom did you used?
[T-Mobile LG G2x] King-Nai:
I was using KashaMalagas hackfest build.
[T-Mobile LG G2x] DankoFGL:
Someine has tried to use a non hackfest build?

Enviado desde mi LG-P999 usando Tapatalk 2
[T-Mobile LG G2x] O1A2K:
service gone after flashing #7 ROM

after flashing the #7 ROM using NVFlash it successfully worked but I couldn't get any services on my phone... no incoming or outgoing calls :(

please help me ... I love the #7 ROM but it kills the services on my phone and now i had to return to my previous ROM

thanks in advance
[T-Mobile LG G2x] Core Memory:
Read the whole thread and your question will be answered.
[T-Mobile LG G2x] monte666:
Deleted
[T-Mobile LG G2x] pcartwright81:
I believe what they are trying to say is the OP clearly states that the radio aka cell radio is not working. This radio is what controls the calls and texts.
[T-Mobile LG G2x] O1A2K:
ok ok I guess I might have misread the thread .. sorry about that .. you people can delete my old posts from this thread.. i don't know how to do that
[T-Mobile LG G2x] Mazout360:
This whole comments page has to be cleaned.

I'm not even sure the second one really exists. You probably saw the P999DW service manual which doesn't mention it at all. Maybe we'd have more luck confirming this if we find photos from the P999 mainboard. I also think unsetting DUAL SPI in GB doesn't affect the whole radio transmission..not quite sure about that though. Maybe a logcat from a working GB ROM could answer this.

I'd really like here to have the source code for the RIL blobs lge-ril.so and related files from LG. We could rework them and maybe change how the communication to the RIL is made and adapt it to the newer kernel.
[T-Mobile LG G2x] kangi26:
Cleaned the thread. Please use the search feature, it works very well, and you are very likely to find your answer. Also, if you dont contribute an answer, you too are cluttering the thread.

Thanks

Happy New Year
[T-Mobile LG G2x] Mazout360:
Thanks Kangi

Naberus, I looked at your github and the code for mdm6600 looks good :p I'm starting to believe we will have to implement the SRDY and MRDY controls via nvodm functions to get it working...mmmm dirty porting XD

One more thing, your baud rate is incorrect. It should read B230400 under cflag. I guess this might cause issues during data transmission. Also, your TS ldisc should refer to 21 to not interfere with N_CAIF.

EDIT Oh also (that might be irrelevant though) ...from my debug logs for TS0710, it always calls mux_exit on channel 1, but during the device boot it sends this function on channel 29, then waits, then loops on closing channel 1...

Some debug logs also began appearing recently :