Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP

2016-01-19 Thread Zeh, Werner
Hi Ben.

Alternatively you can use your own flash map setup file where you modify
FMAP_FMAP_SIZE to your needs and point Kconfig to your modified fmd-file.

In this way you can leave Makefile.inc unchanged and get your image right as 
well.

Werner

-Ursprüngliche Nachricht-
Von: coreboot [mailto:coreboot-boun...@coreboot.org] Im Auftrag von Ben Gardner
Gesendet: Montag, 18. Januar 2016 21:54
An: Patrick Georgi
Cc: coreboot
Betreff: Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP

Thank you. That worked.

On Mon, Jan 18, 2016 at 2:46 PM, Patrick Georgi <pgeo...@google.com> wrote:
> 2016-01-18 21:34 GMT+01:00 Ben Gardner <gardner@gmail.com>:
>> Is there a work-around for this? For example, is there an option to 
>> pad the FMAP out to 4 KB?
> The workaround is indeed to increase the FMAP region's size to 4K.
>
> To do this, edit $(top)/Makefile.inc, line 708 (since you're on x86, 
> otherwise line 723):
> FMAP_FMAP_SIZE := 0x100
> to
> FMAP_FMAP_SIZE := 0x1000
>
>
> Patrick
> --
> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg Registergericht und 
> -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

--
coreboot mailing list: coreboot@coreboot.org 
http://www.coreboot.org/mailman/listinfo/coreboot
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP

2016-01-19 Thread Ben Gardner
Thanks. That also worked.

For the benefit of others:
I copied build/fmap.fmd to src/mainboard/$VENDOR/$BOARD/ and then
updated the FMDFILE config item to point to it.
  CONFIG_FMDFILE="src/mainboard/$VENDOR/$BOARD/fmap.fmd"

It may help to look at util/cbfstool/default-x86.fmd to see the names
of the values.

Ben

On Tue, Jan 19, 2016 at 4:55 AM, Zeh, Werner <werner@siemens.com> wrote:
> Hi Ben.
>
> Alternatively you can use your own flash map setup file where you modify
> FMAP_FMAP_SIZE to your needs and point Kconfig to your modified fmd-file.
>
> In this way you can leave Makefile.inc unchanged and get your image right as 
> well.
>
> Werner
>
> -Ursprüngliche Nachricht-
> Von: coreboot [mailto:coreboot-boun...@coreboot.org] Im Auftrag von Ben 
> Gardner
> Gesendet: Montag, 18. Januar 2016 21:54
> An: Patrick Georgi
> Cc: coreboot
> Betreff: Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP
>
> Thank you. That worked.
>
> On Mon, Jan 18, 2016 at 2:46 PM, Patrick Georgi <pgeo...@google.com> wrote:
>> 2016-01-18 21:34 GMT+01:00 Ben Gardner <gardner@gmail.com>:
>>> Is there a work-around for this? For example, is there an option to
>>> pad the FMAP out to 4 KB?
>> The workaround is indeed to increase the FMAP region's size to 4K.
>>
>> To do this, edit $(top)/Makefile.inc, line 708 (since you're on x86,
>> otherwise line 723):
>> FMAP_FMAP_SIZE := 0x100
>> to
>> FMAP_FMAP_SIZE := 0x1000
>>
>>
>> Patrick
>> --
>> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg Registergericht und
>> -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
>> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
>
> --
> coreboot mailing list: coreboot@coreboot.org 
> http://www.coreboot.org/mailman/listinfo/coreboot

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP

2016-01-18 Thread Patrick Georgi via coreboot
2016-01-18 21:34 GMT+01:00 Ben Gardner :
> Is there a work-around for this? For example, is there an option to
> pad the FMAP out to 4 KB?
The workaround is indeed to increase the FMAP region's size to 4K.

To do this, edit $(top)/Makefile.inc, line 708 (since you're on x86,
otherwise line 723):
FMAP_FMAP_SIZE := 0x100
to
FMAP_FMAP_SIZE := 0x1000


Patrick
-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] cbfstool: CBFS alignment broken due to FMAP

2016-01-18 Thread Ben Gardner
Thank you. That worked.

On Mon, Jan 18, 2016 at 2:46 PM, Patrick Georgi  wrote:
> 2016-01-18 21:34 GMT+01:00 Ben Gardner :
>> Is there a work-around for this? For example, is there an option to
>> pad the FMAP out to 4 KB?
> The workaround is indeed to increase the FMAP region's size to 4K.
>
> To do this, edit $(top)/Makefile.inc, line 708 (since you're on x86,
> otherwise line 723):
> FMAP_FMAP_SIZE := 0x100
> to
> FMAP_FMAP_SIZE := 0x1000
>
>
> Patrick
> --
> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
> Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: 
> Hamburg
> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

[coreboot] cbfstool: CBFS alignment broken due to FMAP

2016-01-18 Thread Ben Gardner
Hi all,

With the latest cbfstool in master, the alignment option is broken in cbfstool.
Or rather, the alignment is relative to the CBFS start, not the actual
ROM address, and the 256-byte FMAP throws off the alignment.

In my case, I have a ROM size of 16 MB and the BIOS region starts at 0x20.
Layout from ifdtool (sorted):
  :0fff fd
  1000:001f me
  0020:00ff bios

Layout from cbfstool:
  'BIOS' (read-only, size 14680064)
  'FMAP' (read-only, size 256)
  'COREBOOT' (CBFS, size 14679808)

When I add a 16 KB file with alignment 4096:
$ cbfstool coreboot.rom add -f 16kb_ff.bin -n alignment.bin -t raw -a 4096

The new file is aligned in the CBFS at 0x99000.
$ cbfstool output/coreboot.rom print
Performing operation on 'COREBOOT' region...
Name   Offset Type Size
... snip ...
(empty)0x98640null 2392
alignment.bin  0x98fc0raw  16384
(empty)0x9d000null 13774488
... snip ...

But due to the FMAP, that address is really 0x99100, not 0x99000,
which is not 4 KB aligned.

002990c0  4c 41 52 43 48 49 56 45  00 00 40 00 00 00 00 50  |LARCHIVE..@P|
002990d0  00 00 00 28 00 00 00 40  61 6c 69 67 6e 6d 65 6e  |...(...@alignmen|
002990e0  74 2e 62 69 6e 00 00 00  42 43 5a 4c 00 00 00 10  |t.bin...BCZL|
002990f0  00 00 00 00 00 00 40 00  ff ff ff ff ff ff ff ff  |..@.|
00299100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ||

And this is because the CBFS starts at 0x2000100 instead of 0x200.
Is there a work-around for this? For example, is there an option to
pad the FMAP out to 4 KB?
Or maybe a way to force the CBFS to be place at a 4 KB alignment?
Is someone working on a patch?

Thanks,
Ben

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot