From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
Subject: [PATCH v2 07/21] mips: convert fdt pointers to opaque pointers
Date: Tue, 22 Apr 2014 20:18:07 -0500 [thread overview]
Message-ID: <1398215901-25609-8-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1398215901-25609-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
The architecture code does not need to access the internals of the FDT
blob directly, so make the pointers to it void * and use char arrays
for section variables.
Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
---
v2: no change
arch/mips/include/asm/mips-boards/generic.h | 4 +---
arch/mips/include/asm/prom.h | 6 +++---
arch/mips/kernel/prom.c | 2 +-
arch/mips/lantiq/prom.c | 2 +-
arch/mips/lantiq/prom.h | 2 +-
arch/mips/mti-sead3/sead3-setup.c | 8 ++++----
arch/mips/ralink/of.c | 4 ++--
7 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/arch/mips/include/asm/mips-boards/generic.h b/arch/mips/include/asm/mips-boards/generic.h
index 4861681..b969491 100644
--- a/arch/mips/include/asm/mips-boards/generic.h
+++ b/arch/mips/include/asm/mips-boards/generic.h
@@ -67,9 +67,7 @@
extern int mips_revision_sconid;
-#ifdef CONFIG_OF
-extern struct boot_param_header __dtb_start;
-#endif
+extern char __dtb_start[];
#ifdef CONFIG_PCI
extern void mips_pcibios_init(void);
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
index ccd2b75..a9494c0 100644
--- a/arch/mips/include/asm/prom.h
+++ b/arch/mips/include/asm/prom.h
@@ -21,13 +21,13 @@ extern void device_tree_init(void);
struct boot_param_header;
-extern void __dt_setup_arch(struct boot_param_header *bph);
+extern void __dt_setup_arch(void *bph);
#define dt_setup_arch(sym) \
({ \
- extern struct boot_param_header __dtb_##sym##_begin; \
+ extern char __dtb_##sym##_begin[]; \
\
- __dt_setup_arch(&__dtb_##sym##_begin); \
+ __dt_setup_arch(__dtb_##sym##_begin); \
})
#else /* CONFIG_OF */
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 3c3b0df..5d39bb8 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -47,7 +47,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
}
-void __init __dt_setup_arch(struct boot_param_header *bph)
+void __init __dt_setup_arch(void *bph)
{
if (!early_init_dt_scan(bph))
return;
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index cdea687..7447d32 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -71,7 +71,7 @@ void __init plat_mem_setup(void)
* Load the builtin devicetree. This causes the chosen node to be
* parsed resulting in our memory appearing
*/
- __dt_setup_arch(&__dtb_start);
+ __dt_setup_arch(__dtb_start);
}
void __init device_tree_init(void)
diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h
index 8e07b5f..69a4c58 100644
--- a/arch/mips/lantiq/prom.h
+++ b/arch/mips/lantiq/prom.h
@@ -26,6 +26,6 @@ struct ltq_soc_info {
extern void ltq_soc_detect(struct ltq_soc_info *i);
extern void ltq_soc_init(void);
-extern struct boot_param_header __dtb_start;
+extern char __dtb_start[];
#endif
diff --git a/arch/mips/mti-sead3/sead3-setup.c b/arch/mips/mti-sead3/sead3-setup.c
index bf7fe48..e43f480 100644
--- a/arch/mips/mti-sead3/sead3-setup.c
+++ b/arch/mips/mti-sead3/sead3-setup.c
@@ -69,17 +69,17 @@ static void __init parse_memsize_param(void)
if (!memsize)
return;
- offset = fdt_path_offset(&__dtb_start, "/memory");
+ offset = fdt_path_offset(__dtb_start, "/memory");
if (offset > 0) {
uint64_t new_value;
/*
* reg contains 2 32-bits BE values, offset and size. We just
* want to replace the size value without affecting the offset
*/
- prop_value = fdt_getprop(&__dtb_start, offset, "reg", &prop_len);
+ prop_value = fdt_getprop(__dtb_start, offset, "reg", &prop_len);
new_value = be64_to_cpu(*prop_value);
new_value = (new_value & ~0xffffffffllu) | memsize;
- fdt_setprop_inplace_u64(&__dtb_start, offset, "reg", new_value);
+ fdt_setprop_inplace_u64(__dtb_start, offset, "reg", new_value);
}
}
@@ -92,7 +92,7 @@ void __init plat_mem_setup(void)
* Load the builtin devicetree. This causes the chosen node to be
* parsed resulting in our memory appearing
*/
- __dt_setup_arch(&__dtb_start);
+ __dt_setup_arch(__dtb_start);
}
void __init device_tree_init(void)
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 0170d82..91d7060 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -28,7 +28,7 @@
__iomem void *rt_sysc_membase;
__iomem void *rt_memc_membase;
-extern struct boot_param_header __dtb_start;
+extern char __dtb_start[];
__iomem void *plat_of_remap_node(const char *node)
{
@@ -63,7 +63,7 @@ void __init plat_mem_setup(void)
* Load the builtin devicetree. This causes the chosen node to be
* parsed resulting in our memory appearing
*/
- __dt_setup_arch(&__dtb_start);
+ __dt_setup_arch(__dtb_start);
if (soc_info.mem_size)
add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-04-23 1:18 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 1:18 [PATCH v2 00/21] FDT clean-ups and libfdt support Rob Herring
2014-04-23 1:18 ` [PATCH v2 01/21] mips: octeon: convert to use unflatten_and_copy_device_tree Rob Herring
2014-04-23 1:18 ` [PATCH v2 02/21] mips: lantiq: copy built-in DTB out of init section Rob Herring
2014-04-23 1:18 ` [PATCH v2 03/21] mips: xlp: " Rob Herring
2014-04-23 1:18 ` [PATCH v2 04/21] mips: ralink: convert to use unflatten_and_copy_device_tree Rob Herring
2014-04-23 1:18 ` [PATCH v2 05/21] ARM: dt: use default early_init_dt_alloc_memory_arch Rob Herring
2014-04-23 1:18 ` [PATCH v2 06/21] c6x: convert fdt pointers to opaque pointers Rob Herring
[not found] ` <1398215901-25609-7-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-24 14:21 ` Mark Salter
2014-04-23 1:18 ` [PATCH v2 08/21] of/fdt: consolidate built-in dtb section variables Rob Herring
2014-04-23 1:18 ` [PATCH v2 09/21] of/fdt: remove some unneeded includes Rob Herring
2014-04-23 1:18 ` [PATCH v2 10/21] of/fdt: remove unused of_scan_flat_dt_by_path Rob Herring
2014-04-23 1:18 ` [PATCH v2 11/21] of/fdt: update of_get_flat_dt_prop in prep for libfdt Rob Herring
2014-04-23 1:18 ` [PATCH v2 12/21] of/fdt: Convert FDT functions to use libfdt Rob Herring
2014-04-23 1:18 ` [PATCH v2 13/21] of/fdt: use libfdt accessors for header data Rob Herring
2014-04-23 1:18 ` [PATCH v2 14/21] of/fdt: create common debugfs Rob Herring
2014-04-23 13:52 ` Michal Simek
2014-04-23 1:18 ` [PATCH v2 15/21] of/fdt: move memreserve and dtb memory reservations into core Rob Herring
2014-05-01 16:27 ` Catalin Marinas
2014-04-23 1:18 ` [PATCH v2 16/21] of/fdt: fix phys_addr_t related print size warnings Rob Herring
2014-04-23 1:18 ` [PATCH v2 17/21] of/fdt: introduce of_get_flat_dt_size Rob Herring
2014-04-23 13:45 ` Michal Simek
2014-04-23 1:18 ` [PATCH v2 18/21] powerpc: use libfdt accessors for header data Rob Herring
2014-04-23 13:48 ` Michal Simek
[not found] ` <5357C4BE.3050606-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2014-04-23 14:05 ` Rob Herring
2014-04-23 14:21 ` Michal Simek
2014-04-23 1:18 ` [PATCH v2 19/21] x86: use FDT accessors for FDT blob " Rob Herring
2014-04-23 1:18 ` [PATCH v2 20/21] of/fdt: convert initial_boot_params to opaque pointer Rob Herring
2014-04-23 1:18 ` [PATCH v2 21/21] of: push struct boot_param_header and defines into powerpc Rob Herring
2014-04-28 1:37 ` Benjamin Herrenschmidt
2014-04-23 14:22 ` [PATCH v2 00/21] FDT clean-ups and libfdt support Michal Simek
2014-04-23 21:04 ` Max Filippov
[not found] ` <1398215901-25609-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-23 1:18 ` Rob Herring [this message]
2014-04-29 14:00 ` Grant Likely
2014-04-30 0:33 ` Stephen N Chivers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398215901-25609-8-git-send-email-robherring2@gmail.com \
--to=robherring2-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).