File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -285,9 +285,11 @@ static char *realloc_property(char *fdt,
285285 return fdt ;
286286}
287287
288- static void load_dtb (char * * ram_loc , char * bootargs )
288+ static void load_dtb (char * * ram_loc , vm_attr_t * attr )
289289{
290290#include "minimal_dtb.h"
291+ char * bootargs = attr -> data .system .bootargs ;
292+ char * vblk = attr -> data .system .vblk_device ;
291293 char * blob = * ram_loc ;
292294 char * buf ;
293295 size_t len ;
@@ -314,6 +316,18 @@ static void load_dtb(char **ram_loc, char *bootargs)
314316 assert (!err );
315317 }
316318
319+ /* remove the vblk node from soc if it is not specified */
320+ if (!vblk ) {
321+ int subnode ;
322+ node = fdt_path_offset (blob , "/soc@F0000000" );
323+ assert (node >= 0 );
324+
325+ subnode = fdt_subnode_offset (blob , node , "virtio@4200000" );
326+ assert (subnode >= 0 );
327+
328+ assert (fdt_del_node (blob , subnode ) == 0 );
329+ }
330+
317331 totalsize = fdt_totalsize (blob );
318332 * ram_loc += totalsize ;
319333 return ;
@@ -499,7 +513,7 @@ riscv_t *rv_create(riscv_user_t rv_attr)
499513
500514 uint32_t dtb_addr = attr -> mem -> mem_size - DTB_SIZE ;
501515 ram_loc = ((char * ) attr -> mem -> mem_base ) + dtb_addr ;
502- load_dtb (& ram_loc , attr -> data . system . bootargs );
516+ load_dtb (& ram_loc , attr );
503517 rv_log_info ("DTB loaded" );
504518 /*
505519 * Load optional initrd image at last 8 MiB before the dtb region to
You can’t perform that action at this time.
0 commit comments