c0b35fe010362a3cd7c34f9243b23d0152a90831
[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         default CONFIG_ROM_IMAGE_SIZE = CONFIG_FAILOVER_SIZE
9 else
10     if CONFIG_USE_FALLBACK_IMAGE
11         default CONFIG_ROM_SECTION_SIZE   = CONFIG_FALLBACK_SIZE
12         default CONFIG_ROM_SECTION_OFFSET = ( CONFIG_ROM_SIZE - CONFIG_FALLBACK_SIZE - CONFIG_FAILOVER_SIZE )
13     else
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     end
17 end
18
19 ##
20 ## Compute where this copy of coreboot will start in the boot rom
21 ##
22 default CONFIG_ROMBASE      = (0xffffffff - CONFIG_ROM_SIZE + CONFIG_ROM_SECTION_OFFSET + 1)
23
24 ##
25 ## Compute a range of ROM that can cached to speed up coreboot,
26 ## execution speed.
27 ##
28 ## CONFIG_XIP_ROM_SIZE must be a power of 2 and is set in mainboard Config.lb
29 ## CONFIG_XIP_ROM_BASE must be a multiple of CONFIG_XIP_ROM_SIZE
30 ##
31
32 if CONFIG_USE_FAILOVER_IMAGE
33         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE)
34 else
35     if CONFIG_USE_FALLBACK_IMAGE
36         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE + CONFIG_FAILOVER_SIZE)
37     else
38         default CONFIG_XIP_ROM_BASE = ( CONFIG_ROMBASE - CONFIG_XIP_ROM_SIZE + CONFIG_ROM_IMAGE_SIZE)
39     end
40 end
41