Skip to content

Commit

Permalink
Merge branch 'dt' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ozbenh committed Nov 15, 2012
2 parents 11ee7e9 + f459d63 commit de1bb03
Show file tree
Hide file tree
Showing 25 changed files with 267 additions and 292 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-mxs/mach-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
macaddr[4] = (val >> 8) & 0xff;
macaddr[5] = (val >> 0) & 0xff;

prom_update_property(np, newmac);
of_update_property(np, newmac);
}
}

Expand Down
47 changes: 0 additions & 47 deletions arch/powerpc/include/asm/pSeries_reconfig.h

This file was deleted.

16 changes: 16 additions & 0 deletions arch/powerpc/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; }

extern void of_instantiate_rtc(void);

/* The of_drconf_cell struct defines the layout of the LMB array
* specified in the device tree property
* ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory
*/
struct of_drconf_cell {
u64 base_addr;
u32 drc_index;
u32 reserved;
u32 aa_index;
u32 flags;
};

#define DRCONF_MEM_ASSIGNED 0x00000008
#define DRCONF_MEM_AI_INVALID 0x00000040
#define DRCONF_MEM_RESERVED 0x00000080

/* These includes are put at the bottom because they may contain things
* that are overridden by this file. Ideally they shouldn't be included
* by this file, but there are a bunch of .c files that currently depend
Expand Down
5 changes: 5 additions & 0 deletions arch/powerpc/include/asm/rtas.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,13 @@ static inline int page_is_rtas_user_buf(unsigned long pfn)
return 1;
return 0;
}

/* Not the best place to put pSeries_coalesce_init, will be fixed when we
* move some of the rtas suspend-me stuff to pseries */
extern void pSeries_coalesce_init(void);
#else
static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}
static inline void pSeries_coalesce_init(void) { }
#endif

extern int call_rtas(const char *, int, int, unsigned long *, ...);
Expand Down
14 changes: 7 additions & 7 deletions arch/powerpc/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node)
* be sure what's in them, so remove them. */
prop = of_find_property(node, "linux,crashkernel-base", NULL);
if (prop)
prom_remove_property(node, prop);
of_remove_property(node, prop);

prop = of_find_property(node, "linux,crashkernel-size", NULL);
if (prop)
prom_remove_property(node, prop);
of_remove_property(node, prop);

if (crashk_res.start != 0) {
prom_add_property(node, &crashk_base_prop);
of_add_property(node, &crashk_base_prop);
crashk_size = resource_size(&crashk_res);
prom_add_property(node, &crashk_size_prop);
of_add_property(node, &crashk_size_prop);
}

/*
* memory_limit is required by the kexec-tools to limit the
* crash regions to the actual memory used.
*/
prom_update_property(node, &memory_limit_prop);
of_update_property(node, &memory_limit_prop);
}

static int __init kexec_setup(void)
Expand All @@ -249,11 +249,11 @@ static int __init kexec_setup(void)
/* remove any stale properties so ours can be found */
prop = of_find_property(node, kernel_end_prop.name, NULL);
if (prop)
prom_remove_property(node, prop);
of_remove_property(node, prop);

/* information needed by userspace when using default_machine_kexec */
kernel_end = __pa(_end);
prom_add_property(node, &kernel_end_prop);
of_add_property(node, &kernel_end_prop);

export_crashk_values(node);

Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,14 @@ static int __init export_htab_values(void)
/* remove any stale propertys so ours can be found */
prop = of_find_property(node, htab_base_prop.name, NULL);
if (prop)
prom_remove_property(node, prop);
of_remove_property(node, prop);
prop = of_find_property(node, htab_size_prop.name, NULL);
if (prop)
prom_remove_property(node, prop);
of_remove_property(node, prop);

htab_base = __pa(htab_address);
prom_add_property(node, &htab_base_prop);
prom_add_property(node, &htab_size_prop);
of_add_property(node, &htab_base_prop);
of_add_property(node, &htab_size_prop);

of_node_put(node);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pci_create_OF_bus_map(void)
of_prop->name = "pci-OF-bus-map";
of_prop->length = 256;
of_prop->value = &of_prop[1];
prom_add_property(dn, of_prop);
of_add_property(dn, of_prop);
of_node_put(dn);
}
}
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/debugfs.h>
#include <linux/irq.h>
#include <linux/memblock.h>
#include <linux/of.h>

