yashsingh1/xdaforums huggingface dataset:
[Atrix 4G Android Development] lehjr:
There are 59 unused pins according to the schematic. I'm working on the file now. I'll report back here when done, I want to try to make it less a jumbled blob and more human readable. My repo skills are probably below level for most primates, so I'll probably have to use pastebin and let someone with the appropriate skill level grab it from there.

---------- Post added at 01:01 PM ---------- Previous post was at 12:31 PM ----------

OK, here's the file so far. Note, it just has the unused pins. I haven't gotten as far as tracking down where the used ones go yet, but I do intend to at least try.

Edit:

Interesting note on the schematic page 8:

"DISP_5V_EN WAS ON GPIO_PS<1>" (for the less tech folks following this thread, this is to turn on power to the display: Display 5 Volt Enable; GPIO_PS<1> is a specific pin on the tegra 2 chip, and GPIO stands for General Purpose Input/Output, meaning the pins have different functions that can be selected in software)

The current location shows as GPIO_PF7 (in the schematic). I'm not sure if that means it was moved pre-production (transition from prototype to production model) or post-production (revision).

Edit 2:

I got most of the pins labeled. A few I'm not sure about yet. The other thing I'm not sure about yet is how the names on the schematic will translate into names in the code, but you can see I've labeled them by //(PURPOSE)(DIRECTION) NAME_AS IT APPEARS_ON_THE_SCHEMATIC where "PURPOSE" is how they are grouped on page 8 of the schematic.
[Atrix 4G Android Development] toyota86:
Krystian,

I dont know if those guys will answer because you gave them a link to your 3.1.10 kernel repo

The leaked kernel is 2.6.39.4.

Yes the specific code in question is probably common on both but they rely on other things.

Maybe re-post your question on sourceforge and give them a link to your 2.6.39 stingray kernel repo.

Just my 2c.
[Atrix 4G Android Development] lehjr:
Now that I pretty much have the pins figured out and labeled, I'm searching both kernels for this project (2.6.39.4 and 3.1) for references to the pins, and using the kernel from MROM as a reference just to check if the pins are actually used despite what the schematic says or are unused in the code, even though the the schematic shows them having a function.
[Atrix 4G Android Development] mmontuori:
Re: Olympus ICS/JB Kernel Port

Thanks for contributing...
[Atrix 4G Android Development] lehjr:
I really wish I had the skills to help on a higher level. Most of my C skills are hobby level with PIC MCU's, something that's much easier when you only have a few pins.

So far, I've checked TEGRA_GPIO_PA0 to TEGRA_GPIO_PA7, only the first of which appears to be used for anything inside the kernel, although the schematic does show all of those pins having a purpose.

Edit:

Just thinking, maybe they're called by a different name elsewhere and not addressed by using TEGRA_GPIO names but rather by ports.

Edit 2: !*@#*^*#$ Pingroups (pinmux) I need to look at that a bit more I guess.
[Atrix 4G Android Development] Geramy:
Would like to help

I would love to help if anyone could tell me where we are exactly, I know C, C++, Java, C#, VB Ewww lol, a bit of x86/64 Assembly, PIC Assembly, and some ARM Assembly enough to make a hello world os and boot into 32 bit mode haha :)

I have currently been helping with getting the Dell Streak 7 a new kernel 2.6.39 so I have some experience with that.
[Atrix 4G Android Development] krystianp:
Nice to hear that more people are interested in development. Every one is welcome here. To gain access to github you have to contact mmontuori, git repo is here:

https://github.com/CyanogenMod-Atrix/

we are now trying to fix cpcap problem. I'm waiting for mmontuori to make some tests, so we can find the reason why it's not working as it should. PM me so i can give you links to logs i'm getting from kernels and disassembled files if you want.

---------- Post added at 01:55 PM ---------- Previous post was at 01:36 PM ----------

