From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 72C5B21AE30EC for ; Sun, 11 Jun 2017 19:17:01 -0700 (PDT) Received: by mail-pg0-x22a.google.com with SMTP id a70so40399521pge.3 for ; Sun, 11 Jun 2017 19:18:14 -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; bh=1n9X2m0rhMfeIakfkkrp3PpLNvvp5KD6X2CFNiXCrjU=; b=QzycemoFB5qssUxQ1yQfU9InQxtwecy5d5eb2R/N33986P19biF6wwfJkocD7YqU/j M6bICb1fq9HLYo6DuhRwI1XOEFluW+F9S07T+5Cjy5a/KOa8BKnOOA/l+K9CXu4orhVb E8miOXCF9mLnbNP5XIK05NOaxVgy/rEHrC4gk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1n9X2m0rhMfeIakfkkrp3PpLNvvp5KD6X2CFNiXCrjU=; b=IuyoSuZ4XEySzdh6HG+kQxq9eSOC1krsSDqDYL36yHQLu34mKCYpvCFKZ/8rxvkIzU QXySLFpXoGbcCQ8YDBl5fyXHWUWU1hMQC6RpsbdpV/opv9EM+0iZB++ksNlRKa5/9k9U R6f7Sd1kpDzpdDkaH3PY9Xk99woERJqdj11AQuxFjc5Uu0JOxe012SqCveHezFze/u44 K8a0F5EJ3+8mqXo9BSY+K965PDvSr6oI4IfzBeE4qZkPuJUshLK3bOpGQGacTpjLS8Ti /1LElKZQhJsjI2OFUnYJwTdWqbdw6Hq+L0a8dmYjOnpKKlNcLoLYlmB3Q+RvlG6PxtV8 xXdQ== X-Gm-Message-State: AODbwcA6n6nMCOZaOjnF/Z+WEg6SGLe75SAfO5dOtmvxTO6KUCNBDO7Y PazprmOYmH7RW4yD X-Received: by 10.99.186.91 with SMTP id l27mr51102983pgu.87.1497233894144; Sun, 11 Jun 2017 19:18:14 -0700 (PDT) Received: from localhost.localdomain (118-163-176-124.HINET-IP.hinet.net. [118.163.176.124]) by smtp.gmail.com with ESMTPSA id y28sm16305915pfd.32.2017.06.11.19.18.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Jun 2017 19:18:13 -0700 (PDT) From: Jun Nie To: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, olivier.martin@arm.com, haojian.zhuang@linaro.org, edk2-devel@lists.01.org Cc: shawn.guo@linaro.org, jason.liu@linaro.org, Jun Nie Date: Mon, 12 Jun 2017 10:18:05 +0800 Message-Id: <1497233885-11082-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [PATCH v2] EmbeddedPkg/MmcDxe: Add non-DDR timing mode support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2017 02:17:01 -0000 Only DDR mode is support for 8bit mode currently. Add non-DDR case when configuring ECSD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 574a77e..4ce0ddd 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -254,7 +254,7 @@ InitializeEmmcDevice ( EFI_MMC_HOST_PROTOCOL *Host; EFI_STATUS Status = EFI_SUCCESS; ECSD *ECSDData; - UINT32 BusClockFreq, Idx; + UINT32 BusClockFreq, Idx, BusMode; UINT32 TimingMode[4] = {EMMCHS52DDR1V2, EMMCHS52DDR1V8, EMMCHS52, EMMCHS26}; Host = MmcHostInstance->MmcHost; @@ -286,7 +286,19 @@ InitializeEmmcDevice ( } Status = Host->SetIos (Host, BusClockFreq, 8, TimingMode[Idx]); if (!EFI_ERROR (Status)) { - Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_DDR_8BIT); + switch (TimingMode[Idx]) { + case EMMCHS52DDR1V2: + case EMMCHS52DDR1V8: + BusMode = EMMC_BUS_WIDTH_DDR_8BIT; + break; + case EMMCHS52: + case EMMCHS26: + BusMode = EMMC_BUS_WIDTH_8BIT; + break; + default: + return EFI_UNSUPPORTED; + } + Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, BusMode); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "InitializeEmmcDevice(): Failed to set EXTCSD bus width, Status:%r\n", Status)); } -- 1.9.1