Skip to content

Commit

Permalink
Merge branch 'for_linus' of master.kernel.org:/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/galak/powerpc

* 'for_linus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc:
  [PPC] Fix compilation and linking errors of mpc86xads build.
  [PPC] Fix compilation and linking errors of mpc885ads build.
  [PPC] MPC8272 ADS compile fixed, defconfig refreshed.
  • Loading branch information
Linus Torvalds committed Apr 12, 2007
2 parents 6a04de6 + 7a6491d commit 0ea41a2
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 148 deletions.
26 changes: 26 additions & 0 deletions arch/ppc/8xx_io/commproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@
#include <asm/tlbflush.h>
#include <asm/rheap.h>

#define immr_map(member) \
({ \
u32 offset = offsetof(immap_t, member); \
void *addr = ioremap (IMAP_ADDR + offset, \
sizeof( ((immap_t*)0)->member)); \
addr; \
})

#define immr_map_size(member, size) \
({ \
u32 offset = offsetof(immap_t, member); \
void *addr = ioremap (IMAP_ADDR + offset, size); \
addr; \
})

static void m8xx_cpm_dpinit(void);
static uint host_buffer; /* One page of host buffer */
static uint host_end; /* end + 1 */
Expand Down Expand Up @@ -364,11 +379,16 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
static rh_info_t cpm_dpmem_info;

#define CPM_DPMEM_ALIGNMENT 8
static u8* dpram_vbase;
static uint dpram_pbase;

void m8xx_cpm_dpinit(void)
{
spin_lock_init(&cpm_dpmem_lock);

dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;

/* Initialize the info header */
rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
sizeof(cpm_boot_dpmem_rh_block) /
Expand Down Expand Up @@ -442,3 +462,9 @@ void *cpm_dpram_addr(uint offset)
return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
}
EXPORT_SYMBOL(cpm_dpram_addr);

uint cpm_dpram_phys(u8* addr)
{
return (dpram_pbase + (uint)(addr - dpram_vbase));
}
EXPORT_SYMBOL(cpm_dpram_phys);
Loading

0 comments on commit 0ea41a2

Please sign in to comment.