:: commit 582a86a7efff48040cf9a86b01db78c57221ea2f

mintsuki <mintsuki@protonmail.com> — 2024-07-14 07:32

parents: 717ecb74a8

protos/linux_risc: Minor code reshuffling to get initramfs loading print to show

diff --git a/common/protos/linux_risc.c b/common/protos/linux_risc.c
index db945111..9d1b9e5b 100644
--- a/common/protos/linux_risc.c
+++ b/common/protos/linux_risc.c
@@ -99,25 +99,6 @@ void *prepare_device_tree_blob(char *config, char *cmdline) {
         }
     }
 
-    size_t req_width = 0, req_height = 0, req_bpp = 0;
-
-    char *resolution = config_get_value(config, 0, "RESOLUTION");
-    if (resolution != NULL) {
-        parse_resolution(&req_width, &req_height, &req_bpp, resolution);
-    }
-
-    struct fb_info *fbs;
-    size_t fbs_count;
-
-    term_notready();
-
-    fb_init(&fbs, &fbs_count, req_width, req_height, req_bpp);
-
-    // TODO(qookie): Let the user pick a framebuffer if there's > 1
-    if (fbs_count > 0) {
-        add_framebuffer(&fbs[0]);
-    }
-
     // Load an initrd if requested and add it to the device tree.
     char *module_path = config_get_value(config, 0, "MODULE_PATH");
     if (module_path) {
@@ -148,6 +129,25 @@ void *prepare_device_tree_blob(char *config, char *cmdline) {
         }
     }
 
+    size_t req_width = 0, req_height = 0, req_bpp = 0;
+
+    char *resolution = config_get_value(config, 0, "RESOLUTION");
+    if (resolution != NULL) {
+        parse_resolution(&req_width, &req_height, &req_bpp, resolution);
+    }
+
+    struct fb_info *fbs;
+    size_t fbs_count;
+
+    term_notready();
+
+    fb_init(&fbs, &fbs_count, req_width, req_height, req_bpp);
+
+    // TODO(qookie): Let the user pick a framebuffer if there's > 1
+    if (fbs_count > 0) {
+        add_framebuffer(&fbs[0]);
+    }
+
     // Set the kernel command line arguments.
     ret = fdt_set_chosen_string(dtb, "bootargs", cmdline);
     if (ret < 0) {
tab: 248 wrap: offon