Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-11 Thread Bin Meng
Hi Simon,

On Tue, Nov 11, 2014 at 8:28 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,


[snip]


 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

 I don't see where the descriptor.bin is created?

 This needs to be downloaded and provided, as with mrc.bin, etc.

I thought the descriptor.bin is used to describe the u-boot.rom
layout, but seems you are saying it is coming from Intel(?). Is the
format defined by Intel so that all the BIOS for that platform
(u-boot.rom in our case) has to obey?

 I think I will adjust it (later) so that it builds an empty u-boot.rom
 and prints a warning on stdout if the binaries are not available. That
 way the buildman build will still succeed, but the user will see the
 problem. It might also be useful to have U-Boot report missing
 binaries when it starts up.

Sounds good.

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-11 Thread Simon Glass
Hi Bin,

On 11 November 2014 01:37, Bin Meng bmeng...@gmail.com wrote:
 Hi Simon,

 On Tue, Nov 11, 2014 at 8:28 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,


 [snip]


 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

 I don't see where the descriptor.bin is created?

 This needs to be downloaded and provided, as with mrc.bin, etc.

 I thought the descriptor.bin is used to describe the u-boot.rom
 layout, but seems you are saying it is coming from Intel(?). Is the
 format defined by Intel so that all the BIOS for that platform
 (u-boot.rom in our case) has to obey?

Yes, but only if there is a management engine (the CONFIG option you asked for).


 I think I will adjust it (later) so that it builds an empty u-boot.rom
 and prints a warning on stdout if the binaries are not available. That
 way the buildman build will still succeed, but the user will see the
 problem. It might also be useful to have U-Boot report missing
 binaries when it starts up.

 Sounds good.

 Regards,
 Bin

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-11 Thread Bin Meng
Hi Simon,

On Wed, Nov 12, 2014 at 12:11 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,

 On 11 November 2014 01:37, Bin Meng bmeng...@gmail.com wrote:
 Hi Simon,

 On Tue, Nov 11, 2014 at 8:28 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,


 [snip]


 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

 I don't see where the descriptor.bin is created?

 This needs to be downloaded and provided, as with mrc.bin, etc.

 I thought the descriptor.bin is used to describe the u-boot.rom
 layout, but seems you are saying it is coming from Intel(?). Is the
 format defined by Intel so that all the BIOS for that platform
 (u-boot.rom in our case) has to obey?

 Yes, but only if there is a management engine (the CONFIG option you asked 
 for).

So we need bundle the descriptor.bin and me.bin together with a CONFIG
option, and has better documentation to describe this.

[snip]

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-11 Thread Simon Glass
Hi Bin,


On 11 November 2014 18:17, Bin Meng bmeng...@gmail.com wrote:
 Hi Simon,

 On Wed, Nov 12, 2014 at 12:11 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,

 On 11 November 2014 01:37, Bin Meng bmeng...@gmail.com wrote:
 Hi Simon,

 On Tue, Nov 11, 2014 at 8:28 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,


 [snip]


 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

 I don't see where the descriptor.bin is created?

 This needs to be downloaded and provided, as with mrc.bin, etc.

 I thought the descriptor.bin is used to describe the u-boot.rom
 layout, but seems you are saying it is coming from Intel(?). Is the
 format defined by Intel so that all the BIOS for that platform
 (u-boot.rom in our case) has to obey?

 Yes, but only if there is a management engine (the CONFIG option you asked 
 for).

 So we need bundle the descriptor.bin and me.bin together with a CONFIG
 option, and has better documentation to describe this.

Yes that sounds right.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-10 Thread Simon Glass
Hi Bin,

