Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Vogtinator

Pages: 1 ... 72 73 [74] 75 76 ... 83
1096
TI-Nspire / Re: Calling all Linux Kernel developers!
« 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).

1097
TI-Nspire / Re: Calling all Linux Kernel developers!
« 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 ;-)

1098
TI-Nspire / Re: Calling all Linux Kernel developers!
« 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)

1099
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 07, 2012, 05:22:55 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)

1100
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 06, 2012, 01:28:27 am »
IRQ domain add legacy failed on boottime with a huge stack backtrace because of a warning on line 23, which gets shown if the irqs couldn't get reserved.
It still fails with nr_irqs 128..
But with irq_set_chained_handler  it seems to work but still crashes if I enable interrupts on GPIO 21. I"ll try both, like mach-at91/gpio.c.
If I regiser the chained handler for the timer int, /proc/interrupts shows
18: GPIO timer
and the system is VERY slow (what makes sense, but it still works).

Levak: Sadly useless.. Does still run in foreground. If I poll the touchpad the function returns after it has the data..

Edit 2: If I enable int's for GPIO21 (the floating one), the kernel hangs. No soft-lockup, hard-lockup.
What could be the reasons? For the other GPIOs it works fine (they're not changing).
Code: [Select]
irq = request_irq(controller->irq, nspire_gpio_irq, 0, "gpio", controller);

static irqreturn_t nspire_gpio_irq(int irq, void *data)
{
    uint8_t pin, port;
    uint16_t status_val;
    uint16_t __iomem *status = NSPIRE_GPIO(0, INT_MASKED_STATUS);
    for (port = 0; port < controller->chip.ngpio; port += 8) {
        status_val = readw(status);
        /* Ack interrupt */
        writew(0xFF, status + (NSPIRE_GPIO_INT_STATUS_OFFSET
        - NSPIRE_GPIO_INT_MASKED_STATUS_OFFSET));
        status += NSPIRE_GPIO_SECTION_SIZE;
        //if(!status_val)
            continue;
        //Rest cut out
    }
    return IRQ_HANDLED;
}
Do I have to do some other calls for registering my IRQ? I think request_irq should do it.

1101
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 05, 2012, 12:57:10 am »
Then how can I see how the OS is changing the GPIOs? Only in nspire_emu, if I compile it with custom debugging?
Simply re-enable interrupts?

Edit: As GPIOs generate only one interrupt (7) I have to use an irq_domain. But there are only 32 irq's available on the device.
Are there some kind of virtual interrupts?

Edit2: With "IRQ chained handlers" I now get almost infinite amount of interrupts.. The GPIO irqs don't want to stop, even after I did
Code: [Select]
for (irq = 0; irq < controller->chip.ngpio; irq += 8) {
/* Sticky interrupt status */
writew(0xFF, NSPIRE_GPIO(irq, INT_STICKY));
/* Reset interrupt status */
writew(0xFF, NSPIRE_GPIO(irq, INT_STATUS));
/* Disable interrupts */
writew(0xFF, NSPIRE_GPIO(irq, INT_DISABLE));
}
NSPIRE_GPIO returns the adress of the given register in the given GPIO section. (And works)
Edit3: Works now.. My error was elsewhere (as expected..).
But the touchpad doesn't, have to investigate that further, but it's hard without any hardware-debugging like scope..

1102
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 04, 2012, 12:26:57 pm »
Quote
Well, of course i2c isn't still running in the background OS: You completely replaced it. Nothing is running in the background except what Linux knows to do
No, im reading the GPIO registers with a C program started with ndless.

Quote
Is there a driver for the i2c protocol implemented yet?
Yes, i2c-gpio.

Quote
Maybe we'll get lucky and find out the touchpad itself is already supported, and just the adapter needed a driver.
If not, I think the serial mouse driver in linux will be a good example and it will be easy to port it to i²c.
Could be a bit harder if it uses interrupts, tough.

1103
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 04, 2012, 04:51:30 am »
Quote
That's probably to be expected. The pins are probably not connected to anything so it's floating.
One floating pin? I'd expect more pins to float, although it's bad engineering.

Quote
The output shouldn't vary at all unless you change it.
It has to be changed by the touchpad I²C driver.
The input and direction pins should do something, too.

Quote
I know you can do this with AVRs (people did this to make a cheap touch sensor - i.e. bring pin high and measure how long it actually takes to go high). Not sure with Nspires though.
I tried it myself and it worked better than I expected.
For i2c-gpio there's an option "scl_is_output_only", so I need to know whether it works..

Quote
Again, as expected from floating voltages.
More important, that says GPIOs are working under linux :D

Quote
Best test for GPIO is the touchpad :-P
But the touchpad seems to be not connected to GPIOs at all.
Or it could be the OS is not doing any i²c in background and I have to poll the touchpad.
I can't use touchpad_scan(touchpad_report_t) as it's not running in background.. Has someone an idea?

Quote
Speaking of which, should the touchpad driver be a kernel driver or a userspace daemon (pulling strings with i2c and userspace uevents)?
I²C can't be use for anything else than the touchpad, so a userspace implementation would only be more confusing.

1104
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 03, 2012, 09:55:26 am »
I'm currently testing GPIOs with ndless. The binary (input) value of all ports toggles randomly between 0x59d00bf and 0x5bdoobf.
(Could also be periodically, sample rate is highest possible)
What is GPIO 21(0x020000)?
Also, the output value (0x80132d) doesn't vary at all. Isn't the touchpad connected to GPIOs 1 + 3?

Edit: Can I use GPIOs both as input and output? Example:
GPIO1 configured as output=HIGH, connected to ground through resistor.
Can I read input=LOW?

Edit2: With linux the gpio input still toggles randomly.
Should I implement an irq_chip for this? Directly setting, getting and changing direction are working. (At least the right values in the registers change)

Edit3: Could someone please test GPIOs? I don't know how.
http://dl.dropbox.com/u/105478372/zImagetest.tns
With useless i2c-gpio:
http://dl.dropbox.com/u/105478372/zImagetesti2c.tns

1105
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 03, 2012, 01:28:25 am »
it didn't work because the MMU can only map whole pages, not bytes,
like it is on x86 with PAGing?

1106
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 03, 2012, 01:21:37 am »
Is SZ_4K =1 because the size has to be in pages?
I'll change it, test it and send you a new patch.
Does X and directfb work on click and touchpads?
If not, you have to add cx_clcd_check to your classic clcd panel struct.

1107
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 02, 2012, 03:54:52 pm »
Quote
Nope, that's the name of a commercial Linux distro ;-)
Didn't know that.. What's your suggestion?

Quote
because the calculator usually flat out crashes, after exiting a Ndless program, if you draw past the end of the screen area.
Yeah, I noticed it unintentionally..

1108
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 02, 2012, 02:54:53 pm »
Quote
And what is in the second RAM?
There's the SRAM (flip-flops, fast) and the SDRAM (slow, has to be refreshed dynamically)

Quote
But how knows nClock the right time after any softreboot (linucx, chrash on calc etc.)?
I think it CAN be that linucx doesn't override that value in RAM, but that's random.
The ram doesn't get cleared by linux.

BTW: We should choose a new name, linucx is outdated and wrong. Maybe linspire?

1109
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 02, 2012, 12:01:21 pm »
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.


Edit: With ioremap it works.. IDK why, but I'll make a patch.
Edit2: I can't use floats inside the kernel: "Undefined reference to '__aeabi_f2d'" -> Wrong toolchain?
Edit3: Ok, moved calculation of voltages to the userspace :-/

1110
TI-Nspire / Re: Calling all Linux Kernel developers!
« on: December 02, 2012, 11:45:33 am »
You have to write it on a usb-stick using "dd if=rootfs.ext2 of=/dev/sdb".
Also, you are using the wrong image, the only images with X are my builds and I use only tar.bz2.

The ADC works perfectly with ndless, but not my linux kernel driver..
What am I doing wrong?
My changes in nspire_mmio.h:
Code: [Select]
#define NSPIRE_ADC_PHYS_BASE 0xC4000000
#define NSPIRE_ADC_SIZE 0x000001DF
#define NSPIRE_ADC_VIRT_BASE 0xfed7ee21 //0x1df before BOOT1

common.c:
Code: [Select]
struct map_desc nspire_io_regs[] __initdata = {
IOTABLE_ENTRY(ADC),
IOTABLE_ENTRY(APB),
IOTABLE_ENTRY(BOOT1),
IOTABLE_ENTRY(INTERRUPT),
};

Then im accessing it with:
Code: [Select]
adc[0] = readl(IOMEM(NSPIRE_ADC_VIRT_BASE + 0x110));What am I doing wrong?

Pages: 1 ... 72 73 [74] 75 76 ... 83