From patchwork Tue Jul 26 00:12:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 9247299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A9778607FD for ; Tue, 26 Jul 2016 00:28:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9749622380 for ; Tue, 26 Jul 2016 00:28:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 889A12787C; Tue, 26 Jul 2016 00:28:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44D0D22380 for ; Tue, 26 Jul 2016 00:28:05 +0000 (UTC) Received: from localhost ([::1]:36415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqE8-0007mA-6C for patchwork-qemu-devel@patchwork.kernel.org; Mon, 25 Jul 2016 20:28:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqDq-0007jT-OR for qemu-devel@nongnu.org; Mon, 25 Jul 2016 20:27:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRqDo-00006k-MT for qemu-devel@nongnu.org; Mon, 25 Jul 2016 20:27:45 -0400 Received: from mail-sn1nam02on0082.outbound.protection.outlook.com ([104.47.36.82]:41551 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqDi-00006B-RZ; Mon, 25 Jul 2016 20:27:39 -0400 Received: from SN1NAM02FT018.eop-nam02.prod.protection.outlook.com (10.152.72.51) by SN1NAM02HT096.eop-nam02.prod.protection.outlook.com (10.152.73.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.5; Tue, 26 Jul 2016 00:13:05 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by SN1NAM02FT018.mail.protection.outlook.com (10.152.72.122) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.549.5 via Frontend Transport; Tue, 26 Jul 2016 00:13:05 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:32942 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1bRpzc-0002Cn-I1; Mon, 25 Jul 2016 17:13:04 -0700 Received: from [127.0.0.1] (port=38229 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1bRpzc-0000n5-Ef; Mon, 25 Jul 2016 17:13:04 -0700 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u6Q06Jld028695; Mon, 25 Jul 2016 17:06:20 -0700 Received: from [172.19.74.182] (port=59992 helo=xsjalistai50.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1bRpzb-0000n2-PJ; Mon, 25 Jul 2016 17:13:03 -0700 From: Alistair Francis To: , Date: Mon, 25 Jul 2016 17:12:35 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22472.005 X-TM-AS-Result: No--5.572-7.0-31-10 X-imss-scan-details: No--5.572-7.0-31-10 X-TMASE-MatchedRID: ZF1pLboQoELFvZkHJO4cD1VN8laWo90M6SXuwUgGH0hYYjdv4zyROx4u a24ul9odkKaVbA4S4D3c8+FPg1rJdhLmJd2F/yFu4pdq9sdj8LVYN1akkye0qFmc19Us2m2y/BL THkvHKMtLbMLc3nVqMuZG+4fcCFvZe4t+BIGa1PR05zsoB1UKTov8pidhVYOUmyiLZetSf8mfop 0ytGwvXiq2rl3dzGQ1+y21Qho7kEn/s5lbYbm2BHLDX1KbEEztyxUCp0+nITLbP2vs+/AhQQ== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.96; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(19580405001)(4326007)(105606002)(19580395003)(71366001)(77096005)(2906002)(2950100001)(87936001)(586003)(7846002)(85426001)(305945005)(11100500001)(36756003)(92566002)(7696003)(5003600100003)(356003)(50986999)(47776003)(76176999)(106466001)(50226002)(5003940100001)(64026002)(5001770100001)(81166006)(81156014)(8676002)(50466002)(189998001)(229853001)(48376002)(33646002)(118296001)(86362001)(8936002)(9786002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT096; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; PTR:unknown-60-96.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT018; 1:1O0sz7pBd9ScMVyL22qyMASRnoKTQ8EXgPHKbE3vy1fbHbGXxjsxuv0zl97M+V1psPJ19r9VUMz8vuZrhc+qoVen5HGmqy2IiqV4Jd1RORbSg7fiCi5QySUNMS4uVWKLUSFQd8VIXfWOAefpxMQPYEA4zSWXTfUPXA1X0T+3GW2lXQjNrpaU52z12wLB+epCFRm7wdrhNrAu4SgPu3Do5yr4SbDGApmaU0XNqyvvq3CM65kshQgFNKVbqJTVCCn4IpWoUU6ZH0NhCeduTtMew+jiWlRUi6PmxOlXIonyyzonFPflnoWs0wrga3JRmjQ4ssit/eFknK6iBOmLYY6KJHPpZLp1gq57XXIlZiE+xKK3UONhNSpgKxB6e63IdqC5LgI3oErX2KbC1kPeGzSfkA1n5q/sVuKr17gm5S5NlfnHSSV8QBhr31DLn8twGY0nv7PmaWEGZKQ9s1DQH0zr2p4pgIrVR2b7zYHTHx9M7Noq1IDYgLzyI6thP+yCw75KteJCvaJ+3zBlh1Rzs2/CAiJK/kZxzvxUP17jU0EXjgD7GlsMOq95ZTP3r9ua+MvQ87fB/JXfVnjcwrkZXFucC43Fk+qCZN8GMJOu8GXt/Yw= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e847cc81-0d5a-4401-ee85-08d3b4e99d90 X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02HT096; 2:dlbSjNz/MkqrezrKlfdx+UO+3u7cAV+SX04eRnVb1KwmetLb0gjAYGPvsXri4D3luVfKdeYUS19s1HvWn9gymi/D6BG4WhVB8CUwga83XaQYMqz+5nI4FbuhRIGyh3IMqNWtFjXFoTL9PgXCLEUHy9RSXdzD2MiLFodVZZwTDaXxzcM2oEIooxgpbVKo+Kps; 3:6ESGO3I43Yl5cTpZ6oIyjOc6ZCGADcJkF/7q/T6bXA2s1KjrzdrwFPuv3B6z810gdkyLTdXFWV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tmXE= X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02HT096; 31:b/afijwO2Kbd53YDB4Dgi9OoznsZjJbPoN7G03rHIbpBZsqNu3/J0vjblIAwi0/GNCmQ3HFPnL43iFOgESrtvfn4VCYv0NUS0x38O+PKF65mi+Qr+7jCj6VfuHxL0zR7r7fZXsvtzmJ8Wm+uFlTwCGJ2sJDKlRLYkPfIxBozo4FvXQG7RTkPCxv8yjMiCLhiV6Y0yQu4gEoKAx/FW8BHSg==; 20:CIUEFX0pbLsDDri3f/+FgzJCLXIqaX2Q+WWiTkF2ewp7O2u8WXYUEam+YhokN7wM00rQITkHHYzCeVXpdIklwp/dbOU/ge7BeCin773FG2rKtBiRhJLpGwmMoOhd5hyEGGBTVdBGmMQ9kWx5xPYZiPTZ0p01UjFLItFALnt4+9D8JiHvY3n1NsP97EuNvgY8DDi+NIEkeVXd7+D1+Iq7G8f6zGilnBCc+eK6/9U5s8x9mw9vdTYibD3iNehd4++0ZgrQFo2OzgStvuw20Z4L8beXWcwefeJJqaX1wIu9yeEFwrsrVFBwyBaVDisxCIiF46f29z+vJYZ68oIuUY4crnVyrSYiRZ6lev+96ic/gxPSxLA/tBp0tK2D7i4lYBDiIsBZwpJ406xR/kBA7FWu3MVWaqlhbThGUFhcSnNpfQViXpn03lodlUOPiyIe5NXXPRkwL/t3qDmuY0lRLy8y+SoaUyYZOqy6K4jYkwjBcrLuVKfNBzi+d/X4zGBskkx7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13024025)(13018025)(13023025)(13017025)(13015025)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1NAM02HT096; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT096; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02HT096; 4:U0zNvXFib3S/isHQQdJ6UgvATtQV5QvifVOu9zGAQkjsbHc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zjCohWQn7FpTh1sq50XxhgQLew9I2CmKI3JElphqRQUwGO5YMZmHopJeFu6pH4jtncXBfYxVGACMglX/cu3l5onNY6thZFmW/IKz0eNGF2l3wqjEptKhMlxMIN1BCgc7sc4FMnmbdgg4VVfOSzPORrkj4ghkRIcdmsaX/vT536G7YLNLCVXxGspZM6UUOg8+eQ53WgkiYOa80COczy0wflFoCjuuIfkbDHELu9iLeHsqxmKfd8ouo+RmNo0xFsa1khEDL9nAxI+Gk1yi5gGdoyFKMEu6Og==; 5:EDbHb6bWnJAI42uP7FYXuo42ic+XrhJE23XZIbbq0jfBZNoKl/8CnpR2+a4B7mXO/UK/0Q+I0cYsgjipyko7pajhdGhWOaFBdbaLXeNUEjkRXRMNztmOrp+ftXSwE4em8x47RvWBMJfSrkXQ7sd8jg==; 24:z8BBdnR7W4taIc0pnykOPHWrPpf8Dl77kNlgD9m4NsEob9sLbgdGzgYLggfTWC/vRVOGZz3G4Bz0uuzFvrKcZVZIVYGujn55NeMH+NZiaPw=; 7:0odFXfDCO5OVzHp02Osa1AxN9lx+r3uNIjssXnqrpm+c3Q+USnM34czMP+xCOgplVIqt4vOlBlPlnxienX6ZCCF1QTHuNbt1tSGCwcmV5mzxhZNknIu028BfIL7wYufNaxWXKaFkfX7erBBCjagC5WkIjVljFdiwmCVcm4KQHym2jH521zXjlSbo7oLWZ+GmSALKRsshVqgi6ddBWnLwencYnfIHKjvebH892SY/YpOYSipfml8sMcBdSyGT1j8U SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2016 00:13:05.0928 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT096 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.82 Subject: [Qemu-devel] [PATCH v2 1/6] cadence_gem: QOMify Cadence GEM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The sysbus_init_irq() call will eventually depend on a property so it needs to be in the realize function. Signed-off-by: Alistair Francis Reviewed-by: Peter Maydell --- V2: - Update commit message hw/net/cadence_gem.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index db1b301..7adc2a8 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1214,24 +1214,30 @@ static NetClientInfo net_gem_info = { .link_status_changed = gem_set_link, }; -static int gem_init(SysBusDevice *sbd) +static void gem_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(sbd); CadenceGEMState *s = CADENCE_GEM(dev); + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); + + qemu_macaddr_default_if_unset(&s->conf.macaddr); + + s->nic = qemu_new_nic(&net_gem_info, &s->conf, + object_get_typename(OBJECT(dev)), dev->id, s); +} + +static void gem_init(Object *obj) +{ + CadenceGEMState *s = CADENCE_GEM(obj); + DeviceState *dev = DEVICE(obj); + DB_PRINT("\n"); gem_init_register_masks(s); memory_region_init_io(&s->iomem, OBJECT(s), &gem_ops, s, "enet", sizeof(s->regs)); - sysbus_init_mmio(sbd, &s->iomem); - sysbus_init_irq(sbd, &s->irq); - qemu_macaddr_default_if_unset(&s->conf.macaddr); - - s->nic = qemu_new_nic(&net_gem_info, &s->conf, - object_get_typename(OBJECT(dev)), dev->id, s); - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } static const VMStateDescription vmstate_cadence_gem = { @@ -1257,9 +1263,8 @@ static Property gem_properties[] = { static void gem_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); - sdc->init = gem_init; + dc->realize = gem_realize; dc->props = gem_properties; dc->vmsd = &vmstate_cadence_gem; dc->reset = gem_reset; @@ -1269,6 +1274,7 @@ static const TypeInfo gem_info = { .name = TYPE_CADENCE_GEM, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(CadenceGEMState), + .instance_init = gem_init, .class_init = gem_class_init, };