From patchwork Wed Apr 30 08:45:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Qiang X-Patchwork-Id: 344068 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6E1A21400AC for ; Wed, 30 Apr 2014 18:48:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 659A94B9C1; Wed, 30 Apr 2014 10:48:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1DwdlKs4se85; Wed, 30 Apr 2014 10:48:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FFED4B9D5; Wed, 30 Apr 2014 10:48:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B21D64B9BD for ; Wed, 30 Apr 2014 10:48:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nJvFfJufytgK for ; Wed, 30 Apr 2014 10:48:03 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0185.outbound.protection.outlook.com [207.46.163.185]) by theia.denx.de (Postfix) with ESMTPS id 8ED5E4B998 for ; Wed, 30 Apr 2014 10:47:58 +0200 (CEST) Received: from BY2PR03CA036.namprd03.prod.outlook.com (10.242.234.157) by BY2PR03MB348.namprd03.prod.outlook.com (10.141.139.22) with Microsoft SMTP Server (TLS) id 15.0.934.12; Wed, 30 Apr 2014 08:47:55 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:170) by BY2PR03CA036.outlook.office365.com (2a01:111:e400:2c2c::29) with Microsoft SMTP Server (TLS) id 15.0.929.12 via Frontend Transport; Wed, 30 Apr 2014 08:47:55 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.1) by BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Wed, 30 Apr 2014 08:47:55 +0000 Received: from titan.ap.freescale.net (udp143770uds.ap.freescale.net [10.192.208.233] (may be forged)) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s3U8lpQP022419; Wed, 30 Apr 2014 01:47:53 -0700 From: Zhao Qiang To: , Date: Wed, 30 Apr 2014 16:45:31 +0800 Message-ID: <1398847531-7779-1-git-send-email-B45475@freescale.com> X-Mailer: git-send-email 1.8.5 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.1; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(979002)(6009001)(428001)(189002)(199002)(31966008)(87286001)(93916002)(74502001)(62966002)(74662001)(92566001)(88136002)(92726001)(81342001)(6806004)(83072002)(87936001)(99396002)(46102001)(50466002)(77096999)(89996001)(85852003)(101416001)(81542001)(83322001)(19580405001)(80976001)(44976005)(80022001)(50986999)(48376002)(19580395003)(50226001)(77156001)(77982001)(76482001)(79102001)(36756003)(47776003)(20776003)(4396001)(42866002)(42262001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB348; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:gate-tx3.freescale.com; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Forefront-PRVS: 0197AFBD92 Received-SPF: None (: freescale.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.168.1) smtp.mailfrom=qiang.zhao@freescale.com; X-OriginatorOrg: freescale.com Cc: Zhao Qiang , R63061@freescale.com Subject: [U-Boot] [PATCH v4] qe: disable qe when qe-ucode fails to be uploaded for "deep sleep" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de when qe-ucode fails to be uploaded, "deep sleep" will hang. if there is no qe-ucode, disable qe module for platforms which support "deep sleep" Signed-off-by: Zhao Qiang --- Changes for v2: - add "#ifdef CONFIG_MPC85xx" Changes for v3: - modify commit msg Changes for v4: - modify "#ifdef CONFIG_MPC85xx" to "#ifdef CONFIG_DEEP_SLEEP" diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c index b1da75e..9c5fbd1 100644 --- a/drivers/qe/qe.c +++ b/drivers/qe/qe.c @@ -14,6 +14,8 @@ #include "asm/immap_qe.h" #include "qe.h" +#define MPC85xx_DEVDISR_QE_DISABLE 0x1 + qe_map_t *qe_immr = NULL; static qe_snum_t snums[QE_NUM_OF_SNUM]; @@ -317,7 +319,9 @@ int qe_upload_firmware(const struct qe_firmware *firmware) size_t calc_size = sizeof(struct qe_firmware); size_t length; const struct qe_header *hdr; - +#ifdef CONFIG_DEEP_SLEEP + ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); +#endif if (!firmware) { printf("Invalid address\n"); return -EINVAL; @@ -330,6 +334,9 @@ int qe_upload_firmware(const struct qe_firmware *firmware) if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') || (hdr->magic[2] != 'F')) { printf("Not a microcode\n"); +#ifdef CONFIG_DEEP_SLEEP + setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE); +#endif return -EPERM; }