Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 079da354 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Linus Torvalds
Browse files

[PATCH] ppc32: 8xx commproc avoid direct pte manipulation, use dma coherent API instead



Touching the pte directly causes the 8Mbyte TLB entry to be invalidated.

This has been fixed in v2.4 for ages.

Signed-off-by: default avatarMarcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 204085c5
Loading
Loading
Loading
Loading
+1 −17
Original line number Original line Diff line number Diff line
@@ -39,8 +39,6 @@
#include <asm/tlbflush.h>
#include <asm/tlbflush.h>
#include <asm/rheap.h>
#include <asm/rheap.h>


extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);

static void m8xx_cpm_dpinit(void);
static void m8xx_cpm_dpinit(void);
static	uint	host_buffer;	/* One page of host buffer */
static	uint	host_buffer;	/* One page of host buffer */
static	uint	host_end;	/* end + 1 */
static	uint	host_end;	/* end + 1 */
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = {
	.end		= cpm_eoi,
	.end		= cpm_eoi,
};
};


extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);

void
void
m8xx_cpm_reset(uint bootpage)
m8xx_cpm_reset(void)
{
{
	volatile immap_t	 *imp;
	volatile immap_t	 *imp;
	volatile cpm8xx_t	*commproc;
	volatile cpm8xx_t	*commproc;
	pte_t *pte;


	imp = (immap_t *)IMAP_ADDR;
	imp = (immap_t *)IMAP_ADDR;
	commproc = (cpm8xx_t *)&imp->im_cpm;
	commproc = (cpm8xx_t *)&imp->im_cpm;
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage)
	/* Reclaim the DP memory for our use. */
	/* Reclaim the DP memory for our use. */
	m8xx_cpm_dpinit();
	m8xx_cpm_dpinit();


	/* get the PTE for the bootpage */
	if (!get_pteptr(&init_mm, bootpage, &pte))
	       panic("get_pteptr failed\n");
																							
	/* and make it uncachable */
	pte_val(*pte) |= _PAGE_NO_CACHE;
	_tlbie(bootpage);

	host_buffer = bootpage;
	host_end = host_buffer + PAGE_SIZE;

	/* Tell everyone where the comm processor resides.
	/* Tell everyone where the comm processor resides.
	*/
	*/
	cpmp = (cpm8xx_t *)commproc;
	cpmp = (cpm8xx_t *)commproc;
+2 −6
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)];
extern void m8xx_ide_init(void);
extern void m8xx_ide_init(void);


extern unsigned long find_available_memory(void);
extern unsigned long find_available_memory(void);
extern void m8xx_cpm_reset(uint cpm_page);
extern void m8xx_cpm_reset();
extern void m8xx_wdt_handler_install(bd_t *bp);
extern void m8xx_wdt_handler_install(bd_t *bp);
extern void rpxfb_alloc_pages(void);
extern void rpxfb_alloc_pages(void);
extern void cpm_interrupt_init(void);
extern void cpm_interrupt_init(void);
@@ -70,13 +70,9 @@ board_init(void)
void __init
void __init
m8xx_setup_arch(void)
m8xx_setup_arch(void)
{
{
	int	cpm_page;

	cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE);

	/* Reset the Communication Processor Module.
	/* Reset the Communication Processor Module.
	*/
	*/
	m8xx_cpm_reset(cpm_page);
	m8xx_cpm_reset();


#ifdef CONFIG_FB_RPX
#ifdef CONFIG_FB_RPX
	rpxfb_alloc_pages();
	rpxfb_alloc_pages();