From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSlqN-0001go-8h for qemu-devel@nongnu.org; Mon, 29 Oct 2012 05:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSlqL-0002cL-PP for qemu-devel@nongnu.org; Mon, 29 Oct 2012 05:41:15 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:58295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSlqL-0002bh-JC for qemu-devel@nongnu.org; Mon, 29 Oct 2012 05:41:13 -0400 Received: from eusync4.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MCN004JJEXHYN50@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Mon, 29 Oct 2012 09:41:41 +0000 (GMT) Received: from [106.109.8.87] by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MCN00E00EWI6M30@eusync4.samsung.com> for qemu-devel@nongnu.org; Mon, 29 Oct 2012 09:41:08 +0000 (GMT) Message-id: <508E4F31.4090409@samsung.com> Date: Mon, 29 Oct 2012 13:41:05 +0400 From: Igor Mitsyanko MIME-version: 1.0 References: In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 1/2] pl330: Initial version Reply-To: i.mitsyanko@samsung.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: vineshp@xilinx.com, peter.maydell@linaro.org, qemu-devel@nongnu.org, Kirill Batuzov , Kyungmin Park , john.williams@xilinx.com, edgar.iglesias@gmail.com, afaerber@suse.de Good day, Peter) On 10/29/2012 10:35 AM, Peter Crosthwaite wrote: > Device model for Primecell PL330 dma controller. > > + > +static Property pl330_properties[] = { > + /* CR0 */ > + DEFINE_PROP_UINT8("num_chnls", PL330, num_chnls, 8), > + DEFINE_PROP_UINT8("num_periph_req", PL330, num_periph_req, 8), > + DEFINE_PROP_UINT8("num_events", PL330, num_events, 8), > + DEFINE_PROP_UINT8("mgr_ns_at_rst", PL330, mgr_ns_at_rst, 0), > + /* CR1 */ > + DEFINE_PROP_UINT8("i-cache_len", PL330, i_cache_len, 4), > + DEFINE_PROP_UINT8("num_i-cache_lines", PL330, num_i_cache_lines, 8), > + > + DEFINE_PROP_UINT8("mgr_ns_at_rst", PL330, mgr_ns_at_rst, 0), That's a duplicate, you had the same property three rows before. > + > + /* CR2-4 */ > + DEFINE_PROP_UINT32("boot_addr", PL330, cfg[CFG_BOOT_ADDR], 0), > + DEFINE_PROP_UINT32("INS", PL330, cfg[CFG_INS], 0), > + DEFINE_PROP_UINT32("PNS", PL330, cfg[CFG_PNS], 0), > + /* CRD */ > + DEFINE_PROP_UINT8("data_width", PL330, data_width, 0), You do not decode this value in pl330_init() like you do for, for example, i_cache_len property. I think default value here should be 32, which corresponds to 0b010 in LSB of CRD register. And you should also check for reserved values of this property and, perhaps, hw_error() on them. > + DEFINE_PROP_UINT8("wr_cap", PL330, wr_cap, 0), > + DEFINE_PROP_UINT8("wr_q_dep", PL330, wr_q_dep, 0), > + DEFINE_PROP_UINT8("rd_cap", PL330, rd_cap, 0), > + DEFINE_PROP_UINT8("rd_q_dep", PL330, rd_q_dep, 0), > + DEFINE_PROP_UINT16("data_buffer_dep", PL330, data_buffer_dep, 0), > + > + DEFINE_PROP_END_OF_LIST(), > +}; > + > +static void pl330_class_init(ObjectClass *klass, void *data) > +{ > + DeviceClass *dc = DEVICE_CLASS(klass); > + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); > + > + k->init = pl330_init; > + dc->reset = pl330_reset; > + dc->props = pl330_properties; > + dc->vmsd = &vmstate_pl330; > +} > + > +static const TypeInfo pl330_type_info = { > + .name = "pl330", > + .parent = TYPE_SYS_BUS_DEVICE, > + .instance_size = sizeof(PL330), > + .class_init = pl330_class_init, > +}; > + > +static void pl330_register_types(void) > +{ > + type_register_static(&pl330_type_info); > +} > + > +type_init(pl330_register_types) -- Mitsyanko Igor ASWG, Moscow R&D center, Samsung Electronics email: i.mitsyanko@samsung.com