From patchwork Mon Jun 9 15:03:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31575 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 291D820675 for ; Mon, 9 Jun 2014 15:03:13 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id l13sf13721702iga.11 for ; Mon, 09 Jun 2014 08:03:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=zbGY50IgMrSvpYG1BrgjFwgmQ8jfPTm1fN76Wq0KuZY=; b=Gu7ahn66RpIHmm9kcBmQQ6Vq/YE85wRroP+5xP+wbWcK9vXt9SbcaNYBxf9ojlaGg7 Xp8o8PIPmESz6sVJNW3aF128nZ7LJsykWs9h125st0nrYLaDY35dPE6LHRqQZvIkIXsB hyZcWkR1jEhihtvXGEkiD0kQEX/0L+pWPe7GiskXTNrOJNfMWN2OvvJXjL5uyAiopGFp qfTCaBFEcYkq9IzZAnr9bJdlp0SLmbWmhmT7LzQz3Tu59v8XWaJ9gX/508sBsR1JdbEn EoJIOD1noUMhEEaNdO8Y50bVr9OYNzUUGB1/twYXV/dP4V8+wCc3vzjf423nSzXLurGq yDKA== X-Gm-Message-State: ALoCoQnIkjPqVSs+9rL1AyUlZapUjUH4e0iYksaIO5vfe9JzvO9y1hqTo3yitpmTKJm4qOR6/GUA X-Received: by 10.182.28.136 with SMTP id b8mr3106094obh.19.1402326192557; Mon, 09 Jun 2014 08:03:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.143 with SMTP id s15ls1600136qga.33.gmail; Mon, 09 Jun 2014 08:03:12 -0700 (PDT) X-Received: by 10.221.40.193 with SMTP id tr1mr26386387vcb.31.1402326192327; Mon, 09 Jun 2014 08:03:12 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id da12si11991550vec.9.2014.06.09.08.03.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 08:03:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so4691539vcb.30 for ; Mon, 09 Jun 2014 08:03:12 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr21871069vdd.24.1402326191991; Mon, 09 Jun 2014 08:03:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp152612vcb; Mon, 9 Jun 2014 08:03:11 -0700 (PDT) X-Received: by 10.180.7.137 with SMTP id j9mr31787896wia.7.1402326191115; Mon, 09 Jun 2014 08:03:11 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ci2si12085396wib.59.2014.06.09.08.03.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 08:03:11 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Wu16K-0006DS-1N; Mon, 09 Jun 2014 16:03:08 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Stefan Hajnoczi Subject: [PATCH v2] hw/net/eepro100: Implement read-only bits in MDI registers Date: Mon, 9 Jun 2014 16:03:08 +0100 Message-Id: <1402326188-23869-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Although we defined an eepro100_mdi_mask[] array indicating which bits in the registers are read-only, we weren't actually doing anything with it. Make the MDI register-write code use it rather than manually making register 1 read-only and leaving the rest as reads-as-written. (The special-case handling of register 0 remains as before since its mask is all-zeros and the special casing happens before we apply the masking.) Signed-off-by: Peter Maydell Message-id: 1402159924-13853-1-git-send-email-peter.maydell@linaro.org --- No code change, but I fixed the errors in the commit message. hw/net/eepro100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 3b891ca..9c70cce 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1217,7 +1217,6 @@ static void eepro100_write_mdi(EEPRO100State *s) break; case 1: /* Status Register */ missing("not writable"); - data = s->mdimem[reg]; break; case 2: /* PHY Identification Register (Word 1) */ case 3: /* PHY Identification Register (Word 2) */ @@ -1230,7 +1229,8 @@ static void eepro100_write_mdi(EEPRO100State *s) default: missing("not implemented"); } - s->mdimem[reg] = data; + s->mdimem[reg] &= eepro100_mdi_mask[reg]; + s->mdimem[reg] |= data & ~eepro100_mdi_mask[reg]; } else if (opcode == 2) { /* MDI read */ switch (reg) {