From patchwork Sun Aug 5 10:45:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 953517 X-Patchwork-Delegate: jason.jin@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sysam.it Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41jy9b2PYtz9s3q for ; Sun, 5 Aug 2018 20:45:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CF29DC21C2F; Sun, 5 Aug 2018 10:45:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 97CF4C21C2F; Sun, 5 Aug 2018 10:45:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A0D97C21C2F; Sun, 5 Aug 2018 10:45:26 +0000 (UTC) Received: from sysam.it (ec2-18-194-220-216.eu-central-1.compute.amazonaws.com [18.194.220.216]) by lists.denx.de (Postfix) with ESMTP id EDC58C21EBE for ; Sun, 5 Aug 2018 10:45:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sysam.it (Postfix) with ESMTP id E1AE221CAF; Sun, 5 Aug 2018 10:45:25 +0000 (UTC) Received: from sysam.it ([127.0.0.1]) by localhost (sysam.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WURIY9zyXQiF; Sun, 5 Aug 2018 10:45:25 +0000 (UTC) Received: from localhost.localdomain (host237-227-dynamic.44-79-r.retail.telecomitalia.it [79.44.227.237]) by sysam.it (Postfix) with ESMTPSA id 4648A21CAC; Sun, 5 Aug 2018 10:45:25 +0000 (UTC) From: Angelo Dureghello To: angelo@sysam.it Date: Sun, 5 Aug 2018 12:45:23 +0200 Message-Id: <20180805104523.20449-1-angelo@sysam.it> X-Mailer: git-send-email 2.18.0 Cc: u-boot@lists.denx.de, alison.wang@freescale.com Subject: [U-Boot] [PATCH] m68k: ColdFire mcf5441x, add eSDHC support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds mcf5441x eSDHC support for the mcf5441x family. Signed-off-by: Angelo Dureghello --- arch/m68k/cpu/mcf5445x/cpu_init.c | 10 ++++++++++ arch/m68k/cpu/mcf5445x/speed.c | 2 ++ arch/m68k/include/asm/global_data.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/arch/m68k/cpu/mcf5445x/cpu_init.c b/arch/m68k/cpu/mcf5445x/cpu_init.c index 0b86020204..7632d9262c 100644 --- a/arch/m68k/cpu/mcf5445x/cpu_init.c +++ b/arch/m68k/cpu/mcf5445x/cpu_init.c @@ -173,6 +173,15 @@ void cpu_init_f(void) /* Lowest slew rate for UART0,1,2 */ out_8(&gpio->srcr_uart, 0x00); + +#ifdef CONFIG_FSL_ESDHC + /* eSDHC pin as faster speed */ + out_8(&gpio->srcr_sdhc, 0x03); + + /* All esdhc pins as SD */ + out_8(&gpio->par_sdhch, 0xff); + out_8(&gpio->par_sdhcl, 0xff); +#endif #endif /* CONFIG_MCF5441x */ #ifdef CONFIG_MCF5445x @@ -534,4 +543,5 @@ void cfspi_release_bus(uint bus, uint cs) clrbits_8(&gpio->par_dspiow, GPIO_PAR_DSPIOW_DSPI0PSC1); #endif } + #endif diff --git a/arch/m68k/cpu/mcf5445x/speed.c b/arch/m68k/cpu/mcf5445x/speed.c index 5214730a0f..e15e32ebde 100644 --- a/arch/m68k/cpu/mcf5445x/speed.c +++ b/arch/m68k/cpu/mcf5445x/speed.c @@ -120,6 +120,8 @@ void setup_5441x_clocks(void) temp = ((pdr & PLL_DR_OUTDIV2_BITS) >> 5) + 1; gd->bus_clk = vco / temp; /* bus clock */ + temp = ((pdr & PLL_DR_OUTDIV3_BITS) >> 10) + 1; + gd->arch.sdhc_clk = vco / temp; } #endif diff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h index aa0be8191a..188055e9d3 100644 --- a/arch/m68k/include/asm/global_data.h +++ b/arch/m68k/include/asm/global_data.h @@ -18,6 +18,9 @@ struct arch_global_data { unsigned long vco_clk; unsigned long flb_clk; #endif +#ifdef CONFIG_MCF5441x + unsigned long sdhc_clk; +#endif }; #include