mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
arm-devs queue
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABCAAGBQJR7RnMAAoJEDwlJe0UNgze9BQP/iuj/QKrw71vrMMCHlrzqjRc WXNaGkGHGaRw1r1X/XSiEqI3Ti2frHhsJ+annso4Q3forfGCbnB1Qaqvs/KzQW09 KQBK3b2AZ9m4b35ZpZYpmbNaIS60XVV1VVB9tshXKJgyYObGlHRWj8MpepSrl3Rr texchdyNgZnqCS7Ep6oxzaR2bLqcr1Mi8+NG4dLJfw/z8BREPasQfxOYQoKxDVKV Cg2gd31ZAVzqJXtUuwdtkuM7JddfOnGk/MfDkZEBFhQ/fnRE5GSGYTuOHQp9hYdt bKnJbT0tqorP5+xg4dzVTqOJ+TsWm+ZfQrzQzkWSM34msYSoohCsF3/BA3xkF3/9 6iE4ZfHrM6R/XO3A61NbtE9CvhFq9YsLPq7TcAAEzapBFXZlQAGCbZNJlGqn72p1 XSTFwB02c2+gOXhhUtCwh0OKVbX79J99TQkBR1bEXr3C0yokxa0bIy7kJy+X2+vF NOMzoWhEteylZn18tvDfjPCXXzO4kJ8+3sYtvyYAWRadG1QcCq+8xMwUgcVQgmnM 3TO2r+i4Cs+Ut9m6krW3P3ctL4cCoZj4bDqOu/8Fd7OVBK6u6LtXwej6LoiIDSPD 3D2Bns65EhEZVucoObgNxG2h+JFLcLm3qRKY51VxD0lJh4Nn90jo317I43FHWONe HZZqqO8yPPf7LG/QGTzA =AvPS -----END PGP SIGNATURE----- Merge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130722' into staging arm-devs queue # gpg: Signature made Mon 22 Jul 2013 06:38:52 AM CDT using RSA key ID 14360CDE # gpg: Can't check signature: public key not found # By Peter Maydell (8) and Soren Brinkmann (2) # Via Peter Maydell * pmaydell/tags/pull-arm-devs-20130722: hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header hw/loader: Support ramdisk with u-boot header vexpress: Add virtio-mmio transports vexpress: Make VEDBoardInfo extend arm_boot_info arm/boot: Allow boards to modify the FDT blob virtio: Implement MMIO based virtio transport virtio: Support transports which can specify the vring alignment virtio: Add support for guest setting of queue size arm/boot: Use qemu_devtree_setprop_sized_cells() device_tree: Add qemu_devtree_setprop_sized_cells() utility functions Message-id: 1374493427-3254-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
commit
549c272b3c
12 changed files with 771 additions and 68 deletions
|
@ -55,6 +55,10 @@ struct arm_boot_info {
|
|||
const struct arm_boot_info *info);
|
||||
void (*secondary_cpu_reset_hook)(ARMCPU *cpu,
|
||||
const struct arm_boot_info *info);
|
||||
/* if a board needs to be able to modify a device tree provided by
|
||||
* the user it should implement this hook.
|
||||
*/
|
||||
void (*modify_dtb)(const struct arm_boot_info *info, void *fdt);
|
||||
/* Used internally by arm_boot.c */
|
||||
int is_linux;
|
||||
hwaddr initrd_start;
|
||||
|
|
|
@ -17,6 +17,19 @@ int load_aout(const char *filename, hwaddr addr, int max_sz,
|
|||
int load_uimage(const char *filename, hwaddr *ep,
|
||||
hwaddr *loadaddr, int *is_linux);
|
||||
|
||||
/**
|
||||
* load_ramdisk:
|
||||
* @filename: Path to the ramdisk image
|
||||
* @addr: Memory address to load the ramdisk to
|
||||
* @max_sz: Maximum allowed ramdisk size (for non-u-boot ramdisks)
|
||||
*
|
||||
* Load a ramdisk image with U-Boot header to the specified memory
|
||||
* address.
|
||||
*
|
||||
* Returns the size of the loaded image on success, -1 otherwise.
|
||||
*/
|
||||
int load_ramdisk(const char *filename, hwaddr addr, uint64_t max_sz);
|
||||
|
||||
ssize_t read_targphys(const char *name,
|
||||
int fd, hwaddr dst_addr, size_t nbytes);
|
||||
void pstrcpy_targphys(const char *name,
|
||||
|
|
|
@ -62,6 +62,12 @@ typedef struct VirtioBusClass {
|
|||
* This is called by virtio-bus just before the device is unplugged.
|
||||
*/
|
||||
void (*device_unplug)(DeviceState *d);
|
||||
/*
|
||||
* Does the transport have variable vring alignment?
|
||||
* (ie can it ever call virtio_queue_set_align()?)
|
||||
* Note that changing this will break migration for this transport.
|
||||
*/
|
||||
bool has_variable_vring_alignment;
|
||||
} VirtioBusClass;
|
||||
|
||||
struct VirtioBusState {
|
||||
|
|
|
@ -200,7 +200,9 @@ void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data);
|
|||
void virtio_config_writel(VirtIODevice *vdev, uint32_t addr, uint32_t data);
|
||||
void virtio_queue_set_addr(VirtIODevice *vdev, int n, hwaddr addr);
|
||||
hwaddr virtio_queue_get_addr(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num);
|
||||
int virtio_queue_get_num(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_align(VirtIODevice *vdev, int n, int align);
|
||||
void virtio_queue_notify(VirtIODevice *vdev, int n);
|
||||
uint16_t virtio_queue_vector(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
|
||||
|
|
|
@ -51,4 +51,63 @@ int qemu_devtree_add_subnode(void *fdt, const char *name);
|
|||
|
||||
void qemu_devtree_dumpdtb(void *fdt, int size);
|
||||
|
||||
/**
|
||||
* qemu_devtree_setprop_sized_cells_from_array:
|
||||
* @fdt: device tree blob
|
||||
* @node_path: node to set property on
|
||||
* @property: property to set
|
||||
* @numvalues: number of values
|
||||
* @values: array of number-of-cells, value pairs
|
||||
*
|
||||
* Set the specified property on the specified node in the device tree
|
||||
* to be an array of cells. The values of the cells are specified via
|
||||
* the values list, which alternates between "number of cells used by
|
||||
* this value" and "value".
|
||||
* number-of-cells must be either 1 or 2 (other values will result in
|
||||
* an error being returned). If a value is too large to fit in the
|
||||
* number of cells specified for it, an error is returned.
|
||||
*
|
||||
* This function is useful because device tree nodes often have cell arrays
|
||||
* which are either lists of addresses or lists of address,size tuples, but
|
||||
* the number of cells used for each element vary depending on the
|
||||
* #address-cells and #size-cells properties of their parent node.
|
||||
* If you know all your cell elements are one cell wide you can use the
|
||||
* simpler qemu_devtree_setprop_cells(). If you're not setting up the
|
||||
* array programmatically, qemu_devtree_setprop_sized_cells may be more
|
||||
* convenient.
|
||||
*
|
||||
* Return value: 0 on success, <0 on error.
|
||||
*/
|
||||
int qemu_devtree_setprop_sized_cells_from_array(void *fdt,
|
||||
const char *node_path,
|
||||
const char *property,
|
||||
int numvalues,
|
||||
uint64_t *values);
|
||||
|
||||
/**
|
||||
* qemu_devtree_setprop_sized_cells:
|
||||
* @fdt: device tree blob
|
||||
* @node_path: node to set property on
|
||||
* @property: property to set
|
||||
* @...: list of number-of-cells, value pairs
|
||||
*
|
||||
* Set the specified property on the specified node in the device tree
|
||||
* to be an array of cells. The values of the cells are specified via
|
||||
* the variable arguments, which alternates between "number of cells
|
||||
* used by this value" and "value".
|
||||
*
|
||||
* This is a convenience wrapper for the function
|
||||
* qemu_devtree_setprop_sized_cells_from_array().
|
||||
*
|
||||
* Return value: 0 on success, <0 on error.
|
||||
*/
|
||||
#define qemu_devtree_setprop_sized_cells(fdt, node_path, property, ...) \
|
||||
({ \
|
||||
uint64_t qdt_tmp[] = { __VA_ARGS__ }; \
|
||||
qemu_devtree_setprop_sized_cells_from_array(fdt, node_path, \
|
||||
property, \
|
||||
ARRAY_SIZE(qdt_tmp) / 2, \
|
||||
qdt_tmp); \
|
||||
})
|
||||
|
||||
#endif /* __DEVICE_TREE_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue