From fe468a574815e3e4f71a5bb796025973a625f290 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 26 Sep 2023 19:46:57 +0200 Subject: fix LSI detection, PCI mapping, PDC_MODEL --- src/parisc/hppa.h | 16 +++++++++++----- src/parisc/hppa_hardware.h | 8 ++++---- src/parisc/parisc.c | 9 ++++++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/parisc/hppa.h b/src/parisc/hppa.h index d832514..953eff4 100644 --- a/src/parisc/hppa.h +++ b/src/parisc/hppa.h @@ -216,7 +216,7 @@ extern unsigned long hppa_port_pci_data; static inline void outl(u32 value, portaddr_t port) { if (is_astro_ioport(port)) - *(volatile u32 *)(astro_ioport_addr(port)) = cpu_to_le32(value); + *(volatile u32 *)(astro_ioport_addr(port)) = value; else if (!pci_ioport_addr(port)) { *(volatile u32 *)(port) = be32_to_cpu(value); @@ -230,7 +230,7 @@ static inline void outl(u32 value, portaddr_t port) { static inline void outw(u16 value, portaddr_t port) { if (is_astro_ioport(port)) - *(volatile u16 *)(astro_ioport_addr(port)) = cpu_to_le16(value); + *(volatile u16 *)(astro_ioport_addr(port)) = value; else if (!pci_ioport_addr(port)) { *(volatile u16 *)(port) = be16_to_cpu(value); @@ -243,7 +243,10 @@ static inline void outw(u16 value, portaddr_t port) { } static inline void outb(u8 value, portaddr_t port) { - if (has_astro || !pci_ioport_addr(port)) { + if (is_astro_ioport(port)) + *(volatile u8 *)(astro_ioport_addr(port)) = value; + else + if (!pci_ioport_addr(port)) { *(volatile u8 *)(port) = value; } else { /* write PCI I/O address to Dino's PCI_CONFIG_ADDR */ @@ -254,6 +257,9 @@ static inline void outb(u8 value, portaddr_t port) { } static inline u8 inb(portaddr_t port) { + if (is_astro_ioport(port)) + return *(volatile u8 *)(astro_ioport_addr(port)); + else if (has_astro || !pci_ioport_addr(port)) { return *(volatile u8 *)(port); } else { @@ -266,7 +272,7 @@ static inline u8 inb(portaddr_t port) { static inline u16 inw(portaddr_t port) { if (is_astro_ioport(port)) - return le16_to_cpu(*(volatile u16 *)(astro_ioport_addr(port))); + return *(volatile u16 *)(astro_ioport_addr(port)); else if (!pci_ioport_addr(port)) { return *(volatile u16 *)(port); @@ -279,7 +285,7 @@ static inline u16 inw(portaddr_t port) { } static inline u32 inl(portaddr_t port) { if (is_astro_ioport(port)) - return (le32_to_cpu(*(volatile u32 *)(astro_ioport_addr(port)))); + return *(volatile u32 *)(astro_ioport_addr(port)); else if (!pci_ioport_addr(port)) { return *(volatile u32 *)(port); diff --git a/src/parisc/hppa_hardware.h b/src/parisc/hppa_hardware.h index f363d9d..e62b134 100644 --- a/src/parisc/hppa_hardware.h +++ b/src/parisc/hppa_hardware.h @@ -52,11 +52,11 @@ /* ASTRO Memory and I/O regions */ -#define LMMIO_DIST_BASE_ADDR 0xf4000000ULL -#define LMMIO_DIST_BASE_SIZE 0x4000000ULL +#define LMMIO_DIST_BASE_ADDR 0xf4000000UL +#define LMMIO_DIST_BASE_SIZE 0x4000000UL -#define IOS_DIST_BASE_ADDR 0xfffee00000ULL -#define IOS_DIST_BASE_SIZE 0x10000ULL +#define IOS_DIST_BASE_ADDR 0xfee00000UL +#define IOS_DIST_BASE_SIZE 0x10000UL #define ROPES_PER_IOC 8 /* per Ike half or Pluto/Astro */ diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index 6739ce5..b87e51c 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -1043,6 +1043,13 @@ static int pdc_model(unsigned int *arg) case PDC_MODEL_GET_INSTALL_KERNEL: // No need to provide a special install kernel during installation of HP-UX return PDC_BAD_OPTION; + case PDC_MODEL_GET_PLATFORM_INFO: + model_str = has_astro ? "A6057A" : "9000/778"; + strtcpy((char *)ARG2, model_str, 16); + strtcpy((char *)ARG3, model_str, 16); + /* use: current_machine->pdc_model.sw_id ? */ + strtcpy((char *)ARG4, "001122334455", 16); + return PDC_OK; } dprintf(0, "\n\nSeaBIOS: Unimplemented PDC_MODEL function %d %x %x %x %x\n", ARG1, ARG2, ARG3, ARG4, ARG5); return PDC_BAD_OPTION; @@ -2397,7 +2404,7 @@ void __VISIBLE start_parisc_firmware(void) pci_setup(); serial_setup(); -// block_setup(); + block_setup(); PAGE0->vec_rendz = 0; /* No rendezvous yet. Add MEM_RENDEZ_HI later */ -- cgit v1.1