I'm using 3.1.10 because only this kernel gives me early logs. 2.6.39.4 doesn't so if it hungs early i won't be able to read where it hung (like in case of panel init). Also stingray's kernel doesn't have all tegra related drivers that olympus requires i tried to add them by hand but since we can't get early logs i don't know where's the problem. So we gonna try some other 2.6.39.4 kernels to check if any one gives good results and then merge it with all 3.1.10 changes we made. Since most of them weren't kernel dependant it shouldn't be a problem.
[Atrix 4G Android Development] lehjr:
Right now, I'm just trying to check the pins in the code vs in the schematic. The biggest obstacle is that, like any other embedded programming, there are multiple ways of dealing with the same pins. So far a I've only found a few pins addressed by the macros in the gpio-names.h file. I suspect the rest will be addressed by pinmuxing, which in itself isn't bad. It's just that the documentation seems a bit weak especially when you're trying to find out what specific pins are in certain pin groups or what pin is assigned a specific function within a group.

For instance, in the gpio-names.h names file, pins are set like this (note that I actually added the comments from what I could find in the schematic):

/* GPIO1 - PORT-A */
#define TEGRA_GPIO_PA0	0 //(BP/IPC)(OUT) BP_WAKE_AP_UART
#define TEGRA_GPIO_PA1	1 //(UART)(IN) AP_UART3_CTS/BT_RTS
#define TEGRA_GPIO_PA2	2 //(DIGITAL AUDIO)(OUT) AP_DAP2_FS/ASAP_FS
#define TEGRA_GPIO_PA3	3 //(DIGITAL AUDIO)(OUT) AP_DAP2_CLK/ASAP_CLK
#define TEGRA_GPIO_PA4	4 //(DIGITAL AUDIO)(IN) AP_DAP2_DIN/ASAP_DOUT
#define TEGRA_GPIO_PA5	5 //(DIGITAL AUDIO)(OUT) AP_DAP2_DOUT/ASAP_DIN
#define TEGRA_GPIO_PA6	6 //(MICRO SD CARD)(OUT) AP_SDIO3_CLK/SD_CLK
#define TEGRA_GPIO_PA7	7 //(MICRO SD CARD)(OUT) AP_SDIO3_CMD/SD_CMD

The trick now is to equate those pins to the "pad groups" in the pinmux tables. A somewhat helpful description of this is in the Technical Reference Manual (starting on page 182):

The file pinmux-t2-tables.c should be extremely helpful:

