From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaV8q-0001Z6-QC for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:23:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaV8l-0001gj-2L for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:23:44 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:14524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaV8k-0001ga-UO for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:23:39 -0500 Received: from euspt1 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LW500KPZHJAUN@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 13 Dec 2011 16:23:34 +0000 (GMT) Received: from [106.109.8.52] by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LW500B3YHJAFY@spt1.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 13 Dec 2011 16:23:34 +0000 (GMT) Date: Tue, 13 Dec 2011 20:23:33 +0400 From: Mitsyanko Igor In-reply-to: Message-id: <4EE77C05.7080805@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7BIT References: <1323672206-11891-1-git-send-email-e.voevodin@samsung.com> <1323672206-11891-14-git-send-email-e.voevodin@samsung.com> Subject: Re: [Qemu-devel] [PATCH v3 13/14] ARM: exynos4210: added SD/MMC host controller Reply-To: i.mitsyanko@samsung.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 12/13/2011 06:56 PM, Peter Maydell wrote: > On 12 December 2011 06:43, Evgeny Voevodin wrote: >> --- /dev/null >> +++ b/hw/exynos4210_sdhc.c >> @@ -0,0 +1,1666 @@ >> +/* >> + * Samsung exynos4210 SD/MMC host controller >> + * (SD host controller specification ver. 2.0 compliant) > > Is there anything in this implementation which is exynos specific, > or is it purely an implementation of the standard? > We should separate out (and name appropriately) the code which > is implementing the SD host standard specification, and if necessary > add a thin wrapper for any exynos-specific bits. > > -- PMM > > Yes, exynos SD host controller has additional features controlled by exynos-specific bits in several specification-defined registers, and by registers CONTROL2 and CONTROL3 (which are not defined in SD host controller specification at all). Are you suggesting to implement something like layered device, when device-specific SD host controller state structure includes generic host controller state? I thought about replacing exynos-specific registers in sd host controller state with two variables holding pointer to and size of these exynos-specific (or any other device specific) registers, plus add extra variable to hold host controller variant. This way it should be easier to account for influence of device sd host controller specific bits to default specification-defined registers behaviour.