On 9 November 2014 23:36, Bin Meng bmeng...@gmail.com wrote:
 Hi Simon,

 On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass s...@chromium.org wrote:
 On x86 machines U-Boot needs to be added to a large ROM image which is
 then flashed onto the target board. The ROM has a particular format so it
 makes sense for U-Boot to build this image automatically. Unfortunately
 it relies on binary blobs so we cannot require this for the default
 build as yet.

 Create a u-boot.rom output file for this purpose.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

  Makefile  | 27 ++-
  arch/x86/Kconfig  |  4 
  include/configs/chromebook_link.h |  2 ++
  3 files changed, 32 insertions(+), 1 deletion(-)

 diff --git a/Makefile b/Makefile
 index 9c8a580..86d0510 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -743,6 +743,9 @@ ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:%=%)
  endif
  ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf

 +# We can't do this yet due to the need for binary blobs
 +# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 +
  # enable combined SPL/u-boot/dtb rules for tegra
  ifneq ($(CONFIG_TEGRA),)
  ifeq ($(CONFIG_SPL),y)
 @@ -804,7 +807,8 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
  u-boot.hex u-boot.srec: u-boot FORCE
 $(call if_changed,objcopy)

 -OBJCOPYFLAGS_u-boot.bin := -O binary
 +OBJCOPYFLAGS_u-boot.bin := -O binary \
 +   $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)

  binary_size_check: u-boot.bin FORCE
 @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
 @@ -943,6 +947,27 @@ u-boot-nand.gph: u-boot.bin FORCE
 $(call if_changed,mkimage)
 @dd if=/dev/zero bs=8 count=1 2/dev/null  $@

 +# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff 
 (including
 +# reset vector) at the top, Intel ME at the bottom, and U-Boot in the 
 middle.
 +ifneq ($(CONFIG_X86_RESET_VECTOR),)
 +rom: u-boot.rom FORCE
 +
 +u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin \

 The u-boot-dtb.bin means we have to use device tree for all x86 board
 port. Is this a must-have?

Yes I'd like to use device tree, since it is a convenient way of
getting configuration into U-Boot.


 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

 I don't see where the descriptor.bin is created?

This needs to be downloaded and provided, as with mrc.bin, etc.

I think I will adjust it (later) so that it builds an empty u-boot.rom
and prints a warning on stdout if the binaries are not available. That
way the buildman build will still succeed, but the user will see the
problem. It might also be useful to have U-Boot report missing
binaries when it starts up.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-09 Thread Bin Meng
Hi Simon,

On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass s...@chromium.org wrote:
 On x86 machines U-Boot needs to be added to a large ROM image which is
 then flashed onto the target board. The ROM has a particular format so it
 makes sense for U-Boot to build this image automatically. Unfortunately
 it relies on binary blobs so we cannot require this for the default
 build as yet.

 Create a u-boot.rom output file for this purpose.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

  Makefile  | 27 ++-
  arch/x86/Kconfig  |  4 
  include/configs/chromebook_link.h |  2 ++
  3 files changed, 32 insertions(+), 1 deletion(-)

 diff --git a/Makefile b/Makefile
 index 9c8a580..86d0510 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -743,6 +743,9 @@ ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:%=%)
  endif
  ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf

 +# We can't do this yet due to the need for binary blobs
 +# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 +
  # enable combined SPL/u-boot/dtb rules for tegra
  ifneq ($(CONFIG_TEGRA),)
  ifeq ($(CONFIG_SPL),y)
 @@ -804,7 +807,8 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
  u-boot.hex u-boot.srec: u-boot FORCE
 $(call if_changed,objcopy)

 -OBJCOPYFLAGS_u-boot.bin := -O binary
 +OBJCOPYFLAGS_u-boot.bin := -O binary \
 +   $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)

  binary_size_check: u-boot.bin FORCE
 @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
 @@ -943,6 +947,27 @@ u-boot-nand.gph: u-boot.bin FORCE
 $(call if_changed,mkimage)
 @dd if=/dev/zero bs=8 count=1 2/dev/null  $@

 +# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
 +# reset vector) at the top, Intel ME at the bottom, and U-Boot in the middle.
 +ifneq ($(CONFIG_X86_RESET_VECTOR),)
 +rom: u-boot.rom FORCE
 +
 +u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin \

The u-boot-dtb.bin means we have to use device tree for all x86 board
port. Is this a must-have?

 +   $(srctree)/board/$(BOARDDIR)/descriptor.bin

