aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2024-02-08 09:55:26 +0100
committerHelge Deller <deller@gmx.de>2024-02-08 10:08:56 +0100
commit1f45a92ff2b1dc1c2e7b23e265a55eee104f2060 (patch)
tree0162c825ae97e8df1230c415228cb5107121d334
parent49dfa18238341069b2829e247dec51929c52effb (diff)
downloadseabios-hppa-1f45a92ff2b1dc1c2e7b23e265a55eee104f2060.zip
seabios-hppa-1f45a92ff2b1dc1c2e7b23e265a55eee104f2060.tar.gz
seabios-hppa-1f45a92ff2b1dc1c2e7b23e265a55eee104f2060.tar.bz2
parisc/sti: Fix STI on 64-bit boot console handler
Allow the firmware boot messages and boot menu to show up on an emulated STI/artist card. The current fixes are functional for booting, but to support STI on 64-bit with Linux later on, additional patches are needed. Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/sti.c2
-rw-r--r--src/parisc/stirom.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/parisc/sti.c b/src/parisc/sti.c
index 72f2b89..1bba989 100644
--- a/src/parisc/sti.c
+++ b/src/parisc/sti.c
@@ -130,7 +130,7 @@ void sti_console_init(struct sti_rom *rom)
void sti_putc(const char c)
{
- struct sti_rom *rom = (struct sti_rom *)PAGE0->proc_sti;
+ struct sti_rom *rom = (struct sti_rom *) ROM_EXTEND(PAGE0->proc_sti);
struct sti_rom_font *font = (void *)rom + rom->font_start;
static int row, col;
diff --git a/src/parisc/stirom.c b/src/parisc/stirom.c
index a694959..99c50b9 100644
--- a/src/parisc/stirom.c
+++ b/src/parisc/stirom.c
@@ -34,6 +34,8 @@
#define __stifunc(_name) __attribute__((section(".sti.text." _name)))
+#define STI_F_EXTEND(x) ((void*)(long)(int)(x))
+
static const __stidata char user_data[256] __aligned(32);
static const region_t sti_region_list[STI_REGION_MAX] __stidata __aligned(32) = {
@@ -3283,7 +3285,7 @@ struct sti_rom __stiheader sti_proc_rom = {
static void __stitext write_artist(struct sti_glob_cfg *cfg,
int reg, u32 val)
{
- gsc_writel((void *)cfg->region_ptrs[2] + reg, val);
+ gsc_writel(STI_F_EXTEND(cfg->region_ptrs[2] + reg), val);
}
static int __stifunc("state_mgmt") sti_state_mgmt(struct sti_state_flags *flags,
@@ -3347,7 +3349,7 @@ static int __stifunc("font_unpmv") sti_font_unpmv(struct sti_font_flags *flags,
struct sti_font_outptr *out,
struct sti_glob_cfg *cfg)
{
- struct font *font = (struct font *) in->font_start_addr;
+ struct font *font = (struct font *) ROM_EXTEND(in->font_start_addr);
int bpc = font->hdr.bytes_per_char;
int width = font->hdr.width;
unsigned char *src;
@@ -3396,8 +3398,8 @@ static int __stifunc("init_graph") sti_init_graph(struct sti_init_flags *flags,
struct sti_init_outptr *out,
struct sti_glob_cfg *cfg)
{
- u32 *cmap = (u32 *)cfg->region_ptrs[1];
- u32 resolution = *(u32 *)(cfg->region_ptrs[2] + 0x111110);
+ u32 *cmap = STI_F_EXTEND(cfg->region_ptrs[1]);
+ u32 resolution = *(u32 *)STI_F_EXTEND(cfg->region_ptrs[2] + 0x111110);
out->errno = 0;
if (resolution & (1 << 31)) {
@@ -3531,7 +3533,7 @@ int __stifunc("set_cm_entry") sti_set_cm_entry(struct setcm_flags *flags,
struct setcm_outptr *out,
struct sti_glob_cfg *cfg)
{
- u32 *cmap = (u32 *)cfg->region_ptrs[1];
+ u32 *cmap = STI_F_EXTEND(cfg->region_ptrs[1]);
(void)flags;
(void)cfg;