Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34051
b: refs/heads/master
c: c61c27d
h: refs/heads/master
i:
  34049: a21dc01
  34047: 2c5286a
v: v3
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed Jul 31, 2006
1 parent 66cd0dd commit 3c09a31
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8efca49329a50710d656a8bb78d6f0f0e2f48a26
refs/heads/master: c61c27d58af61e5b78257019b173732c29ce0c64
8 changes: 3 additions & 5 deletions trunk/arch/powerpc/platforms/cell/cbe_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void __init cbe_regs_init(void)
struct cbe_regs_map *map = &cbe_regs_maps[cbe_regs_map_count++];

/* That hack must die die die ! */
struct address_prop {
const struct address_prop {
unsigned long address;
unsigned int len;
} __attribute__((packed)) *prop;
Expand All @@ -114,13 +114,11 @@ void __init cbe_regs_init(void)
if (cbe_thread_map[i].cpu_node == cpu)
cbe_thread_map[i].regs = map;

prop = (struct address_prop *)get_property(cpu, "pervasive",
NULL);
prop = get_property(cpu, "pervasive", NULL);
if (prop != NULL)
map->pmd_regs = ioremap(prop->address, prop->len);

prop = (struct address_prop *)get_property(cpu, "iic",
NULL);
prop = get_property(cpu, "iic", NULL);
if (prop != NULL)
map->iic_regs = ioremap(prop->address, prop->len);
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/powerpc/platforms/cell/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,14 @@ static int __init setup_iic(void)
struct resource r0, r1;
struct irq_host *host;
int found = 0;
u32 *np;
const u32 *np;

for (dn = NULL;
(dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) {
if (!device_is_compatible(dn,
"IBM,CBEA-Internal-Interrupt-Controller"))
continue;
np = (u32 *)get_property(dn, "ibm,interrupt-server-ranges",
NULL);
np = get_property(dn, "ibm,interrupt-server-ranges", NULL);
if (np == NULL) {
printk(KERN_WARNING "IIC: CPU association not found\n");
of_node_put(dn);
Expand Down
22 changes: 12 additions & 10 deletions trunk/arch/powerpc/platforms/cell/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,16 @@ static void cell_do_map_iommu(struct cell_iommu *iommu,

static void iommu_devnode_setup(struct device_node *d)
{
unsigned int *ioid;
unsigned long *dma_window, map_start, map_size, token;
const unsigned int *ioid;
unsigned long map_start, map_size, token;
const unsigned long *dma_window;
struct cell_iommu *iommu;

ioid = (unsigned int *)get_property(d, "ioid", NULL);
ioid = get_property(d, "ioid", NULL);
if (!ioid)
pr_debug("No ioid entry found !\n");

dma_window = (unsigned long *)get_property(d, "ibm,dma-window", NULL);
dma_window = get_property(d, "ibm,dma-window", NULL);
if (!dma_window)
pr_debug("No ibm,dma-window entry found !\n");

Expand Down Expand Up @@ -371,8 +372,9 @@ static int cell_map_iommu_hardcoded(int num_nodes)

static int cell_map_iommu(void)
{
unsigned int num_nodes = 0, *node_id;
unsigned long *base, *mmio_base;
unsigned int num_nodes = 0;
const unsigned int *node_id;
const unsigned long *base, *mmio_base;
struct device_node *dn;
struct cell_iommu *iommu = NULL;

Expand All @@ -381,7 +383,7 @@ static int cell_map_iommu(void)
for(dn = of_find_node_by_type(NULL, "cpu");
dn;
dn = of_find_node_by_type(dn, "cpu")) {
node_id = (unsigned int *)get_property(dn, "node-id", NULL);
node_id = get_property(dn, "node-id", NULL);

if (num_nodes < *node_id)
num_nodes = *node_id;
Expand All @@ -396,9 +398,9 @@ static int cell_map_iommu(void)
dn;
dn = of_find_node_by_type(dn, "cpu")) {

node_id = (unsigned int *)get_property(dn, "node-id", NULL);
base = (unsigned long *)get_property(dn, "ioc-cache", NULL);
mmio_base = (unsigned long *)get_property(dn, "ioc-translation", NULL);
node_id = get_property(dn, "node-id", NULL);
base = get_property(dn, "ioc-cache", NULL);
mmio_base = get_property(dn, "ioc-translation", NULL);

if (!base || !mmio_base || !node_id)
return cell_map_iommu_hardcoded(num_nodes);
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/powerpc/platforms/cell/spider-pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc,
static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
{
unsigned int virq;
u32 *imap, *tmp;
const u32 *imap, *tmp;
int imaplen, intsize, unit;
struct device_node *iic;
struct irq_host *iic_host;
Expand All @@ -248,25 +248,25 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
#endif

/* Now do the horrible hacks */
tmp = (u32 *)get_property(pic->of_node, "#interrupt-cells", NULL);
tmp = get_property(pic->of_node, "#interrupt-cells", NULL);
if (tmp == NULL)
return NO_IRQ;
intsize = *tmp;
imap = (u32 *)get_property(pic->of_node, "interrupt-map", &imaplen);
imap = get_property(pic->of_node, "interrupt-map", &imaplen);
if (imap == NULL || imaplen < (intsize + 1))
return NO_IRQ;
iic = of_find_node_by_phandle(imap[intsize]);
if (iic == NULL)
return NO_IRQ;
imap += intsize + 1;
tmp = (u32 *)get_property(iic, "#interrupt-cells", NULL);
tmp = get_property(iic, "#interrupt-cells", NULL);
if (tmp == NULL)
return NO_IRQ;
intsize = *tmp;
/* Assume unit is last entry of interrupt specifier */
unit = imap[intsize - 1];
/* Ok, we have a unit, now let's try to get the node */
tmp = (u32 *)get_property(iic, "ibm,interrupt-server-ranges", NULL);
tmp = get_property(iic, "ibm,interrupt-server-ranges", NULL);
if (tmp == NULL) {
of_node_put(iic);
return NO_IRQ;
Expand Down
18 changes: 9 additions & 9 deletions trunk/arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ int spu_irq_class_1_bottom(struct spu *spu)

static int __init find_spu_node_id(struct device_node *spe)
{
unsigned int *id;
const unsigned int *id;
struct device_node *cpu;
cpu = spe->parent->parent;
id = (unsigned int *)get_property(cpu, "node-id", NULL);
id = get_property(cpu, "node-id", NULL);
return id ? *id : 0;
}

Expand All @@ -500,7 +500,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
{
static DEFINE_MUTEX(add_spumem_mutex);

struct address_prop {
const struct address_prop {
unsigned long address;
unsigned int len;
} __attribute__((packed)) *p;
Expand All @@ -511,7 +511,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
struct zone *zone;
int ret;

p = (void*)get_property(spe, prop, &proplen);
p = get_property(spe, prop, &proplen);
WARN_ON(proplen != sizeof (*p));

start_pfn = p->address >> PAGE_SHIFT;
Expand All @@ -531,12 +531,12 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
static void __iomem * __init map_spe_prop(struct spu *spu,
struct device_node *n, const char *name)
{
struct address_prop {
const struct address_prop {
unsigned long address;
unsigned int len;
} __attribute__((packed)) *prop;

void *p;
const void *p;
int proplen;
void* ret = NULL;
int err = 0;
Expand Down Expand Up @@ -570,14 +570,14 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
{
struct irq_host *host;
unsigned int isrc;
u32 *tmp;
const u32 *tmp;

host = iic_get_irq_host(spu->node);
if (host == NULL)
return -ENODEV;

/* Get the interrupt source from the device-tree */
tmp = (u32 *)get_property(np, "isrc", NULL);
tmp = get_property(np, "isrc", NULL);
if (!tmp)
return -ENODEV;
spu->isrc = isrc = tmp[0];
Expand All @@ -593,7 +593,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)

static int __init spu_map_device(struct spu *spu, struct device_node *node)
{
char *prop;
const char *prop;
int ret;

ret = -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-powerpc/spu.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct spu_context;
struct spu_runqueue;

struct spu {
char *name;
const char *name;
unsigned long local_store_phys;
u8 *local_store;
unsigned long problem_phys;
Expand Down

0 comments on commit 3c09a31

Please sign in to comment.