diff options
author | Helge Deller <deller@gmx.de> | 2023-10-09 16:14:40 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2023-10-09 16:14:40 +0200 |
commit | 883138b009ffde8cb4002baf11d0c1194ad6c1c8 (patch) | |
tree | 65dac89ce74fb02f16072f301686973d4316f01e | |
parent | f8871f5f3987f430ad704b736890d5bcae5d616a (diff) | |
download | seabios-hppa-883138b009ffde8cb4002baf11d0c1194ad6c1c8.zip seabios-hppa-883138b009ffde8cb4002baf11d0c1194ad6c1c8.tar.gz seabios-hppa-883138b009ffde8cb4002baf11d0c1194ad6c1c8.tar.bz2 |
Fix graphics output on B160L
-rw-r--r-- | src/parisc/hppa.h | 21 | ||||
-rw-r--r-- | src/parisc/lasips2.c | 11 | ||||
-rw-r--r-- | src/parisc/parisc.c | 7 | ||||
-rw-r--r-- | src/parisc/stirom.c | 2 |
4 files changed, 33 insertions, 8 deletions
diff --git a/src/parisc/hppa.h b/src/parisc/hppa.h index 5214380..e83ebb8 100644 --- a/src/parisc/hppa.h +++ b/src/parisc/hppa.h @@ -382,6 +382,27 @@ static inline u8 readb(const void *addr) { return val; } +/* gsc_readX()/gsc_writeX() do no byteswapping */ + +static inline void gsc_writel(void *addr, u32 val) { + barrier(); + *(volatile u32 *)addr = val; +} +static inline void gsc_writeb(void *addr, u8 val) { + barrier(); + *(volatile u8 *)addr = val; +} +static inline u32 gsc_readl(const void *addr) { + u32 val = *(volatile const u32 *)addr; + barrier(); + return val; +} +static inline u8 gsc_readb(const void *addr) { + u8 val = *(volatile const u8 *)addr; + barrier(); + return val; +} + // FLASH_FLOPPY not supported #define GDT_CODE (0) #define GDT_DATA (0) diff --git a/src/parisc/lasips2.c b/src/parisc/lasips2.c index e86cbff..a7bb9fe 100644 --- a/src/parisc/lasips2.c +++ b/src/parisc/lasips2.c @@ -14,14 +14,15 @@ #include "string.h" #include "lasips2.h" + int lasips2_kbd_in(char *c, int max) { struct bregs regs; volatile int count = 0; // check if PS2 reported new keys, if so queue them up. - while((readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_RBNE)) { - process_key(readb(LASIPS2_KBD_DATA)); + while((gsc_readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_RBNE)) { + process_key(gsc_readb(LASIPS2_KBD_DATA)); } while(count < max) { @@ -50,13 +51,13 @@ int ps2_kbd_command(int command, u8 *param) int lasips2_command(u16 cmd) { - while(readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_TBNE) + while(gsc_readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_TBNE) udelay(10); writeb(LASIPS2_KBD_DATA, cmd & 0xff); - while(!(readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_RBNE)) + while(!(gsc_readl(LASIPS2_KBD_STATUS) & LASIPS2_KBD_STATUS_RBNE)) udelay(10); - return readb(LASIPS2_KBD_DATA); + return gsc_readb(LASIPS2_KBD_DATA); } void ps2port_setup(void) diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index c0e6d9e..c839806 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -539,7 +539,7 @@ void make_modinfo_from_pcidev(struct pci_device *pci, memset(p, 0, sizeof(*p)); p->mod_addr = pfa; p->mod_pgs = 0; - p->add_addrs = 0; // HPA_is_graphics_device(pfa) ? GFX_NUM_PAGES : 0; + p->add_addrs = HPA_is_graphics_device(pfa) ? GFX_NUM_PAGES : 0; }; #define MAX_PCI_DEVICES 10 @@ -2747,7 +2747,10 @@ void __VISIBLE start_parisc_firmware(void) sti_rom_init(); sti_console_init(&sti_proc_rom); PAGE0->proc_sti = (u32)&sti_proc_rom; - ps2port_setup(); + if (has_astro) + kbd_init(); + else + ps2port_setup(); } else { remove_from_keep_list(LASI_GFX_HPA); remove_from_keep_list(LASI_PS2KBD_HPA); diff --git a/src/parisc/stirom.c b/src/parisc/stirom.c index 4c41d7c..ddc6285 100644 --- a/src/parisc/stirom.c +++ b/src/parisc/stirom.c @@ -3281,7 +3281,7 @@ struct sti_rom __stiheader sti_proc_rom = { static void __stitext write_artist(struct sti_glob_cfg *cfg, int reg, u32 val) { - writel((void *)cfg->region_ptrs[2] + reg, val); + gsc_writel((void *)cfg->region_ptrs[2] + reg, val); } static int __stifunc("state_mgmt") sti_state_mgmt(struct sti_state_flags *flags, |