|
|
e28c09 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
e28c09 |
From: Daniel Axtens <dja@axtens.net>
|
|
|
e28c09 |
Date: Fri, 8 Apr 2022 12:35:28 +1000
|
|
|
e28c09 |
Subject: [PATCH] powerpc: do CAS in a more compatible way
|
|
|
e28c09 |
|
|
|
e28c09 |
I wrongly assumed that the most compatible way to perform CAS
|
|
|
e28c09 |
negotiation was to only set the minimum number of vectors required
|
|
|
e28c09 |
to ask for more memory. It turns out that this messes up booting
|
|
|
e28c09 |
if the minimum VP capacity would be less than the default 10% in
|
|
|
e28c09 |
vector 4.
|
|
|
e28c09 |
|
|
|
e28c09 |
Linux configures the minimum capacity to be 1%, so copy it for that
|
|
|
e28c09 |
and for vector 3 which we now need to specify as well.
|
|
|
e28c09 |
|
|
|
e28c09 |
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
e28c09 |
(cherry picked from commit e6f02ad4e75cd995a8ee2954d28949c415b6cbfe)
|
|
|
e28c09 |
---
|
|
|
e28c09 |
grub-core/kern/ieee1275/init.c | 54 ++++++++++++++++++++++++------------------
|
|
|
e28c09 |
1 file changed, 31 insertions(+), 23 deletions(-)
|
|
|
e28c09 |
|
|
|
e28c09 |
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
|
|
|
e28c09 |
index 9704715c83..ef55107467 100644
|
|
|
e28c09 |
--- a/grub-core/kern/ieee1275/init.c
|
|
|
e28c09 |
+++ b/grub-core/kern/ieee1275/init.c
|
|
|
e28c09 |
@@ -298,33 +298,37 @@ grub_ieee1275_total_mem (grub_uint64_t *total)
|
|
|
e28c09 |
|
|
|
e28c09 |
/* Based on linux - arch/powerpc/kernel/prom_init.c */
|
|
|
e28c09 |
struct option_vector2 {
|
|
|
e28c09 |
- grub_uint8_t byte1;
|
|
|
e28c09 |
- grub_uint16_t reserved;
|
|
|
e28c09 |
- grub_uint32_t real_base;
|
|
|
e28c09 |
- grub_uint32_t real_size;
|
|
|
e28c09 |
- grub_uint32_t virt_base;
|
|
|
e28c09 |
- grub_uint32_t virt_size;
|
|
|
e28c09 |
- grub_uint32_t load_base;
|
|
|
e28c09 |
- grub_uint32_t min_rma;
|
|
|
e28c09 |
- grub_uint32_t min_load;
|
|
|
e28c09 |
- grub_uint8_t min_rma_percent;
|
|
|
e28c09 |
- grub_uint8_t max_pft_size;
|
|
|
e28c09 |
+ grub_uint8_t byte1;
|
|
|
e28c09 |
+ grub_uint16_t reserved;
|
|
|
e28c09 |
+ grub_uint32_t real_base;
|
|
|
e28c09 |
+ grub_uint32_t real_size;
|
|
|
e28c09 |
+ grub_uint32_t virt_base;
|
|
|
e28c09 |
+ grub_uint32_t virt_size;
|
|
|
e28c09 |
+ grub_uint32_t load_base;
|
|
|
e28c09 |
+ grub_uint32_t min_rma;
|
|
|
e28c09 |
+ grub_uint32_t min_load;
|
|
|
e28c09 |
+ grub_uint8_t min_rma_percent;
|
|
|
e28c09 |
+ grub_uint8_t max_pft_size;
|
|
|
e28c09 |
} __attribute__((packed));
|
|
|
e28c09 |
|
|
|
e28c09 |
struct pvr_entry {
|
|
|
e28c09 |
- grub_uint32_t mask;
|
|
|
e28c09 |
- grub_uint32_t entry;
|
|
|
e28c09 |
+ grub_uint32_t mask;
|
|
|
e28c09 |
+ grub_uint32_t entry;
|
|
|
e28c09 |
};
|
|
|
e28c09 |
|
|
|
e28c09 |
struct cas_vector {
|
|
|
e28c09 |
- struct {
|
|
|
e28c09 |
- struct pvr_entry terminal;
|
|
|
e28c09 |
- } pvr_list;
|
|
|
e28c09 |
- grub_uint8_t num_vecs;
|
|
|
e28c09 |
- grub_uint8_t vec1_size;
|
|
|
e28c09 |
- grub_uint8_t vec1;
|
|
|
e28c09 |
- grub_uint8_t vec2_size;
|
|
|
e28c09 |
- struct option_vector2 vec2;
|
|
|
e28c09 |
+ struct {
|
|
|
e28c09 |
+ struct pvr_entry terminal;
|
|
|
e28c09 |
+ } pvr_list;
|
|
|
e28c09 |
+ grub_uint8_t num_vecs;
|
|
|
e28c09 |
+ grub_uint8_t vec1_size;
|
|
|
e28c09 |
+ grub_uint8_t vec1;
|
|
|
e28c09 |
+ grub_uint8_t vec2_size;
|
|
|
e28c09 |
+ struct option_vector2 vec2;
|
|
|
e28c09 |
+ grub_uint8_t vec3_size;
|
|
|
e28c09 |
+ grub_uint16_t vec3;
|
|
|
e28c09 |
+ grub_uint8_t vec4_size;
|
|
|
e28c09 |
+ grub_uint16_t vec4;
|
|
|
e28c09 |
} __attribute__((packed));
|
|
|
e28c09 |
|
|
|
e28c09 |
/* Call ibm,client-architecture-support to try to get more RMA.
|
|
|
e28c09 |
@@ -345,13 +349,17 @@ grub_ieee1275_ibm_cas (void)
|
|
|
e28c09 |
} args;
|
|
|
e28c09 |
struct cas_vector vector = {
|
|
|
e28c09 |
.pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */
|
|
|
e28c09 |
- .num_vecs = 2 - 1,
|
|
|
e28c09 |
+ .num_vecs = 4 - 1,
|
|
|
e28c09 |
.vec1_size = 0,
|
|
|
e28c09 |
.vec1 = 0x80, /* ignore */
|
|
|
e28c09 |
.vec2_size = 1 + sizeof(struct option_vector2) - 2,
|
|
|
e28c09 |
.vec2 = {
|
|
|
e28c09 |
0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
|
|
|
e28c09 |
},
|
|
|
e28c09 |
+ .vec3_size = 2 - 1,
|
|
|
e28c09 |
+ .vec3 = 0x00e0, // ask for FP + VMX + DFP but don't halt if unsatisfied
|
|
|
e28c09 |
+ .vec4_size = 2 - 1,
|
|
|
e28c09 |
+ .vec4 = 0x0001, // set required minimum capacity % to the lowest value
|
|
|
e28c09 |
};
|
|
|
e28c09 |
|
|
|
e28c09 |
INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2);
|
|
|
e28c09 |
@@ -364,7 +372,7 @@ grub_ieee1275_ibm_cas (void)
|
|
|
e28c09 |
args.ihandle = root;
|
|
|
e28c09 |
args.cas_addr = (grub_ieee1275_cell_t)&vector;
|
|
|
e28c09 |
|
|
|
e28c09 |
- grub_printf("Calling ibm,client-architecture-support...");
|
|
|
e28c09 |
+ grub_printf("Calling ibm,client-architecture-support from grub...");
|
|
|
e28c09 |
IEEE1275_CALL_ENTRY_FN (&args);
|
|
|
e28c09 |
grub_printf("done\n");
|
|
|
e28c09 |
|