From: Li Guang <lig.fnst@cn.fujitsu.com>
To: Beniamino Galvani <b.galvani@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] hw/arm/allwinner-a10: initialize EMAC
Date: Mon, 06 Jan 2014 08:49:18 +0800 [thread overview]
Message-ID: <52C9FD8E.5040200@cn.fujitsu.com> (raw)
In-Reply-To: <1388654332-10303-3-git-send-email-b.galvani@gmail.com>
Hi,
please use prefix AwA10 for names instead of Aw,
also PATCH 1/2.
Thanks for your effort on this!
Beniamino Galvani wrote:
> Signed-off-by: Beniamino Galvani<b.galvani@gmail.com>
> ---
> hw/arm/allwinner-a10.c | 20 ++++++++++++++++++++
> include/hw/arm/allwinner-a10.h | 4 ++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
> index 4658e19..155e026 100644
> --- a/hw/arm/allwinner-a10.c
> +++ b/hw/arm/allwinner-a10.c
> @@ -22,6 +22,7 @@
> static void aw_a10_init(Object *obj)
> {
> AwA10State *s = AW_A10(obj);
> + DeviceState *dev;
>
> object_initialize(&s->cpu, sizeof(s->cpu), "cortex-a8-" TYPE_ARM_CPU);
> object_property_add_child(obj, "cpu", OBJECT(&s->cpu), NULL);
> @@ -31,6 +32,14 @@ static void aw_a10_init(Object *obj)
>
> object_initialize(&s->timer, sizeof(s->timer), TYPE_AW_A10_PIT);
> qdev_set_parent_bus(DEVICE(&s->timer), sysbus_get_default());
> +
> + if (nd_table[0].used) {
> + qemu_check_nic_model(&nd_table[0], "allwinner_emac");
> + object_initialize(&s->emac, sizeof(s->emac), TYPE_AW_EMAC);
> + dev = DEVICE(&s->emac);
> + qdev_set_nic_properties(dev,&nd_table[0]);
> + qdev_set_parent_bus(dev, sysbus_get_default());
> + }
> }
>
> static void aw_a10_realize(DeviceState *dev, Error **errp)
> @@ -76,6 +85,17 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
> sysbus_connect_irq(sysbusdev, 4, s->irq[67]);
> sysbus_connect_irq(sysbusdev, 5, s->irq[68]);
>
> + if (nd_table[0].used) {
> + object_property_set_bool(OBJECT(&s->emac), true, "realized",&err);
> + if (err != NULL) {
> + error_propagate(errp, err);
> + return;
> + }
> + sysbusdev = SYS_BUS_DEVICE(&s->emac);
> + sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE);
> + sysbus_connect_irq(sysbusdev, 0, s->irq[55]);
> + }
> +
> serial_mm_init(get_system_memory(), AW_A10_UART0_REG_BASE, 2, s->irq[1],
> 115200, serial_hds[0], DEVICE_NATIVE_ENDIAN);
> }
> diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h
> index da36647..6ea5988 100644
> --- a/include/hw/arm/allwinner-a10.h
> +++ b/include/hw/arm/allwinner-a10.h
> @@ -6,6 +6,7 @@
> #include "hw/arm/arm.h"
> #include "hw/timer/allwinner-a10-pit.h"
> #include "hw/intc/allwinner-a10-pic.h"
> +#include "hw/net/allwinner_emac.h"
>
> #include "sysemu/sysemu.h"
> #include "exec/address-spaces.h"
> @@ -14,9 +15,11 @@
> #define AW_A10_PIC_REG_BASE 0x01c20400
> #define AW_A10_PIT_REG_BASE 0x01c20c00
> #define AW_A10_UART0_REG_BASE 0x01c28000
> +#define AW_A10_EMAC_BASE 0x01c0b000
>
> #define AW_A10_SDRAM_BASE 0x40000000
>
> +
> #define TYPE_AW_A10 "allwinner-a10"
> #define AW_A10(obj) OBJECT_CHECK(AwA10State, (obj), TYPE_AW_A10)
>
> @@ -29,6 +32,7 @@ typedef struct AwA10State {
> qemu_irq irq[AW_A10_PIC_INT_NR];
> AwA10PITState timer;
> AwA10PICState intc;
> + AwEmacState emac;
> } AwA10State;
>
> #define ALLWINNER_H_
>
next prev parent reply other threads:[~2014-01-06 0:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 9:18 [Qemu-devel] [PATCH 0/2] hw/arm: add ethernet support to Allwinner A10 Beniamino Galvani
2014-01-02 9:18 ` [Qemu-devel] [PATCH 1/2] hw/net: add support for Allwinner EMAC Fast Ethernet controller Beniamino Galvani
2014-01-02 10:25 ` Peter Crosthwaite
2014-01-02 14:58 ` Beniamino Galvani
2014-01-03 1:26 ` Peter Crosthwaite
2014-01-03 17:42 ` Beniamino Galvani
2014-01-06 3:27 ` Stefan Hajnoczi
2014-01-06 3:46 ` Peter Crosthwaite
2014-01-06 6:12 ` Stefan Hajnoczi
2014-01-10 21:48 ` Beniamino Galvani
2014-01-10 22:16 ` Peter Crosthwaite
2014-01-10 22:48 ` Peter Crosthwaite
2014-01-12 13:59 ` Edgar E. Iglesias
2014-01-12 22:00 ` Peter Crosthwaite
2014-01-13 4:00 ` Stefan Hajnoczi
2014-01-04 0:56 ` Peter Crosthwaite
2014-01-04 9:36 ` Beniamino Galvani
2014-01-02 9:18 ` [Qemu-devel] [PATCH 2/2] hw/arm/allwinner-a10: initialize EMAC Beniamino Galvani
2014-01-02 10:20 ` Peter Crosthwaite
2014-01-02 10:21 ` Peter Crosthwaite
2014-01-02 17:19 ` Beniamino Galvani
2014-01-02 22:32 ` Peter Crosthwaite
2014-01-06 0:49 ` Li Guang [this message]
2014-01-06 13:56 ` Beniamino Galvani
2014-01-08 7:27 ` Li Guang
2014-01-08 8:14 ` Peter Crosthwaite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52C9FD8E.5040200@cn.fujitsu.com \
--to=lig.fnst@cn.fujitsu.com \
--cc=b.galvani@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.