From patchwork Tue Dec 24 07:12:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 304903 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id AFBED2C09E4 for ; Tue, 24 Dec 2013 18:16:55 +1100 (EST) Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 962872C02B0 for ; Tue, 24 Dec 2013 18:13:43 +1100 (EST) Received: by mail-pd0-f179.google.com with SMTP id r10so6051980pdi.10 for ; Mon, 23 Dec 2013 23:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9flP6uhciEssCdmNqCMbf8ScR+4OpiFa+nKmoy28dzA=; b=aVkLQyaM4deKOFVZvPQgzT73D9pQ1xiSRMn2MheLK2CbcRIwo0WLYkNB1+aNp1h+dg g2C3m+lZ8LAjNDB54Xp7G62nNMal47XgZpCEmL0R/UJVFsed4V0+nWlU6kOxsewzVL33 vg3a5jtgZ/RmLzI7hVl4j4mAJSfewgWmi/MNsIPulf/OCJhOFFt5ML7/ZsPtXQe/QI5M GFUDLLB66wPRzVaAQ8NbnaY804cSHvXs5Rb0yybdSKnc9Q11akErFHJuAV9N5PROa3Kj 7Om0jyxyJ5hpExdng5bUMonxBAunKMu25xX0vexD5anYRzESxWm6DCF1Fc1N+qTRQJVG fS+w== X-Received: by 10.68.162.131 with SMTP id ya3mr30668334pbb.102.1387869220799; Mon, 23 Dec 2013 23:13:40 -0800 (PST) Received: from pek-khao-d1.corp.ad.wrs.com ([1.202.252.122]) by mx.google.com with ESMTPSA id y9sm51408806pas.10.2013.12.23.23.13.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Dec 2013 23:13:40 -0800 (PST) From: Kevin Hao To: Scott Wood Subject: [PATCH v4 07/10] powerpc/fsl_booke: introduce map_mem_in_cams_addr Date: Tue, 24 Dec 2013 15:12:09 +0800 Message-Id: <1387869132-12650-8-git-send-email-haokexin@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387869132-12650-1-git-send-email-haokexin@gmail.com> References: <1387869132-12650-1-git-send-email-haokexin@gmail.com> Cc: linuxppc X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Introduce this function so we can set both the physical and virtual address for the map in cams. This will be used by the relocation code. Signed-off-by: Kevin Hao --- v4: A new patch in v4. arch/powerpc/mm/fsl_booke_mmu.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index 1d54f6d35e71..ca956c83e3a2 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c @@ -171,11 +171,10 @@ unsigned long calc_cam_sz(unsigned long ram, unsigned long virt, return 1UL << camsize; } -unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) +static unsigned long map_mem_in_cams_addr(phys_addr_t phys, unsigned long virt, + unsigned long ram, int max_cam_idx) { int i; - unsigned long virt = PAGE_OFFSET; - phys_addr_t phys = memstart_addr; unsigned long amount_mapped = 0; /* Calculate CAM values */ @@ -195,6 +194,14 @@ unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) return amount_mapped; } +unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) +{ + unsigned long virt = PAGE_OFFSET; + phys_addr_t phys = memstart_addr; + + return map_mem_in_cams_addr(phys, virt, ram, max_cam_idx); +} + #ifdef CONFIG_PPC32 #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)