All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: "Cédric Le Goater" <clg@kaod.org>, openbmc@lists.ozlabs.org
Subject: Re: [PATCH qemu 12/12] ast2400: add a FTGMAC100 nic
Date: Tue, 07 Jun 2016 16:56:32 +0930	[thread overview]
Message-ID: <1465284392.16048.80.camel@aj.id.au> (raw)
In-Reply-To: <1464556805-4340-13-git-send-email-clg@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 3739 bytes --]

On Sun, 2016-05-29 at 23:20 +0200, Cédric Le Goater wrote:
> Only the first nic, but the second shouldn't be too complex to add if
> needed.

What was this patch based on? The GEM NIC is in the openbmc/qemu repo,
but this patch doesn't remove it - Was it based on upstream?


> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Regardless, looks good to me, we can massage it to apply wherever we
need, eg. by first backing out the GEM NIC as a separate commit.

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  hw/arm/ast2400.c         | 18 ++++++++++++++++++
>  include/hw/arm/ast2400.h |  2 ++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c
> index a4a7c10e4361..67ae91f5f977 100644
> --- a/hw/arm/ast2400.c
> +++ b/hw/arm/ast2400.c
> @@ -19,6 +19,7 @@
>  #include "hw/char/serial.h"
>  #include "hw/boards.h"
>  #include "hw/i2c/aspeed_i2c.h"
> +#include "net/net.h"
>  
>  #define AST2400_UART_5_BASE      0x00184000
>  #define AST2400_IOMEM_SIZE       0x00200000
> @@ -32,6 +33,8 @@
>  #define AST2400_LPC_BASE         0x1E789000
>  #define AST2400_IBT_BASE         (AST2400_LPC_BASE + 0x140)
>  #define AST2400_I2C_BASE         0x1E78A000
> +#define AST2400_ETH1_BASE        0x1E660000
> +#define AST2400_ETH2_BASE        0x1E680000
>  
>  static const int uart_irqs[] = { 9, 32, 33, 34, 10 };
>  static const int timer_irqs[] = { 16, 17, 18, 35, 36, 37, 38, 39, };
> @@ -95,6 +98,10 @@ static void ast2400_init(Object *obj)
>      object_initialize(&s->bt, sizeof(s->bt), TYPE_ASPEED_BT);
>      object_property_add_child(obj, "bt", OBJECT(&s->bt), NULL);
>      qdev_set_parent_bus(DEVICE(&s->bt), sysbus_get_default());
> +
> +    object_initialize(&s->ftgmac100, sizeof(s->ftgmac100), TYPE_FTGMAC100);
> +    object_property_add_child(obj, "ftgmac100", OBJECT(&s->ftgmac100), NULL);
> +    qdev_set_parent_bus(DEVICE(&s->ftgmac100), sysbus_get_default());
>  }
>  
>  static void ast2400_realize(DeviceState *dev, Error **errp)
> @@ -221,6 +228,17 @@ static void ast2400_realize(DeviceState *dev, Error **errp)
>      sysbus_mmio_map(SYS_BUS_DEVICE(&s->bt), 0, AST2400_IBT_BASE);
>      sysbus_connect_irq(SYS_BUS_DEVICE(&s->bt), 0,
>                         qdev_get_gpio_in(DEVICE(&s->vic), 10));
> +
> +    /* Net */
> +    qdev_set_nic_properties(DEVICE(&s->ftgmac100), &nd_table[0]);
> +    object_property_set_bool(OBJECT(&s->ftgmac100), true, "realized", &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
> +    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ftgmac100), 0, AST2400_ETH1_BASE);
> +    sysbus_connect_irq(SYS_BUS_DEVICE(&s->ftgmac100), 0,
> +                       qdev_get_gpio_in(DEVICE(&s->vic), 2));
>  }
>  
>  static void ast2400_class_init(ObjectClass *oc, void *data)
> diff --git a/include/hw/arm/ast2400.h b/include/hw/arm/ast2400.h
> index 2b517e89eeea..bb221734c7b1 100644
> --- a/include/hw/arm/ast2400.h
> +++ b/include/hw/arm/ast2400.h
> @@ -19,6 +19,7 @@
>  #include "hw/i2c/aspeed_i2c.h"
>  #include "hw/ssi/aspeed_smc.h"
>  #include "hw/misc/aspeed_bt.h"
> +#include "hw/net/ftgmac100.h"
>  
>  typedef struct AST2400State {
>      /*< private >*/
> @@ -35,6 +36,7 @@ typedef struct AST2400State {
>      AspeedSMCState smc;
>      AspeedSMCState spi;
>      AspeedBTState bt;
> +    Ftgmac100State ftgmac100;
>  } AST2400State;
>  
>  #define TYPE_AST2400 "ast2400"

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-06-07  7:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29 21:19 [PATCH qemu 00/12] SMC and network support Cédric Le Goater
2016-05-29 21:19 ` [PATCH qemu 01/12] ast2400: add SMC controllers (FMC and SPI) Cédric Le Goater
2016-06-07  2:08   ` Andrew Jeffery
2016-06-08 11:53     ` Cédric Le Goater
2016-05-29 21:19 ` [PATCH qemu 02/12] ast2400: add SPI flash slave object Cédric Le Goater
2016-06-07  5:34   ` Andrew Jeffery
2016-06-08 12:42     ` Cédric Le Goater
2016-05-29 21:19 ` [PATCH qemu 03/12] ast2400: create SPI flash slaves Cédric Le Goater
2016-06-07  5:56   ` Andrew Jeffery
2016-06-08 12:46     ` Cédric Le Goater
2016-05-29 21:19 ` [PATCH qemu 04/12] m25p80: add a get storage routine Cédric Le Goater
2016-05-29 21:19 ` [PATCH qemu 05/12] ast2400: handle SPI flash Command mode (read only) Cédric Le Goater
2016-06-07  6:04   ` Andrew Jeffery
2016-05-29 21:19 ` [PATCH qemu 06/12] ast2400: use contents of first SPI flash as a rom Cédric Le Goater
2016-06-07  6:24   ` Andrew Jeffery
2016-06-09 10:42     ` Cédric Le Goater
2016-05-29 21:20 ` [PATCH qemu 07/12] m25p80: add RDCR instruction for Macronix chip Cédric Le Goater
2016-05-29 21:20 ` [PATCH qemu 08/12] m25p80: add mx25l25635f chip Cédric Le Goater
2016-05-29 21:20 ` [PATCH qemu 09/12] ast2400: use a " Cédric Le Goater
2016-06-07  6:29   ` Andrew Jeffery
2016-05-29 21:20 ` [PATCH qemu 10/12] ast2400: add a BT device Cédric Le Goater
2016-06-07  7:15   ` Andrew Jeffery
2016-05-29 21:20 ` [PATCH qemu 11/12] net: add FTGMAC100 support Cédric Le Goater
2016-06-08  3:50   ` Andrew Jeffery
2016-05-29 21:20 ` [PATCH qemu 12/12] ast2400: add a FTGMAC100 nic Cédric Le Goater
2016-06-07  7:26   ` Andrew Jeffery [this message]
2016-06-23 17:00 ` [PATCH qemu 00/12] SMC and network support Cédric Le Goater
2016-06-24  7:06   ` Joel Stanley
2016-06-24  7:18     ` Cédric Le Goater
2016-06-27 16:09   ` Andrew Jeffery

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=1465284392.16048.80.camel@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=openbmc@lists.ozlabs.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.