public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
	Kumar Gala <galak@kernel•crashing.org>,
	Linus <torvalds@linux-foundation•org>
Subject: linux-next: manual merge of the 52xx-and-virtex tree with the  tree
Date: Tue, 15 Dec 2009 10:31:17 +1100	[thread overview]
Message-ID: <20091215103117.dab34f72.sfr@canb.auug.org.au> (raw)

Hi Grant,

Today's linux-next merge of the 52xx-and-virtex tree got a conflict in
arch/powerpc/mm/fsl_booke_mmu.c between commit
8b27f0b61db57f5555fc2d3fc95c3ea9fd1a9d6c ("powerpc/fsl-booke: Rework TLB
CAM code") from Linus' tree and commit
ae4cec4736969ec2196a6bbce4ab263ff7cb7eef ("powerpc: fix up for
mmu_mapin_ram api change") from the 52xx-and-virtex tree.

I fixed it up (see below) and can carry the fix for a while.  Grant, you
can (of course) fix this by merging with Linus' tree.  (Or Linus, if you
merge Grant's tree, I think this fixup is correct).

-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

diff --cc arch/powerpc/mm/fsl_booke_mmu.c
index fcfcb6e,6da4b90..0000000
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@@ -172,44 -148,27 +172,44 @@@ static void settlbcam(int index, unsign
  	loadcam_entry(index);
  }
  
 -void invalidate_tlbcam_entry(int index)
 -{
 -	TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index);
 -	TLBCAM[index].MAS1 = ~MAS1_VALID;
 -
 -	loadcam_entry(index);
 -}
 -
 -unsigned long __init mmu_mapin_ram(unsigned long top)
 +unsigned long map_mem_in_cams(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;
 +	unsigned long max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xf;
 +
 +	/* Convert (4^max) kB to (2^max) bytes */
 +	max_cam = max_cam * 2 + 10;
  
 -	while (tlbcam_index < ARRAY_SIZE(cam) && cam[tlbcam_index]) {
 -		settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
 -		virt += cam[tlbcam_index];
 -		phys += cam[tlbcam_index];
 -		tlbcam_index++;
 +	/* Calculate CAM values */
 +	for (i = 0; ram && i < max_cam_idx; i++) {
 +		unsigned int camsize = __ilog2(ram) & ~1U;
 +		unsigned int align = __ffs(virt | phys) & ~1U;
 +		unsigned long cam_sz;
 +
 +		if (camsize > align)
 +			camsize = align;
 +		if (camsize > max_cam)
 +			camsize = max_cam;
 +
 +		cam_sz = 1UL << camsize;
 +		settlbcam(i, virt, phys, cam_sz, PAGE_KERNEL_X, 0);
 +
 +		ram -= cam_sz;
 +		amount_mapped += cam_sz;
 +		virt += cam_sz;
 +		phys += cam_sz;
  	}
 +	tlbcam_index = i;
 +
 +	return amount_mapped;
 +}
  
- unsigned long __init mmu_mapin_ram(void)
 -	return virt - PAGE_OFFSET;
++unsigned long __init mmu_mapin_ram(unsigned long top)
 +{
 +	return tlbcam_addrs[tlbcam_index - 1].limit - PAGE_OFFSET + 1;
  }
  
  /*

             reply	other threads:[~2009-12-14 23:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 23:31 Stephen Rothwell [this message]
2009-12-15 18:38 ` linux-next: manual merge of the 52xx-and-virtex tree with the tree Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091215103117.dab34f72.sfr@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=galak@kernel$(echo .)crashing.org \
    --cc=grant.likely@secretlab$(echo .)ca \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=torvalds@linux-foundation$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox