From patchwork Fri Oct 16 01:20:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 54136 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9G1MtuA011198 for ; Fri, 16 Oct 2009 01:25:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981AbZJPBZe (ORCPT ); Thu, 15 Oct 2009 21:25:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758267AbZJPBZe (ORCPT ); Thu, 15 Oct 2009 21:25:34 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]:54191 "EHLO mail-ew0-f208.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753981AbZJPBZd (ORCPT ); Thu, 15 Oct 2009 21:25:33 -0400 Received: by ewy4 with SMTP id 4so1160796ewy.37 for ; Thu, 15 Oct 2009 18:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=LMKw5UZcI5kE2sGU6xCvTVoKhwFQc1XFTVQyKxUGeeQ=; b=UGAEG7wFy71g8XBPNpEvx4naCp0MJNU4Ki5NHwXuQMnScnjP7x4YQz8+et28DPoC7a kC5SAFXqa/VOHit7lxiRhPDcaquSgGTFHEfYwbIjQSsiUONOIbtbzJN9sV5W7/4vfh54 fn6L43xY1jlQvCN8Z3lUksC4z/lF5kOkctd9Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=Hyyi521TLpZMPEBJJiy4kOahLrZKsnqx3356bKPVmhTSJONm2Rg2zlxkcEqGWpP9SX PTXWFrA4BjQFFGjciv/79d2XHr5MfamyiQpWx/uaTDEcn4yJl3ong3jfponw8+qr1gtX 4VU6/HQGyDXNlQbhjiS1WNC38wULbZoMWDoNc= Received: by 10.211.172.11 with SMTP id z11mr121915ebo.93.1255656296845; Thu, 15 Oct 2009 18:24:56 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 7sm3856061eyb.8.2009.10.15.18.24.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 18:24:55 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 16 Oct 2009 10:20:06 +0900 Message-Id: <20091016012006.20892.67821.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: disabled cache handling fix for sh4 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index a98c7d8..c1615d8 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c @@ -709,6 +709,7 @@ extern void __weak sh4__flush_region_init(void); */ void __init sh4_cache_init(void) { + unsigned int cache_enabled = !!(__raw_readl(CCR) & CCR_CACHE_ENABLE); unsigned int wt_enabled = !!(__raw_readl(CCR) & CCR_CACHE_WT); printk("PVR=%08x CVR=%08x PRR=%08x\n", @@ -716,6 +717,17 @@ void __init sh4_cache_init(void) ctrl_inl(CCN_CVR), ctrl_inl(CCN_PRR)); + /* disabled cache handling: + * + * __flush_dcache_segment_fn() implementations in this file make use + * of the movca instruction which bombs out if caches are disabled. + * + * no flushing is necessary in the disabled cache case so we can + * just keep the noop functions in local_flush_..() and __flush_..() + */ + if (!cache_enabled) + return; + if (wt_enabled) __flush_dcache_segment_fn = __flush_dcache_segment_writethrough; else {