7626289e2d63cd14433ec6705670fe2aa574cf37
[coreboot.git] / src / config / failovercalculation.lb
1 ##
2 ## Compute the location and size of where this firmware image
3 ## (coreboot plus bootloader) will live in the boot rom chip.
4 ##
5 if CONFIG_USE_FAILOVER_IMAGE
6         default CONFIG_ROM_SECTION_SIZE   = CONFIG_FAILOVER_SIZE
7         default CONFIG_ROM_SECTION_OFFSET = ( CONFIG_ROM_SIZE - CONFIG_FAILOVER_SIZE )
8 else
9     if CONFIG_USE_FALLBACK_IMAGE
10         default CONFIG_ROM_SECTION_SIZE   = CONFIG_FALLBACK_SIZE
11         default CONFIG_ROM_SECTION_OFFSET = ( CONFIG_ROM_SIZE - CONFIG_FALLBACK_SIZE - CONFIG_FAILOVER_SIZE )
12     else
13         if CONFIG_CBFS
14                 default CONFIG_ROM_SECTION_SIZE   = CONFIG_FALLBACK_SIZE
15                 default CONFIG_ROM_SECTION_OFFSET = ( CONFIG_ROM_SIZE - CONFIG_FALLBACK_SIZE - CONFIG_FALLBACK_SIZE - CONFIG_FAILOVER_SIZE )
16         else
17                 default CONFIG_ROM_SECTION_SIZE   = ( CONFIG_ROM_SIZE - CONFIG_FALLBACK_SIZE - CONFIG_FAILOVER_SIZE )
18                 default CONFIG_ROM_SECTION_OFFSET = 0
19         end
20     end
21 end
22
23 ##
24 ## Compute the start location and size size of
25 ## The coreboot bootloader.
26 ##
27 default CONFIG_PAYLOAD_SIZE            = ( CONFIG_ROM_SECTION_SIZE - CONFIG_ROM_IMAGE_SIZE )
28 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - CONFIG_ROM_SIZE + CONFIG_ROM_SECTION_OFFSET + 1)
29
30 ##
31 ## Compute where this copy of coreboot will start in the boot rom
32 ##
33 default CONFIG_ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + CONFIG_PAYLOAD_SIZE )
34
35 ##
36 ## Compute a range of ROM that can cached to speed up coreboot,
37 ## execution speed.
38 ##
39 ## CONFIG_XIP_ROM_SIZE must be a power of 2 and is set in mainboard Config.lb
40 ## CONFIG_XIP_ROM_BASE must be a multiple of CONFIG_XIP_ROM_SIZE
41 ##
42
43 if CONFIG_USE_FAILOVER_IMAGE
44         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE)
45 else
46     if CONFIG_USE_FALLBACK_IMAGE
47         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE + CONFIG_FAILOVER_SIZE)
48     else
49         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE)
50     end
51 end
52