#include <asm/prom.h>
#include <asm/rtas.h>
Expand All @@ -49,7 +50,6 @@
#include <asm/btext.h>
#include <asm/sections.h>
#include <asm/machdep.h>
#include <asm/pSeries_reconfig.h>
#include <asm/pci-bridge.h>
#include <asm/kexec.h>
#include <asm/opal.h>
Expand Down Expand Up @@ -803,7 +803,7 @@ static int prom_reconfig_notifier(struct notifier_block *nb,
int err;

switch (action) {
case PSERIES_RECONFIG_ADD:
case OF_RECONFIG_ATTACH_NODE:
err = of_finish_dynamic_node(node);
if (err < 0)
printk(KERN_ERR "finish_node returned %d\n", err);
Expand All @@ -822,7 +822,7 @@ static struct notifier_block prom_reconfig_nb = {

static int __init prom_reconfig_setup(void)
{
return pSeries_reconfig_notifier_register(&prom_reconfig_nb);
return of_reconfig_notifier_register(&prom_reconfig_nb);
}
__initcall(prom_reconfig_setup);
#endif
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <asm/time.h>
#include <asm/mmu.h>
#include <asm/topology.h>
#include <asm/pSeries_reconfig.h>

struct rtas_t rtas = {
.lock = __ARCH_SPIN_LOCK_UNLOCKED
Expand Down
12 changes: 0 additions & 12 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,6 @@ static unsigned long read_n_cells(int n, const unsigned int **buf)
return result;
}

struct of_drconf_cell {
u64 base_addr;
u32 drc_index;
u32 reserved;
u32 aa_index;
u32 flags;
};

#define DRCONF_MEM_ASSIGNED 0x00000008
#define DRCONF_MEM_AI_INVALID 0x00000040
#define DRCONF_MEM_RESERVED 0x00000080

/*
* Read the next memblock list entry from the ibm,dynamic-memory property
* and return the information in the provided of_drconf_cell structure.
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/85xx/p1022_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void)
};

/*
* prom_update_property() is called before
* of_update_property() is called before
* kmalloc() is available, so the 'new' object
* should be allocated in the global area.
* The easiest way is to do that is to
Expand All @@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void)
*/
pr_info("p1022ds: disabling %s node",
np2->full_name);
prom_update_property(np2, &nor_status);
of_update_property(np2, &nor_status);
of_node_put(np2);
}

Expand All @@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void)

pr_info("p1022ds: disabling %s node",
np2->full_name);
prom_update_property(np2, &nand_status);
of_update_property(np2, &nand_status);
of_node_put(np2);
}

Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/ps3/os-area.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node,

if (tmp) {
pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name);
prom_remove_property(node, tmp);
of_remove_property(node, tmp);
}

result = prom_add_property(node, prop);
result = of_add_property(node, prop);

if (result)
pr_debug("%s:%d prom_set_property failed\n", __func__,
pr_debug("%s:%d of_set_property failed\n", __func__,
__LINE__);
}

Expand Down
34 changes: 6 additions & 28 deletions arch/powerpc/platforms/pseries/dlpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/notifier.h>
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/cpu.h>
#include <linux/slab.h>
#include <linux/of.h>
#include "offline_states.h"

#include <asm/prom.h>
#include <asm/machdep.h>
#include <asm/uaccess.h>
#include <asm/rtas.h>
#include <asm/pSeries_reconfig.h>

struct cc_workarea {
u32 drc_index;
Expand Down Expand Up @@ -255,9 +254,6 @@ static struct device_node *derive_parent(const char *path)

int dlpar_attach_node(struct device_node *dn)
{
#ifdef CONFIG_PROC_DEVICETREE
struct proc_dir_entry *ent;
#endif
int rc;

of_node_set_flag(dn, OF_DYNAMIC);
Expand All @@ -266,44 +262,26 @@ int dlpar_attach_node(struct device_node *dn)
if (!dn->parent)
return -ENOMEM;

rc = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, dn);
rc = of_attach_node(dn);
if (rc) {
printk(KERN_ERR "Failed to add device node %s\n",
dn->full_name);
return rc;
}

of_attach_node(dn);

#ifdef CONFIG_PROC_DEVICETREE
ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde);
if (ent)
proc_device_tree_add_node(dn, ent);
#endif

of_node_put(dn->parent);
return 0;
}

int dlpar_detach_node(struct device_node *dn)
{
#ifdef CONFIG_PROC_DEVICETREE
struct device_node *parent = dn->parent;
struct property *prop = dn->properties;

while (prop) {
remove_proc_entry(prop->name, dn->pde);
prop = prop->next;
}
int rc;

if (dn->pde)
remove_proc_entry(dn->pde->name, parent->pde);
#endif
rc = of_detach_node(dn);
if (rc)
return rc;

pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn);
of_detach_node(dn);
of_node_put(dn); /* Must decrement the refcount */

return 0;
}

Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/platforms/pseries/hotplug-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
#include <linux/delay.h>
#include <linux/sched.h> /* for idle_task_exit */
#include <linux/cpu.h>
#include <linux/of.h>
#include <asm/prom.h>
#include <asm/rtas.h>
#include <asm/firmware.h>
#include <asm/machdep.h>
#include <asm/vdso_datapage.h>
#include <asm/pSeries_reconfig.h>
#include <asm/xics.h>
#include "plpar_wrappers.h"
#include "offline_states.h"
Expand Down Expand Up @@ -333,10 +333,10 @@ static int pseries_smp_notifier(struct notifier_block *nb,
int err = 0;

switch (action) {
case PSERIES_RECONFIG_ADD:
case OF_RECONFIG_ATTACH_NODE:
err = pseries_add_processor(node);
break;
case PSERIES_RECONFIG_REMOVE:
case OF_RECONFIG_DETACH_NODE:
pseries_remove_processor(node);
break;
}
Expand Down Expand Up @@ -399,7 +399,7 @@ static int __init pseries_cpu_hotplug_init(void)

/* Processors can be added/removed only on LPAR */
if (firmware_has_feature(FW_FEATURE_LPAR)) {
pSeries_reconfig_notifier_register(&pseries_smp_nb);
of_reconfig_notifier_register(&pseries_smp_nb);
cpu_maps_update_begin();
if (cede_offline_enabled && parse_cede_parameters() == 0) {
default_offline_state = CPU_STATE_INACTIVE;
Expand Down
Loading

0 comments on commit de1bb03

Please sign in to comment.