367 changes: 289 additions & 78 deletions hw/hppa/machine.c

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions hw/input/lasips2.c
Expand Up @@ -351,6 +351,11 @@ static void lasips2_port_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);

/*
* The PS/2 mouse port is integreal part of LASI and can not be
* created by users without LASI.
*/
dc->user_creatable = false;
dc->realize = lasips2_port_realize;
}

Expand Down Expand Up @@ -397,6 +402,11 @@ static void lasips2_kbd_port_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_CLASS(klass);

/*
* The PS/2 keyboard port is integreal part of LASI and can not be
* created by users without LASI.
*/
dc->user_creatable = false;
device_class_set_parent_realize(dc, lasips2_kbd_port_realize,
&lpdc->parent_realize);
}
Expand Down
2 changes: 1 addition & 1 deletion hw/net/tulip.c
Expand Up @@ -1020,7 +1020,7 @@ static void tulip_class_init(ObjectClass *klass, void *data)
k->exit = pci_tulip_exit;
k->vendor_id = PCI_VENDOR_ID_DEC;
k->device_id = PCI_DEVICE_ID_DEC_21143;
k->subsystem_vendor_id = 0x103c;
k->subsystem_vendor_id = PCI_VENDOR_ID_HP;
k->subsystem_id = 0x104f;
k->class_id = PCI_CLASS_NETWORK_ETHERNET;
dc->vmsd = &vmstate_pci_tulip;
Expand Down
4 changes: 4 additions & 0 deletions hw/pci-host/Kconfig
Expand Up @@ -82,6 +82,10 @@ config DINO
bool
select PCI

config ASTRO
bool
select PCI

config GT64120
bool
select PCI
Expand Down
885 changes: 885 additions & 0 deletions hw/pci-host/astro.c

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions hw/pci-host/meson.build
Expand Up @@ -27,6 +27,7 @@ pci_ss.add(when: 'CONFIG_MV64361', if_true: files('mv64361.c'))
pci_ss.add(when: 'CONFIG_VERSATILE_PCI', if_true: files('versatile.c'))

# HPPA devices
pci_ss.add(when: 'CONFIG_ASTRO', if_true: files('astro.c'))
pci_ss.add(when: 'CONFIG_DINO', if_true: files('dino.c'))

system_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss)
Expand Down
11 changes: 11 additions & 0 deletions hw/pci-host/trace-events
Expand Up @@ -46,3 +46,14 @@ pnv_phb4_xive_notify_abt(uint64_t notif_port, uint64_t data) "notif=@0x%"PRIx64"
dino_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx64" is %d"
dino_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
dino_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"

# astro.c
astro_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx64" is %d"
astro_chip_read(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
astro_chip_write(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
elroy_read(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
elroy_write(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
elroy_pci_config_data_read(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
elroy_pci_config_data_write(uint64_t addr, int size, uint64_t val) "addr 0x%"PRIx64" size %d val 0x%"PRIx64
iosapic_reg_write(uint64_t reg_select, int size, uint64_t val) "reg_select 0x%"PRIx64" size %d val 0x%"PRIx64
iosapic_reg_read(uint64_t reg_select, int size, uint64_t val) "reg_select 0x%"PRIx64" size %d val 0x%"PRIx64
92 changes: 92 additions & 0 deletions include/hw/pci-host/astro.h
@@ -0,0 +1,92 @@
/*
* HP-PARISC Astro Bus connector with Elroy PCI host bridges
*/

#ifndef ASTRO_H
#define ASTRO_H

#include "hw/pci/pci_host.h"

#define ASTRO_HPA 0xfed00000

#define ROPES_PER_IOC 8 /* per Ike half or Pluto/Astro */

#define TYPE_ASTRO_CHIP "astro-chip"
OBJECT_DECLARE_SIMPLE_TYPE(AstroState, ASTRO_CHIP)

#define TYPE_ELROY_PCI_HOST_BRIDGE "elroy-pcihost"
OBJECT_DECLARE_SIMPLE_TYPE(ElroyState, ELROY_PCI_HOST_BRIDGE)

#define ELROY_NUM 4 /* # of Elroys */
#define ELROY_IRQS 8 /* IOSAPIC IRQs */

/* ASTRO Memory and I/O regions */
#define LMMIO_DIST_BASE_ADDR 0xf4000000ULL
#define LMMIO_DIST_BASE_SIZE 0x4000000ULL

#define IOS_DIST_BASE_ADDR 0xfffee00000ULL
#define IOS_DIST_BASE_SIZE 0x10000ULL

struct AstroState;

struct ElroyState {
PCIHostState parent_obj;

/* parent Astro device */
struct AstroState *astro;

/* HPA of this Elroy */
hwaddr hpa;

/* PCI bus number (Elroy number) */
unsigned int pci_bus_num;

uint64_t config_address;
uint64_t config_reg_elroy;

uint64_t status_control;
uint64_t arb_mask;
uint64_t mmio_base[(0x0250 - 0x200) / 8];
uint64_t error_config;

uint32_t iosapic_reg_select;
uint64_t iosapic_reg[0x20];

uint32_t ilr;

MemoryRegion this_mem;

MemoryRegion pci_mmio;
MemoryRegion pci_mmio_alias;
MemoryRegion pci_hole;
MemoryRegion pci_io;
};

struct AstroState {
PCIHostState parent_obj;

uint64_t ioc_ctrl;
uint64_t ioc_status_ctrl;
uint64_t ioc_ranges[(0x03d8 - 0x300) / 8];
uint64_t ioc_rope_config;
uint64_t ioc_status_control;
uint64_t ioc_flush_control;
uint64_t ioc_rope_control[8];
uint64_t tlb_ibase;
uint64_t tlb_imask;
uint64_t tlb_pcom;
uint64_t tlb_tcnfg;
uint64_t tlb_pdir_base;

struct ElroyState *elroy[ELROY_NUM];

MemoryRegion this_mem;

MemoryRegion pci_mmio;
MemoryRegion pci_io;

IOMMUMemoryRegion iommu;
AddressSpace iommu_as;
};

#endif
2 changes: 2 additions & 0 deletions include/hw/pci/pci_ids.h
Expand Up @@ -179,6 +179,8 @@
#define PCI_DEVICE_ID_AMD_LANCE 0x2000
#define PCI_DEVICE_ID_AMD_SCSI 0x2020

#define PCI_VENDOR_ID_HP 0x103c

#define PCI_VENDOR_ID_TI 0x104c

#define PCI_VENDOR_ID_MOTOROLA 0x1057
Expand Down
Binary file modified pc-bios/hppa-firmware.img
Binary file not shown.
2 changes: 1 addition & 1 deletion roms/seabios-hppa
Submodule seabios-hppa updated from 763e3b to fd5b6c