Author Topic: Calling all Linux Kernel developers!  (Read 392293 times)

0 Members and 3 Guests are viewing this topic.

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #480 on: December 07, 2012, 10:46:08 pm »
I just measured the outputs and inputs of some GPIOs connected to the pins on the bottom port, and it's correct.
They're even sensitive for fingertips..
The input of the pins 1 and 3 are always high, so there are indeed pullups.
But why does the touchpad not get detected? (At least not through i2cdetect)

Not sure if it'll help or not, but when I was working with the keypad driver, I noticed that any activity on the Touchpad will also cause a keypad interrupt. Read keypad.c in nspire_emu.

Other than that, on the CX, the Touchpad seems to be accessed through address 0x90050000 according to a quick read of nspire_emu's source code.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #481 on: December 08, 2012, 06:53:13 am »
Yeah, I read it but I can't make use of that now, as we don't have any driver for the touchpd.
In nspire emus source I grepped "touchpad" and could only find GPIO 1 +3.
I'll search for that address.
But if the touchpad is connected to the GPIOs on the non-CX, you could test my git fork:
http://github.com/Vogtinator/linux (branch testing)
« Last Edit: December 08, 2012, 08:08:57 am by Vogtinator »

Offline InspiredByCas

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +4/-1
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #482 on: December 08, 2012, 11:57:08 am »
I just measured the outputs and inputs of some GPIOs connected to the pins on the bottom port, and it's correct.
They're even sensitive for fingertips..

Yeah cool.
We could make a lie detector...

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #483 on: December 08, 2012, 01:19:37 pm »
Quote
Yeah cool.
We could make a lie detector...
No, a built-in cheat detector during exams :-P
Works quite well with ADC6 ;-)

Offline InspiredByCas

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +4/-1
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #484 on: December 08, 2012, 01:42:47 pm »
Quote
Yeah cool.
We could make a lie detector...
No, a built-in cheat detector during exams :-P

Bad idea. ;)

edit: What, if we overwrite everything in memory what is not used by linux, will the OS (which should be not there then anymore) still protect the LED from flashing?
« Last Edit: December 08, 2012, 02:48:08 pm by InspiredByCas »

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #485 on: December 08, 2012, 02:52:15 pm »
The OS isn't running at all, so it cannot access the hardware.
Maybe there are some hardware registers which has to be written to (Find out which and what value if you want to access the LED :-P).
« Last Edit: December 08, 2012, 02:52:25 pm by Vogtinator »

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #486 on: December 09, 2012, 12:41:31 am »
(Find out which and what value if you want to access the LED :-P).

I'll look into this once I work out how I can enter press to test via the emulator :P

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #487 on: December 09, 2012, 09:22:50 am »
X is a bit too large to use as initrd.
http://dl.dropbox.com/u/105478372/zImage.tns
http://dl.dropbox.com/u/105478372/rootfs.tar.bz2
I posted these URLs somewhere in this thread, but I'm too lazy to search.
So I have to put the tar.bz2 on an usb stick (unzipped by the way ?), and then to connect it on the TI-Nspire CX CAS, with this kind of adaptator, don't I ?
But do I need to have a special kind of usb stick ? And then, what have I to launch ?
I tried to lauch therootfs.ext2 this way :
Code: [Select]
kernel linux/zImage.tns
initrd linux/rootfs.ext2.tns
cmdline debug root=/dev/ram console=ttyAMA0,115200n8
But the calculator crashed.
On the console of linux, I don't understand a thing : why help command doesn't exist and why commands like "ls", "cd" don't have any effect ?
Sorry for those questions, I'm not an expert in this domain.



Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #488 on: December 09, 2012, 09:35:16 am »
Quote
I tried to lauch therootfs.ext2 this way :
Which rootfs.ext2? If you downloaded the files from above, you only have zImage.tns and rootfs.tar.bz2.
Quote
But the calculator crashed.
You can't use a tar.bz2 as initrd.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Calling all Linux Kernel developers!
« Reply #489 on: December 09, 2012, 09:39:10 am »
These questions should probably be posted in the Nspire Linux questions topic ;)

Quote
So I have to put the tar.bz2 on an usb stick (unzipped by the way ?)
Yes, and yes, you need to unpack rootfs.tar.bz2.

Quote
and then to connect it on the TI-Nspire CX CAS, with this kind of adaptator, don't I ?
Your link is imprecise. What you need is a fairly uncommon male mini-A to female A cable.

Quote
But do I need to have a special kind of usb stick ?
No, Linux can work with any well-behaved USB Mass Storage Device.

Quote
And then, what have I to launch ?
linuxloader2, preferably invoked through a script, as described into the documentation ;)

Quote
why help command doesn't exist
It does on bash; maybe it does not on the size-constrained busybox.

