mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-15 17:58:46 +02:00
8245f0b321
This reverts commit a08b8d94fc.
From #libreboot IRC today:
07:02 <irys> ooh this is fun. seabios commit 8863cbbd15a73b03153553c562f5b1fb939ad4d7 (ahci: add controller reset) breaks ahci entirely on t420
07:05 <irys> cbmem console on that seabios commit has a timeout then "AHCI/0: device not ready"
07:07 <irys> AHCI works fine if i change config/seabios/default/target.cfg to use the immediate previous seabios commit (df9dd418b3b0e586cb208125094620fc7f90f23d)
07:07 <irys> works in grub payload either way though
07:31 <irys> here, `cbmem -c` after booting the broken rev: https://0x0.st/84oQ.log
07:31 <irys> compared to the working one https://0x0.st/84o1.log
07:33 <irys> i can't report to upstream myself *right now* but i figure you might want to know about this leah
I have downloaded those logs locally for reference, so that an upstream
report can be made to SeaBIOS. For the purposes of this Libreboot commit,
the diff of the logs is as follows (diff -u broken.log working.log):
Taking each diff line out of the log, the relevant entries
seem to be:
Searching bootorder for: /pci@i0cf8/*@1f,2/drive@0/disk@0
+AHCI/0: Set transfer mode to UDMA-6
+Searching bios-geometry for: /pci@i0cf8/*@1f,2/drive@0/disk@0
+AHCI/0: registering: "AHCI/0: Netac SSD 128GB ATA-11 Hard-Disk (119 GiBytes)"
-WARNING - Timeout at ahci_port_setup:477!
-AHCI/0: device not ready (tf 0x80)
-All threads complete.
-2. Payload [memtest]
+2. AHCI/0: Netac SSD 128GB ATA-11 Hard-Disk (119 GiBytes)
+3. Payload [memtest]
-Space available for UMB: c7000-eb800, f5880-f5ff0
-Returned 16777216 bytes of ZoneHigh
+drive 0x000f5fa0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 s=250069680
+Space available for UMB: c7000-eb800, f5880-f5fa0
+Returned 16773120 bytes of ZoneHigh
Therefore, the revision will be reverted back for now. It was
only about 8 additional patches imported in the update anyway.
87 lines
2.8 KiB
Diff
87 lines
2.8 KiB
Diff
From 2aff8adc1dcd1315877fdb4ac4ef5e649c5b7d11 Mon Sep 17 00:00:00 2001
|
|
From: Riku Viitanen <riku.viitanen@protonmail.com>
|
|
Date: Sat, 10 Feb 2024 21:23:33 +0200
|
|
Subject: [PATCH 1/2] romfile: implement a generic loader
|
|
|
|
romfile_loadfile_g:
|
|
Based on romfile_loadfile but more flexible. User has to supply pointer
|
|
to a malloc function and the number of trailing padding bytes. Thus, any
|
|
memory region may be used.
|
|
|
|
romfile_loadfile:
|
|
It is now a wrapper around romfile_loadfile_g. Functionality is the same.
|
|
|
|
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
|
|
---
|
|
src/romfile.c | 25 ++++++++++++++++++++-----
|
|
src/romfile.h | 2 ++
|
|
2 files changed, 22 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/romfile.c b/src/romfile.c
|
|
index b598274edc09..8ccf5139ece8 100644
|
|
--- a/src/romfile.c
|
|
+++ b/src/romfile.c
|
|
@@ -47,10 +47,12 @@ romfile_find(const char *name)
|
|
return __romfile_findprefix(name, strlen(name) + 1, NULL);
|
|
}
|
|
|
|
-// Helper function to find, malloc_tmphigh, and copy a romfile. This
|
|
-// function adds a trailing zero to the malloc'd copy.
|
|
+// Generic function to find romfile, malloc (using provided function
|
|
+// pointer), and copy a romfile. add_len specifies how many additional
|
|
+// trailing bytes to reserve. The extra bytes will not be initialised.
|
|
void *
|
|
-romfile_loadfile(const char *name, int *psize)
|
|
+romfile_loadfile_g(const char *name, int *psize,
|
|
+ void *(*malloc_fn)(u32), int add_len)
|
|
{
|
|
struct romfile_s *file = romfile_find(name);
|
|
if (!file)
|
|
@@ -60,7 +62,7 @@ romfile_loadfile(const char *name, int *psize)
|
|
if (!filesize)
|
|
return NULL;
|
|
|
|
- char *data = malloc_tmphigh(filesize+1);
|
|
+ char *data = malloc_fn(filesize+add_len);
|
|
if (!data) {
|
|
warn_noalloc();
|
|
return NULL;
|
|
@@ -74,7 +76,20 @@ romfile_loadfile(const char *name, int *psize)
|
|
}
|
|
if (psize)
|
|
*psize = filesize;
|
|
- data[filesize] = '\0';
|
|
+
|
|
+ return data;
|
|
+}
|
|
+
|
|
+// Helper function to find, malloc_tmphigh, and copy a romfile. This
|
|
+// function adds a trailing zero to the malloc'd copy.
|
|
+void *
|
|
+romfile_loadfile(const char *name, int *psize)
|
|
+{
|
|
+ char *data = romfile_loadfile_g(name, psize, &malloc_tmphigh, 1);
|
|
+ if (!data)
|
|
+ return NULL;
|
|
+
|
|
+ data[*psize] = '\0';
|
|
return data;
|
|
}
|
|
|
|
diff --git a/src/romfile.h b/src/romfile.h
|
|
index 3e0f820047dd..1b967d86551f 100644
|
|
--- a/src/romfile.h
|
|
+++ b/src/romfile.h
|
|
@@ -13,6 +13,8 @@ struct romfile_s {
|
|
void romfile_add(struct romfile_s *file);
|
|
struct romfile_s *romfile_findprefix(const char *prefix, struct romfile_s *prev);
|
|
struct romfile_s *romfile_find(const char *name);
|
|
+void *romfile_loadfile_g(const char *name, int *psize,
|
|
+ void *(*malloc_fn)(u32), int add_len);
|
|
void *romfile_loadfile(const char *name, int *psize);
|
|
u64 romfile_loadint(const char *name, u64 defval);
|
|
|
|
--
|
|
2.43.0
|
|
|