I don't see where the descriptor.bin is created?

 +   $(objtree)/tools/ifdtool -c -r $(CONFIG_ROM_SIZE) \
 +   -D $(srctree)/board/$(BOARDDIR)/descriptor.bin u-boot.tmp
 +   $(objtree)/tools/ifdtool -w \
 +   $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-dtb.bin u-boot.tmp
 +   $(objtree)/tools/ifdtool -w \
 +   $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin \
 +   u-boot.tmp
 +   mv u-boot.tmp $@
 +
 +OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
 +u-boot-x86-16bit.bin: u-boot FORCE
 +   $(call if_changed,objcopy)
 +endif
 +

[snip]

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 19/39] x86: Build a .rom file which can be flashed to an x86 machine

2014-11-06 Thread Simon Glass
On x86 machines U-Boot needs to be added to a large ROM image which is
then flashed onto the target board. The ROM has a particular format so it
makes sense for U-Boot to build this image automatically. Unfortunately
it relies on binary blobs so we cannot require this for the default
build as yet.

Create a u-boot.rom output file for this purpose.

Signed-off-by: Simon Glass s...@chromium.org
---

 Makefile  | 27 ++-
 arch/x86/Kconfig  |  4 
 include/configs/chromebook_link.h |  2 ++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9c8a580..86d0510 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,9 @@ ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:%=%)
 endif
 ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
 
+# We can't do this yet due to the need for binary blobs
+# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_SPL),y)
@@ -804,7 +807,8 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
 u-boot.hex u-boot.srec: u-boot FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot.bin := -O binary
+OBJCOPYFLAGS_u-boot.bin := -O binary \
+   $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
 
 binary_size_check: u-boot.bin FORCE
@file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
@@ -943,6 +947,27 @@ u-boot-nand.gph: u-boot.bin FORCE
$(call if_changed,mkimage)
@dd if=/dev/zero bs=8 count=1 2/dev/null  $@
 
+# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
+# reset vector) at the top, Intel ME at the bottom, and U-Boot in the middle.
+ifneq ($(CONFIG_X86_RESET_VECTOR),)
+rom: u-boot.rom FORCE
+
+u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin \
+   $(srctree)/board/$(BOARDDIR)/descriptor.bin
+   $(objtree)/tools/ifdtool -c -r $(CONFIG_ROM_SIZE) \
+   -D $(srctree)/board/$(BOARDDIR)/descriptor.bin u-boot.tmp
+   $(objtree)/tools/ifdtool -w \
+   $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-dtb.bin u-boot.tmp
+   $(objtree)/tools/ifdtool -w \
+   $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin \
+   u-boot.tmp
+   mv u-boot.tmp $@
+
+OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
+u-boot-x86-16bit.bin: u-boot FORCE
+   $(call if_changed,objcopy)
+endif
+
 ifneq ($(CONFIG_SUNXI),)
 OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 07ff149..d9ce129 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -34,6 +34,10 @@ config TARGET_CHROMEBOOK_LINK
 
 endchoice
 
+config ROM_SIZE
+   hex
+   default 0x80
+
 source arch/x86/cpu/ivybridge/Kconfig
 
 source board/chromebook-x86/coreboot/Kconfig
diff --git a/include/configs/chromebook_link.h 
b/include/configs/chromebook_link.h
index 1d6f55b..5e8a747 100644
--- a/include/configs/chromebook_link.h
+++ b/include/configs/chromebook_link.h
@@ -18,8 +18,10 @@
 #define CONFIG_SYS_CAR_ADDR0xff7e
 #define CONFIG_SYS_CAR_SIZE(128 * 1024)
 #define CONFIG_SYS_MONITOR_LEN (1  20)
+#define CONFIG_SYS_X86_START16 0xf800
 #define CONFIG_BOARD_EARLY_INIT_R
 
+#define CONFIG_X86_RESET_VECTOR
 #define CONFIG_NR_DRAM_BANKS   8
 
 /*
-- 
2.1.0.rc2.206.gedb03e5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot