From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzMbA-000098-Js for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:40 -0400 Received: from [140.186.70.92] (port=34769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzMb9-000082-Br for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzMb7-0001pX-TD for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:39 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:37776) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzMb7-0001mu-O8 for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:37 -0400 Received: by mail-pz0-f204.google.com with SMTP id 42so139118pzk.4 for ; Tue, 06 Apr 2010 21:10:37 -0700 (PDT) Sender: Grant Likely From: Grant Likely Date: Tue, 06 Apr 2010 22:10:33 -0600 Message-ID: <20100407041033.20274.72493.stgit@angua> In-Reply-To: <20100407040129.20274.44284.stgit@angua> References: <20100407040129.20274.44284.stgit@angua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH 7/7] devicetree: Add fdt_populate hook to smc91x device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, devicetree-discuss@lists.ozlabs.org, jeremy.kerr@canonical.com Signed-off-by: Grant Likely --- hw/smc91c111.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/hw/smc91c111.c b/hw/smc91c111.c index b7398c9..300d209 100644 --- a/hw/smc91c111.c +++ b/hw/smc91c111.c @@ -721,8 +721,28 @@ static int smc91c111_init1(SysBusDevice *dev) return 0; } +#ifdef CONFIG_FDT +#include +static int smc91c111_fdt_populate(SysBusDevice *dev, void *fdt, int offset) +{ + smc91c111_state *s = FROM_SYSBUS(smc91c111_state, dev); + int rc; + + rc = fdt_setprop_string(fdt, offset, "compatible", "smc,91c111"); + if (rc < 0) + return rc; + + rc = fdt_setprop(fdt, offset, "local-mac-address", s->conf.macaddr.a, + sizeof(s->conf.macaddr.a)); + return 0; +} +#endif + static SysBusDeviceInfo smc91c111_info = { .init = smc91c111_init1, +#ifdef CONFIG_FDT + .fdt_populate = smc91c111_fdt_populate, +#endif .qdev.name = "smc91c111", .qdev.size = sizeof(smc91c111_state), .qdev.props = (Property[]) {