All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/6] x86: Add infrastructure to extract an e820 table from the coreboot tables
Date: Sun, 04 Dec 2011 11:52:08 +1100	[thread overview]
Message-ID: <4EDAC438.3000403@gmail.com> (raw)
In-Reply-To: <1322911130-29856-5-git-send-email-gabeblack@chromium.org>

Hi Gabe,

Last nit, I promise, and then I'll apply it all to u-boot-x86/next

On 03/12/11 22:18, Gabe Black wrote:
> Also approximate the size of RAM using the largest RAM address available
> in the tables. There may be areas which are marked as reserved which are
> actually at the end of RAM.
> 
> Signed-off-by: Gabe Black <gabeblack@chromium.org>
> ---
> Changes in v2:
> - Moved the coreboot specfic e820 function into this patch.
> 
>  arch/x86/cpu/coreboot/sdram.c |   38 +++++++++++++++++++++++++++++++++++++-
>  arch/x86/include/asm/zimage.h |    5 +++++
>  2 files changed, 42 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
> index b56085a..f8fdac6 100644
> --- a/arch/x86/cpu/coreboot/sdram.c
> +++ b/arch/x86/cpu/coreboot/sdram.c
> @@ -23,13 +23,49 @@
>   */
>  
>  #include <common.h>
> +#include <malloc.h>
> +#include <asm/e820.h>
>  #include <asm/u-boot-x86.h>
> +#include <asm/global_data.h>
> +#include <asm/arch-coreboot/sysinfo.h>
> +#include <asm/arch-coreboot/tables.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
> +{
> +	int i;
> +
> +	unsigned num_entries = min(lib_sysinfo.n_memranges, max_entries);
> +	if (num_entries < lib_sysinfo.n_memranges) {
> +		printf("Warning: Limiting e820 map to %d entries.\n",
> +			num_entries);
> +	}
> +	for (i = 0; i < num_entries; i++) {
> +		struct memrange *memrange = &lib_sysinfo.memrange[i];
> +
> +		entries[i].addr = memrange->base;
> +		entries[i].size = memrange->size;
> +		entries[i].type = memrange->type;
> +	}
> +	return num_entries;
> +}
> +
>  int dram_init_f(void)
>  {
> -	gd->ram_size = 64*1024*1024;
> +	int i;
> +	phys_size_t ram_size = 0;
> +
> +	for (i = 0; i < lib_sysinfo.n_memranges; i++) {
> +		struct memrange *memrange = &lib_sysinfo.memrange[i];
> +		unsigned long long end = memrange->base + memrange->size;
> +
> +		if (memrange->type == CB_MEM_RAM && end > ram_size)
> +			ram_size = end;
> +	}
> +	gd->ram_size = ram_size;
> +	if (ram_size == 0)
> +		return -1;
>  	return 0;
>  }
>  
> diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h
> index 8ee6a74..3a68bb0 100644
> --- a/arch/x86/include/asm/zimage.h
> +++ b/arch/x86/include/asm/zimage.h

The zimage.h changes belong in patch 3

> @@ -24,6 +24,8 @@
>  #ifndef _ASM_ZIMAGE_H_
>  #define _ASM_ZIMAGE_H_
>  
> +#include <asm/e820.h>
> +
>  /* linux i386 zImage/bzImage header. Offsets relative to
>   * the start of the image */
>  
> @@ -44,6 +46,9 @@
>  #define BZIMAGE_LOAD_ADDR  0x100000
>  #define ZIMAGE_LOAD_ADDR   0x10000
>  
> +/* Implementation defined function to install an e820 map. */
> +unsigned install_e820_map(unsigned max_entries, struct e820entry *);
> +

Should be u8 as boot_params.e820_entries is u8 (__u8 really, but we don't
use the kernel data types)

>  void *load_zimage(char *image, unsigned long kernel_size,
>  		  unsigned long initrd_addr, unsigned long initrd_size,
>  		  int auto_boot, void **load_address);

Regards,

Graeme

  reply	other threads:[~2011-12-04  0:52 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30  9:17 [U-Boot] [PATCH 0/4] Add support for the 32 bit boot protocol to the x86 zboot command Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 1/4] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 2/4] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 3/4] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-02 21:43   ` Graeme Russ
2011-12-02 21:47     ` Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 4/4] x86: Add support for specifying an initrd with the zboot command Gabe Black
2011-12-02 21:40   ` Graeme Russ
2011-11-30  9:28 ` [U-Boot] [PATCH 0/4] Add support for the 32 bit boot protocol to the x86 " Graeme Russ
2011-11-30 22:04   ` Graeme Russ
2011-11-30 12:13 ` Graeme Russ
2011-11-30 17:46   ` Gabe Black
2011-11-30 20:19     ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 0/6] Add support for the 32 bit boot protocol and coreboot table parsing Gabe Black
2011-12-05 22:09   ` [U-Boot] [PATCH v3 " Gabe Black
2011-12-05 22:12     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 1/6] x86: Import code from coreboot's libpayload to parse the coreboot table Gabe Black
2011-12-06 10:35     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 2/6] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-12-06 10:36     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 3/6] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-12-06 10:36     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 4/6] x86: Add infrastructure to extract an e820 table from the coreboot tables Gabe Black
2011-12-06 10:37     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 5/6] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-06 10:37     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 6/6] x86: Add support for specifying an initrd with the zboot command Gabe Black
2011-12-06 10:38     ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 1/6] x86: Import code from coreboot's libpayload to parse the coreboot table Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 2/6] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 3/6] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 4/6] x86: Add infrastructure to extract an e820 table from the coreboot tables Gabe Black
2011-12-04  0:52   ` Graeme Russ [this message]
2011-12-05 22:06     ` Gabe Black
2011-12-05 22:09       ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 5/6] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 6/6] x86: Add support for specifying an initrd with the zboot command Gabe Black

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EDAC438.3000403@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.