git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
ppc
/
syslib
/
cpm2_common.c
diff --git
a/arch/ppc/syslib/cpm2_common.c
b/arch/ppc/syslib/cpm2_common.c
index
5ca6d4c
..
cbac44b
100644
(file)
--- a/
arch/ppc/syslib/cpm2_common.c
+++ b/
arch/ppc/syslib/cpm2_common.c
@@
-21,13
+21,12
@@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
-#include <linux/bootmem.h>
#include <linux/module.h>
#include <linux/module.h>
+#include <asm/io.h>
#include <asm/irq.h>
#include <asm/mpc8260.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/mpc8260.h>
#include <asm/page.h>
#include <asm/pgtable.h>
-#include <asm/immap_cpm2.h>
#include <asm/cpm2.h>
#include <asm/rheap.h>
#include <asm/cpm2.h>
#include <asm/rheap.h>
@@
-39,10
+38,14
@@
cpm_cpm2_t *cpmp; /* Pointer to comm processor space */
*/
cpm2_map_t *cpm2_immr;
*/
cpm2_map_t *cpm2_immr;
+#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
+ of space for CPM as it is larger
+ than on PQ2 */
+
void
cpm2_reset(void)
{
void
cpm2_reset(void)
{
- cpm2_immr = (cpm2_map_t *)
CPM_MAP_ADDR
;
+ cpm2_immr = (cpm2_map_t *)
ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE)
;
/* Reclaim the DP memory for our use.
*/
/* Reclaim the DP memory for our use.
*/
@@
-70,7
+73,7
@@
cpm2_reset(void)
* oversampled clock.
*/
void
* oversampled clock.
*/
void
-cpm
2
_setbrg(uint brg, uint rate)
+cpm_setbrg(uint brg, uint rate)
{
volatile uint *bp;
{
volatile uint *bp;
@@
-119,8
+122,6
@@
static rh_info_t cpm_dpmem_info;
static void cpm2_dpinit(void)
{
static void cpm2_dpinit(void)
{
- void *dprambase = &((cpm2_map_t *)CPM_MAP_ADDR)->im_dprambase;
-
spin_lock_init(&cpm_dpmem_lock);
/* initialize the info header */
spin_lock_init(&cpm_dpmem_lock);
/* initialize the info header */
@@
-135,15
+136,13
@@
static void cpm2_dpinit(void)
* varies with the processor and the microcode patches activated.
* But the following should be at least safe.
*/
* varies with the processor and the microcode patches activated.
* But the following should be at least safe.
*/
- rh_attach_region(&cpm_dpmem_info,
dprambase +
CPM_DATAONLY_BASE,
+ rh_attach_region(&cpm_dpmem_info,
(void *)
CPM_DATAONLY_BASE,
CPM_DATAONLY_SIZE);
}
CPM_DATAONLY_SIZE);
}
-/* This function used to return an index into the DPRAM area.
- * Now it returns the actuall physical address of that area.
- * use cpm2_dpram_offset() to get the index
+/* This function returns an index into the DPRAM area.
*/
*/
-
void *cpm2
_dpalloc(uint size, uint align)
+
uint cpm
_dpalloc(uint size, uint align)
{
void *start;
unsigned long flags;
{
void *start;
unsigned long flags;
@@
-153,53
+152,46
@@
void *cpm2_dpalloc(uint size, uint align)
start = rh_alloc(&cpm_dpmem_info, size, "commproc");
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
start = rh_alloc(&cpm_dpmem_info, size, "commproc");
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
- return start;
+ return
(uint)
start;
}
}
-EXPORT_SYMBOL(cpm
2
_dpalloc);
+EXPORT_SYMBOL(cpm_dpalloc);
-int cpm
2_dpfree(void *addr
)
+int cpm
_dpfree(uint offset
)
{
int ret;
unsigned long flags;
spin_lock_irqsave(&cpm_dpmem_lock, flags);
{
int ret;
unsigned long flags;
spin_lock_irqsave(&cpm_dpmem_lock, flags);
- ret = rh_free(&cpm_dpmem_info,
addr
);
+ ret = rh_free(&cpm_dpmem_info,
(void *)offset
);
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
return ret;
}
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
return ret;
}
-EXPORT_SYMBOL(cpm
2
_dpfree);
+EXPORT_SYMBOL(cpm_dpfree);
/* not sure if this is ever needed */
/* not sure if this is ever needed */
-
void *cpm2_dpalloc_fixed(void *addr
, uint size, uint align)
+
uint cpm_dpalloc_fixed(uint offset
, uint size, uint align)
{
void *start;
unsigned long flags;
spin_lock_irqsave(&cpm_dpmem_lock, flags);
cpm_dpmem_info.alignment = align;
{
void *start;
unsigned long flags;
spin_lock_irqsave(&cpm_dpmem_lock, flags);
cpm_dpmem_info.alignment = align;
- start = rh_alloc_fixed(&cpm_dpmem_info,
addr
, size, "commproc");
+ start = rh_alloc_fixed(&cpm_dpmem_info,
(void *)offset
, size, "commproc");
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
- return start;
+ return
(uint)
start;
}
}
-EXPORT_SYMBOL(cpm
2
_dpalloc_fixed);
+EXPORT_SYMBOL(cpm_dpalloc_fixed);
-void cpm
2
_dpdump(void)
+void cpm_dpdump(void)
{
rh_dump(&cpm_dpmem_info);
}
{
rh_dump(&cpm_dpmem_info);
}
-EXPORT_SYMBOL(cpm2_dpdump);
-
-uint cpm2_dpram_offset(void *addr)
-{
- return (uint)((u_char *)addr -
- ((uint)((cpm2_map_t *)CPM_MAP_ADDR)->im_dprambase));
-}
-EXPORT_SYMBOL(cpm2_dpram_offset);
+EXPORT_SYMBOL(cpm_dpdump);
-void *cpm
2_dpram_addr(
int offset)
+void *cpm
_dpram_addr(u
int offset)
{
{
- return (void *)&
((cpm2_map_t *)CPM_MAP_ADDR)
->im_dprambase[offset];
+ return (void *)&
cpm2_immr
->im_dprambase[offset];
}
}
-EXPORT_SYMBOL(cpm
2
_dpram_addr);
+EXPORT_SYMBOL(cpm_dpram_addr);