Change the CBFS build process to use coreboot.rom
[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 USE_FAILOVER_IMAGE
6         default ROM_SECTION_SIZE   = FAILOVER_SIZE
7         default ROM_SECTION_OFFSET = ( ROM_SIZE - FAILOVER_SIZE )
8 else
9     if USE_FALLBACK_IMAGE
10         default ROM_SECTION_SIZE   = FALLBACK_SIZE
11         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
12     else
13         if CONFIG_CBFS
14                 default ROM_SECTION_SIZE   = FALLBACK_SIZE
15                 default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
16         else
17                 default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
18                 default 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 PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
28 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
29
30 ##
31 ## Compute where this copy of coreboot will start in the boot rom
32 ##
33 default _ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
34
35 ##
36 ## Compute a range of ROM that can cached to speed up coreboot,
37 ## execution speed.
38 ##
39 ## XIP_ROM_SIZE must be a power of 2.
40 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
41 ##
42 default XIP_ROM_SIZE = 64 * 1024
43
44 if USE_FAILOVER_IMAGE
45         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
46 else
47     if USE_FALLBACK_IMAGE
48         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
49     else
50         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
51     end
52 end
53