File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010#ifdef CONFIG_OF
1111
12- extern const struct machine_desc * setup_machine_fdt (unsigned int dt_phys );
12+ extern const struct machine_desc * setup_machine_fdt (void * dt_virt );
1313extern void __init arm_dt_init_cpu_maps (void );
1414
1515#else /* CONFIG_OF */
1616
17- static inline const struct machine_desc * setup_machine_fdt (unsigned int dt_phys )
17+ static inline const struct machine_desc * setup_machine_fdt (void * dt_virt )
1818{
1919 return NULL ;
2020}
Original file line number Diff line number Diff line change 22void convert_to_tag_list (struct tag * tags );
33
44#ifdef CONFIG_ATAGS
5- const struct machine_desc * setup_machine_tags (phys_addr_t __atags_pointer ,
5+ const struct machine_desc * setup_machine_tags (void * __atags_vaddr ,
66 unsigned int machine_nr );
77#else
88static inline const struct machine_desc * __init __noreturn
9- setup_machine_tags (phys_addr_t __atags_pointer , unsigned int machine_nr )
9+ setup_machine_tags (void * __atags_vaddr , unsigned int machine_nr )
1010{
1111 early_print ("no ATAGS support: can't continue\n" );
1212 while (true);
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ static void __init squash_mem_tags(struct tag *tag)
174174}
175175
176176const struct machine_desc * __init
177- setup_machine_tags (phys_addr_t __atags_pointer , unsigned int machine_nr )
177+ setup_machine_tags (void * atags_vaddr , unsigned int machine_nr )
178178{
179179 struct tag * tags = (struct tag * )& default_tags ;
180180 const struct machine_desc * mdesc = NULL , * p ;
@@ -195,8 +195,8 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
195195 if (!mdesc )
196196 return NULL ;
197197
198- if (__atags_pointer )
199- tags = phys_to_virt ( __atags_pointer ) ;
198+ if (atags_vaddr )
199+ tags = atags_vaddr ;
200200 else if (mdesc -> atag_offset )
201201 tags = (void * )(PAGE_OFFSET + mdesc -> atag_offset );
202202
Original file line number Diff line number Diff line change @@ -203,12 +203,12 @@ static const void * __init arch_get_next_mach(const char *const **match)
203203
204204/**
205205 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
206- * @dt_phys: physical address of dt blob
206+ * @dt_virt: virtual address of dt blob
207207 *
208208 * If a dtb was passed to the kernel in r2, then use it to choose the
209209 * correct machine_desc and to setup the system.
210210 */
211- const struct machine_desc * __init setup_machine_fdt (unsigned int dt_phys )
211+ const struct machine_desc * __init setup_machine_fdt (void * dt_virt )
212212{
213213 const struct machine_desc * mdesc , * mdesc_best = NULL ;
214214
@@ -221,7 +221,7 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
221221 mdesc_best = & __mach_desc_GENERIC_DT ;
222222#endif
223223
224- if (!dt_phys || !early_init_dt_verify (phys_to_virt ( dt_phys ) ))
224+ if (!dt_virt || !early_init_dt_verify (dt_virt ))
225225 return NULL ;
226226
227227 mdesc = of_flat_dt_match_machine (mdesc_best , arch_get_next_mach );
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ unsigned int cacheid __read_mostly;
8989EXPORT_SYMBOL (cacheid );
9090
9191unsigned int __atags_pointer __initdata ;
92+ void * atags_vaddr __initdata ;
9293
9394unsigned int system_rev ;
9495EXPORT_SYMBOL (system_rev );
@@ -1081,19 +1082,22 @@ void __init hyp_mode_check(void)
10811082
10821083void __init setup_arch (char * * cmdline_p )
10831084{
1084- const struct machine_desc * mdesc ;
1085+ const struct machine_desc * mdesc = NULL ;
1086+
1087+ if (__atags_pointer )
1088+ atags_vaddr = phys_to_virt (__atags_pointer );
10851089
10861090 setup_processor ();
1087- mdesc = setup_machine_fdt (__atags_pointer );
1091+ if (atags_vaddr )
1092+ mdesc = setup_machine_fdt (atags_vaddr );
10881093 if (!mdesc )
1089- mdesc = setup_machine_tags (__atags_pointer , __machine_arch_type );
1094+ mdesc = setup_machine_tags (atags_vaddr , __machine_arch_type );
10901095 if (!mdesc ) {
10911096 early_print ("\nError: invalid dtb and unrecognized/unsupported machine ID\n" );
10921097 early_print (" r1=0x%08x, r2=0x%08x\n" , __machine_arch_type ,
10931098 __atags_pointer );
10941099 if (__atags_pointer )
1095- early_print (" r2[]=%*ph\n" , 16 ,
1096- phys_to_virt (__atags_pointer ));
1100+ early_print (" r2[]=%*ph\n" , 16 , atags_vaddr );
10971101 dump_machine_table ();
10981102 }
10991103
Original file line number Diff line number Diff line change @@ -1489,7 +1489,7 @@ static void __init map_lowmem(void)
14891489}
14901490
14911491#ifdef CONFIG_ARM_PV_FIXUP
1492- extern unsigned long __atags_pointer ;
1492+ extern void * atags_vaddr ;
14931493typedef void pgtables_remap (long long offset , unsigned long pgd , void * bdata );
14941494pgtables_remap lpae_pgtables_remap_asm ;
14951495
@@ -1520,7 +1520,7 @@ static void __init early_paging_init(const struct machine_desc *mdesc)
15201520 */
15211521 lpae_pgtables_remap = (pgtables_remap * )(unsigned long )__pa (lpae_pgtables_remap_asm );
15221522 pa_pgd = __pa (swapper_pg_dir );
1523- boot_data = __va ( __atags_pointer ) ;
1523+ boot_data = atags_vaddr ;
15241524 barrier ();
15251525
15261526 pr_info ("Switching physical address space to 0x%08llx\n" ,
You can’t perform that action at this time.
0 commit comments