From: Peter Maydell <peter.maydell@linaro.org>
To: Evgeny Voevodin <e.voevodin@samsung.com>
Cc: m.kozlov@samsung.com, qemu-devel@nongnu.org, d.solodkiy@samsung.com
Subject: Re: [Qemu-devel] [PATCH v3 11/14] hw/exynos4210.c: Add LAN support for SMDKC210.
Date: Tue, 13 Dec 2011 12:01:06 +0000 [thread overview]
Message-ID: <CAFEAcA-d8XJyoPc6fGb7DvxpXTZRVz=BRGExZQGPrztzM3koCA@mail.gmail.com> (raw)
In-Reply-To: <1323672206-11891-12-git-send-email-e.voevodin@samsung.com>
On 12 December 2011 06:43, Evgeny Voevodin <e.voevodin@samsung.com> wrote:
> SMDKC210 uses lan9215 chip, but lan9118 in 16-bit mode seems to
> be enough.
>
> Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
> ---
> hw/exynos4210.c | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/hw/exynos4210.c b/hw/exynos4210.c
> index 055205d..0a93866 100644
> --- a/hw/exynos4210.c
> +++ b/hw/exynos4210.c
> @@ -26,6 +26,8 @@
> #include "sysemu.h"
> #include "sysbus.h"
> #include "arm-misc.h"
> +#include "net.h"
> +#include "devices.h"
> #include "exec-memory.h"
> #include "exynos4210.h"
>
> @@ -226,6 +228,8 @@ static void exynos4210_init(ram_addr_t ram_size,
> SysBusDevice *busdev;
> ram_addr_t mem_size;
> int n;
> + NICInfo *nd;
> + int done_nic = 0;
>
> switch (board_type) {
> case BOARD_EXYNOS4210_NURI:
> @@ -458,6 +462,20 @@ static void exynos4210_init(ram_addr_t ram_size,
> exynos4210_uart_create(addr, fifo_size, channel, NULL, uart_irq);
> }
>
> + /*** LAN adapter: this should be a 9215 but the 9118 is close enough ***/
> + if (board_type == BOARD_EXYNOS4210_SMDKC210) {
> + for (n = 0; n < nb_nics; n++) {
> + nd = &nd_table[n];
> +
> + if (!done_nic && (!nd->model ||
> + strcmp(nd->model, "lan9118") == 0)) {
> + dev = lan9118_init(nd, 0x05000000,
> + qemu_irq_invert(irq_table[exynos4210_get_irq(37, 1)]));
> + qdev_prop_set_uint32(dev, "mode_16bit", 1);
> + done_nic = 1;
> + }
> + }
> + }
This whole loop is overkill for the straightforward case of
"we only allow one NIC and this is it". Look at hw/vexpress.c,
but basically you want:
nd = &nd_table[0];
if (nd->vlan) {
initialise lan9118 based on nd;
}
As noted in previous patch, you can't set qdev properties after
the device has been initialised, only before.
>
> /*** Load kernel ***/
>
> --
> 1.7.4.1
>
>
next prev parent reply other threads:[~2011-12-13 12:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 6:43 [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Evgeny Voevodin
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 01/14] ARM: Samsung exynos4210-based boards emulation Evgeny Voevodin
2011-12-12 22:17 ` Peter Maydell
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 02/14] ARM: exynos4210: CMU support Evgeny Voevodin
2011-12-12 22:44 ` Peter Maydell
2011-12-14 12:10 ` Maksim E. Kozlov
2011-12-14 11:43 ` Peter Maydell
2011-12-14 17:08 ` Maksim E. Kozlov
2011-12-14 16:25 ` Peter Maydell
2011-12-15 7:11 ` Dmitry Solodkiy
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 03/14] ARM: exynos4210: UART support Evgeny Voevodin
2011-12-12 22:55 ` Peter Maydell
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 04/14] hw/sysbus.h: Increase maximum number of device IRQs Evgeny Voevodin
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 05/14] ARM: exynos4210: IRQ subsystem support Evgeny Voevodin
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 06/14] ARM: exynos4210: PWM support Evgeny Voevodin
2011-12-13 10:51 ` Peter Maydell
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 07/14] hw/arm_boot.c: Add new secondary CPU bootloader Evgeny Voevodin
2011-12-13 11:28 ` Peter Maydell
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 08/14] ARM: exynos4210: MCT support Evgeny Voevodin
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 09/14] hw/exynos4210.c: Boot secondary CPU Evgeny Voevodin
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 10/14] hw/lan9118: Add basic 16-bit mode support Evgeny Voevodin
2011-12-13 11:54 ` Peter Maydell
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 11/14] hw/exynos4210.c: Add LAN support for SMDKC210 Evgeny Voevodin
2011-12-13 12:01 ` Peter Maydell [this message]
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API Evgeny Voevodin
2011-12-13 15:11 ` Peter Maydell
2011-12-13 16:22 ` Peter Maydell
2011-12-14 8:29 ` Mitsyanko Igor
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 13/14] ARM: exynos4210: added SD/MMC host controller Evgeny Voevodin
2011-12-13 14:56 ` Peter Maydell
2011-12-13 16:23 ` Mitsyanko Igor
2011-12-12 6:43 ` [Qemu-devel] [PATCH v3 14/14] ARM: exynos4210: added display controller implementation Evgeny Voevodin
2011-12-12 7:22 ` [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Stefan Weil
2011-12-13 10:14 ` Peter Maydell
2011-12-13 10:37 ` Dmitry Solodkiy
2011-12-13 10:59 ` Peter Maydell
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='CAFEAcA-d8XJyoPc6fGb7DvxpXTZRVz=BRGExZQGPrztzM3koCA@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=d.solodkiy@samsung.com \
--cc=e.voevodin@samsung.com \
--cc=m.kozlov@samsung.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).