Two hppa cleanup patches
cover Two hppa cleanup patches
From: Helge Deller <[email protected]>
Two leftover cleanup patches which I did not wanted to merge shortly before the qemu-v11 release. Nothing critical, and both suggested by Philippe Mathieu-Daudé.
Please review.
Helge Deller (2):
hw/pci-host/astro: Encode Astro version numbers hw/hppa: Move static variable lasi_dev into MachineState
hw/hppa/machine.c | 15 ++++++++++----- hw/pci-host/astro.c | 5 ++++- 2 files changed, 14 insertions(+), 6 deletions(-)
Signature · 1 line
2.54.0
PATCH 1/2 hw/pci-host/astro: Encode Astro version numbers
From: Helge Deller <[email protected]>
Add enum which encodes the Astro version numbers.
--- hw/pci-host/astro.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/pci-host/astro.c +4 -1
@@ -41,6 +41,9 @@ static const int elroy_hpa_offsets[ELROY_NUM] = {static const char elroy_rope_nr[ELROY_NUM ] = {0 ,1 ,4 ,6 };/* busnum path, e.g. [10:6] */ +/* Astro version numbers */ +enum {ID_ASTRO_1_0 =0 ,ID_ASTRO_2_1 =9 ,ID_ASTRO_3_0 =2 }; +/* * Helper functions */
@@ -738,7 +741,7 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,switch ((addr >>3 ) <<3 ) {/* R2I registers */ case 0x0000 :/* ID */ - val = (0x01 <<3 ) |0x01ULL ; + val =ID_ASTRO_2_1 ;break ;case 0x0008 :/* IOC_CTRL */ val = s->ioc_ctrl;
Signature · 1 line
2.54.0
PATCH 2/2 hw/hppa: Move static variable lasi_dev into MachineState
In reply to Helge DellerFrom: Helge Deller <[email protected]>
Avoid static variables, so move lasi_dev into the MachineState struct.
--- hw/hppa/machine.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
hw/hppa/machine.c +10 -5
@@ -44,6 +44,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(HppaMachineState, HPPA_COMMON_MACHINE)struct HppaMachineState {MachineState parent_obj; +DeviceState *lasi_dev;uint64_t memsplit_addr; };
@@ -52,8 +53,6 @@ struct HppaMachineState {#define HPA_POWER_BUTTON (FIRMWARE_END - 0x10)static hwaddr soft_power_reg; -static DeviceState *lasi_dev; -static void hppa_powerdown_req (Notifier *n,void *opaque) {uint32_t val;
@@ -399,7 +398,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, {const char *kernel_filename = machine->kernel_filename;MachineClass *mc =MACHINE_GET_CLASS (machine); -DeviceState *dev; +HppaMachineState *hpm =HPPA_COMMON_MACHINE (machine); +DeviceState *dev, *lasi_dev;PCIDevice *pci_dev;long size;uint64_t kernel_entry =0 ;
@@ -408,6 +408,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,SysBusDevice *s;/* Graphics setup. */ + lasi_dev = hpm->lasi_dev;if (lasi_dev && machine->enable_graphics && vga_interface_type !=VGA_NONE ) { dev =qdev_new ("artist" );
@@ -576,7 +577,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,*/ static void machine_HP_715_init (MachineState *machine) { -DeviceState *dev; +HppaMachineState *hpm =HPPA_COMMON_MACHINE (machine); +DeviceState *dev, *lasi_dev;MemoryRegion *addr_space =get_system_memory ();TranslateFn *translate;ISABus *isa_bus;
@@ -596,6 +598,7 @@ static void machine_HP_715_init(MachineState *machine)/* Init Lasi chip */ lasi_dev =DEVICE (lasi_init ()); + hpm->lasi_dev = lasi_dev;memory_region_add_subregion (addr_space,translate (NULL ,LASI_HPA_715 ),sysbus_mmio_get_region (SYS_BUS_DEVICE (lasi_dev),0 ));
@@ -652,7 +655,8 @@ static void machine_HP_715_init(MachineState *machine)*/ static void machine_HP_B160L_init (MachineState *machine) { -DeviceState *dev, *dino_dev; +HppaMachineState *hpm =HPPA_COMMON_MACHINE (machine); +DeviceState *dev, *dino_dev, *lasi_dev;MemoryRegion *addr_space =get_system_memory ();TranslateFn *translate;ISABus *isa_bus;
@@ -669,6 +673,7 @@ static void machine_HP_B160L_init(MachineState *machine)/* Init Lasi chip */ lasi_dev =DEVICE (lasi_init ()); + hpm->lasi_dev = lasi_dev;memory_region_add_subregion (addr_space,translate (NULL ,LASI_HPA ),sysbus_mmio_get_region (SYS_BUS_DEVICE (lasi_dev),0 ));
Signature · 1 line
2.54.0
Re: [PATCH 2/2] hw/hppa: Move static variable lasi_dev into MachineState
Quoted 7 lines · Helge Deller
From: Helge Deller <[email protected]>
Avoid static variables, so move
lasi_devinto the MachineState struct.Signed-off-by Helge Deller <[email protected]>Suggested-by Philippe Mathieu-Daudé <[email protected]>
thanks
-- PMM
Quoted 7 lines · Helge Deller
From: Helge Deller <[email protected]>
Two leftover cleanup patches which I did not wanted to merge shortly before the qemu-v11 release. Nothing critical, and both suggested by Philippe Mathieu-Daudé.
Please review.
Quoted 7 lines
Helge Deller (2):
hw/pci-host/astro: Encode Astro version numbers hw/hppa: Move static variablelasi_devinto MachineStatehw/hppa/machine.c | 15 ++++++++++----- hw/pci-host/astro.c | 5 ++++- 2 files changed, 14 insertions(+), 6 deletions(-)
Thank you! Series: