From patchwork Fri May 4 15:58:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10380969 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 B0D7460353 for ; Fri, 4 May 2018 16:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A6BD294D7 for ; Fri, 4 May 2018 16:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F49F294DB; Fri, 4 May 2018 16:05:37 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 2AC8D294D7 for ; Fri, 4 May 2018 16:05:37 +0000 (UTC) Received: from localhost ([::1]:35043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdDE-0006fW-Ee for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 May 2018 12:05:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEd7Q-0002RL-9J for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEd7O-0001Pf-I6 for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:36 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:43334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEd7O-0001PL-DK for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:34 -0400 Received: by mail-qk0-x243.google.com with SMTP id h19so16976164qkj.10 for ; Fri, 04 May 2018 08:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RQTpAJ52w58SUS1U6gF4bCSfJNwalAVxvfMYpKTP1bg=; b=qVE1ckAJUzrM9v28P0dAsuvzyyxj0cbFy9qPn3rBRA9BuLR2soCa61QmMqYuk7qaSJ DGmPAtKymZ8u4VDNtxvb9FDJADQ+aAXF3G8SBWz4scN8SpLWNanvO8kmUuXLdjBhqOM9 7h1Vuq2gLOZG+uRH4xlx9CeY+2lBjvWH5sZ3/kKKQzuS+2h+kOAH3Uu9Id7IXlXbPEde BphBa2kXYeMIhiOFAqo51GmwHxCU6vJEu16V4R2ErN6D9ETge5ZB5rKcKif+Z60FMY+z jMhdgo4Ythod+noVOdFhkEC4nWWIATx5WwoUJWlDwvXyU/X1/m/66lUpdXQv0xG4lFCj uWWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RQTpAJ52w58SUS1U6gF4bCSfJNwalAVxvfMYpKTP1bg=; b=Wg7NUEZ5kYik97Q5dl1V6mX6uxP5bCnkh7IJygj8SnPlQXoALGN4rQzLmxnW/ZsqNM 1BHjdx2AC8AaegX6GaN8XDtacA1KJjrXSoO+ic5N2xQ0nTj/YRcEZx2U3B0N1+FtYRHF 0KGjCtu4Wc6LTEnSaLHPQbVkjFX63uQaSRYYdO9CinqAK3VThyPi3RIY9zw7PlGtK9Nh Hr6mf15P4jQ6CvzMYvx0dMYtsJL90jNQrtOH+f807rfKUKzPrQQVd9tSkkysCqR44X3b NsV4mlwR7qCkrS2aVJwNBwn7j+/nfAP4TCknqVtgyykSI8Q81PFajgBXmTaqQfLU4ySB lpNQ== X-Gm-Message-State: ALQs6tCIegoJnbPzb4DH/uQPBM7yW1tYGtHCQBsW3xOK9ig7qkjpV09s gjVXuXmTtsRhmh8aWG+JSGw= X-Google-Smtp-Source: AB8JxZrLjA/N5EawnDT5uyJ66+ztudp4qyXo71VWe33Eu8Lk8QpNbFAs1plpoNjJQRzedbayfAJR8Q== X-Received: by 10.55.31.234 with SMTP id n103mr22562126qkh.412.1525449569860; Fri, 04 May 2018 08:59:29 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id a83sm8587066qkb.22.2018.05.04.08.59.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 08:59:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , "Edgar E . Iglesias" Date: Fri, 4 May 2018 12:58:59 -0300 Message-Id: <20180504155918.21287-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504155918.21287-1-f4bug@amsat.org> References: <20180504155918.21287-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 01/20] sdcard: Use the ldst API 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: Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Michael Walle , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The load/store API will ease further code movement. Per the Physical Layer Simplified Spec. "3.6 Bus Protocol": "In the CMD line the Most Significant Bit (MSB) is transmitted first, the Least Significant Bit (LSB) is the last." Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/milkymist-memcard.c | 3 +-- hw/sd/ssi-sd.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index 5570c1e9a0..ff2b92dc64 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -100,8 +100,7 @@ static void memcard_sd_command(MilkymistMemcardState *s) SDRequest req; req.cmd = s->command[0] & 0x3f; - req.arg = (s->command[1] << 24) | (s->command[2] << 16) - | (s->command[3] << 8) | s->command[4]; + req.arg = ldl_be_p(s->command + 1); req.crc = s->command[5]; s->response[0] = req.cmd; diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index ae04b6641b..0bb26e596d 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -97,8 +97,7 @@ static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val) uint8_t longresp[16]; /* FIXME: Check CRC. */ request.cmd = s->cmd; - request.arg = (s->cmdarg[0] << 24) | (s->cmdarg[1] << 16) - | (s->cmdarg[2] << 8) | s->cmdarg[3]; + request.arg = ldl_be_p(s->cmdarg); DPRINTF("CMD%d arg 0x%08x\n", s->cmd, request.arg); s->arglen = sdbus_do_command(&s->sdbus, &request, longresp); if (s->arglen <= 0) {