linux-mips
[Top] [All Lists]

Re: [PATCH V10 05/13] MIPS: Loongson: Add UEFI-like firmware inte

To: Huacai Chen <chenhc@lemote.com>
Subject: Re: [PATCH V10 05/13] MIPS: Loongson: Add UEFI-like firmware interface support
From: Andreas Barth <aba@ayous.org>
Date: Sat, 22 Jun 2013 14:59:50 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>, John Crispin <john@phrozen.org>, linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>, Zhangjin Wu <wuzhangjin@gmail.com>, Hongliang Tao <taohl@lemote.com>, Hua Yan <yanh@lemote.com>
In-reply-to: <1366030028-5084-6-git-send-email-chenhc@lemote.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1366030028-5084-1-git-send-email-chenhc@lemote.com> <1366030028-5084-6-git-send-email-chenhc@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
* Huacai Chen (chenhc@lemote.com) [130415 14:49]:
> The new UEFI-like firmware interface has 3 advantages:
> 
> 1, Firmware export a physical memory map which is similar to X86's
>    E820 map, so prom_init_memory() will be more elegant that #ifdef
>    clauses can be removed.
> 2, Firmware export a pci irq routing table, we no longer need pci
>    irq routing fixup in kernel's code.
> 3, Firmware has a built-in vga bios, and its address is exported,
>    the linux kernel no longer need an embedded blob.
> 
> With the new interface, Loongson-3A/2G and all their successors can use
> a unified kernel. All Loongson-based machines support this new interface
> except 2E/2F series.

Can't we auto-detect whether there is an UEFI-like interface? That
would allow to reduce the number of #ifdefs a bit.


> --- a/arch/mips/loongson/common/env.c
> +++ b/arch/mips/loongson/common/env.c
>       while (l != 0) {
> -             parse_even_earlier(bus_clock, "busclock", l);
>               parse_even_earlier(cpu_clock_freq, "cpuclock", l);
>               parse_even_earlier(memsize, "memsize", l);
>               parse_even_earlier(highmemsize, "highmemsize", l);
> @@ -57,8 +73,32 @@ void __init prom_init_env(void)
>       }
>       if (memsize == 0)
>               memsize = 256;
> -     if (bus_clock == 0)
> -             bus_clock = 66000000;
> +#else

why are we not interested anymore in busclock in non-UEFI-like
machines (and shouldn't this be documented in the summary)?



Andi
> 

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