99#include <arm_vm/gen_config.h>
1010
1111/*- set config = configuration[me.name] -*/
12+ /*- if not config -*/
13+ /*? raise(Exception('Missing VM configuration')) ?*/
14+ /*- endif -*/
15+
1216/*- set vm_address_config = config.get('vm_address_config') -*/
13- /*- set vm_image_config = config.get('vm_image_config') -*/
14- /*- set linux_address_config = config.get('linux_address_config') - */
15- /*- set linux_image_config = config.get('linux_image_config') -*/
17+ /*- if not vm_address_config -*/
18+ /*? raise(Exception('Missing VM address configuration')) ? */
19+ /*- endif -*/
1620
17- /*# For legacy compatibility, a fall back to the standard Linux entry exists. #*/
18- /*- set is_64_bit = (8 == macros.get_word_size(options.architecture)) -*/
19- /*- set entry_offset = 0x80000 if is_64_bit else 0x8000 -*/
21+ /*- set vm_image_config = config.get('vm_image_config') -*/
22+ /*- if not vm_image_config -*/
23+ /*? raise(Exception('Missing VM image configuration')) ?*/
24+ /*- endif -*/
2025
2126const vm_config_t vm_config = {
2227
23- /*- if vm_address_config -*/
24-
2528 .ram = {
2629 .phys_base = /*? vm_address_config.get('ram_paddr_base') ?*/ ,
2730 .base = /*? vm_address_config.get('ram_base') ?*/ ,
@@ -34,29 +37,13 @@ const vm_config_t vm_config = {
3437/*- if vm_address_config.get('kernel_entry_addr') != '-1' -*/
3538 .entry_addr = /*? vm_address_config.get('kernel_entry_addr') ?*/ ,
3639/*- else -*/
40+ /*# For legacy compatibility, a fall back to the standard Linux entry exists. #*/
41+ /*- set is_64_bit = (8 == macros.get_word_size(options.architecture)) -*/
42+ /*- set entry_offset = 0x80000 if is_64_bit else 0x8000 -*/
3743#warning Using standard Linux entry point, please consider setting kernel_entry_addr explicitly.
3844 .entry_addr = /*? vm_address_config.get('ram_base') ?*/ + /*? '0x%x'%entry_offset ?*/ ,
3945/*- endif -*/
4046
41- /*- else -*/
42-
43- #warning You are using the deprecated linux_address_config structure. Please use the vm_address_config structure instead
44-
45- .ram = {
46- .phys_base = /*? linux_address_config.get('linux_ram_paddr_base') ?*/ ,
47- .base = /*? linux_address_config.get('linux_ram_base') ?*/ ,
48- .size = /*? linux_address_config.get('linux_ram_size') ?*/ ,
49- },
50-
51- .dtb_addr = /*? linux_address_config.get('dtb_addr') ?*/ ,
52- .initrd_addr = /*? linux_address_config.get('initrd_addr') ?*/ ,
53- /* Use standard Linux entry point. */
54- .entry_addr = /*? linux_address_config.get('linux_ram_base') ?*/ + /*? '0x%x'%entry_offset ?*/ ,
55-
56- /*- endif -*/
57-
58- /*- if vm_image_config -*/
59-
6047 .provide_initrd = /*? vm_image_config.get('provide_initrd') ?*/ ,
6148 .generate_dtb = /*? vm_image_config.get('generate_dtb') ?*/ ,
6249 .provide_dtb = /*? vm_image_config.get('provide_dtb') ?*/ ,
@@ -73,50 +60,4 @@ const vm_config_t vm_config = {
7360 .kernel_bootcmdline = "/*? vm_image_config.get('kernel_bootcmdline', " ") ?*/" ,
7461 .kernel_stdout = "/*? vm_image_config.get('kernel_stdout', " ") ?*/" ,
7562
76- /*- else -*/
77-
78- #warning "You are using the deprecated linux_image_config structure. The provide_initrd, generate_dtb, provide_dtb, \
79- map_one_to_one, and clean_cache flags are set to replicate previous behavior, which may cause your configuration to break. \
80- Please use the vm_image_config structure instead."
81-
82- #ifdef CONFIG_VM_INITRD_FILE
83- #warning VmInitRdFile is a deprecated setting. Please remove and use vm_image_config.provide_initrd
84- .provide_initrd = 1 ,
85- #else
86- .provide_initrd = 0 ,
87- #endif
88-
89- #ifdef CONFIG_VM_DTB_FILE
90- #warning VmDtbFile is a deprecated setting. Please remove and use vm_image_config.provide_dtb
91- .provide_dtb = 1 ,
92- .generate_dtb = 0 ,
93- #else
94- .provide_dtb = 0 ,
95- .generate_dtb = 1 ,
96- #endif
97-
98- #if defined(CONFIG_PLAT_EXYNOS5 ) || defined(CONFIG_PLAT_QEMU_ARM_VIRT ) || defined(CONFIG_PLAT_TX2 )
99- .map_one_to_one = 1 ,
100- #else
101- .map_one_to_one = 0 ,
102- #endif
103-
104- #if defined(CONFIG_PLAT_TX1 ) || defined(CONFIG_PLAT_TX2 )
105- .clean_cache = 1 ,
106- #else
107- .clean_cache = 0 ,
108- #endif
109-
110- .files = {
111- .kernel = "/*? linux_image_config.get('linux_name') ?*/" ,
112- .initrd = "/*? linux_image_config.get('initrd_name') ?*/" ,
113- .dtb = "/*? linux_image_config.get('dtb_name') ?*/" ,
114- .dtb_base = "/*? linux_image_config.get('dtb_base_name') ?*/" ,
115- },
116-
117- .kernel_bootcmdline = "/*? linux_image_config.get('linux_bootcmdline') ?*/" ,
118- .kernel_stdout = "/*? linux_image_config.get('linux_stdout') ?*/" ,
119-
120- /*- endif -*/
121-
12263};
0 commit comments