linux-mips
[Top] [All Lists]

Re: early_initcall replacement

To: "Ralf Baechle" <ralf@linux-mips.org>
Subject: Re: early_initcall replacement
From: dejo <riamae@gmail.com>
Date: Thu, 1 Mar 2007 12:33:29 +0800
Cc: linux-mips@linux-mips.org
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=hlns2RpgDa6MTh5+CfG44TH4djbtFn8B0ECJEal2xlb1+KeMtxTcOFaQEssIkBEulQc5hV8lz7ZB0rexBAgke0BkXC9NwxZMbbFjx1xhBDrygJDkL7bwUrruMjZizh91Bkdy/9TXYOMqqcFHvMxw3VA8GGwSyXKVw89BKfEUGIk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=hJIjKRI5hafqVUSt+648nFqeNBh8LJS8yTdzZnRjPI9pgQ9wvkRlubQ5K8MAGJk6wCfcPWgztczx9i+YQblpuQVMFwZ0SVZr1obIxoOvC0RMWcNF5uI66P0F+3iS8k/sZpBvWZx6zPPcHFnTO8l1loYY0pcRyieTIUkyE/Ywmwc=
In-reply-to: <20070228024756.GA23519@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <d28769380702271755u675241b3vb8b265120a2c70ca@mail.gmail.com> <20070228024756.GA23519@linux-mips.org>
Reply-to: riamae@gmail.com
Sender: linux-mips-bounce@linux-mips.org
Thank you for your reply, sir. I found out that there's already a plat_mem_setup defined in vr41xx/common/init.c that's why I cannot rename the function invoked by early_initcall to plat_mem_setup.

Actually, when I examined it further, I found out that using arch_initcall works just fine except that the add_memory_region is not called before everything else. It causes error because there's no memory region allotted.

I did this:
/*arch/mips/vr41xx/common/init
.c */
void __init plat_mem_setup(void)
{
    vr41xx_calculate_clock_frequency();

    timer_init();
    iomem_resource_init();
            add_memory_region(0, 0x04000000, BOOT_MEM_RAM);
}

and it worked! But it's not good practice isn't it? I might ruin the other vr41xx boards. Do you have any suggestions? Thank you.

ria mae


On 2/28/07, Ralf Baechle <ralf@linux-mips.org> wrote:
On Wed, Feb 28, 2007 at 09:55:28AM +0800, dejo wrote:

> Hello! I would like to ask what replaced early_initcall in the
> 2.6.18.4kernel.

What you need to change is

o remove the early_initcall() line.
o rename the function invoked by early_initcall to plat_mem_setup and
   change its prototype to: "void __init plat_mem_setup(void)".

  Ralf

<Prev in Thread] Current Thread [Next in Thread>
  • Re: early_initcall replacement, dejo <=