Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336572
b: refs/heads/master
c: 90b335f
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Warren authored and Rob Herring committed Nov 30, 2012
1 parent 01e5528 commit 720b85a
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 50 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: 465aac6d496aa3e99caaa6868865fb3830f73d80
refs/heads/master: 90b335fbbc316b58a0daee8ea792b5aa8903f2ae
15 changes: 8 additions & 7 deletions trunk/Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1175,15 +1175,16 @@ When kbuild executes, the following steps are followed (roughly):
in an init section in the image. Platform code *must* copy the
blob to non-init memory prior to calling unflatten_device_tree().

Example:
#arch/x86/platform/ce4100/Makefile
clean-files := *dtb.S
To use this command, simply add *.dtb into obj-y or targets, or make
some other target depend on %.dtb

DTC_FLAGS := -p 1024
obj-y += foo.dtb.o
A central rule exists to create $(obj)/%.dtb from $(src)/%.dts;
architecture Makefiles do no need to explicitly write out that rule.

$(obj)/%.dtb: $(src)/%.dts
$(call cmd,dtc)
Example:
targets += $(dtb-y)
clean-files += *.dtb
DTC_FLAGS ?= -p 1024

--- 6.8 Custom kbuild commands

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-vexpress/v2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void __init v2m_dt_init_early(void)
return;

/* Confirm board type against DT property, if available */
if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) {
if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
int site = v2m_get_master_site();
u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ?
V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/mips/cavium-octeon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ DTB_FILES = $(patsubst %.dts, %.dtb, $(DTS_FILES))

obj-y += $(patsubst %.dts, %.dtb.o, $(DTS_FILES))

$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)

# Let's keep the .dtb files around in case we want to look at them.
.SECONDARY: $(addprefix $(obj)/, $(DTB_FILES))

Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/mips/lantiq/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
obj-$(CONFIG_DT_EASY50712) := easy50712.dtb.o

$(obj)/%.dtb: $(obj)/%.dts
$(call if_changed,dtc)
3 changes: 0 additions & 3 deletions trunk/arch/mips/netlogic/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o

$(obj)/%.dtb: $(obj)/%.dts
$(call if_changed,dtc)
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/sysdev/scom.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
ent->map = SCOM_MAP_INVALID;
spin_lock_init(&ent->lock);
snprintf(ent->name, 8, "scom%d", i);
ent->blob.data = (void*) dn->full_name;
ent->blob.data = dn->full_name;
ent->blob.size = strlen(dn->full_name);

dir = debugfs_create_dir(ent->name, root);
Expand Down
33 changes: 16 additions & 17 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ struct alias_prop {

static LIST_HEAD(aliases_lookup);

struct device_node *of_allnodes;
EXPORT_SYMBOL(of_allnodes);
struct device_node *allnodes;
struct device_node *of_chosen;
struct device_node *of_aliases;

Expand Down Expand Up @@ -200,7 +199,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
struct device_node *np;

read_lock(&devtree_lock);
np = prev ? prev->allnext : of_allnodes;
np = prev ? prev->allnext : allnodes;
for (; np != NULL; np = np->allnext)
if (of_node_get(np))
break;
Expand Down Expand Up @@ -423,7 +422,7 @@ EXPORT_SYMBOL(of_get_child_by_name);
*/
struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = of_allnodes;
struct device_node *np = allnodes;

read_lock(&devtree_lock);
for (; np; np = np->allnext) {
Expand Down Expand Up @@ -453,7 +452,7 @@ struct device_node *of_find_node_by_name(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : of_allnodes;
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext)
if (np->name && (of_node_cmp(np->name, name) == 0)
&& of_node_get(np))
Expand Down Expand Up @@ -482,7 +481,7 @@ struct device_node *of_find_node_by_type(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : of_allnodes;
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext)
if (np->type && (of_node_cmp(np->type, type) == 0)
&& of_node_get(np))
Expand Down Expand Up @@ -513,7 +512,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : of_allnodes;
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
if (type
&& !(np->type && (of_node_cmp(np->type, type) == 0)))
Expand Down Expand Up @@ -546,7 +545,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
struct property *pp;

read_lock(&devtree_lock);
np = from ? from->allnext : of_allnodes;
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
for (pp = np->properties; pp; pp = pp->next) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
Expand Down Expand Up @@ -617,7 +616,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
*match = NULL;

read_lock(&devtree_lock);
np = from ? from->allnext : of_allnodes;
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
if (of_match_node(matches, np) && of_node_get(np)) {
if (match)
Expand Down Expand Up @@ -670,7 +669,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
struct device_node *np;

read_lock(&devtree_lock);
for (np = of_allnodes; np; np = np->allnext)
for (np = allnodes; np; np = np->allnext)
if (np->phandle == handle)
break;
of_node_get(np);
Expand Down Expand Up @@ -979,8 +978,8 @@ EXPORT_SYMBOL_GPL(of_property_count_strings);
* Returns the device_node pointer with refcount incremented. Use
* of_node_put() on it when done.
*/
struct device_node *of_parse_phandle(const struct device_node *np,
const char *phandle_name, int index)
struct device_node *
of_parse_phandle(struct device_node *np, const char *phandle_name, int index)
{
const __be32 *phandle;
int size;
Expand Down Expand Up @@ -1255,9 +1254,9 @@ void of_attach_node(struct device_node *np)

write_lock_irqsave(&devtree_lock, flags);
np->sibling = np->parent->child;
np->allnext = of_allnodes;
np->allnext = allnodes;
np->parent->child = np;
of_allnodes = np;
allnodes = np;
write_unlock_irqrestore(&devtree_lock, flags);
}

Expand All @@ -1278,11 +1277,11 @@ void of_detach_node(struct device_node *np)
if (!parent)
goto out_unlock;

if (of_allnodes == np)
of_allnodes = np->allnext;
if (allnodes == np)
allnodes = np->allnext;
else {
struct device_node *prev;
for (prev = of_allnodes;
for (prev = allnodes;
prev->allnext != np;
prev = prev->allnext)
;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
*/
void __init unflatten_device_tree(void)
{
__unflatten_device_tree(initial_boot_params, &of_allnodes,
__unflatten_device_tree(initial_boot_params, &allnodes,
early_init_dt_alloc_memory_arch);

/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/of_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)

dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");

for_each_available_child_of_node(adap->dev.of_node, node) {
for_each_child_of_node(adap->dev.of_node, node) {
struct i2c_board_info info = {};
struct dev_archdata dev_ad = {};
const __be32 *addr;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
return rc;

/* Loop over the child nodes and register a phy_device for each one */
for_each_available_child_of_node(np, child) {
for_each_child_of_node(np, child) {
const __be32 *paddr;
u32 addr;
int len;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/of/pdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
BUG_ON(!ops);
of_pdt_prom_ops = ops;

of_allnodes = of_pdt_create_node(root_node, NULL);
allnodes = of_pdt_create_node(root_node, NULL);
#if defined(CONFIG_SPARC)
of_allnodes->path_component_name = "";
allnodes->path_component_name = "";
#endif
of_allnodes->full_name = "/";
allnodes->full_name = "/";

nextp = &of_allnodes->allnext;
of_allnodes->child = of_pdt_build_tree(of_allnodes,
of_pdt_prom_ops->getchild(of_allnodes->phandle), &nextp);
nextp = &allnodes->allnext;
allnodes->child = of_pdt_build_tree(allnodes,
of_pdt_prom_ops->getchild(allnodes->phandle), &nextp);

/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
of_alias_scan(kernel_tree_alloc);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static void of_register_spi_devices(struct spi_master *master)
if (!master->dev.of_node)
return;

for_each_available_child_of_node(master->dev.of_node, nc) {
for_each_child_of_node(master->dev.of_node, nc) {
/* Alloc an spi_device */
spi = spi_alloc_device(master);
if (!spi) {
Expand Down
8 changes: 4 additions & 4 deletions trunk/include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
#ifdef CONFIG_OF

/* Pointer for first entry in chain of all nodes. */
extern struct device_node *of_allnodes;
extern struct device_node *allnodes;
extern struct device_node *of_chosen;
extern struct device_node *of_aliases;
extern rwlock_t devtree_lock;

static inline bool of_have_populated_dt(void)
{
return of_allnodes != NULL;
return allnodes != NULL;
}

static inline bool of_node_is_root(const struct device_node *node)
Expand Down Expand Up @@ -270,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np);
extern const struct of_device_id *of_match_node(
const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern struct device_node *of_parse_phandle(const struct device_node *np,
extern struct device_node *of_parse_phandle(struct device_node *np,
const char *phandle_name,
int index);
extern int of_parse_phandle_with_args(struct device_node *np,
Expand Down Expand Up @@ -438,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np,
return -ENOSYS;
}

static inline struct device_node *of_parse_phandle(const struct device_node *np,
static inline struct device_node *of_parse_phandle(struct device_node *np,
const char *phandle_name,
int index)
{
Expand Down
3 changes: 3 additions & 0 deletions trunk/scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
quiet_cmd_dtc = DTC $@
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<

$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)

# Bzip2
# ---------------------------------------------------------------------------

Expand Down

0 comments on commit 720b85a

Please sign in to comment.