primecell.h cleanups
cover primecell.h cleanups
This patchseries does some minor cleanup of the primecell.h header. The arm_sysctl patch I posted yesterday; I've included it in this series since the later ones textually depend on it. The two new patches are pretty trivial.
Eventually when we have proper QOM devices with named pins rather than nameless arrays of GPIO lines we'll be able to drop the remaining two #defines and delete the header altogether...
Peter Maydell (3):
hw/arm_sysctl: Drop legacy init function hw/primecell.h: Remove obsolete pl080_init() declaration Remove unnecessary includes of primecell.h
hw/arm_sysctl.c | 16 ++-------------- hw/highbank.c | 1 - hw/integratorcp.c | 1 - hw/pl022.c | 1 - hw/primecell.h | 6 ------ hw/versatilepb.c | 1 - 6 files changed, 2 insertions(+), 24 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/3 hw/arm_sysctl: Drop legacy init function
Drop the legacy init function arm_sysctl_init(), since it has no users left any more. This allows us to drop the awkward '1' from the actual device init function.
--- hw/arm_sysctl.c | 16 ++-------------- hw/primecell.h | 3 --- 2 files changed, 2 insertions(+), 17 deletions(-)
hw/arm_sysctl.c +2 -14
@@ -378,7 +378,7 @@ static void arm_sysctl_gpio_set(void *opaque, int line, int level) } } -static int arm_sysctl_init1 (SysBusDevice *dev) +static int arm_sysctl_init (SysBusDevice *dev) {arm_sysctl_state *s =FROM_SYSBUS (arm_sysctl_state, dev);
@@ -389,18 +389,6 @@ static int arm_sysctl_init1(SysBusDevice *dev)return 0 ; } -/* Legacy helper function. */ -void arm_sysctl_init (uint32_t base,uint32_t sys_id,uint32_t proc_id) -{ -DeviceState *dev; - - dev =qdev_create (NULL ,"realview_sysctl" ); -qdev_prop_set_uint32 (dev,"sys_id" , sys_id); -qdev_init_nofail (dev); -qdev_prop_set_uint32 (dev,"proc_id" , proc_id); -sysbus_mmio_map (sysbus_from_qdev (dev),0 , base); -} -static Property arm_sysctl_properties[] = {DEFINE_PROP_UINT32 ("sys_id" , arm_sysctl_state, sys_id,0 ),DEFINE_PROP_UINT32 ("proc_id" , arm_sysctl_state, proc_id,0 ),
@@ -412,7 +400,7 @@ static void arm_sysctl_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); - k->init = arm_sysctl_init1; + k->init = arm_sysctl_init; dc->reset = arm_sysctl_reset; dc->vmsd = &vmstate_arm_sysctl; dc->props = arm_sysctl_properties;
hw/primecell.h +0 -3
@@ -8,9 +8,6 @@/* pl080.c */ void *pl080_init (uint32_t base,qemu_irq irq,int nchannels); -/* arm_sysctl.c */ -void arm_sysctl_init (uint32_t base,uint32_t sys_id,uint32_t proc_id); -/* arm_sysctl GPIO lines */ #define ARM_SYSCTL_GPIO_MMC_WPROT 0#define ARM_SYSCTL_GPIO_MMC_CARDIN 1
Signature · 1 line
1.7.5.4
PATCH 2/3 hw/primecell.h: Remove obsolete pl080_init() declaration
In reply to Peter MaydellRemove an obsolete declaration of pl080_init(), which has been incorrect since the conversion of pl080 to qdev back in 2009.
--- hw/primecell.h | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
hw/primecell.h +0 -3
@@ -5,9 +5,6 @@/* Also includes some devices that are currently only used by the ARM boards. */ -/* pl080.c */ -void *pl080_init (uint32_t base,qemu_irq irq,int nchannels); -/* arm_sysctl GPIO lines */ #define ARM_SYSCTL_GPIO_MMC_WPROT 0#define ARM_SYSCTL_GPIO_MMC_CARDIN 1
Signature · 1 line
1.7.5.4
PATCH 3/3 Remove unnecessary includes of primecell.h
In reply to Peter MaydellThe primecell.h header now only has the definitions of constants indicating the usage of the arm_sysctl GPIO lines; remove obsolete includes of it from source files which don't care about those GPIO lines.
--- hw/highbank.c | 1 - hw/integratorcp.c | 1 - hw/pl022.c | 1 - hw/versatilepb.c | 1 - 4 files changed, 0 insertions(+), 4 deletions(-)
hw/highbank.c +0 -1
@@ -19,7 +19,6 @@#include "sysbus.h" #include "arm-misc.h" -#include "primecell.h" #include "devices.h" #include "loader.h" #include "net.h"
hw/integratorcp.c +0 -1
@@ -8,7 +8,6 @@*/ #include "sysbus.h" -#include "primecell.h" #include "devices.h" #include "boards.h" #include "arm-misc.h"
hw/pl022.c +0 -1
@@ -9,7 +9,6 @@#include "sysbus.h" #include "ssi.h" -#include "primecell.h" //#define DEBUG_PL022 1
hw/versatilepb.c +0 -1
@@ -9,7 +9,6 @@#include "sysbus.h" #include "arm-misc.h" -#include "primecell.h" #include "devices.h" #include "net.h" #include "sysemu.h"
Signature · 1 line
1.7.5.4