static const int gpio_pin_pingroup[] = {
gpio_pingroup(A, 0, DTE),
gpio_pingroup(A, 1, UCB),
gpio_pingroup(A, 2, DAP2),
gpio_pingroup(A, 3, DAP2),
gpio_pingroup(A, 4, DAP2),
gpio_pingroup(A, 5, DAP2),
gpio_pingroup(A, 6, SDD),
gpio_pingroup(A, 7, SDD),

So above you can see the pin TEGRA_GPIO_PA0 is part of the "pad group" DTE. I'm just not sure what part of that group yet and it may take a bit more time and caffeine to figure it out. It's not impossible, just time consuming.

Btw, the explanations I try to include are really for the non-developers that try to follow this thread but can't always understand what's being discussed.

---------- Post added at 09:20 AM ---------- Previous post was at 08:38 AM ----------

OK, so I'm going through the code in pinmux-t2-tables.c (from GB, ICS version is apparently coded differently) trying to associate the pins with their groups and I find that the table stops 2 pins short.

gpio_pingroup(BB, 0, PMC),
gpio_pingroup(BB, 1, DTE),
gpio_pingroup(BB, 2, DTF),
gpio_pingroup(BB, 3, DTF),
gpio_pingroup(BB, 4, DTE),
gpio_pingroup(BB, 5, DTE)

Maybe I accidentally butchered the file, but TEGRA_GPIO_PBB6 and TEGRA_GPIO_PBB7 aren't part of that table in the copy I have.
[Atrix 4G Android Development] krystianp:
No, there is no mention of those two. I've looked in some other kernels and none of them has those.
[Atrix 4G Android Development] lehjr:
Thanks. I can't find anything on the schematic either. Maybe they're addressed a different way, possibly even intentionally to obscure their purpose in this particular configuration.

---------- Post added at 10:52 AM ---------- Previous post was at 10:19 AM ----------

Any idea what the total pin count is on this device? I know there are 224 GPIO pins (at least in the table), so far all but 2 go to certain pad groups. However, there are pad groups without GPIO pins, and GPIO pins without pad groups. The schematic shows other pins in addition to the GPIO's being used, and not all pad groups are shown in the pinmux table in the source code, so I'm assuming there must be several pins that are not considered GPIO's but instead have a specific function.

Pages 186-192 of the reference manual show the GPIO pins assigned to the pad groups (not very well, but it shows them). So far I haven't found any other pins specifically named with any physical designation.

---------- Post added at 11:07 AM ---------- Previous post was at 10:52 AM ----------

I just found an anomaly in the GB code in pinmux-t2-tables.c:

gpio_pingroup(I, 5, ATB),

According to the TRM on page 186, that pin is actually part of ATC, and not ATB as it shows in the code. Not that it matters, I just thought it was interesting.

Edit: Here's another one. TRM page 190 shows group SDB as the pin TEGRA_GPIO_PA7, but pinmux-t2-tables.c once again shows something different:

gpio_pingroup(A, 7, SDD),

Since it works, it won't have any impact on continued operation for existing production kernels, but little discrepancies like this can make it difficult to troubleshoot, especially if you don't know if it's the code that's wrong or just the documentation. I don't know how reliable nVidia's documentation is, so I really can't be sure. I know that both documentation and code errors are pretty common when dealing with Microchip's libraries and datasheets, so it's not surprising to see the same with something as complex as this.
[Atrix 4G Android Development] seanandrsn:
Re: Olympus ICS/JB Kernel Port

Well folks I would like to contribute to the project by donating my Atrix phone. I went to apply the new 4.5.145 update and it has failed. It looks like the unit is hard bricked as I cannot access rsd or fastboot and neither one of my computers recognize it when plugged in. So if it will be useful for the project send me a PM.

I am on my old HTC for now and debating on a S3 or a Nexus.

Sent from xda app-developers app
[Atrix 4G Android Development] sendust7:
getprop ro.tegra.* settings

Hi Michael,

While comparing the "getprop" dumps of MROM ICS and ICSROM, I came across these settings for MROM:

[ro.tegra.debug]: [0]
[ro.tegra.gpumode]: [quality]
[ro.tegra.mode]: [performance]

Sorry if this question has been asked before, but is there a relationship between "ro.tegra.mode" / "ro.tegra.gpumode" settings and battery life?

Or are these settings irrelevant as they are in CM7? http://xdaforums.com/showthread.php?p=38101759

Thanks.
[Atrix 4G Android Development] guidoido004:
Hey guys, i told i was going to test which exactly component was getting hot, but i have a sad thing to share with you, my atrix literally died, so this may be my last comment in dev sections, ill still helpin in general and Q&A, but i wont be of any help anymore for devs(unless i get something useful and worthy the share with you) see ya next time

hope you guys get this working, motorola gave up on the atrix, but their users didnt, and you guys deserve the recognition for working on this.
[Atrix 4G Android Development] mmontuori:
Those settings are not present in CM7, like you said, but in ICS and above we will have to experiment to see... I have not had a chance to examine their behavior, maybe you can provide additional feedback...
[Atrix 4G Android Development] mmontuori:
Status Update

We have some good news and bad news...

The good news is: we were able to overcome the cpcap issue.

The bad news is: the next problem is related to regulator init. We have to correctly set the registers to allow power on the main core components. The specific errors that we see in the logs are:

<3>Tegra protected aperture disabled because nvmap is using system memory
<6>regulator_init_complete: vsimcard: disabling
<6>regulator_init_complete: vpll: disabling
<3>cpcap_regacc_write: Unable to write 0x0 & 0x47 to register 403
<3>regulator_init_complete: vpll: couldn't disable: -22
<6>regulator_init_complete: vsdio: disabling
<6>regulator_init_complete: sw4: disabling

from the leaked kernel we have:

<4>[ 3.513944,1] regulator_init_complete: vsimcard: incomplete constraints, leaving on
<4>[ 3.514257,1] regulator_init_complete: vpll: incomplete constraints, leaving on
<4>[ 3.514321,1] regulator_init_complete: vsdio: incomplete constraints, leaving on
<4>[ 3.514587,1] regulator_init_complete: sw4: incomplete constraints, leaving on
<4>[ 3.514650,1] regulator_init_complete: sw3: incomplete constraints, leaving on
<4>[ 3.514713,1] regulator_init_complete: sw2: incomplete constraints, leaving on
<4>[ 3.514775,1] regulator_init_complete: sw1: incomplete constraints, leaving on

At this point the phone reboots...
[Atrix 4G Android Development] attrixnor:
Hors sujet :

The good news , is that the project is progressing now !

Thanks for all community devlopper that an help Mmontuori and KrystianP
[Atrix 4G Android Development] Geramy:
I had this same problem with porting 2.39 to the dell streak7 the regulators init then it stalls or powers off but not actually off.

it may be something to do with getting the address to boot the rom.

EDIT: I have not been able to overcome this issue on the streak7 because I don't have not setup hardware COM on it lol.

it may also be a interrupt problem? or driver issue.
[Atrix 4G Android Development] danilocps87:
Can this page be helpful?
[Atrix 4G Android Development] quetzalcoatl2435:
It has been mentioned several times already...
[Atrix 4G Android Development] Cocolopes:
Re: Olympus ICS/JB Kernel Port

Kristian last github commit:

Still no usb :(, blue MROM logo showing up :)...

Great work devs...you are the future for the atrix...Thanks!!!
[Atrix 4G Android Development] lehjr:
By garbage do you mean nothing useful or do you mean that it's just a bunch of random looking characters? Is JTAG serial out working for both 2.6.39 and 3.1 kernels?

<3>Tegra protected aperture disabled because nvmap is using system memory
<6>regulator_init_complete: vsimcard: disabling
<6>regulator_init_complete: vpll: disabling
<3>cpcap_regacc_write: Unable to write 0x0 & 0x47 to register 403
<3>regulator_init_complete: vpll: couldn't disable: -22
<6>regulator_init_complete: vsdio: disabling
<6>regulator_init_complete: sw4: disabling

I'm not sure if it helps, but you can see some of the references in the schematic on page 3.

vsimcard is on CPCAP pin F3

vpll is on CPCAP pin F20

vsdio is on CPCAP pin D20

sw4 looks like a group of pins on the CPCAP:

SW4FB = C18

SW4LX1 = B18

SW4LX2 = A18

I can see where the error comes from (./drivers/regulator/core.c),

if (has_full_constraints) {
/* We log since this may kill the system if it
* goes wrong. */
rdev_info(rdev, "disabling\n");
ret = ops->disable(rdev);
if (ret != 0) {
rdev_err(rdev, "couldn't disable: %d\n", ret);
}
} else {
/* The intention is that in future we will
* assume that full constraints are provided
* so warn even if we aren't going to do
* anything here.
*/
rdev_warn(rdev, "incomplete constraints, leaving on\n");
}

I'm not sure what has_full_constraints is (too tired to search atm), but apparently the leak is set to FALSE for those items for whatever reason (again, too tired to look atm).

Btw, I think I found out how many pins the Tegra 2 has, or at least guessing by the package information on this page, it looks like 481 pins. Sounds like a lot, but it has 119 ground pins according to the schematic. The pins are numbered in the typical alpha-numerical grid pattern. I'm currently trying to put together a full list of pins, with pad groups for pins that are part of one. Usually that is part of the documentation, but I can't seem to find it.
[Atrix 4G Android Development] dvijm:
Re: Olympus ICS/JB Kernel Port

will this http://xdaforums.com/showthread.php?t=1322499&page=2documentation be of any use... maybe we are already looking at it.. just helping..
[Atrix 4G Android Development] krystianp:
Odp: Olympus ICS/JB Kernel Port

You should join our team. Send me PM and I'll give you some more info. About regulators init it's been solved, we found two solutions, we used one replicating what was in leaked kernel logs.

---------- Post added at 09:07 AM ---------- Previous post was at 08:59 AM ----------

Update on current project status. Problems with usb are caused by bad cdev creation. During enabling we get null pointer dereference, so usb function config can't be written to cdev. Skipping that let us get mrom ics logo. So we are moving forward but we HAVE to fix usb first before we get to ics.
[Atrix 4G Android Development] attrixnor:
hopes ,lehjr join your team ! and get usb working soon !
[Atrix 4G Android Development] krystianp:
Odp: Olympus ICS/JB Kernel Port

It's not MY team;) I'm just one of it's members. anyone who wants to learn something can join. We are not some sort of kernel gurus who won't talk with noobs. If you are familiar with how Linux kernel works and feel good with C our doors are open:) Of course this is only my opinion but I think other members will agree. Building this kernel is currently most important thing for Atrix community. At least I think that way.

