On Mon, 20 Jun 2016, Aaron Durbin wrote:

> On Thu, Jun 16, 2016 at 8:55 AM, Rolf Evers-Fischer
> <[email protected]> wrote:
> > Hello,
> > my ApolloLake board was not able to find the "romstage" in the SPI memory,
> > because it searched in the wrong part of the memory.
> >
> > ___FMAP__COREBOOT_BASE was set to the relative offset within the parent
> > section, but rdev_readat needs the *absolute* address: There was a
> > mismatch.
> > However, I was able to fix this problem locally by adding an additional
> > fixed offset to fmap_top, like
> 
> Could you please provide an example fmd and the generated header file?
> 

This is the content of the fmd file:

FLASH 8M {
        WP_RO@0x0 0x500000 {
                SI_DESC@0x0 0x1000
                IFWI@0x100000 0x1ff000
                RO_SECTION@0x300000 0x200000 {
                        RO_VPD@0x0 0x4000
                        FMAP@0x4000 0x800
                        RO_FRID@0x4800 0x40
                        RO_FRID_PAD@0x4840 0x7c0
                        COREBOOT(CBFS)@0x5000 0x17b000
                        GBB@0x180000 0x40000
                        # logical boot partition 2. Remove with updated 
CSE
                        SIGN_CSE@0x1c0000 0x10000
                }
        }
        MISC_RW@0x500000 0x1a000 {
                RW_MRC_CACHE@0x0 0x10000
                RW_ELOG@0x10000 0x4000
                RW_SHARED@0x14000 0x4000 {
                        SHARED_DATA@0x0 0x2000
                        VBLOCK_DEV@0x2000 0x2000
                }
                RW_VPD@0x18000 0x2000
        }
        RW_SECTION_A 0xf0000 {
                VBLOCK_A 64K
                FW_MAIN_A(CBFS) 768K
                RW_FWID_A 64
        }
        RW_SECTION_B 0xf0000 {
                VBLOCK_B 64K
                FW_MAIN_B(CBFS) 768K
                RW_FWID_B 64
        }
        DEVICE_EXTENSION@0x77f000 0x80000
}

And this is the content of the generated fmap_config.h:

#ifndef FMAPTOOL_GENERATED_HEADER_H_
#define FMAPTOOL_GENERATED_HEADER_H_

#define FMAP_OFFSET 0x304000

#define ___FMAP__COREBOOT_BASE 0x5000
#define ___FMAP__COREBOOT_SIZE 0x17b000
#define ___FMAP__FW_MAIN_A_BASE 0x10000
#define ___FMAP__FW_MAIN_A_SIZE 0xc0000
#define ___FMAP__FW_MAIN_B_BASE 0x10000
#define ___FMAP__FW_MAIN_B_SIZE 0xc0000
#endif

There is a new commit, which may fix this problem. I'll test this commit 
right now: https://review.coreboot.org/15273

> >
> > diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
> > index aa652c2..f36a499 100644
> > --- a/src/lib/cbfs.c
> > +++ b/src/lib/cbfs.c
> > @@ -230,7 +230,7 @@ static int cbfs_master_header_props(struct cbfs_props 
> > *props
> >         if (bdev == NULL)
> >                 return -1;
> >
> > -       size_t fmap_top = ___FMAP__COREBOOT_BASE + ___FMAP__COREBOOT_SIZE;
> > +       size_t fmap_top = ___FMAP__COREBOOT_BASE + ___FMAP__COREBOOT_SIZE + 
> > 0x300000;
> >
> >         /* Find location of header using signed 32-bit offset from
> >          * end of CBFS region. */
> >
> >
> > But imho this shouldn't be a permanent solution!
> >
> > Therefore I suggest to modify the 'fmaptool' in such way that it outputs
> > the absolute address for (at least) ___FMAP__COREBOOT_BASE, because the
> > 'rdev_readat()' function  of the 'boot_device_ro()' needs it in this form.
> >
> > What is your opinion?
> >
> > Kind regards,
> >  Rolf
> >
> > --
> > coreboot mailing list: [email protected]
> > https://www.coreboot.org/mailman/listinfo/coreboot
> 

-- 
coreboot mailing list: [email protected]
https://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to