Pengutronics - Camera Interface - CON20 - GPJ not working

miniarm
Hi,

I have ported Pengutroncs bsp in mini2440 successfully with linux 3.1. But
after implementing I am not able to control CON20 - GPJ port from
kernel/userspace, I don't know why? Before with Friendly arm BSP with linux
2.6.32.2 I was able to control CON20 - GPJ port from kernel/userspace?

In my simple driver I am trying to write value on GPJ port using
__raw_writel, but no luch, however same thing happen for GPF port.

__raw_writel(0x000000, S3C2440_GPJDAT) - not working - GPJ port remains
high
__raw_writel(0x000001, S3C2440_GPFDAT) - working - GPF port value is now 1

@Juergen, can you please help me out there...? Its urgent.. !!

Juergen Beisert
Did you configure these GPIOs to act as GPIO and output?

miniarm
From where should I configure this GPIO to act as GPIO? from my driver
itself?

If so, how can I configure this pin to act as gpio? 

s3c2410_gpio_cfgpin(S3C2440_GPJ0,S3C2440_GPJ0_OUTP), but S3c2440_GPJ0 is
not defined in kernel 3.1.

How do define S3C2440_GPJ0? in older kenel it was defined in
/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h as #define S3C2440_GPJ0   
        S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0)

Please guide me right direction, so that I can use GPJ port as GPIO !!

Juergen Beisert
For example in this way:

gpio_request_one(S3C2410_GPJ(<X>), GPIOF_OUT_INIT_HIGH, <usage of X>);

e.g. use the generic gpiolib to manipulate the GPIO in a correct and
managed manner from inside the kernel.

miniarm
@Juergen,

I want send data to whole GPJ Bank using __raw_writel, however the same
thing working pergectly for GPF bank using __raw_writel method inside the
kernel.

I was able to drive GPJ bank in 2.6.32.2, but somehow I am not able to
control it from kernel.

    int i,ret;
    for (i = 0; i < 13 ; i++)
    gpio_request_one(S3C2410_GPJ(i), GPIOF_OUT_INIT_HIGH, "For X");


I did this thing in driver for initialization, now when I try to send data
on GPJ,only GPJ0 pin takes effect, all other pin remains low. i.e. no
effect on other pin.

I have also tried the same thing from user space, but GPJ is not operating,
but GPF is operating.

I don't know what is wrong over here.

miniarm
@Juergen,

This comment is defined in regs-gpio.h.
/* The S3C2412 and S3C2413 move the GPJ register set to after
 * GPH, which means all registers after 0x80 are now offset by 0x10
 * for the 2412/2413 from the 2410/2440/2442
*/


Do i need to check with offset 0x10 instead of 0x04, because in kernel
2.6.32.2 i used to do __raw_writel(0x0000011, base + 0x04), so that offset
was 0x04.

Please let me know in details.

Juergen Beisert
You have to follow the S3C2440 data sheet and keep in mind the hardware
registers are accessible only via a virtual address. First test with the
gpio lib API, and if it works, change back to your own method.

miniarm
@Juergen,

I am following the standard way to drive GPIO, as it was working perfectly
with older kernel 2.6.32.2 with BSP from Friendly ARM.

It will be great If you can provide example of PWM, LED control in
Pengutronics BSP.

As of now other GPIO are working from the kernel space but GPJ is not
working. As in my previous post there is a comments in regs-gpio.h file
about offset.

My only question is only GPJ port is not working this way. Could you please
try operating GPJ port from the kernel module with recent kernel and tell
me If I am doing something wrong over here?

Thank you for your time in advance.

miniarm
@Juergen,


Any updates on accessing GPJ port using Pengutronics BSP? I really needed
help from you.

OR can you please share me an example of operaing gpj port using
address/driver?

Look forward to hear from you soon.

miniarm
@Davef, @Juergen,

I am trying to get GPJ port working as you know, If I try to get base of
GPJ port using below line I am getting kernel error while sending data to
GPJ port.

void __iomem *base = S3C2410_GPJ(0);

Unable to handle kernel NULL pointer dereference at virtual address 
00000104

If I am trying to get base value is below line, GPJ port is not working.

void __iomem *base = S3C2440_GPJCON;

Please help me to get GPJ port working with Pengutronics BSP with
linux-3.1.

Are you guys on holiday or something? 

Please help me, I really need this.

OR

let me know If linux-2.6.32.2 is working with Pengutronics BSP. I have
tried but seems like kernel is not finding correct partition.

Look forward to hear from you soon.

davef
miniarm,

I have been away building a house.

I not have experience with what you are trying to do.  I do recall a
previous thread where someone else was trying "to get direct access to
memory" and from what I could understand this was a "difficult procedure".

I would not even try to get 2.6.32.2 to work with the Pengutronix BSP.
Stick to their packages, at least they have been tested.

Good luck!

miniarm
@davef,

If I am trying to do telnet I am getting following error.


Trying 192.168.1.167...
Connected to 192.168.1.167.
Escape character is '^]'.
Connection closed by foreign host.

with this error, telnetd process stop/kill inside the board. Don't know
why?

miniarm
Hi,

Finally, able to set GPJ port using Pengutronics BSP from user space.


I am still not sure this patch help me or not.
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-March/010698....

But I configure GPJ port in kernel space and I am able to operate from user
space, also verify voltage with Multimeter for all GPJ pin.

Thanks all for your time and consideration.

nicky jack
hi i am using pengutronics BSP can i can i able to interface the wireless
video camera???
if possible send some references....



Thanks in advance

Juergen Beisert
Depends on the wireless adapter you are using at the Mini2440 side to
receive the data from the camera.