From patchwork Thu May 21 15:55:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Liu X-Patchwork-Id: 475109 X-Patchwork-Delegate: sbabic@denx.de 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 72B9C14077A for ; Fri, 22 May 2015 03:30:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F9754B62B; Thu, 21 May 2015 19:30:18 +0200 (CEST) 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 y6E9wf9GVAsc; Thu, 21 May 2015 19:30:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 999224B617; Thu, 21 May 2015 19:30:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD50B4B617 for ; Thu, 21 May 2015 19:30:13 +0200 (CEST) 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 zXnugW_GG88r for ; Thu, 21 May 2015 19:30:13 +0200 (CEST) X-Greylist: delayed 4785 seconds by postgrey-1.34 at theia; Thu, 21 May 2015 19:30:09 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-bn1bon0142.outbound.protection.outlook.com [157.56.111.142]) by theia.denx.de (Postfix) with ESMTPS id 36D3E4B615 for ; Thu, 21 May 2015 19:30:09 +0200 (CEST) Received: from DM2PR0301MB1213.namprd03.prod.outlook.com (10.160.219.154) by DM2PR0301MB0687.namprd03.prod.outlook.com (10.160.96.25) with Microsoft SMTP Server (TLS) id 15.1.166.22; Thu, 21 May 2015 15:55:20 +0000 Received: from DM2PR0301MB1213.namprd03.prod.outlook.com ([10.160.219.154]) by DM2PR0301MB1213.namprd03.prod.outlook.com ([10.160.219.154]) with mapi id 15.01.0166.017; Thu, 21 May 2015 15:55:20 +0000 From: Liu Jason To: Tim Harvey , Stefano Babic Thread-Topic: [U-Boot] [PATCH] thermal: imx_thermal: increase critical temperature threshold Thread-Index: AQHQk9xy4FfYzGB7zUCJDNTmOJO7XZ2GlRH3 Date: Thu, 21 May 2015 15:55:19 +0000 Message-ID: <1432223716874.47933@freescale.com> References: <1432222806-15970-1-git-send-email-tharvey@gateworks.com> In-Reply-To: <1432222806-15970-1-git-send-email-tharvey@gateworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Hui.Liu@freescale.com; x-originating-ip: [192.88.170.35] x-microsoft-exchange-diagnostics: 1; DM2PR0301MB0687; 3:PK1fwLnNfqkOKqKfGwNukvO3Ar5LYaWf0rDy5xonr/BBj0p/isF7rs9uh7lnfWdd0858MXKlnBAd4Bj734Q7ojF/5T9+PGJl4djIRglM0Dw/NULLLprPwQ4lQ9CRwcD6tEVEVxvCp6WMhEj+8vL1lA==; 10:Zy/aQDy+X4MD+uA0xhVQ0oqqz0vmICGMR0QUgLLdbKSEfMUHVEVsX3Onh/6/8YUu7uVZJzPOgIhQ7NAme7qQDGjBnsW33ha3JphP+Ud3wqk=; 6:LTAdH0spYfJTB18eJG2yETFC5ZPcts+/A7IEVoEPd8eTz8TmxTfJC4Qe0N5MHh0i x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0687; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR0301MB0687; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0687; x-forefront-prvs: 0583A86C08 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(189002)(199003)(36756003)(107886002)(5001960100002)(117636001)(5001830100001)(5001860100001)(5001770100001)(189998001)(19580405001)(19580395003)(50986999)(76176999)(122556002)(54356999)(64706001)(106116001)(86362001)(2656002)(87936001)(66066001)(92566002)(68736005)(77096005)(97736004)(62966003)(81156007)(102836002)(77156002)(46102003)(99286002)(101416001)(2950100001)(2900100001)(4001540100001)(105586002)(40100003)(106356001)(586874002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0687; H:DM2PR0301MB1213.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: freescale.com does not designate permitted sender hosts) MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2015 15:55:19.0435 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0687 Cc: Fabio Estevam , Jon Nettleton , "u-boot@lists.denx.de" , Stefan Roese , Markus Niebel Subject: Re: [U-Boot] [PATCH] thermal: imx_thermal: increase critical temperature threshold X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index b5dab63..0d893c9 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -19,6 +19,8 @@ #include #include +/* board will busyloop until this many degrees C below CPU max temperature */ +#define TEMPERATURE_HOT_DELTA 5 /* CPU maxT - 5C */ #define FACTOR0 10000000 #define FACTOR1 15976 #define FACTOR2 4297157 @@ -34,7 +36,7 @@ struct thermal_data { unsigned int fuse; - int passive; + int critical; int minc; int maxc; }; @@ -129,9 +131,10 @@ int imx_thermal_get_temp(struct udevice *dev, int *temp) cpu_tmp = read_cpu_temperature(dev); while (cpu_tmp > priv->minc && cpu_tmp < priv->maxc) { - if (cpu_tmp >= priv->passive) { - printf("CPU Temperature is %d C, too hot to boot, waiting...\n", - cpu_tmp); + if (cpu_tmp >= priv->critical) { + printf("CPU Temperature (%dC) too close to max (%dC)", + cpu_tmp, priv->maxc); + puts(" waiting...\n"); udelay(5000000); cpu_tmp = read_cpu_temperature(dev); } else { @@ -164,9 +167,9 @@ static int imx_thermal_probe(struct udevice *dev) return -EPERM; } - /* set passive cooling temp to max - 20C */ + /* set critical cooling temp */ get_cpu_temp_grade(&priv->minc, &priv->maxc); - priv->passive = priv->maxc - 20; + priv->critical = priv->maxc - TEMPERATURE_HOT_DELTA; priv->fuse = fuse; enable_thermal_clk();