From patchwork Tue Nov 2 10:59:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516620 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp4389886iml; Tue, 2 Nov 2021 04:06:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXp7WTj8b1QEU8p/90tY6BOFzdHGNqBVCgF0VQa928kdQEyvDXILhpc0D+GmweEXEwj/2 X-Received: by 2002:a05:6830:2383:: with SMTP id l3mr25115294ots.236.1635851202703; Tue, 02 Nov 2021 04:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635851202; cv=none; d=google.com; s=arc-20160816; b=Vopq1p0Hx8aWGzqbueiGJgbutfAi0IYoJebQCm6fhYHXWmz7juERrQ+g4iY7aNGQn+ 0kvgUGQZLemRKQ6tmdc1vd1y2WI3acdgFnoTeWkfU+IXFp6LYGjKfYUmUGpvF/opVwdc 8pp37EP1EG5l8NI4dDGeX2d7MYWfooGEz5w2dItXkUxqhX7AygxmFBMOMDXtJRCYDwnl awuqnwrZPirTEE+d4BVmzsNw5J1nuwA24sj3yLSG3ihnBsX3RnKeAbDX2ggsT2XauHNC sF8vACqkkhRYZ1mPtQxxq7qk1APkEC9pYLprNigS2NONHPokarnqNVVItKoDnueR4/1A KggA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CLouTaodPxEP08iPvDZkl4yjeSN0JJ+7RsZ1lYxtnnA=; b=EGZHsCTXXgAs6LcRJURvdvNn/+O+x4KqYGeUmZPHJgN95ximfzHMH2zl5Ls0Das3Oo qptjObS8puaD9R+Ye6t9NAbdjC2qWK+uFyQMlVcf8GIBVcqTAXaeuvRtbgFz1A3N63xs NNOAbPk3whoHlRD3k3D+Sq1o5MYg4o/QmIITe1FdB2V2+0gpvyTtlPEmyy5auA1UPJfE lk78ExO35sqqx1bFylsLzjtkc6cfd+C2GE3orCmb3Bi7z3+dGw1fT272i9I/E74zucVX u/LiNUNy0eEn1QlNnO05AgXxdhrKn6QwpZqKxx41aU+mfeQbzDVUQd0KlSd5Fo4FAqmr geCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=udCD3SO4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bm38si1171924oib.73.2021.11.02.04.06.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Nov 2021 04:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=udCD3SO4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhrco-0007bh-43 for patch@linaro.org; Tue, 02 Nov 2021 07:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhrW0-0007Ko-Tv for qemu-devel@nongnu.org; Tue, 02 Nov 2021 06:59:40 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:39435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhrVy-0006qu-6q for qemu-devel@nongnu.org; Tue, 02 Nov 2021 06:59:40 -0400 Received: by mail-qv1-xf35.google.com with SMTP id k29so13000022qve.6 for ; Tue, 02 Nov 2021 03:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CLouTaodPxEP08iPvDZkl4yjeSN0JJ+7RsZ1lYxtnnA=; b=udCD3SO4jUmgz+y/9Vje7uguJ0g42ikO7p9VGEXg43kT0HZT07xfVd+1HFcQhUNtjv TnaqYkeK58EJ2neZhbcTjKC0SdFSaPYhv4FRbj3VfWg0a04FfFD8r4TpZiihFOt0/fy8 iAPKE0p8iP67qW0/Sm1MOPAAQyX77AfubBv6FsBKGfUy0pIGfpyprwMWt6jDvDDyneAM CBcY6RyBYGh2ErRoc/2Lu3simN7zwTTMrgKxeNBvEr8L+yaF0P2lWQyndNvmloqtA/zs Jj4Wf6oDLSzKqcjC+cqVT4sTz/f62j7XZ7eim/dS6+hcxYBCnlJ75o1gBKp7FTKn0f0O EvAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CLouTaodPxEP08iPvDZkl4yjeSN0JJ+7RsZ1lYxtnnA=; b=zCHqair+79YSLwd39nY0sJxasxZL/gUQhe1NSAvjoDjHN5WW6OomxTbPPMYt2EnLqB fdjnBUuxGaUiN3uKV2YGyTObvRFXFJ+AHdToKSlEdaZqgY9wwlAxw10j4NYY1AlZBhvJ cCK6VRGjx8ycz7TNpLq40PPdhNorC5tW1ID9hB96SXl2iX4kuqfZMxAte0E6AEnWczqH IZHCBH6lg3/ZncQWJr8QrmRwmfVwVRgCWEhaMoNosKdgIrPNoIW47IsjjdpqS1g+mKM8 ZjVZI0oMGBWYIocWiaqo1Hdjw1fqH1J1tt04emx2CKv1AJK4IXlWuydjS6CDgaXH0qPg BnnA== X-Gm-Message-State: AOAM533EAVzEpFmdeLVkbx3ILrn+5UdQbkNDNpVP/hIaac5zgjy0Fpor /N5od9c52PWac2HuImDBxxGTAJxNpaB+bg== X-Received: by 2002:a05:6214:129:: with SMTP id w9mr14626249qvs.22.1635850777424; Tue, 02 Nov 2021 03:59:37 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id z26sm11789510qko.13.2021.11.02.03.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 03:59:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/12] hw/arm: Attach MMC to quanta-gbs-bmc Date: Tue, 2 Nov 2021 06:59:25 -0400 Message-Id: <20211102105934.214596-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102105934.214596-1-richard.henderson@linaro.org> References: <20211102105934.214596-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao Wu , Tyrone Ting , Shengtan Mao , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Shengtan Mao Signed-off-by: Shengtan Mao Signed-off-by: Hao Wu Reviewed-by: Hao Wu Reviewed-by: Tyrone Ting Reviewed-by: Peter Maydell Message-Id: <20211008002628.1958285-4-wuhaotsh@google.com> Signed-off-by: Richard Henderson --- hw/arm/npcm7xx_boards.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.25.1 diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index a656169f61..dec7d16ae5 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -27,6 +27,9 @@ #include "qemu-common.h" #include "qemu/datadir.h" #include "qemu/units.h" +#include "sysemu/blockdev.h" +#include "sysemu/sysemu.h" +#include "sysemu/block-backend.h" #define NPCM750_EVB_POWER_ON_STRAPS 0x00001ff7 #define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff @@ -81,6 +84,22 @@ static void npcm7xx_connect_dram(NPCM7xxState *soc, MemoryRegion *dram) &error_abort); } +static void sdhci_attach_drive(SDHCIState *sdhci) +{ + DriveInfo *di = drive_get_next(IF_SD); + BlockBackend *blk = di ? blk_by_legacy_dinfo(di) : NULL; + + BusState *bus = qdev_get_child_bus(DEVICE(sdhci), "sd-bus"); + if (bus == NULL) { + error_report("No SD bus found in SOC object"); + exit(1); + } + + DeviceState *carddev = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(carddev, "drive", blk, &error_fatal); + qdev_realize_and_unref(carddev, bus, &error_fatal); +} + static NPCM7xxState *npcm7xx_create_soc(MachineState *machine, uint32_t hw_straps) { @@ -355,6 +374,7 @@ static void quanta_gbs_init(MachineState *machine) drive_get(IF_MTD, 0, 0)); quanta_gbs_i2c_init(soc); + sdhci_attach_drive(&soc->mmc.sdhci); npcm7xx_load_kernel(machine, soc); }