From baf7e9aa2e29e0991e75f0af46bf49ff2db20424 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Wed, 18 Jan 2023 18:54:19 +0000 Subject: [PATCH] zipl: move STAGE2_MAX_SIZE and STAGE1B_LOAD_ADDR to `loaders_layout.h` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the reuse of the macro in the next patch. In order to match the naming scheme rename `STAGE1B_LOAD_ADDR` to `STAGE1B_LOAD_ADDRESS`. Acked-by: Eduard Shishkin Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/boot/loaders_layout.h | 3 +++ zipl/src/boot.c | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/boot/loaders_layout.h b/include/boot/loaders_layout.h index 5fc6d257..09493c49 100644 --- a/include/boot/loaders_layout.h +++ b/include/boot/loaders_layout.h @@ -14,12 +14,15 @@ #include "lib/zt_common.h" #include "linux_layout.h" +#define STAGE1B_LOAD_ADDRESS _AC(0xe000, UL) + #define STAGE2_DESC _AC(0x78, UL) #define STAGE2_ENTRY _AC(0x2018, UL) #define STAGE2_HEAP_ADDRESS _AC(0x6000, UL) #define STAGE2_HEAP_SIZE _AC(0x3000, UL) #define STAGE2_STACK_ADDRESS _AC(0xe400, UL) #define STAGE2_STACK_SIZE _AC(0x1c00, UL) +#define STAGE2_MAX_SIZE _AC(0x3000, UL) #define STAGE3_ENTRY _AC(0xa000, UL) diff --git a/zipl/src/boot.c b/zipl/src/boot.c index 2f040345..bbfefcbc 100644 --- a/zipl/src/boot.c +++ b/zipl/src/boot.c @@ -17,6 +17,7 @@ #include #include #include "lib/util_libc.h" +#include "boot/loaders_layout.h" #include "stage3.h" @@ -29,15 +30,13 @@ #define DATA_SIZE(x) ((size_t) (&_binary_##x##_bin_end - &_binary_##x##_bin_start)) #define DATA_ADDR(x) (&_binary_##x##_bin_start) -#define STAGE2_MAX_SIZE 0x3000 -#define STAGE1B_LOAD_ADDR 0xe000 #define CCW_FLAG_CC 0x40 #define CCW_FLAG_SLI 0x20 #define FBA_BLK_SIZE 512 static struct boot_ccw0 tic_to_stage1b = { .cmd = 0x08, /* tic */ - .address_lo = STAGE1B_LOAD_ADDR, + .address_lo = STAGE1B_LOAD_ADDRESS, }; /* Check sizes of internal objects. Return 0 if everything is correct, @@ -133,8 +132,7 @@ boot_init_fba_stage0(struct boot_fba_stage0 *stage0, for (i = 0; i < stage1b_count; i++) { stage0->locdata[i].blocknr = (uint32_t) stage1b_list[i].linear.block; - stage0->locread[i].read.address_lo = - STAGE1B_LOAD_ADDR + i * FBA_BLK_SIZE; + stage0->locread[i].read.address_lo = STAGE1B_LOAD_ADDRESS + i * FBA_BLK_SIZE; } /* Terminate CCW chain: Tic to stage 1b */ memcpy(&stage0->locread[i], &tic_to_stage1b, sizeof(tic_to_stage1b)); @@ -178,7 +176,7 @@ boot_init_eckd_stage1(struct boot_eckd_stage1 *stage1, ((stage1b_list[i].chs.cyl >> 12) & 0xfff0); stage1->seek[i].sec = stage1b_list[i].chs.sec; stage1->ssrt[i].read.address_lo = - STAGE1B_LOAD_ADDR + i * stage1b_list[i].chs.size; + STAGE1B_LOAD_ADDRESS + i * stage1b_list[i].chs.size; stage1->ssrt[i].read.flags = CCW_FLAG_CC | CCW_FLAG_SLI; } /* Terminate CCW chain: Tic to stage 1b */