linux-mips
[Top] [All Lists]

use bootmem in platform code on MIPS

To: Linux-MIPS <linux-mips@linux-mips.org>
Subject: use bootmem in platform code on MIPS
From: Manuel Lauss <manuel.lauss@googlemail.com>
Date: Tue, 27 Apr 2010 14:14:32 +0200
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=jFSdP2eKxW2WctFyaOKBOQDDYlcJ/rdfHayiC4xnCL0=; b=TYeLiXJPapCkUE1t2gRxVlwcAFsxQrnWHZCkodNMwIOfHCcTqNyf5PPdbWSgFKrpPV 6VT6U4FmtMl+rA9hMQRynUuKmMz5vV4Gk/5qUnNRiC4QD294DZ3ZreL/oYIXJiMQ+3GN zhhOg9jIQU9Atp+zD9PySkUiKCfvQHGKHa4t8=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=WH08/WiMIL5/DWb7jF3YeHaTKR+VKCqxUhxMtHXc8V+1UsHther/kJeBWptqMX92vn qAsDYfhK1MS9zmuD4plQS/gAuiFMX0t+vk+d3ns/S2DYvbIC3UsTQxsbAgTN38ekdh+w uaOyVsPqV+2Tok35sy083VaALIp9pk+Rp1UUs=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hello,

I'd like to use bootmem to reserve large chunks of RAM (at a particular physical
address; for Au1200 MAE, CIM and framebuffer, and later Au1300 OpenGL block)
but it seems that it can't be done:  Doing __alloc_bootmem() in
plat_mem_setup() is
too early, while an arch_initcall() is too late because by then the
slab allocator is
already up and handing out random addresses and/or refusing allocations larger
than a few MBytes.

Is there another callback I could use which would allow me to use bootmem (short
of abusing plat_smp_setup)?

Would a separate callback like this be an acceptable solution?

--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -487,6 +487,10 @@ static void __init arch_mem_init(char **cmdline_p)
        }

        bootmem_init();
+
+       if (plat_bootmem_init)
+               plat_bootmem_init();
+
        sparse_init();
        paging_init();
 }

Thanks,
     Manuel Lauss

<Prev in Thread] Current Thread [Next in Thread>