Quote
and why commands like "ls", "cd" don't have any effect ?
* when run from a directory which does not contain any non-hidden files - which is, precisely, the case when logging in as root in Vogtinator's rootfs - it's perfectly natural that ls doesn't print anything, that's the expected behaviour ;)
* "cd", without arguments, will change to your home directory - from which you started when you logged, so it will appear not to do anything either.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #490 on: December 09, 2012, 10:08:01 am »
These questions should probably be posted in the Nspire Linux questions topic ;)
Ok, I answered here.



Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #491 on: December 09, 2012, 12:44:18 pm »
I got the touchpad to work partially (X and Y swapped, changing the page didn't work at all).
Now I chose to rewrote everything, and I can only get 0s (running in nspire_emu):
Code: [Select]
#define NSPIRE_TOUCHPAD_BASE 0x90050000
static void nspire_touchpad_write(uint32_t value, uint32_t addr, struct nspire_touchpad *touchpad)
{
*((uint32_t*)(addr + NSPIRE_TOUCHPAD_BASE)) = value;
}

static uint8_t nspire_touchpad_read(uint32_t addr, struct nspire_touchpad *touchpad)
{
return *((uint32_t*)(addr + NSPIRE_TOUCHPAD_BASE));
}

/* Reset */
nspire_touchpad_write(0, 0x38, touchpad);
/* Set port to 0xFF */
nspire_touchpad_write(0xFF, 0x10, touchpad);
/* Set page to 0x04 */
nspire_touchpad_write(0x04, 0x10, touchpad);
/* Reset */
nspire_touchpad_write(0, 0x38, touchpad);
/* Set port to 0xFF */
nspire_touchpad_write(0xFF, 0x10, touchpad);
/* Increase 'reading' */
nspire_touchpad_write(0x100, 0x10, touchpad);
/* Read current page */
read[0] = nspire_touchpad_read(0x10, touchpad);

nspire_emus code:
Spoiler For Spoiler:
Code: [Select]
/* 90050000 */
int touchpad_cx_state;
int touchpad_cx_reading;
u8 touchpad_cx_port;
u32 touchpad_cx_read(u32 addr) {
switch (addr & 0xFFFF) {
case 0x0010:
if (!touchpad_cx_reading)
break;
touchpad_cx_reading--;
return touchpad_read(touchpad_cx_port++);
case 0x0070:
return touchpad_cx_reading ? 12 : 4;
default:
return 0;
}
return bad_read_word(addr);
}
void touchpad_cx_write(u32 addr, u32 value) {
switch (addr & 0xFFFF) {
case 0x0010:
if (touchpad_cx_state == 0) {
touchpad_cx_port = value;
touchpad_cx_state = 1;
} else {
if (value & 0x100) {
touchpad_cx_reading++;
} else {
touchpad_write(touchpad_cx_port++, value);
}
}
return;
case 0x0038:
touchpad_cx_state = 0;
touchpad_cx_reading = 0;
return;
}
//bad_write_word(addr, value);
}

Edit: With my old code I can get only x OR y velocity. If X comes first, Y is 0 and vice versa.
But proximity, contact and the absolute positions work flawlessly.
Edit2: Now I tried to write a driver for linux, but it's only returning 0 :-(
« Last Edit: December 09, 2012, 03:59:57 pm by Vogtinator »

Offline InspiredByCas

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +4/-1
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #492 on: December 10, 2012, 08:26:28 am »
As the Touchpad is a resistive one, it should recognize more than one contact with finders...
Is that possible under linux where not the standart driver from the OS is used?

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #493 on: December 10, 2012, 08:34:07 am »
Quote
As the Touchpad is a resistive one, it should recognize more than one contact with finders...
Wrong :P Only capacitive and optical touchsensitive interfaces are capable of recognizing more than one position.

Quote
Is that possible under linux where not the standart driver from the OS is used?
Nope, only position, velocity and proximity can be read.
http://hackspire.unsads.com/wiki/index.php/Keypads#Touchpad_I.C2.B2C
« Last Edit: December 10, 2012, 08:34:22 am by Vogtinator »

Offline InspiredByCas

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +4/-1
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #494 on: December 10, 2012, 10:53:28 am »
Wrong :P Only capacitive and optical touchsensitive interfaces are capable of recognizing more than one position.
Ouch. But I thought of the right type... ;)

And somewhere in the web I saw a resitive touchpad witch could regocnize up to five fingers and different pressure...

Quote
Is that possible under linux where not the standart driver from the OS is used?
Nope, only position, velocity and proximity can be read.
http://hackspire.unsads.com/wiki/index.php/Keypads#Touchpad_I.C2.B2C
So this is limited by the firmware in the touchpad itself?
« Last Edit: December 10, 2012, 11:24:53 am by InspiredByCas »