Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754765AbXLFMnh (ORCPT ); Thu, 6 Dec 2007 07:43:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754443AbXLFMmb (ORCPT ); Thu, 6 Dec 2007 07:42:31 -0500 Received: from miranda.se.axis.com ([193.13.178.8]:53681 "EHLO miranda.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbXLFMlv (ORCPT ); Thu, 6 Dec 2007 07:41:51 -0500 From: Jesper Nilsson Message-Id: <77d5816c68f53fb45d3da63f62480bad15500efd.1196848533.git.jesper.nilsson@axis.com> In-Reply-To: References: To: Andrew Morton , Mikael Starvik , Jesper Nilsson , linux-kernel@vger.kernel.org Date: Thu, 29 Nov 2007 17:24:10 +0100 Subject: [PATCH 07/47] Add L2 cache initialization code. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1394 Lines: 50 Signed-off-by: Jesper Nilsson --- arch/cris/arch-v32/mm/l2cache.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) create mode 100644 arch/cris/arch-v32/mm/l2cache.c diff --git a/arch/cris/arch-v32/mm/l2cache.c b/arch/cris/arch-v32/mm/l2cache.c new file mode 100644 index 0000000..332ff10 --- /dev/null +++ b/arch/cris/arch-v32/mm/l2cache.c @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define L2CACHE_SIZE 64 + +int __init l2cache_init(void) +{ + reg_l2cache_rw_ctrl ctrl = {0}; + reg_l2cache_rw_cfg cfg = {.en = regk_l2cache_yes}; + + ctrl.csize = L2CACHE_SIZE; + ctrl.cbase = L2CACHE_SIZE / 4 + (L2CACHE_SIZE % 4 ? 1 : 0); + REG_WR(l2cache, regi_l2cache, rw_ctrl, ctrl); + + /* Flush the tag memory */ + memset((void *)(MEM_INTMEM_START | MEM_NON_CACHEABLE), 0, 2*1024); + + /* Enable the cache */ + REG_WR(l2cache, regi_l2cache, rw_cfg, cfg); + + return 0; +} + -- 1.5.3.6.970.gd25430 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/