Powerpc and ioremap

2008-08-07 Thread Sébastien Chrétien
Hello,

I am trying to port linux on my Powerpc Board. I have used Linux 2.6.26 and
gcc 3.4.5.
I have used Uboot 1.2.
Linux seems running from _start to udbg_early_init(). That's why I
develloped a udbg_driver.
It must write in a register which is located at 0x2001b044. So I wrote :

void __iomem *p;
p=ioremap(0x2001b044,4);
iowrite32('O',p);
iowrite32('K',p);

But when he exectuted ioremap, he looped in the __delay function.

Can you help me to solve this probleme ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Powerpc and ioremap

2008-08-07 Thread Sébastien Chrétien
Thanks for your answer.
But it doesn't work.
I think ioremap create a kernel panic. But I can't see because i have no
UART ready.
Is there a way in order to trace the failure ?

2008/8/7, Juergen Beisert <[EMAIL PROTECTED]>:
>
> Am Donnerstag, 7. August 2008 11:54 schrieb Sébastien Chrétien:
>
> > Hello,
> >
> > I am trying to port linux on my Powerpc Board. I have used Linux 2.6.26
> and
> > gcc 3.4.5.
> > I have used Uboot 1.2.
> > Linux seems running from _start to udbg_early_init(). That's why I
> > develloped a udbg_driver.
> > It must write in a register which is located at 0x2001b044. So I wrote :
> >
> > void __iomem *p;
> > p=ioremap(0x2001b044,4);
> > iowrite32('O',p);
> > iowrite32('K',p);
>
>
> try
>
> p=ioremap(0x2001b000, 0x1000);
> iowrite32('O',p + 0x44);
> iowrite32('K',p + 0x44);
>
> instead.
>
> jbe
>
> --
>   Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
>   Pengutronix - Linux Solutions for Science and Industry
>Handelsregister:  Amtsgericht Hildesheim, HRA 2686
>  Hannoversche Str. 2, 31134 Hildesheim, Germany
>Phone: +49-5121-206917-7 |  Fax: +49-5121-206917-9
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Powerpc and ioremap

2008-08-07 Thread Sébastien Chrétien
Can we call ioremap() during udbg_early_init ?

2008/8/7, Sébastien Chrétien <[EMAIL PROTECTED]>:
>
> Thanks for your answer.
> But it doesn't work.
> I think ioremap create a kernel panic. But I can't see because i have no
> UART ready.
> Is there a way in order to trace the failure ?
>
> 2008/8/7, Juergen Beisert <[EMAIL PROTECTED]>:
>>
>> Am Donnerstag, 7. August 2008 11:54 schrieb Sébastien Chrétien:
>>
>> > Hello,
>> >
>> > I am trying to port linux on my Powerpc Board. I have used Linux 2.6.26
>> and
>> > gcc 3.4.5.
>> > I have used Uboot 1.2.
>> > Linux seems running from _start to udbg_early_init(). That's why I
>> > develloped a udbg_driver.
>> > It must write in a register which is located at 0x2001b044. So I wrote :
>> >
>> > void __iomem *p;
>> > p=ioremap(0x2001b044,4);
>> > iowrite32('O',p);
>> > iowrite32('K',p);
>>
>>
>> try
>>
>> p=ioremap(0x2001b000, 0x1000);
>> iowrite32('O',p + 0x44);
>> iowrite32('K',p + 0x44);
>>
>> instead.
>>
>> jbe
>>
>> --
>>   Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
>>   Pengutronix - Linux Solutions for Science and Industry
>>Handelsregister:  Amtsgericht Hildesheim, HRA 2686
>>  Hannoversche Str. 2, 31134 Hildesheim, Germany
>>Phone: +49-5121-206917-7 |  Fax: +49-5121-206917-9
>>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[MPC7448] machdep_calls

2008-08-18 Thread Sébastien Chrétien
Hello,

I am developping a Linux for my PPC Board. I must write a define_machine
structure (marchdep_calls). Where can I find some Information about
functions of this structure ?

Thanx
Sébastien Chrétien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [MPC7448] machdep_calls

2008-08-18 Thread Sébastien Chrétien
Ok I am going to copy some examples.

2008/8/18, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien wrote:
> > Hello,
> >
> > I am developping a Linux for my PPC Board. I must write a
> > define_machine structure (marchdep_calls). Where can I find some
> > Information about functions of this structure ?
>
>
> It isn't well documented unfortunately. Best is to look at what others
> do... and then find your way through.
>
> I agree somebody should write dome doco one day ... in the meantime,
> feel free to ask questions here.
>
> Cheers,
> Ben.
>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [MPC7448] machdep_calls

2008-08-18 Thread Sébastien Chrétien
Can somebody explain me the aim of the function  "setup_arch" in the
machine_call structure ?

2008/8/18, Sébastien Chrétien <[EMAIL PROTECTED]>:
>
> Ok I am going to copy some examples.
>
> 2008/8/18, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>>
>> On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien wrote:
>> > Hello,
>> >
>> > I am developping a Linux for my PPC Board. I must write a
>> > define_machine structure (marchdep_calls). Where can I find some
>> > Information about functions of this structure ?
>>
>>
>> It isn't well documented unfortunately. Best is to look at what others
>> do... and then find your way through.
>>
>> I agree somebody should write dome doco one day ... in the meantime,
>> feel free to ask questions here.
>>
>> Cheers,
>> Ben.
>>
>>
>>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [MPC7448] machdep_calls

2008-08-18 Thread Sébastien Chrétien
The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on a FPGA.. I read
the code of mpc7448_hpc2.c.
It uses a ioremap in order to iniatilize the tsi108 registers. But I have
already initialized MMU with my registers in HEAD_32.S. Do I need to use
ioremap in setup_arch() ?




2008/8/18, Michael Ellerman <[EMAIL PROTECTED]>:
>
> On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> > Can somebody explain me the aim of the function  "setup_arch" in the
> > machine_call structure ?
>
>
> Is this MPC7448 anything like an mpc7448hpc2 ?
>
> If so maybe you should start by looking at the code for it in:
>
> arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
>
> Even if it's not related, that will give you some idea of what the
> callbacks are for.
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [MPC7448] machdep_calls

2008-08-19 Thread Sébastien Chrétien
I have no screen that's why I have to use UART. I followed the CPM model in
head_32.S :
#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
setup_cpm_bat:
lisr8, 0xf000
orir8, r8,0x002a
mtsprSPRN_DBAT1L, r8

lisr11, 0xf000
orir11, r11, (BL_1M << 2) | 2
mtsprSPRN_DBAT1U, r11

blr
#endif

With this code  I can use udbg.

According to you, what is the best way ?

2008/8/18, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on a FPGA..
> > I read the code of mpc7448_hpc2.c.
> > It uses a ioremap in order to iniatilize the tsi108 registers. But I
> > have already initialized MMU with my registers in HEAD_32.S. Do I need
> > to use ioremap in setup_arch() ?
>
>
> Why did you hack head_32.S ? You shouldn't do that... This is common
> code, not platform code.
>
> Ben.
>
> >
> >
> >
> > 2008/8/18, Michael Ellerman <[EMAIL PROTECTED]>:
> > On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> > > Can somebody explain me the aim of the
> > function  "setup_arch" in the
> > > machine_call structure ?
> >
> >
> > Is this MPC7448 anything like an mpc7448hpc2 ?
> >
> > If so maybe you should start by looking at the code for it in:
> >
> > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> >
> > Even if it's not related, that will give you some idea of what
> > the
> > callbacks are for.
> >
> > cheers
> >
> > --
> > Michael Ellerman
> > OzLabs, IBM Australia Development Lab
> >
> > wwweb: http://michael.ellerman.id.au
> > phone: +61 2 6212 1183 (tie line 70 21183)
> >
> > We do not inherit the earth from our ancestors,
> > we borrow it from our children. - S.M.A.R.T Person
> >
> >
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [MPC7448] machdep_calls

2008-08-19 Thread Sébastien Chrétien
So I will write .setup_arch of machine_call  structure.
When is ppc_md.setup_arch() called ?

2008/8/19, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Tue, 2008-08-19 at 09:00 +0200, Sébastien Chrétien wrote:
> > I have no screen that's why I have to use UART. I followed the CPM
> > model in head_32.S :
> > #ifdef CONFIG_PPC_EARLY_DEBUG_CPM
> > setup_cpm_bat:
> > lisr8, 0xf000
> > orir8, r8,0x002a
> > mtsprSPRN_DBAT1L, r8
> >
> > lisr11, 0xf000
> > orir11, r11, (BL_1M << 2) | 2
> > mtsprSPRN_DBAT1U, r11
> >
> > blr
> > #endif
>
>
> The "EARLY DEBUG" stuff is a pile of hacks to help with bringup,
> it's definitely not a long term solution to your problems.
>
> You may also want to look at Grant Likely's work on doing proper
> early ioremap using BATs.
>
>
> > With this code  I can use udbg.
> >
> > According to you, what is the best way ?
>
>
> The above is fine for early debug console. But that's definitely
> not the only kind of thing you may want to put in your setup_arch()...
> Look at what others do.
>
> Ben.
>
>
> > 2008/8/18, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
> > On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> > > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on
> > a FPGA..
> > > I read the code of mpc7448_hpc2.c.
> > > It uses a ioremap in order to iniatilize the tsi108
> > registers. But I
> > > have already initialized MMU with my registers in HEAD_32.S.
> > Do I need
> > > to use ioremap in setup_arch() ?
> >
> >
> > Why did you hack head_32.S ? You shouldn't do that... This is
> > common
> > code, not platform code.
> >
> > Ben.
> >
> > >
> > >
> > >
> > > 2008/8/18, Michael Ellerman <[EMAIL PROTECTED]>:
> > > On Mon, 2008-08-18 at 13:35 +0200, Sébastien
> > Chrétien wrote:
> > > > Can somebody explain me the aim of the
> > > function  "setup_arch" in the
> > > > machine_call structure ?
> > >
> > >
> > > Is this MPC7448 anything like an mpc7448hpc2 ?
> > >
> > > If so maybe you should start by looking at the code
> > for it in:
> > >
> > > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> > >
> > > Even if it's not related, that will give you some
> > idea of what
> > > the
> > > callbacks are for.
> > >
> > > cheers
> > >
> > > --
> > > Michael Ellerman
> > > OzLabs, IBM Australia Development Lab
> > >
> > > wwweb: http://michael.ellerman.id.au
> > > phone: +61 2 6212 1183 (tie line 70 21183)
> > >
> > > We do not inherit the earth from our ancestors,
> > > we borrow it from our children. - S.M.A.R.T Person
> > >
> > >
> >
> >
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[Initrd] Initialization

2008-08-21 Thread Sébastien Chrétien
Hello,

When Linux is booting, when does it verify if a initrd exists ?

Thanks
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[machdep_calls] IRQ

2008-08-21 Thread Sébastien Chrétien
Hello,

What are the constraints in order to implement a irq_init function ?
I think it has to set the mask. Does it enable IRQ ?

What is the aim or get_irq ? Does it retun an information about the mask,
the states, or... ?

Thanks
Sébastien Chrétien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [machdep_calls] IRQ

2008-08-21 Thread Sébastien Chrétien
Exactly, I mean ppc_md.init_IRQ().
Ok. What have I to setup in this function ? I set the mask and other
registers. Is it right ?  How do I chose the mask ?
At the end of this funtion, IRQ are disable. Is that right ? So who does
enable IRQs ?

Sorry for all this questions, I am learning the low layer of Linux.

2008/8/21, Michael Ellerman <[EMAIL PROTECTED]>:
>
> On Thu, 2008-08-21 at 09:13 +0200, Sébastien Chrétien wrote:
> > Hello,
> >
> > What are the constraints in order to implement a irq_init function ?
>
>
> You mean ppc_md.init_IRQ() ?
>
> If so, it's a hook you can use to setup your interrupt controller. It's
> called from init_IRQ() (arch/powerpc/kernel/irq.c), which is called from
> start_kernel() (init/main.c).
>
> Not long after it is called irqs are enabled. I think it is the last
> callback into arch code before irqs are enabled.
>
> When it is called the device tree is unflattened, so you can use the of_
> API. Bootmem is setup so you can use alloc_bootmem(), but you can't
> kmalloc yet. ioremap should work.
>
>
>
> > What is the aim or get_irq ? Does it retun an information about the
> > mask, the states, or... ?
>
>
> The aim of ppc_md.get_irq() ? It's called from do_IRQ()
> (arch/powerpc/kernel/irq.c) which is called from assembler in the
> appropriate head_x.S
>
> It just returns the number (virtual number) of the irq that just fired.
> If for some reason you took a spurious interrupt it should return
> NO_IRQ.
>
> I'm not sure what you mean about masks or states, someone else might
> though.
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Initrd

2008-08-21 Thread Sébastien Chrétien
Hello,

I am trying to setup a initrd on my board. I selected initrd support in the
2.6.26 kernel. But when my boad boots, it crashes affet MMU:exit.
What is the process in order to use a initrd ?

Thanks
Sébastien Chrétien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [machdep_calls] IRQ

2008-08-22 Thread Sébastien Chrétien
Ok thank you, I will begin to implement the irq functions

2008/8/22, Michael Ellerman <[EMAIL PROTECTED]>:
>
> On Thu, 2008-08-21 at 10:23 +0200, Sébastien Chrétien wrote:
> > Exactly, I mean ppc_md.init_IRQ().
>
> > Ok. What have I to setup in this function ? I set the mask and other
> > registers. Is it right ?  How do I chose the mask ?
>
>
> It totally depends on your platform, I really can't tell you. You can
> look at similar platform code if there is some, otherwise the reference
> manual for your hardware or similar should have what you need.
>
>
> > At the end of this funtion, IRQ are disable. Is that right ? So who
> > does enable IRQs ?
>
>
> Yes, irqs get enabled a bit later in start_kernel().
>
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Initrd

2008-08-22 Thread Sébastien Chrétien
Hello,

I am using linux 2.6.26 on a powerpc board. I would like to use a initrd. So
I set the initrd option in the kernel. But when I boot Linux, it crashes
before  start_kernel(). And after the configuration of the MMU. The last
words of the prompt are :
Probing machine type ...
  MPC7448 on IAD68 ... match !
id mach(): done
MMU:enter
MMU:hw init
hash:enter
hash:find piece
hash:patch
hash:done
MMU:mapin
MMU:setio
MMU:exi

Can you help me ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

initramfs vs initrd

2008-08-25 Thread Sébastien Chrétien
Hello,

What is the difference between initramfs and initrd ?

Sébastien Chrétien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

ttyS0

2008-08-25 Thread Sébastien Chrétien
Hello,

I must create a ttyS0 console for my ppc board. Can someone advice an
example ?

Thanks
Sébastien Chrétien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: initramfs vs initrd

2008-08-25 Thread Sébastien Chrétien
ok thank you



2008/8/25, Josh Boyer <[EMAIL PROTECTED]>:
>
> On Mon, Aug 25, 2008 at 02:57:14PM +0200,
> =?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
> >Hello,
> >
> >What is the difference between initramfs and initrd ?
>
>
> You could poke around in the Documentation directory of the kernel.  That
> should answer your question.
>
> Briefly, initramfs is a gzipped cpio archive.  initrd is typically a
> compressed ext2 filesystem and requires a ramdisk to be unpacked to.
>
> josh
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: initramfs vs initrd

2008-08-25 Thread Sébastien Chrétien
When the kernel is booting, is it possible to check if the initrd is good ?

2008/8/25, Sébastien Chrétien <[EMAIL PROTECTED]>:
>
> ok thank you
>
>
>
> 2008/8/25, Josh Boyer <[EMAIL PROTECTED]>:
>>
>> On Mon, Aug 25, 2008 at 02:57:14PM +0200,
>> =?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
>> >Hello,
>> >
>> >What is the difference between initramfs and initrd ?
>>
>>
>> You could poke around in the Documentation directory of the kernel.  That
>> should answer your question.
>>
>> Briefly, initramfs is a gzipped cpio archive.  initrd is typically a
>> compressed ext2 filesystem and requires a ramdisk to be unpacked to.
>>
>> josh
>> ___
>> Linuxppc-dev mailing list
>> Linuxppc-dev@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[TTY] driver sriel tty on ppc board

2008-08-27 Thread Sébastien Chrétien
Hello,

I am trying to code a tty serial driver (UART link). The initialization is :
(model LDD 3)

static int __init tiny_tty_init(void)
{
int i, retval;

printk("Initialization of ttyS -> \n");
tiny_tty_driver=alloc_tty_driver(NB_TTY);
if(!tiny_tty_driver)
return -ENOMEM;

/*Initialize the tty driver*/

tiny_tty_driver->owner =THIS_MODULE;
tiny_tty_driver->driver_name = "ttyS";
tiny_tty_driver->name = "ttyS";
tiny_tty_driver->major = TTY_MAJOR;
tiny_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
tiny_tty_driver->subtype = SERIAL_TYPE_NORMAL;
tiny_tty_driver->flags = TTY_DRIVER_REAL_RAW;
tiny_tty_driver->init_termios = tty_std_termios;
tiny_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD
|HUPCL|CLOCAL;

tty_set_operations(tiny_tty_driver, &serial_ops);
/*register the tty driver*/
retval=tty_register_driver(tiny_tty_driver);
if(retval)
{
printk(KERN_ERR "Failed to register tiny tty driver");
put_tty_driver(tiny_tty_driver);
return retval;
}

for(i=0; i< NB_TTY; ++i)
tty_register_device(tiny_tty_driver,i,NULL);
printk("<-Initialization of ttyS \n");
return retval;
}

module_init(tiny_tty_init);


but I have a kernel panic :

io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Kernel panic - not syncing: Couldn't register /dev/tty0 driver

Can someone help me to trace the failure ?

Thanks
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Advice : console

2008-08-29 Thread Sébastien Chrétien
Hello,

I am trying to port linux for my ppc board. There is no keybord and no
scree. There is only UART.
I would like to have a console/terminal using UART.
What is the best way ? to write a serial driver using "struct  uart_driver"
or using "tty_driver" or to write a driver from scratch.
Maybe there is other way.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

RAMDISK driver initialized

2008-08-29 Thread Sébastien Chrétien
Hello,

I am using Linux 2.6.26. When I boot my board, I don't see the message :
RAMDISK driver initialized:...
Is it right ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Trace

2008-09-01 Thread Sébastien Chrétien
Hello,

I am triying to write a tty_driver under ppc. And I get a kernel panic.
Can somebody explain me how finding the source of the error with a kernel
panic trace :
thanks

Unable to handle kernel paging request for data at address 0x57f9
Faulting instruction address: 0xc0110ddc
Oops: Kernel access of bad area, sig: 11 [#1]
Modules linked in:
NIP: c0110ddc LR: c08c CTR: 
REGS: cf01bcb0 TRAP: 0300   Not tainted  (2.6.26)
MSR: 9032   CR: 44002022  XER: 2000
DAR: 57f9, DSISR: 4000
TASK = cf01c000[1] 'swapper' THREAD: cf01a000
GPR00: 000c cf01bd60 cf01c000 cf04c300  cf01bdbc 
c01d
GPR08: 1249 fffc  cf000420 84002022  1b00
007fff00
GPR16: 0fffa1d0  0004 cf01bdbc 007ffec0  
0080
GPR24:  c01b7650 0002 c01d  ce4a6700 cf04c300
5741
NIP [c0110ddc] init_dev+0x2bc/0x584
LR [c08c] tty_open+0xe8/0x3e0
Call Trace:
[cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable)
[cf01bdb0] [c08c] tty_open+0xe8/0x3e0
[cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0
[cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8
[cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70
[cf01be60] [c007bc60] do_filp_open+0x200/0x7d0
[cf01bf10] [c00700b4] do_sys_open+0x74/0x114
[cf01bf40] [c0003c94] init_post+0x34/0x258
[cf01bf60] [c019ca64] kernel_init+0x258/0x270
[cf01bff0] [c0011b3c] kernel_thread+0x44/0x60
Instruction dump:
7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81
409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060
---[ end trace b7795a387aeb7786 ]---
Kernel panic - not syncing: Attempted to kill init!
allocation failed: out of vmalloc space - use vmalloc= to increase
size.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Trace

2008-09-01 Thread Sébastien Chrétien
I found where is the failure with your advices
In init_dev (tty_io.c), init_dev calls "tty = driver->ttys[idx]"
after this call, tty value is : tty = 0x5741

Have I to initialize driver->ttys in my driver. If yes, how have I to
Initialize this ?

The driver tty is used in order to have a console on my serial port.
Thanks for your help


2008/9/1, Jenkins, Clive <[EMAIL PROTECTED]>:
>
> The instruction that caused the fault is at this address:
>
> > NIP [c0110ddc] init_dev+0x2bc/0x584
>
>
> The hex value of the instruction is also highlighted between <> here:
>
> > Instruction dump:
> > 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81
> > 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060
>
>
> Disassemble your kernel and look at offset 0x2BC relative to the label
> init_dev
>
> 
>
> From: [EMAIL PROTECTED] [mailto:
> linuxppc-dev-bounces+clive.jenkins =
> [EMAIL PROTECTED] On Behalf Of Sébastien Chrétien
> Sent: 01 September 2008 10:16
> To: linuxppc-dev@ozlabs.org
> Subject: Trace
>
>
>
> Hello,
>
> I am triying to write a tty_driver under ppc. And I get a kernel panic.
> Can somebody explain me how finding the source of the error with a kernel
> panic trace :
> thanks
>
> Unable to handle kernel paging request for data at address 0x57f9
> Faulting instruction address: 0xc0110ddc
> Oops: Kernel access of bad area, sig: 11 [#1]
> Modules linked in:
> NIP: c0110ddc LR: c08c CTR: 
> REGS: cf01bcb0 TRAP: 0300   Not tainted  (2.6.26)
> MSR: 9032   CR: 44002022  XER: 2000
> DAR: 57f9, DSISR: 4000
> TASK = cf01c000[1] 'swapper' THREAD: cf01a000
> GPR00: 000c cf01bd60 cf01c000 cf04c300  cf01bdbc 
> c01d
> GPR08: 1249 fffc  cf000420 84002022  1b00
> 007fff00
> GPR16: 0fffa1d0  0004 cf01bdbc 007ffec0  
> 0080
> GPR24:  c01b7650 0002 c01d  ce4a6700 cf04c300
> 5741
> NIP [c0110ddc] init_dev+0x2bc/0x584
> LR [c08c] tty_open+0xe8/0x3e0
> Call Trace:
> [cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable)
> [cf01bdb0] [c08c] tty_open+0xe8/0x3e0
> [cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0
> [cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8
> [cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70
> [cf01be60] [c007bc60] do_filp_open+0x200/0x7d0
> [cf01bf10] [c00700b4] do_sys_open+0x74/0x114
> [cf01bf40] [c0003c94] init_post+0x34/0x258
> [cf01bf60] [c019ca64] kernel_init+0x258/0x270
> [cf01bff0] [c0011b3c] kernel_thread+0x44/0x60
> Instruction dump:
> 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81
> 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060
> ---[ end trace b7795a387aeb7786 ]---
> Kernel panic - not syncing: Attempted to kill init!
> allocation failed: out of vmalloc space - use vmalloc= to increase
> size.
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Trace

2008-09-01 Thread Sébastien Chrétien

Thanks for your answer.
Your analyse of ttys is very well. It was not my answer. All adresses in 
system.map begin with 0xc... So I think it is the case for ttys too.


I found the mistake. It came from my board_device function in struct 
console(console ->device). It didn't change the value of the parameter 
int* index.

So Linux loaded a tty_structure which was in tiny_ttys[-1]

console.h is not very well documented about this.

Thanks
Sébastien Chrétien

Jenkins, Clive a écrit :

 Why can't tty have value 0x5741 ?


To answer my own question, because it ends in 1 and is not word-aligned!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenkins, Clive
Sent: 01 September 2008 14:54
To: Sébastien Chrétien
Cc: linuxppc-dev@ozlabs.org
Subject: RE: Trace

I'm not sure that is a failure. Why can't tty have value 0x5741 ?

I think the code in tty_io.c initialises driver->ttys and you shouldn't need to 
do anything in your driver.
 
If you are not already aware, a useful way to explore kernel code is to use LXR:

http://lxr.linux.no/linux+v2.6.26/include/linux/tty_driver.h#L212
This may help you understand the tty code.
 
Good luck!
 
____


From: Sébastien Chrétien [mailto:[EMAIL PROTECTED] 
Sent: 01 September 2008 13:25

To: Jenkins, Clive
Cc: linuxppc-dev@ozlabs.org
Subject: Re: Trace


I found where is the failure with your advices 
In init_dev (tty_io.c), init_dev calls "tty = driver->ttys[idx]"

after this call, tty value is : tty = 0x5741

Have I to initialize driver->ttys in my driver. If yes, how have I to 
Initialize this ?

The driver tty is used in order to have a console on my serial port.
Thanks for your help



2008/9/1, Jenkins, Clive <[EMAIL PROTECTED]>: 


The instruction that caused the fault is at this address:

> NIP [c0110ddc] init_dev+0x2bc/0x584


The hex value of the instruction is also highlighted between <> here:

> Instruction dump:
> 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 
2f81
> 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 
801e0060


Disassemble your kernel and look at offset 0x2BC relative to the label 
init_dev



From: [EMAIL PROTECTED] [mailto:linuxppc-dev-bounces+clive.jenkins 
<mailto:linuxppc-dev-bounces%2Bclive.jenkins> [EMAIL PROTECTED] On Behalf Of 
Sébastien Chrétien
Sent: 01 September 2008 10:16
To: linuxppc-dev@ozlabs.org
Subject: Trace



Hello,

I am triying to write a tty_driver under ppc. And I get a kernel panic.
Can somebody explain me how finding the source of the error with a 
kernel panic trace :
thanks

Unable to handle kernel paging request for data at address 0x57f9
Faulting instruction address: 0xc0110ddc
Oops: Kernel access of bad area, sig: 11 [#1]
Modules linked in:
NIP: c0110ddc LR: c08c CTR: 
REGS: cf01bcb0 TRAP: 0300   Not tainted  (2.6.26)
MSR: 9032   CR: 44002022  XER: 2000
DAR: 57f9, DSISR: 4000
TASK = cf01c000[1] 'swapper' THREAD: cf01a000
GPR00: 000c cf01bd60 cf01c000 cf04c300  cf01bdbc  
c01d
GPR08: 1249 fffc  cf000420 84002022  1b00 
007fff00
GPR16: 0fffa1d0  0004 cf01bdbc 007ffec0   
0080
GPR24:  c01b7650 0002 c01d  ce4a6700 cf04c300 
5741
NIP [c0110ddc] init_dev+0x2bc/0x584
LR [c08c] tty_open+0xe8/0x3e0
Call Trace:
[cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable)
[cf01bdb0] [c08c] tty_open+0xe8/0x3e0
[cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0
[cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8
[cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70
[cf01be60] [c007bc60] do_filp_open+0x200/0x7d0
[cf01bf10] [c00700b4] do_sys_open+0x74/0x114
[cf01bf40] [c0003c94] init_post+0x34/0x258
[cf01bf60] [c019ca64] kernel_init+0x258/0x270
[cf01bff0] [c0011b3c] kernel_thread+0x44/0x60
Instruction dump:
7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81
409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 
801e0060
---[ end trace b7795a387aeb7786 ]---
Kernel panic - not syncing: Attempted to kill init!
allocation failed: out of vmalloc space - use vmalloc= to 
increase size.




___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


  

Re: Trace

2008-09-02 Thread Sébastien Chrétien
ok is it a bad way to write a tty driver ? why ?

2008/9/2, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Tue, 2008-09-02 at 07:13 +0200, Sébastien CHRETIEN wrote:
> > My board has only a uart device on a FPGA. I don't use the serial layer
> > because it isn't documented in Linux Device Driver 3rd. Only the tty
> > layer is documented
>
>
> You won't go very far in linux kernel dev. with using books like
> that :-)
>
> Look at other drivers in drivers/serial that should give you all the
> information you need :-0
>
> Cheers,
> Ben.
>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Trace

2008-09-02 Thread Sébastien Chrétien
ok. I will try the serial layer

2008/9/2, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Tue, 2008-09-02 at 09:34 +0200, Sébastien Chrétien wrote:
> > ok is it a bad way to write a tty driver ? why ?
>
>
> Not necessarily, it's just overkill. The UART layer handles a lot
> of stuff for you. The tty layer is tricky to get right.
>
> Cheers,
> Ben.
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

irq

2008-09-03 Thread Sébastien Chrétien
Hello,

I am trying to register a function writh IRQ :

static irqreturn_t uart_test (int irq , void *dev_id)
{
printk("/!\\ Interruption : tx_empty\n");
   return IRQ_HANDLED;
}

req=request_irq(0x18,uart_test,NULL,"uart_test",NULL);
printk("Initialisation IRQ UART : %d \n", req);

When I boot linux ppc, the req value is -38.
What is wrong ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: irq

2008-09-03 Thread Sébastien Chrétien
The failure referes to setup_irq :
desc->chip == &no_irq_chip is true

What is irq_desc and how can I initialize it ?


setup_irq(unsigned int irq, struct irqaction *new)
{
struct irq_desc *desc = irq_desc + irq;
struct irqaction *old, **p;
const char *old_name = NULL;
unsigned long flags;
int shared = 0;

if (irq >= NR_IRQS)
return -EINVAL;

printk("desc\n");
if (desc->chip == &no_irq_chip)
return -ENOSYS;
printk("desc2\n");

2008/9/3, Daniele Bosi <[EMAIL PROTECTED]>:
>
> Try to set some flag into the third parameter of the request_irq()
> function like:
>
> SA_SHIRQInterrupt is shared
>
> SA_INTERRUPTDisable local interrupts while processing
>
> SA_SAMPLE_RANDOMThe interrupt can be used for entropy
>
> otherwise try to use the function install_irq_handler()
>
>
> bye Daniele
>
>
>
> Sébastien Chrétien ha scritto:
>
> > Hello,
> >
> > I am trying to register a function writh IRQ :
> >
> > static irqreturn_t uart_test (int irq , void *dev_id)
> > {
> > printk("/!\\ Interruption : tx_empty\n");
> >return IRQ_HANDLED;
> > }
> >
> > req=request_irq(0x18,uart_test,NULL,"uart_test",NULL);
> > printk("Initialisation IRQ UART : %d \n", req);
> >
> > When I boot linux ppc, the req value is -38.
> > What is wrong ?
>
> > 
> >
> > ___
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
> --
>
>
> 
>
>
>   Daniele Bosi
>
> *DIGITEK S.p.A.*
>
> Via L. Romagnoli 24,
> 41033 Concordia sulla Secchia
> Modena (MO), Italy
>
> *Tel*: +39-(0)53556942 Fax. +39-(0)53554550
>
> *Web:* http://www.digitek.it
>
> *Mail to:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: irq

2008-09-03 Thread Sébastien Chrétien

Ok I will try irq_create_mapping tomorrow.
When have I to use this function ?
I am using a MPC7448.

M B a écrit :

Hi,

this seems to be the same problem I had, when registering an irq with UIO.

On Wed, Sep 3, 2008 at 5:03 PM, Sébastien Chrétien
<[EMAIL PROTECTED]> wrote:
  

The failure referes to setup_irq :
desc->chip == &no_irq_chip is true

What is irq_desc and how can I initialize it ?



I did use irq_create_mapping, to initialize this struct. However I
have no idea if this was right. It seemed to work at first, but I'm
encountering problems now, however I don't know if they come from the
kernel, or UIO interrupt handler. I did this for some test, but irqs
are something you want to be sure they work correctly.

So maybee someone could clarify this as we already raise this issue.

What processor are you using Sebastien? My one is a 405EP

Best Regards

Markus


  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: irq

2008-09-03 Thread Sébastien Chrétien

irq_of_parse_and_map is equivalent to ioremap in the MMU case ?

Scott Wood a écrit :

On Wed, Sep 03, 2008 at 06:36:39PM +0200, Sébastien Chrétien wrote:
  

Ok I will try irq_create_mapping tomorrow.
When have I to use this function ?



You always need to create a mapping (though doing it with
irq_of_parse_and_map is preferred).  request_irq() takes virtual IRQ
numbers, not hardware IRQ numbers.

-Scott

  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: irq

2008-09-04 Thread Sébastien Chrétien
I read the booting_without_of.txt document and the Interrupt Mapping
docucument from http://playground.sun.com/1275. But I don't understand all
parameters. Can somebody help me to create my device tree about interrupt
part ?

I have an interrupt controller at the adresse 0x20006000. The irq_id range
is 1 to 63.
I would like to try UART interrupt, which have ids : 0x18 (tranmission fifo
empty,
0x19 (reception fifo full), 0x1a (reception error), 0x1b (break emission).
What other informations are needed ?


Nothing is cascaded.

Thanks




2008/9/4, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>
> On Wed, 2008-09-03 at 23:02 +0200, Sébastien Chrétien wrote:
>
> > irq_of_parse_and_map is equivalent to ioremap in the MMU case ?
>
>
> On the powerpc architecture, we use virtualized IRQ numbers in order to
> deal with the wide range of interrupt controllers around and multiple
> of them cascaded.
>
> The base function to "map" a physical interrupt to a virtual interrupt
> is irq_create_mapping(). It takes an irq_host argument which represent
> the IRQ "domain" (typically irq controller) off which the interrupt you
> are trying to map hangs.
>
> If you pass NULL, it will use the "default" controller, which doesn't
> always exist, it depends on the platform. Usually, platforms set that
> to the toplevel PIC.
>
> However, normally, that function shouldn't be used directly. Instead,
> you should create a representation of your device in the device-tree
> along with the appropriate interrupt mapping, and then use the
> irq_of_parse_and_map() function to obtain a mapped virtual irq based
> on the device-tree information. This will take care of finding the
> right irq_host but will also properly setup the polarity of the
> interrupt etc...
>
> Now, as to how you should represent the interrupt in the device-tree,
> this should be explained in Documentation/booting-without-of.txt
>
> Cheers,
> Ben.
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: irq

2008-09-04 Thread Sébastien Chrétien
I try to write a device tree about irq :

IT_controller: [EMAIL PROTECTED] {
   clock-frequency = <0>;
   interrupt-controller;
#address-cells = <0>;
   reg = <0x20006000 0x100>;
   compatible = "it";
   device_type = "it";
   big-endian;
   };

   [EMAIL PROTECTED]
   device_type="uart";
   compatible="uart";
   interrupts = <0x18 0>;
   interrupt-parent=<&IT_controller>;
   };


uart_irq=of_find_node_by_type(NULL, "uart");
if(uart_irq==NULL)
 printk("%s: No uart node found !\n", __func__);

virt=irq_of_parse_and_map(uart_irq, 0);
printk("Virtual irq : %d \n",virt);


When I boot linux, virt=0;

What is wrong ?


2008/9/4, Sébastien Chrétien <[EMAIL PROTECTED]>:
>
> I read the booting_without_of.txt document and the Interrupt Mapping
> docucument from http://playground.sun.com/1275. But I don't understand all
> parameters. Can somebody help me to create my device tree about interrupt
> part ?
>
> I have an interrupt controller at the adresse 0x20006000. The irq_id range
> is 1 to 63.
> I would like to try UART interrupt, which have ids : 0x18 (tranmission fifo
> empty,
> 0x19 (reception fifo full), 0x1a (reception error), 0x1b (break emission).
> What other informations are needed ?
>
>
> Nothing is cascaded.
>
> Thanks
>
>
>
>
> 2008/9/4, Benjamin Herrenschmidt <[EMAIL PROTECTED]>:
>>
>> On Wed, 2008-09-03 at 23:02 +0200, Sébastien Chrétien wrote:
>>
>> > irq_of_parse_and_map is equivalent to ioremap in the MMU case ?
>>
>>
>> On the powerpc architecture, we use virtualized IRQ numbers in order to
>> deal with the wide range of interrupt controllers around and multiple
>> of them cascaded.
>>
>> The base function to "map" a physical interrupt to a virtual interrupt
>> is irq_create_mapping(). It takes an irq_host argument which represent
>> the IRQ "domain" (typically irq controller) off which the interrupt you
>> are trying to map hangs.
>>
>> If you pass NULL, it will use the "default" controller, which doesn't
>> always exist, it depends on the platform. Usually, platforms set that
>> to the toplevel PIC.
>>
>> However, normally, that function shouldn't be used directly. Instead,
>> you should create a representation of your device in the device-tree
>> along with the appropriate interrupt mapping, and then use the
>> irq_of_parse_and_map() function to obtain a mapped virtual irq based
>> on the device-tree information. This will take care of finding the
>> right irq_host but will also properly setup the polarity of the
>> interrupt etc...
>>
>> Now, as to how you should represent the interrupt in the device-tree,
>> this should be explained in Documentation/booting-without-of.txt
>>
>> Cheers,
>> Ben.
>>
>>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Trace

2008-09-04 Thread Sébastien Chrétien


I followed your advice : I used the UART layer.
It is easier.
Thanks


Benjamin Herrenschmidt a écrit :

On Tue, 2008-09-02 at 09:34 +0200, Sébastien Chrétien wrote:
  

ok is it a bad way to write a tty driver ? why ?



Not necessarily, it's just overkill. The UART layer handles a lot
of stuff for you. The tty layer is tricky to get right.

Cheers,
Ben.


  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

IDE

2008-09-10 Thread Sébastien Chrétien
Hello

I would like to setup my IDE controller. It uses a generic mapping. And he
is located at the adress 0x20003000.
How can I specifie this adress to the ide driver ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: IDE

2008-09-10 Thread Sébastien Chrétien
Have I to rewrite a IDE driver ?

2008/9/10, Sergei Shtylyov <[EMAIL PROTECTED]>:
>
> Hello.
>
> Sébastien Chrétien wrote:
>
>  I would like to setup my IDE controller. It uses a generic mapping. And he
>> is located at the adress 0x20003000.
>>
>
>  What kin of controller, and what do you mean by generic mapping?
>
>  How can I specifie this adress to the ide driver ?
>>
>
>  The usual ways is via the platform device.
>
>
> MBR, Sergei
>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: IDE

2008-09-10 Thread Sébastien Chrétien
It is a common ide controller :
offset 0x0 Data
offset 0x1 error
offset 0x2 Sector count
offset 0x3 sector No
offset 0x4 Cylinder low
offset 0x5 Cylinder High
offset 0x6 Head
offset 0x7 status

2008/9/10, Sergei Shtylyov <[EMAIL PROTECTED]>:
>
> Hello.
>
> Sébastien Chrétien wrote:
>
>  I would like to setup my IDE controller. It uses a generic mapping. And he
>> is located at the adress 0x20003000.
>>
>
>  What kin of controller, and what do you mean by generic mapping?
>
>  How can I specifie this adress to the ide driver ?
>>
>
>  The usual ways is via the platform device.
>
>
> MBR, Sergei
>
>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: IDE

2008-09-10 Thread Sébastien Chrétien
I looked falconide.c, it uses hw_regs_t hw; and ide_hwif_t *hwif.
Is it a good way ?

2008/9/10, Arnd Bergmann <[EMAIL PROTECTED]>:
>
> On Wednesday 10 September 2008, Sergei Shtylyov wrote:
> >Most probably you can use the existing platform drivers:
> > drivers/ide/egacy/ide_platform.c or drivers/ata/pata_platform.c.
> > Create/register a platform device named "pata_platform" with 2 memory
> > and 1 IRQ resource, and enable one of those drivers.
>
>
> For new boards using a flattened device tree, it should be enough
> to add a device node for the pata_of_platform driver.
> If you need a device specific setup, you should add a new "compatible"
> value in the tree and make the driver handle that in whatever
> way you need.
>
>
> Arnd <><
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: IDE

2008-09-10 Thread Sébastien Chrétien
ok I will use the flat device tree.
Do you utils in order to use ata and check ata link ?
For example, to read some information of my compact flash

2008/9/10, Sergei Shtylyov <[EMAIL PROTECTED]>:
>
> Arnd Bergmann wrote:
>
>   Most probably you can use the existing platform drivers:
>>> drivers/ide/egacy/ide_platform.c or drivers/ata/pata_platform.c.
>>> Create/register a platform device named "pata_platform" with 2 memory and
>>> 1 IRQ resource, and enable one of those drivers.
>>>
>>
>  For new boards using a flattened device tree, it should be enough
>> to add a device node for the pata_of_platform driver.
>>
>
>   Oops, forgot about this one. No wonder, after being knee deep in ARM for
> several months. :-)
>
> MBR, Sergei
>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: IDE

2008-09-10 Thread Sébastien Chrétien

Where can I find a pata_of_platform node example ?

Sergei Shtylyov a écrit :

Arnd Bergmann wrote:

  Most probably you can use the existing platform drivers: 
drivers/ide/egacy/ide_platform.c or drivers/ata/pata_platform.c.
Create/register a platform device named "pata_platform" with 2 
memory and 1 IRQ resource, and enable one of those drivers.



For new boards using a flattened device tree, it should be enough
to add a device node for the pata_of_platform driver.


   Oops, forgot about this one. No wonder, after being knee deep in 
ARM for several months. :-)


MBR, Sergei


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: IDE

2008-09-11 Thread Sébastien Chrétien
I saw pata_of_platform source. And when is called pata_of_platform_probe ?

2008/9/11, Sébastien Chrétien <[EMAIL PROTECTED]>:
>
> Where can I find a pata_of_platform node example ?
>
> Sergei Shtylyov a écrit :
>
>> Arnd Bergmann wrote:
>>
>>   Most probably you can use the existing platform drivers:
>>>> drivers/ide/egacy/ide_platform.c or drivers/ata/pata_platform.c.
>>>> Create/register a platform device named "pata_platform" with 2 memory
>>>> and 1 IRQ resource, and enable one of those drivers.
>>>>
>>>
>>  For new boards using a flattened device tree, it should be enough
>>> to add a device node for the pata_of_platform driver.
>>>
>>
>>   Oops, forgot about this one. No wonder, after being knee deep in ARM for
>> several months. :-)
>>
>> MBR, Sergei
>>
>>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

IRQ : IRQ_HOST_MAP_LEGACY

2008-09-12 Thread Sébastien Chrétien
Hello
I am seeing irq source. What is the use of :

IRQ_HOST_MAP_LEGACY

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

ioremap and vmalloc

2008-09-19 Thread Sébastien Chrétien
Hello,

When I use ioremap, the second time, I obtain this message :

allocation failed: out of vmalloc space - use vmalloc= to increase
size.
What can I do in order to fix this problem ?
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: ioremap and vmalloc

2008-09-19 Thread Sébastien Chrétien

The first is ioremap(0x2000,0x1000);
The second is ioremap(0x8000,0x1000);
Is it too long

Grant Likely a écrit :

On Fri, Sep 19, 2008 at 01:15:20PM +0200, 
=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
  

Hello,

When I use ioremap, the second time, I obtain this message :

allocation failed: out of vmalloc space - use vmalloc= to increase
size.
What can I do in order to fix this problem ?



How large are the regions that you are ioremapping?  The kernel sets
aside a fixed amount of the virtual address space for ioremaps, and if
you exhaust that then more ioremaps will stop working.

g.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ioremap and vmalloc

2008-09-19 Thread Sébastien Chrétien

if I write :
ioremap(0x2000,0x4) and ioremap(0x2000,0x5)

Will it crash ?

Josh Boyer a écrit :

On Fri, Sep 19, 2008 at 06:34:06PM +0200, 
=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
  

The first is ioremap(0x2000,0x1000);
The second is ioremap(0x8000,0x1000);
Is it too long



The error message you are getting should have been a very strong hint that
the answer is "yes."

josh
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ioremap and vmalloc

2008-09-19 Thread Sébastien Chrétien

I made a mistake. The right code is :

ioremap(0x2000,0x4) and ioremap(0x8000,0x5)



Grant Likely a écrit :

On Fri, Sep 19, 2008 at 10:58 AM, Josh Boyer <[EMAIL PROTECTED]> wrote:
  

On Fri, Sep 19, 2008 at 06:45:01PM +0200, 
=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:


if I write :
ioremap(0x2000,0x4) and ioremap(0x2000,0x5)

Will it crash ?
  

I have no idea.  You haven't given us enough information to really answer
that.



But I can say that the second ioremap() call makes the first ioremap()
both redundant and inefficient.  You're using exactly the same base
address so the same region is getting mapped twice.  Since the second
call uses a bigger region than the first then the kernel will probably
need to allocate another chunk of virtual address space to map it
instead of reusing the first mapping.

g.


  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ioremap and vmalloc

2008-09-19 Thread Sébastien Chrétien

The chip that I am using is a MPC7448.
The Kernel version is 2.6.26.
I am developping my own driver.
I am making some tests

Josh Boyer a écrit :

On Fri, Sep 19, 2008 at 06:45:01PM +0200, 
=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
  

if I write :
ioremap(0x2000,0x4) and ioremap(0x2000,0x5)

Will it crash ?



I have no idea.  You haven't given us enough information to really answer
that.

Basic information needed would be: 


1) What board/chip
2) What kernel version
3) What are you actually trying to do
4) What driver are you using
5) If you are writing your own, where is the code for it

etc.

josh

  

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Device Tree

2008-09-28 Thread Sébastien Chrétien

Hello,
I have a question about Device Tree.
Is Device Tree found only only on Linux Powerpc ?

Thanks
Sébastien
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Device Tree

2008-10-29 Thread Sébastien Chrétien

Thank for your answers.
Sébastien

Matt Sealey a écrit :

Benjamin Herrenschmidt wrote:

On Tue, 2008-09-30 at 18:08 -0500, Matt Sealey wrote:

It's far more common than people might think at first glance. With x86
I am sure it would benefit the platform a little more if the OF support
was in-line with the shared code between PPC and SPARC (and now I 
guess,

ARM) but nevertheless it's an Open Firmware platform and something that
appeared not too long ago.

OF is still a going concern; if you want a nice flexible firmware, why
not use it? Most of the implementations are open source (FirmWorks and
CodeGen trees, and the Sun reference design) too.


And SLOF :-)


I guess OpenBIOS counts too :)


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev