From patchwork Mon Mar 19 21:31:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10295251 X-Patchwork-Delegate: geert@linux-m68k.org 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 B621060385 for ; Mon, 19 Mar 2018 21:31:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A58BE29444 for ; Mon, 19 Mar 2018 21:31:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A8582944D; Mon, 19 Mar 2018 21:31:14 +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=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5147C294B1 for ; Mon, 19 Mar 2018 21:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965358AbeCSVbN (ORCPT ); Mon, 19 Mar 2018 17:31:13 -0400 Received: from sauhun.de ([88.99.104.3]:47723 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969942AbeCSVbK (ORCPT ); Mon, 19 Mar 2018 17:31:10 -0400 Received: from localhost (p54B3377B.dip0.t-ipconnect.de [84.179.55.123]) by pokefinder.org (Postfix) with ESMTPSA id 6BDE42C6FDB; Mon, 19 Mar 2018 22:31:09 +0100 (CET) From: Wolfram Sang To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , linux-renesas-soc@vger.kernel.org, Wolfram Sang Subject: [PATCH v2 2/3] nvram: at24c: use a sane default for "rom-size" Date: Mon, 19 Mar 2018 22:31:00 +0100 Message-Id: <20180319213101.6100-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180319213101.6100-1-wsa+renesas@sang-engineering.com> References: <20180319213101.6100-1-wsa+renesas@sang-engineering.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 0 as "rom-size" will lead to an error message. Let's use the size of a small 24c01 which has 128 byte. Signed-off-by: Wolfram Sang Reviewed-by: Philippe Mathieu-Daudé --- hw/nvram/eeprom_at24c.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c index ccf78b25e4..ab1ef686e2 100644 --- a/hw/nvram/eeprom_at24c.c +++ b/hw/nvram/eeprom_at24c.c @@ -28,6 +28,9 @@ #define TYPE_AT24C_EE "at24c-eeprom" #define AT24C_EE(obj) OBJECT_CHECK(EEPROMState, (obj), TYPE_AT24C_EE) +/* default is the size of a 24c01 EEPROM */ +#define AT24C_ROMSIZE_DEFAULT 128 + typedef struct EEPROMState { I2CSlave parent_obj; @@ -171,7 +174,7 @@ void at24c_eeprom_reset(DeviceState *state) } static Property at24c_eeprom_props[] = { - DEFINE_PROP_UINT32("rom-size", EEPROMState, rsize, 0), + DEFINE_PROP_UINT32("rom-size", EEPROMState, rsize, AT24C_ROMSIZE_DEFAULT), DEFINE_PROP_BOOL("writable", EEPROMState, writable, true), DEFINE_PROP_DRIVE("drive", EEPROMState, blk), DEFINE_PROP_END_OF_LIST()