Edit: And I forgot that in English your stands for singular and plural. Sorry, I'm just stupid:D
[Atrix 4G Android Development] attrixnor:
you're right,

rq : unfortunately, i'm a noobs in kernel programming... ;(
[Atrix 4G Android Development] cailloup:
krystianp is the guru, run away people!

Just kidding :silly:
[Atrix 4G Android Development] lehjr:
Interesting. I'm looking at the last post in the thread. The first link, is just 00-INDEX, a file in the Linux kernel documentation.

The second link is a bit more interesting, at least to me, especially since there are tegra-specific archives spanning back years. I'm not sure how useful it will be, but it could give clues to what changes were made over time and why they were made.

As for the third link, unfortunately, it's actually a breakout board for a different chip than what we're dealing with. That one has PCI express and at least 100 more pins, which are laid out differently. I wish the TRM had the same level of pin documentation as the datasheet for the device. I had seen it before, but never paid much attention to it other than thinking about one of those boards would work in one of the low end tablets with the VIA chip on a similar board.

I do know why the TRM doesn't have much information about the actual pins, and that's because, for the most part, only the hardware developers, the ones that design the board the chip goes on, would need to know about those in that way. The pins are often named differently in the code by their function rather than the physical name of the pin to make coding easier (sometimes).

The reason that I like to see the actual pins and how they correlate to the software function is that internally, several different devices can be tied to a single pin and it's important to know which if those devices it is, especial if another setting elsewhere overrides that selection because a few pins on one group are also part one or more other groups. You also want to be able to deal with pins that were left "floating" (not connected to anything) because those can produce erratic behavior. You can deal with them by setting a "pull up" or "pull down" on them, but you have to know where they are, and telling you that pin M12 is floating doesn't tell you anything if you have no idea how to find that pin in the code.

Anyway, back to this project specifically, any thoughts on pruning that source tree a bit, maybe at least dropping source for irrelevant architectures? I'm mainly just thinking in terms of cutting down the time it takes to search the source for a specific string, but maybe that's not that big of an issue, I don't know.
[Atrix 4G Android Development] krystianp:
Odp: Olympus ICS/JB Kernel Port

From what I've seen pins show up in arch/arm/mach-tegra, include/linux and drivers. I haven't seen any more dirs listed during searching for tegra related stuff. Of course I haven't searched for everything so I might have missed something.
[Atrix 4G Android Development] lehjr:
I don't think I have the necessary skills.
[Atrix 4G Android Development] Zeljko1234:
Just join, you are very helpful :)
[Atrix 4G Android Development] lehjr:
So then it's probably not that big of an issue then.
[Atrix 4G Android Development] Cocolopes:
Re: Olympus ICS/JB Kernel Port

Please join the team...I think you can help...

We (atrix users) need you...

Thanks again kernel team!!
[Atrix 4G Android Development] lehjr:
Resistance is futile?
[Atrix 4G Android Development] Zeljko1234:
You are assimilated :)
[Atrix 4G Android Development] krystianp:
Odp: Olympus ICS/JB Kernel Port

You have background in electronics from what I see and also in embedded devices. You look like a person who pretty easily finds (or is very determined to find) what you are looking for. You are good enough for this. Everything else you'll learn during development. We need more brains for brainstorming, more people with different backgrounds more chance we'll finish it with success. Of course I'm not pushing you into anything, just don't feel discouraged (I felt the same at the beginning).
[Atrix 4G Android Development] lehjr:
---------- Post added at 11:55 AM ---------- Previous post was at 11:42 AM ----------

OK, I'll join, but just remember that I'm more of a jack of all trades and master of none. My experience with embedded devices is pretty much limited to hobby level, and in C. Since the kernel is C that shouldn't be much of an issue, but just understand that ability to actually write code is pretty limited. I can do it, but I usually have examples to work from. In fact, I'm used to being able to download the libraries and real datasheets directly from the manufacturer at my leisure rather than nVidia's way of doing things. My understanding of electronics does go a little deeper.
[Atrix 4G Android Development] Zeljko1234:
Could I take it for avatar? Please :)
[Atrix 4G Android Development] lehjr:
LOL. It was a random pic I found.
[Atrix 4G Android Development] krystianp:
We have shell access thru uart. Now only usb is keeping us from getting shell from pc (thru adb).
[Atrix 4G Android Development] Matada02:
Wow, the things were speed up! I can't express my self in other ways.

You guys are the best ever! You are keeping our hope our atrix alive!

We owe you uncountable thanks! :good::highfive::o
[Atrix 4G Android Development] Zeljko1234:
:D

Sorry, you are limited to 8 thanks per day :o
[Atrix 4G Android Development] danilocps87:
Re: Olympus ICS/JB Kernel Port

Wow! Great!
[Atrix 4G Android Development] attrixnor:
danilocps87 : the usb acces actually not work .. but soon we hopes !
[Atrix 4G Android Development] krystianp:
Odp: Olympus ICS/JB Kernel Port

Sorry we won't be making any reports. I'm not a writer and I hate writing essays since primary school;) secondly we are not monitoring what we did and didn't. Sometimes we think something works later it turns out it wasn't fully working. Reports is waste of time. Unless someone wants to be our writer then PM me and I'll give him or her;) access to what we do.
[Atrix 4G Android Development] francescod:
Just trying to help....

Chinese Razr xt889 4.3" qHd, Omap4, Ics source http://sourceforge.net/projects/xt889.motorola/files/XT889/6.7.2_GC-200-YTZWE-3/
[Atrix 4G Android Development] Zeljko1234:
You should monitoring what is done for your good (not for us) ;)
[Atrix 4G Android Development] francescod:
Target already achieved? Sorry guys. :o
[Atrix 4G Android Development] ubunthero:
If you PM me your progress, I can try to sum it up and send it back to you before you confirm it's ready to be unveiled (if you want to see my sum up skills, I can try using the github history ^^)
[Atrix 4G Android Development] scanuto:
Hello guys. I got a simple question: Will this kernel be compatible with CM10.1 without using the userspace hacks (like epinter did)?
[Atrix 4G Android Development] ticiano_arraes:
Reboot your phone plugged on usb, as soon as your pc recognize it, run: