* [PATCH 00/20] FDT clean-ups and libfdt support
@ 2014-04-03 22:16 Rob Herring
2014-04-03 22:16 ` [PATCH 09/20] of/fdt: create common debugfs Rob Herring
2014-04-03 22:17 ` [PATCH 20/20] of: push struct boot_param_header and defines into powerpc Rob Herring
0 siblings, 2 replies; 11+ messages in thread
From: Rob Herring @ 2014-04-03 22:16 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mips, Aurelien Jacquiot, H. Peter Anvin, Max Filippov,
Paul Mackerras, linux, Jonas Bonn, Rob Herring, Russell King,
linux-c6x-dev, x86, Ingo Molnar, Mark Salter, Grant Likely,
linux-xtensa, James Hogan, Thomas Gleixner, linux-metag,
linux-arm-kernel, Chris Zankel, Michal Simek, Vineet Gupta,
Ralf Baechle, linuxppc-dev
From: Rob Herring <robh@kernel.org>
This is a series of clean-ups of architecture FDT code and converts the
core FDT code over to using libfdt functions. This is in preparation
to add FDT based address translation parsing functions for early
console support.
The current MIPS lantiq and xlp DT code is buggy as built-in DTBs need
to be copied out of init section. Patches 2 and 3 should be applied to
3.15.
A branch is available here[1]. Please test! I've compiled on arm,
arm64, mips, microblaze, and powerpc and booted on arm and arm64.
Rob
[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git libfdt
Rob Herring (20):
mips: octeon: convert to use unflatten_and_copy_device_tree
mips: lantiq: copy built-in DTB out of init section
mips: xlp: copy built-in DTB out of init section
mips: ralink: convert to use unflatten_and_copy_device_tree
ARM: dt: use default early_init_dt_alloc_memory_arch
c6x: convert fdt pointers to opaque pointers
mips: convert fdt pointers to opaque pointers
of/fdt: consolidate built-in dtb section variables
of/fdt: create common debugfs
of/fdt: remove some unneeded includes
of/fdt: remove unused of_scan_flat_dt_by_path
of/fdt: update of_get_flat_dt_prop in prep for libfdt
of/fdt: Convert FDT functions to use libfdt
of/fdt: use libfdt accessors for header data
of/fdt: move memreserve and dtb memory reservations into core
build: add libfdt include path globally
powerpc: use libfdt accessors for header data
x86: use libfdt accessors for header data
of/fdt: convert initial_boot_params to opaque pointer
of: push struct boot_param_header and defines into powerpc
Makefile | 5 +
arch/arc/include/asm/sections.h | 1 -
arch/arc/kernel/devtree.c | 2 +-
arch/arm/include/asm/prom.h | 2 -
arch/arm/kernel/devtree.c | 34 +--
arch/arm/mach-exynos/exynos.c | 2 +-
arch/arm/mach-vexpress/platsmp.c | 2 +-
arch/arm/mm/init.c | 1 -
arch/arm/plat-samsung/s5p-dev-mfc.c | 4 +-
arch/arm64/mm/init.c | 21 --
arch/c6x/kernel/setup.c | 4 +-
arch/metag/kernel/setup.c | 4 -
arch/microblaze/kernel/prom.c | 37 +--
arch/mips/cavium-octeon/Makefile | 3 -
arch/mips/cavium-octeon/setup.c | 18 +-
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 | 15 +-
arch/mips/lantiq/prom.h | 2 -
arch/mips/mti-sead3/Makefile | 2 -
arch/mips/mti-sead3/sead3-setup.c | 8 +-
arch/mips/netlogic/xlp/dt.c | 17 +-
arch/mips/ralink/of.c | 29 +--
arch/openrisc/kernel/vmlinux.h | 2 -
arch/powerpc/include/asm/prom.h | 39 +++
arch/powerpc/kernel/epapr_paravirt.c | 2 +-
arch/powerpc/kernel/fadump.c | 4 +-
arch/powerpc/kernel/prom.c | 77 ++----
arch/powerpc/kernel/rtas.c | 2 +-
arch/powerpc/mm/hash_utils_64.c | 22 +-
arch/powerpc/platforms/52xx/efika.c | 4 +-
arch/powerpc/platforms/chrp/setup.c | 4 +-
arch/powerpc/platforms/powernv/opal.c | 12 +-
arch/powerpc/platforms/pseries/setup.c | 4 +-
arch/x86/kernel/devicetree.c | 7 +-
arch/xtensa/kernel/setup.c | 3 +-
drivers/of/Kconfig | 1 +
drivers/of/fdt.c | 379 +++++++++-------------------
drivers/of/of_reserved_mem.c | 4 +-
include/linux/of_fdt.h | 64 +----
lib/Makefile | 2 -
42 files changed, 261 insertions(+), 596 deletions(-)
--
1.8.3.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 09/20] of/fdt: create common debugfs
2014-04-03 22:16 [PATCH 00/20] FDT clean-ups and libfdt support Rob Herring
@ 2014-04-03 22:16 ` Rob Herring
2014-04-04 12:16 ` Michal Simek
2014-04-03 22:17 ` [PATCH 20/20] of: push struct boot_param_header and defines into powerpc Rob Herring
1 sibling, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-04-03 22:16 UTC (permalink / raw)
To: linux-kernel
Cc: Rob Herring, Michal Simek, Paul Mackerras, Grant Likely,
linuxppc-dev
From: Rob Herring <robh@kernel.org>
Both powerpc and microblaze have the same FDT blob in debugfs feature.
Move this to common location and remove the powerpc and microblaze
implementations. This feature could become more useful when FDT
overlay support is added.
This changes the path of the blob from "$arch/flat-device-tree" to
"device-tree/flat-device-tree".
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/microblaze/kernel/prom.c | 31 -------------------------------
arch/powerpc/kernel/prom.c | 21 ---------------------
drivers/of/fdt.c | 24 ++++++++++++++++++++++++
3 files changed, 24 insertions(+), 52 deletions(-)
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index abdfb10..1312cd2 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -114,34 +114,3 @@ void __init early_init_devtree(void *params)
pr_debug(" <- early_init_devtree()\n");
}
-
-/*******
- *
- * New implementation of the OF "find" APIs, return a refcounted
- * object, call of_node_put() when done. The device tree and list
- * are protected by a rw_lock.
- *
- * Note that property management will need some locking as well,
- * this isn't dealt with yet.
- *
- *******/
-
-#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
-static struct debugfs_blob_wrapper flat_dt_blob;
-
-static int __init export_flat_device_tree(void)
-{
- struct dentry *d;
-
- flat_dt_blob.data = initial_boot_params;
- flat_dt_blob.size = initial_boot_params->totalsize;
-
- d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
- of_debugfs_root, &flat_dt_blob);
- if (!d)
- return 1;
-
- return 0;
-}
-device_initcall(export_flat_device_tree);
-#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index dd72beb..7c2f90c 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -29,7 +29,6 @@
#include <linux/bitops.h>
#include <linux/export.h>
#include <linux/kexec.h>
-#include <linux/debugfs.h>
#include <linux/irq.h>
#include <linux/memblock.h>
#include <linux/of.h>
@@ -918,23 +917,3 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
{
return (int)phys_id == get_hard_smp_processor_id(cpu);
}
-
-#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
-static struct debugfs_blob_wrapper flat_dt_blob;
-
-static int __init export_flat_device_tree(void)
-{
- struct dentry *d;
-
- flat_dt_blob.data = initial_boot_params;
- flat_dt_blob.size = be32_to_cpu(initial_boot_params->totalsize);
-
- d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
- powerpc_debugfs_root, &flat_dt_blob);
- if (!d)
- return 1;
-
- return 0;
-}
-__initcall(export_flat_device_tree);
-#endif
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index fa16a91..2085d47 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -20,6 +20,7 @@
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/slab.h>
+#include <linux/debugfs.h>
#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
#ifdef CONFIG_PPC
@@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
unflatten_device_tree();
}
+#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
+static struct debugfs_blob_wrapper flat_dt_blob;
+
+static int __init of_flat_dt_debugfs_export_fdt(void)
+{
+ struct dentry *d = debugfs_create_dir("device-tree", NULL);
+
+ if (!d)
+ return -ENOENT;
+
+ flat_dt_blob.data = initial_boot_params;
+ flat_dt_blob.size = fdt_totalsize(initial_boot_params);
+
+ d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
+ d, &flat_dt_blob);
+ if (!d)
+ return -ENOENT;
+
+ return 0;
+}
+module_init(of_flat_dt_debugfs_export_fdt);
+#endif
+
#endif /* CONFIG_OF_EARLY_FLATTREE */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 20/20] of: push struct boot_param_header and defines into powerpc
2014-04-03 22:16 [PATCH 00/20] FDT clean-ups and libfdt support Rob Herring
2014-04-03 22:16 ` [PATCH 09/20] of/fdt: create common debugfs Rob Herring
@ 2014-04-03 22:17 ` Rob Herring
1 sibling, 0 replies; 11+ messages in thread
From: Rob Herring @ 2014-04-03 22:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Grant Likely, Rob Herring, Paul Mackerras, linuxppc-dev
From: Rob Herring <robh@kernel.org>
Now powerpc is the only user of struct boot_param_header and FDT defines,
so they can be moved into the powerpc architecture code.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/prom.h | 39 +++++++++++++++++++++++++++++++++++++++
include/linux/of_fdt.h | 37 -------------------------------------
2 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index d977b9b..74b79f0 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -26,6 +26,45 @@
#include <linux/of_irq.h>
#include <linux/platform_device.h>
+#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
+#define OF_DT_END_NODE 0x2 /* End node */
+#define OF_DT_PROP 0x3 /* Property: name off, size,
+ * content */
+#define OF_DT_NOP 0x4 /* nop */
+#define OF_DT_END 0x9
+
+#define OF_DT_VERSION 0x10
+
+/*
+ * This is what gets passed to the kernel by prom_init or kexec
+ *
+ * The dt struct contains the device tree structure, full pathes and
+ * property contents. The dt strings contain a separate block with just
+ * the strings for the property names, and is fully page aligned and
+ * self contained in a page, so that it can be kept around by the kernel,
+ * each property name appears only once in this page (cheap compression)
+ *
+ * the mem_rsvmap contains a map of reserved ranges of physical memory,
+ * passing it here instead of in the device-tree itself greatly simplifies
+ * the job of everybody. It's just a list of u64 pairs (base/size) that
+ * ends when size is 0
+ */
+struct boot_param_header {
+ __be32 magic; /* magic word OF_DT_HEADER */
+ __be32 totalsize; /* total size of DT block */
+ __be32 off_dt_struct; /* offset to structure */
+ __be32 off_dt_strings; /* offset to strings */
+ __be32 off_mem_rsvmap; /* offset to memory reserve map */
+ __be32 version; /* format version */
+ __be32 last_comp_version; /* last compatible version */
+ /* version 2 fields below */
+ __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */
+ /* version 3 fields below */
+ __be32 dt_strings_size; /* size of the DT strings block */
+ /* version 17 fields below */
+ __be32 dt_struct_size; /* size of the DT structure block */
+};
+
/*
* OF address retreival & translation
*/
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index aa7fb87..7f67790 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -17,47 +17,10 @@
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
-#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
-#define OF_DT_END_NODE 0x2 /* End node */
-#define OF_DT_PROP 0x3 /* Property: name off, size,
- * content */
-#define OF_DT_NOP 0x4 /* nop */
-#define OF_DT_END 0x9
-
-#define OF_DT_VERSION 0x10
#ifndef __ASSEMBLY__
#include <linux/libfdt.h>
-/*
- * This is what gets passed to the kernel by prom_init or kexec
- *
- * The dt struct contains the device tree structure, full pathes and
- * property contents. The dt strings contain a separate block with just
- * the strings for the property names, and is fully page aligned and
- * self contained in a page, so that it can be kept around by the kernel,
- * each property name appears only once in this page (cheap compression)
- *
- * the mem_rsvmap contains a map of reserved ranges of physical memory,
- * passing it here instead of in the device-tree itself greatly simplifies
- * the job of everybody. It's just a list of u64 pairs (base/size) that
- * ends when size is 0
- */
-struct boot_param_header {
- __be32 magic; /* magic word OF_DT_HEADER */
- __be32 totalsize; /* total size of DT block */
- __be32 off_dt_struct; /* offset to structure */
- __be32 off_dt_strings; /* offset to strings */
- __be32 off_mem_rsvmap; /* offset to memory reserve map */
- __be32 version; /* format version */
- __be32 last_comp_version; /* last compatible version */
- /* version 2 fields below */
- __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */
- /* version 3 fields below */
- __be32 dt_strings_size; /* size of the DT strings block */
- /* version 17 fields below */
- __be32 dt_struct_size; /* size of the DT structure block */
-};
#if defined(CONFIG_OF_FLATTREE)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-03 22:16 ` [PATCH 09/20] of/fdt: create common debugfs Rob Herring
@ 2014-04-04 12:16 ` Michal Simek
2014-04-04 12:22 ` Michal Simek
2014-04-04 13:00 ` Rob Herring
0 siblings, 2 replies; 11+ messages in thread
From: Michal Simek @ 2014-04-04 12:16 UTC (permalink / raw)
To: Rob Herring
Cc: Rob Herring, linux-kernel, Paul Mackerras, Grant Likely,
linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3432 bytes --]
On 04/04/2014 12:16 AM, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
>
> Both powerpc and microblaze have the same FDT blob in debugfs feature.
> Move this to common location and remove the powerpc and microblaze
> implementations. This feature could become more useful when FDT
> overlay support is added.
>
> This changes the path of the blob from "$arch/flat-device-tree" to
> "device-tree/flat-device-tree".
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> arch/microblaze/kernel/prom.c | 31 -------------------------------
> arch/powerpc/kernel/prom.c | 21 ---------------------
> drivers/of/fdt.c | 24 ++++++++++++++++++++++++
> 3 files changed, 24 insertions(+), 52 deletions(-)
>
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index abdfb10..1312cd2 100644
> --- a/arch/microblaze/kernel/prom.c
> +++ b/arch/microblaze/kernel/prom.c
> @@ -114,34 +114,3 @@ void __init early_init_devtree(void *params)
>
> pr_debug(" <- early_init_devtree()\n");
> }
> -
> -/*******
> - *
> - * New implementation of the OF "find" APIs, return a refcounted
> - * object, call of_node_put() when done. The device tree and list
> - * are protected by a rw_lock.
> - *
> - * Note that property management will need some locking as well,
> - * this isn't dealt with yet.
> - *
> - *******/
> -
> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> -static struct debugfs_blob_wrapper flat_dt_blob;
> -
> -static int __init export_flat_device_tree(void)
> -{
> - struct dentry *d;
> -
> - flat_dt_blob.data = initial_boot_params;
> - flat_dt_blob.size = initial_boot_params->totalsize;
As I see even microblaze version was buggy.
...
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index fa16a91..2085d47 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -20,6 +20,7 @@
> #include <linux/string.h>
> #include <linux/errno.h>
> #include <linux/slab.h>
> +#include <linux/debugfs.h>
>
> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> #ifdef CONFIG_PPC
> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
> unflatten_device_tree();
> }
>
> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> +static struct debugfs_blob_wrapper flat_dt_blob;
> +
> +static int __init of_flat_dt_debugfs_export_fdt(void)
> +{
> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
> +
> + if (!d)
> + return -ENOENT;
> +
> + flat_dt_blob.data = initial_boot_params;
> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
Have you tried to compile this?
From my tests fdt_totalsize is not available for target just for host
from libfdt.h
drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 12:16 ` Michal Simek
@ 2014-04-04 12:22 ` Michal Simek
2014-04-04 13:00 ` Rob Herring
1 sibling, 0 replies; 11+ messages in thread
From: Michal Simek @ 2014-04-04 12:22 UTC (permalink / raw)
To: monstr
Cc: Rob Herring, linux-kernel, Rob Herring, Grant Likely,
Paul Mackerras, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index fa16a91..2085d47 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -20,6 +20,7 @@
>> #include <linux/string.h>
>> #include <linux/errno.h>
>> #include <linux/slab.h>
>> +#include <linux/debugfs.h>
>>
>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>> #ifdef CONFIG_PPC
>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>> unflatten_device_tree();
>> }
>>
>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> +static struct debugfs_blob_wrapper flat_dt_blob;
>> +
>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>> +{
>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>> +
>> + if (!d)
>> + return -ENOENT;
>> +
>> + flat_dt_blob.data = initial_boot_params;
>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>
> Have you tried to compile this?
>
> From my tests fdt_totalsize is not available for target just for host
> from libfdt.h
>
> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Ignore this one - there is no compilation problem.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 12:16 ` Michal Simek
2014-04-04 12:22 ` Michal Simek
@ 2014-04-04 13:00 ` Rob Herring
2014-04-04 13:22 ` Michal Simek
1 sibling, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-04-04 13:00 UTC (permalink / raw)
To: Michal Simek
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
> On 04/04/2014 12:16 AM, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>> Move this to common location and remove the powerpc and microblaze
>> implementations. This feature could become more useful when FDT
>> overlay support is added.
>>
>> This changes the path of the blob from "$arch/flat-device-tree" to
>> "device-tree/flat-device-tree".
[snip]
>> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> -static struct debugfs_blob_wrapper flat_dt_blob;
>> -
>> -static int __init export_flat_device_tree(void)
>> -{
>> - struct dentry *d;
>> -
>> - flat_dt_blob.data = initial_boot_params;
>> - flat_dt_blob.size = initial_boot_params->totalsize;
>
> As I see even microblaze version was buggy.
How so?
> ...
>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index fa16a91..2085d47 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -20,6 +20,7 @@
>> #include <linux/string.h>
>> #include <linux/errno.h>
>> #include <linux/slab.h>
>> +#include <linux/debugfs.h>
>>
>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>> #ifdef CONFIG_PPC
>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>> unflatten_device_tree();
>> }
>>
>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> +static struct debugfs_blob_wrapper flat_dt_blob;
>> +
>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>> +{
>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>> +
>> + if (!d)
>> + return -ENOENT;
>> +
>> + flat_dt_blob.data = initial_boot_params;
>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>
> Have you tried to compile this?
>
> From my tests fdt_totalsize is not available for target just for host
> from libfdt.h
>
> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Ah, it needs to be re-ordered after the libfdt conversion when
libfdt.h gets added.
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 13:00 ` Rob Herring
@ 2014-04-04 13:22 ` Michal Simek
2014-04-04 13:32 ` Rob Herring
0 siblings, 1 reply; 11+ messages in thread
From: Michal Simek @ 2014-04-04 13:22 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
[-- Attachment #1.1: Type: text/plain, Size: 3686 bytes --]
On 04/04/2014 03:00 PM, Rob Herring wrote:
> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>> From: Rob Herring <robh@kernel.org>
>>>
>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>> Move this to common location and remove the powerpc and microblaze
>>> implementations. This feature could become more useful when FDT
>>> overlay support is added.
>>>
>>> This changes the path of the blob from "$arch/flat-device-tree" to
>>> "device-tree/flat-device-tree".
>
> [snip]
>
>>> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>>> -static struct debugfs_blob_wrapper flat_dt_blob;
>>> -
>>> -static int __init export_flat_device_tree(void)
>>> -{
>>> - struct dentry *d;
>>> -
>>> - flat_dt_blob.data = initial_boot_params;
>>> - flat_dt_blob.size = initial_boot_params->totalsize;
>>
>> As I see even microblaze version was buggy.
>
> How so?
if you compare it with powerpc version here is missing
be to cpu conversion.
>
>> ...
>>
>>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>>> index fa16a91..2085d47 100644
>>> --- a/drivers/of/fdt.c
>>> +++ b/drivers/of/fdt.c
>>> @@ -20,6 +20,7 @@
>>> #include <linux/string.h>
>>> #include <linux/errno.h>
>>> #include <linux/slab.h>
>>> +#include <linux/debugfs.h>
>>>
>>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>>> #ifdef CONFIG_PPC
>>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>>> unflatten_device_tree();
>>> }
>>>
>>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>>> +static struct debugfs_blob_wrapper flat_dt_blob;
>>> +
>>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>>> +{
>>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>>> +
>>> + if (!d)
>>> + return -ENOENT;
>>> +
>>> + flat_dt_blob.data = initial_boot_params;
>>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>>
>> Have you tried to compile this?
>>
>> From my tests fdt_totalsize is not available for target just for host
>> from libfdt.h
>>
>> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
>> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
>
> Ah, it needs to be re-ordered after the libfdt conversion when
> libfdt.h gets added.
I just pick some of them not all of them and send email. :-(
Anyway I am testing it for microblaze and getting problem
caused by this patch:
commit 3d2ee8571ac0580d49c3f41fa28336289934900a
Author: Rob Herring <robh@kernel.org>
Date: Wed Apr 2 15:10:14 2014 -0500
of/fdt: Convert FDT functions to use libfdt
And reason is that in unflatten_dt_node()
pathp = fdt_get_name(blob, *poffset, &l);
is returning NULL
and here
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
* it later. We detect this because the first character of the name is
* not '/'.
*/
if ((*pathp) != '/') {
code is trying to read it which is causing this kernel bug:
Oops: kernel access of bad area, sig: 11
It means fdt_next_node(is doing something wrong)
Any easy way how to debug it?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #1.2: system.dts --]
[-- Type: text/plain, Size: 13423 bytes --]
/*
* Device Tree Generator version: 1.1
*
* (C) Copyright 2007-2013 Xilinx, Inc.
* (C) Copyright 2007-2013 Michal Simek
* (C) Copyright 2007-2012 PetaLogix Qld Pty Ltd
*
* Michal SIMEK <monstr@monstr.eu>
*
* CAUTION: This file is automatically generated by libgen.
* Version: Xilinx EDK 2013.3 EDK_P.20131013
* Today is: Thursday, the 21 of November, 2013; 19:47:51
*
* XPS project directory: .
*/
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,microblaze";
hard-reset-gpios = <&reset_gpio 0 1>;
model = ".";
aliases {
ethernet0 = &axi_ethernet_eth_buf;
serial0 = &rs232_uart;
} ;
chosen {
bootargs = "console=ttyS0,115200 earlyprintk";
linux,stdout-path = "/axi@0/serial@40400000";
} ;
cpus {
#address-cells = <1>;
#cpus = <0x1>;
#size-cells = <0>;
microblaze_0: cpu@0 {
bus-handle = <µblaze_0_axi_periph_xbar>;
clock-frequency = <100000000>;
compatible = "xlnx,microblaze-9.2";
d-cache-baseaddr = <0x80000000>;
d-cache-highaddr = <0xbfffffff>;
d-cache-line-size = <0x20>;
d-cache-size = <0x4000>;
device_type = "cpu";
i-cache-baseaddr = <0x80000000>;
i-cache-highaddr = <0xbfffffff>;
i-cache-line-size = <0x10>;
i-cache-size = <0x4000>;
interrupt-handle = <µblaze_0_axi_intc>;
model = "microblaze,9.2";
reg = <0>;
timebase-frequency = <100000000>;
xlnx,addr-tag-bits = <0x10>;
xlnx,allow-dcache-wr = <0x1>;
xlnx,allow-icache-wr = <0x1>;
xlnx,area-optimized = <0x0>;
xlnx,async-interrupt = <0x1>;
xlnx,avoid-primitives = <0x0>;
xlnx,base-vectors = <0x0>;
xlnx,branch-target-cache-size = <0x0>;
xlnx,cache-byte-size = <0x4000>;
xlnx,d-axi = <0x1>;
xlnx,d-lmb = <0x1>;
xlnx,data-size = <0x20>;
xlnx,dcache-addr-tag = <0x10>;
xlnx,dcache-always-used = <0x1>;
xlnx,dcache-byte-size = <0x4000>;
xlnx,dcache-data-width = <0x0>;
xlnx,dcache-force-tag-lutram = <0x0>;
xlnx,dcache-line-len = <0x8>;
xlnx,dcache-use-writeback = <0x1>;
xlnx,dcache-victims = <0x0>;
xlnx,debug-enabled = <0x1>;
xlnx,div-zero-exception = <0x1>;
xlnx,dynamic-bus-sizing = <0x0>;
xlnx,ecc-use-ce-exception = <0x0>;
xlnx,edge-is-positive = <0x0>;
xlnx,enable-discrete-ports = <0x0>;
xlnx,endianness = <0x1>;
xlnx,fault-tolerant = <0x0>;
xlnx,fpu-exception = <0x0>;
xlnx,freq = <0x5f5e100>;
xlnx,fsl-exception = <0x0>;
xlnx,fsl-links = <0x0>;
xlnx,i-axi = <0x0>;
xlnx,i-lmb = <0x1>;
xlnx,icache-always-used = <0x1>;
xlnx,icache-data-width = <0x0>;
xlnx,icache-force-tag-lutram = <0x0>;
xlnx,icache-line-len = <0x4>;
xlnx,icache-streams = <0x1>;
xlnx,icache-victims = <0x8>;
xlnx,ill-opcode-exception = <0x1>;
xlnx,instance = "kc705_microblaze_0_0";
xlnx,interconnect = <0x2>;
xlnx,interrupt-is-edge = <0x0>;
xlnx,lockstep-select = <0x0>;
xlnx,lockstep-slave = <0x0>;
xlnx,mmu-dtlb-size = <0x4>;
xlnx,mmu-itlb-size = <0x2>;
xlnx,mmu-privileged-instr = <0x0>;
xlnx,mmu-tlb-access = <0x3>;
xlnx,mmu-zones = <0x2>;
xlnx,number-of-pc-brk = <0x1>;
xlnx,number-of-rd-addr-brk = <0x0>;
xlnx,number-of-wr-addr-brk = <0x0>;
xlnx,opcode-0x0-illegal = <0x1>;
xlnx,optimization = <0x0>;
xlnx,pc-width = <0x20>;
xlnx,pvr = <0x2>;
xlnx,pvr-user1 = <0x0>;
xlnx,pvr-user2 = <0x0>;
xlnx,reset-msr = <0x0>;
xlnx,sco = <0x0>;
xlnx,trace = <0x0>;
xlnx,unaligned-exceptions = <0x1>;
xlnx,use-barrel = <0x1>;
xlnx,use-branch-target-cache = <0x1>;
xlnx,use-config-reset = <0x0>;
xlnx,use-dcache = <0x1>;
xlnx,use-div = <0x1>;
xlnx,use-ext-brk = <0x0>;
xlnx,use-ext-nm-brk = <0x0>;
xlnx,use-extended-fsl-instr = <0x0>;
xlnx,use-fpu = <0x0>;
xlnx,use-hw-mul = <0x2>;
xlnx,use-icache = <0x1>;
xlnx,use-interrupt = <0x2>;
xlnx,use-mmu = <0x3>;
xlnx,use-msr-instr = <0x1>;
xlnx,use-pcmp-instr = <0x1>;
xlnx,use-reorder-instr = <0x1>;
xlnx,use-stack-protection = <0x0>;
} ;
} ;
ddr3_sdram: memory@80000000 {
device_type = "memory";
reg = <0x80000000 0x40000000>;
} ;
microblaze_0_axi_periph_xbar: axi@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,axi-crossbar-2.1", "simple-bus";
ranges ;
axi_ethernet_dma: axi-dma@41e00000 {
axistream-connected = <&axi_ethernet_eth_buf>;
axistream-control-connected = <&axi_ethernet_eth_buf>;
compatible = "xlnx,axi-dma-7.1", "xlnx,axi-dma-1.00.a";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <2 2>, <3 2>;
reg = <0x41e00000 0x10000>;
xlnx,dlytmr-resolution = <0x7d>;
xlnx,enable-multi-channel = <0x0>;
xlnx,include-mm2s = <0x1>;
xlnx,include-mm2s-dre = <0x1>;
xlnx,include-mm2s-sf = <0x1>;
xlnx,include-s2mm = <0x1>;
xlnx,include-s2mm-dre = <0x1>;
xlnx,include-s2mm-sf = <0x1>;
xlnx,include-sg = <0x1>;
xlnx,micro-dma = <0x0>;
xlnx,mm2s-burst-size = <0x10>;
xlnx,num-mm2s-channels = <0x1>;
xlnx,num-s2mm-channels = <0x1>;
xlnx,prmry-is-aclk-async = <0x0>;
xlnx,s2mm-burst-size = <0x10>;
xlnx,sg-include-stscntrl-strm = <0x1>;
xlnx,sg-length-width = <0xe>;
xlnx,sg-use-stsapp-length = <0x1>;
} ;
axi_ethernet_eth_buf: axi-ethernet@44a00000 {
axistream-connected = <&axi_ethernet_dma>;
axistream-control-connected = <&axi_ethernet_dma>;
clock-frequency = <100000000>;
compatible = "xlnx,axi-ethernet-buffer-2.0", "xlnx,axi-ethernet-1.00.a";
device_type = "network";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <1 2>;
local-mac-address = [ 00 0a 35 00 42 4a ];
phy-handle = <&phy0>;
reg = <0x44a00000 0x40000>;
xlnx,avb = <0x0>;
xlnx,halfdup = "1";
xlnx,include-io = "1";
xlnx,mcast-extend = <0x0>;
xlnx,phy-type = <0x1>;
xlnx,phyaddr = <0x1>;
xlnx,rxcsum = <0x0>;
xlnx,rxmem = <0x1000>;
xlnx,rxvlan-strp = <0x0>;
xlnx,rxvlan-tag = <0x0>;
xlnx,rxvlan-tran = <0x0>;
xlnx,stats = <0x0>;
xlnx,txcsum = <0x0>;
xlnx,txmem = <0x1000>;
xlnx,txvlan-strp = <0x0>;
xlnx,txvlan-tag = <0x0>;
xlnx,txvlan-tran = <0x0>;
xlnx,type = <0x1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: phy@7 {
compatible = "marvell,88e1111";
device_type = "ethernet-phy";
reg = <7>;
} ;
} ;
} ;
axi_timer_0: system-timer@41c00000 {
clock-frequency = <100000000>;
compatible = "xlnx,axi-timer-2.0", "xlnx,xps-timer-1.00.a";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <0 2>;
reg = <0x41c00000 0x10000>;
xlnx,count-width = <0x20>;
xlnx,gen0-assert = <0x1>;
xlnx,gen1-assert = <0x1>;
xlnx,one-timer-only = <0x0>;
xlnx,trig0-assert = <0x1>;
xlnx,trig1-assert = <0x1>;
} ;
dip_switches_4bits: gpio@40010000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40010000 0x10000>;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x0>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x4>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
led_8bits: gpio@40020000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40020000 0x10000>;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x1>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x8>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
microblaze_0_axi_intc: interrupt-controller@41200000 {
#interrupt-cells = <0x2>;
compatible = "xlnx,axi-intc-4.0", "xlnx,xps-intc-1.00.a";
interrupt-controller ;
reg = <0x41200000 0x10000>;
xlnx,kind-of-intr = <0x0>;
xlnx,num-intr-inputs = <0x5>;
} ;
primary_flash: flash@60000000 {
#address-cells = <1>;
#size-cells = <1>;
bank-width = <2>;
compatible = "xlnx,axi-emc-2.0", "cfi-flash";
reg = <0x60000000 0x8000000>;
xlnx,axi-clk-period-ps = <0x2710>;
xlnx,include-datawidth-matching-0 = <0x1>;
xlnx,include-datawidth-matching-1 = <0x1>;
xlnx,include-datawidth-matching-2 = <0x1>;
xlnx,include-datawidth-matching-3 = <0x1>;
xlnx,include-negedge-ioregs = <0x0>;
xlnx,instance = "axi_emc_inst";
xlnx,lflash-period-ps = <0x4e20>;
xlnx,linear-flash-sync-burst = <0x0>;
xlnx,max-mem-width = <0x10>;
xlnx,mem0-type = <0x2>;
xlnx,mem0-width = <0x10>;
xlnx,mem1-type = <0x2>;
xlnx,mem1-width = <0x10>;
xlnx,mem2-type = <0x2>;
xlnx,mem2-width = <0x10>;
xlnx,mem3-type = <0x2>;
xlnx,mem3-width = <0x10>;
xlnx,num-banks-mem = <0x1>;
xlnx,parity-type-mem-0 = <0x0>;
xlnx,parity-type-mem-1 = <0x0>;
xlnx,parity-type-mem-2 = <0x0>;
xlnx,parity-type-mem-3 = <0x0>;
xlnx,s-axi-en-reg = <0x0>;
xlnx,s-axi-mem-addr-width = <0x20>;
xlnx,s-axi-mem-data-width = <0x20>;
xlnx,s-axi-mem-id-width = <0x1>;
xlnx,s-axi-reg-addr-width = <0x5>;
xlnx,s-axi-reg-data-width = <0x20>;
xlnx,synch-pipedelay-0 = <0x1>;
xlnx,synch-pipedelay-1 = <0x1>;
xlnx,synch-pipedelay-2 = <0x1>;
xlnx,synch-pipedelay-3 = <0x1>;
xlnx,tavdv-ps-mem-0 = <0x1fbd0>;
xlnx,tavdv-ps-mem-1 = <0x3a98>;
xlnx,tavdv-ps-mem-2 = <0x3a98>;
xlnx,tavdv-ps-mem-3 = <0x3a98>;
xlnx,tcedv-ps-mem-0 = <0x1fbd0>;
xlnx,tcedv-ps-mem-1 = <0x3a98>;
xlnx,tcedv-ps-mem-2 = <0x3a98>;
xlnx,tcedv-ps-mem-3 = <0x3a98>;
xlnx,thzce-ps-mem-0 = <0x1b58>;
xlnx,thzce-ps-mem-1 = <0x1b58>;
xlnx,thzce-ps-mem-2 = <0x1b58>;
xlnx,thzce-ps-mem-3 = <0x1b58>;
xlnx,thzoe-ps-mem-0 = <0x1b58>;
xlnx,thzoe-ps-mem-1 = <0x1b58>;
xlnx,thzoe-ps-mem-2 = <0x1b58>;
xlnx,thzoe-ps-mem-3 = <0x1b58>;
xlnx,tlzwe-ps-mem-0 = <0xc350>;
xlnx,tlzwe-ps-mem-1 = <0x0>;
xlnx,tlzwe-ps-mem-2 = <0x0>;
xlnx,tlzwe-ps-mem-3 = <0x0>;
xlnx,tpacc-ps-flash-0 = <0x61a8>;
xlnx,tpacc-ps-flash-1 = <0x61a8>;
xlnx,tpacc-ps-flash-2 = <0x61a8>;
xlnx,tpacc-ps-flash-3 = <0x61a8>;
xlnx,twc-ps-mem-0 = <0x3a98>;
xlnx,twc-ps-mem-1 = <0x3a98>;
xlnx,twc-ps-mem-2 = <0x3a98>;
xlnx,twc-ps-mem-3 = <0x3a98>;
xlnx,twp-ps-mem-0 = <0x13880>;
xlnx,twp-ps-mem-1 = <0x2ee0>;
xlnx,twp-ps-mem-2 = <0x2ee0>;
xlnx,twp-ps-mem-3 = <0x2ee0>;
xlnx,twph-ps-mem-0 = <0x13880>;
xlnx,twph-ps-mem-1 = <0x2ee0>;
xlnx,twph-ps-mem-2 = <0x2ee0>;
xlnx,twph-ps-mem-3 = <0x2ee0>;
xlnx,wr-rec-time-mem-0 = <0x186a0>;
xlnx,wr-rec-time-mem-1 = <0x6978>;
xlnx,wr-rec-time-mem-2 = <0x6978>;
xlnx,wr-rec-time-mem-3 = <0x6978>;
partition@0x00000000 {
label = "fpga";
reg = <0x00000000 0x00b00000>;
};
partition@0x00b00000 {
label = "boot";
reg = <0x00b00000 0x00040000>;
};
partition@0x00b40000 {
label = "bootenv";
reg = <0x00b40000 0x00020000>;
};
partition@0x00b60000 {
label = "image";
reg = <0x00b60000 0x00c00000>;
};
partition@0x01760000 {
label = "spare";
reg = <0x01760000 0x00000000>;
};
} ;
push_buttons_5bits: gpio@40030000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40030000 0x10000>;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x0>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x5>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
reset_gpio: gpio@40000000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40000000 0x10000>;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x1>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x1>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
rs232_uart: serial@40400000 {
clock-frequency = <100000000>;
compatible = "xlnx,axi-uart16550-2.0", "xlnx,xps-uart16550-2.00.a", "ns16550a";
current-speed = <115200>;
device_type = "serial";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <4 2>;
reg = <0x40400000 0x2000>;
reg-offset = <0x1000>;
reg-shift = <2>;
xlnx,external-xin-clk-hz = <0x17d7840>;
xlnx,external-xin-clk-hz-d = <0x19>;
xlnx,has-external-rclk = <0x0>;
xlnx,has-external-xin = <0x0>;
xlnx,is-a-16550 = <0x1>;
xlnx,s-axi-aclk-freq-hz-d = <0x64>;
xlnx,use-modem-ports = <0x1>;
xlnx,use-user-ports = <0x1>;
} ;
} ;
} ;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 13:22 ` Michal Simek
@ 2014-04-04 13:32 ` Rob Herring
2014-04-04 14:11 ` Michal Simek
0 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-04-04 13:32 UTC (permalink / raw)
To: Michal Simek
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
> On 04/04/2014 03:00 PM, Rob Herring wrote:
>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>> From: Rob Herring <robh@kernel.org>
>>>>
>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>> Move this to common location and remove the powerpc and microblaze
>>>> implementations. This feature could become more useful when FDT
>>>> overlay support is added.
>>
>> [snip]
> Anyway I am testing it for microblaze and getting problem
> caused by this patch:
> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
> Author: Rob Herring <robh@kernel.org>
> Date: Wed Apr 2 15:10:14 2014 -0500
>
> of/fdt: Convert FDT functions to use libfdt
>
> And reason is that in unflatten_dt_node()
>
> pathp = fdt_get_name(blob, *poffset, &l);
>
> is returning NULL
> and here
> /* version 0x10 has a more compact unit name here instead of the full
> * path. we accumulate the full path size using "fpsize", we'll rebuild
> * it later. We detect this because the first character of the name is
> * not '/'.
> */
> if ((*pathp) != '/') {
>
> code is trying to read it which is causing this kernel bug:
> Oops: kernel access of bad area, sig: 11
>
> It means fdt_next_node(is doing something wrong)
>
> Any easy way how to debug it?
I didn't think fdt_get_path should fail. Can you add a print of
*poffset and pathp values.
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 13:32 ` Rob Herring
@ 2014-04-04 14:11 ` Michal Simek
2014-04-07 0:42 ` Rob Herring
0 siblings, 1 reply; 11+ messages in thread
From: Michal Simek @ 2014-04-04 14:11 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 4876 bytes --]
On 04/04/2014 03:32 PM, Rob Herring wrote:
> On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
>> On 04/04/2014 03:00 PM, Rob Herring wrote:
>>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>>> From: Rob Herring <robh@kernel.org>
>>>>>
>>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>>> Move this to common location and remove the powerpc and microblaze
>>>>> implementations. This feature could become more useful when FDT
>>>>> overlay support is added.
>>>
>>> [snip]
>
>> Anyway I am testing it for microblaze and getting problem
>> caused by this patch:
>> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
>> Author: Rob Herring <robh@kernel.org>
>> Date: Wed Apr 2 15:10:14 2014 -0500
>>
>> of/fdt: Convert FDT functions to use libfdt
>>
>> And reason is that in unflatten_dt_node()
>>
>> pathp = fdt_get_name(blob, *poffset, &l);
>>
>> is returning NULL
>> and here
>> /* version 0x10 has a more compact unit name here instead of the full
>> * path. we accumulate the full path size using "fpsize", we'll rebuild
>> * it later. We detect this because the first character of the name is
>> * not '/'.
>> */
>> if ((*pathp) != '/') {
>>
>> code is trying to read it which is causing this kernel bug:
>> Oops: kernel access of bad area, sig: 11
>>
>> It means fdt_next_node(is doing something wrong)
>>
>> Any easy way how to debug it?
>
> I didn't think fdt_get_path should fail. Can you add a print of
> *poffset and pathp values.
Early console on uart16650 at 0x40401000
bootconsole [earlyser0] enabled
Ramdisk addr 0x00000000,
FDT at 0x806b96d4
Linux version 3.14.0-rc8-next-20140331-12541-g43b5fdb-dirty (monstr@monstr-desktop) (gcc version 4.6.4 20120924 (prerelease) (crosstool-NG 1.18.0) ) #51 Fri Apr 4 16:09:17 CEST 2014
-> unflatten_device_tree()
Unflattening device tree:
magic: d00dfeed
size: 00014e20
version: 00000011
unflatten_dt_node blob c0298b00, c0331f84 0
unflatten_dt_node 1a c0298b3c/ -- len 0
unflatten_dt_node 8 old offset 0
unflatten_dt_node 8 new offset 6c
unflatten_dt_node blob c0298b00, c0331f84 6c
unflatten_dt_node 1a c0298ba8/aliases -- len 7
unflatten_dt_node 8 old offset 6c
unflatten_dt_node 8 new offset cc
unflatten_dt_node blob c0298b00, c0331f84 cc
unflatten_dt_node 1a c0298c08/chosen -- len 6
unflatten_dt_node 8 old offset cc
unflatten_dt_node 8 new offset 130
unflatten_dt_node blob c0298b00, c0331f84 130
unflatten_dt_node 1a c0298c6c/cpus -- len 4
unflatten_dt_node 8 old offset 130
unflatten_dt_node 8 new offset 16c
unflatten_dt_node blob c0298b00, c0331f84 16c
unflatten_dt_node 1a c0298ca8/cpu@0 -- len 5
unflatten_dt_node 8 old offset 16c
unflatten_dt_node 8 new offset 7bc
unflatten_dt_node blob c0298b00, c0331f84 7bc
unflatten_dt_node 1a (null)/NULL -- len fffffffc
Below is the possition of debug messages.
Thanks,
Michal
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ee8853c..5422e4e 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -8,6 +8,7 @@
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*/
+#define DEBUG
#include <linux/kernel.h>
#include <linux/initrd.h>
@@ -116,9 +117,15 @@ static void * unflatten_dt_node(struct boot_param_header *blob,
int has_name = 0;
int new_format = 0;
+printk("%s blob %x, %x %x\n", __func__, blob, poffset, *poffset);
+
pathp = fdt_get_name(blob, *poffset, &l);
+printk("%s 1a %p/%s -- len %x\n", __func__, pathp, pathp ? pathp : "NULL", l);
+
allocl = l++;
+ if (!pathp)
+ while (1);
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
* it later. We detect this because the first character of the name is
@@ -267,7 +274,9 @@ static void * unflatten_dt_node(struct boot_param_header *blob,
}
old_depth = depth;
+printk("%s 8 old offset %x\n", __func__, *poffset);
*poffset = fdt_next_node(blob, *poffset, &depth);
+printk("%s 8 new offset %x\n", __func__, *poffset);
while (*poffset > 0 && depth > old_depth) {
mem = unflatten_dt_node(blob, mem, poffset, np, allnextpp,
fpsize);
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-04 14:11 ` Michal Simek
@ 2014-04-07 0:42 ` Rob Herring
2014-04-07 7:04 ` Michal Simek
0 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-04-07 0:42 UTC (permalink / raw)
To: Michal Simek
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
On Fri, Apr 4, 2014 at 9:11 AM, Michal Simek <monstr@monstr.eu> wrote:
> On 04/04/2014 03:32 PM, Rob Herring wrote:
>> On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
>>> On 04/04/2014 03:00 PM, Rob Herring wrote:
>>>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>>>> From: Rob Herring <robh@kernel.org>
>>>>>>
>>>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>>>> Move this to common location and remove the powerpc and microblaze
>>>>>> implementations. This feature could become more useful when FDT
>>>>>> overlay support is added.
>>>>
>>>> [snip]
>>
>>> Anyway I am testing it for microblaze and getting problem
>>> caused by this patch:
>>> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
>>> Author: Rob Herring <robh@kernel.org>
>>> Date: Wed Apr 2 15:10:14 2014 -0500
>>>
>>> of/fdt: Convert FDT functions to use libfdt
>>>
>>> And reason is that in unflatten_dt_node()
>>>
>>> pathp = fdt_get_name(blob, *poffset, &l);
>>>
>>> is returning NULL
>>> and here
>>> /* version 0x10 has a more compact unit name here instead of the full
>>> * path. we accumulate the full path size using "fpsize", we'll rebuild
>>> * it later. We detect this because the first character of the name is
>>> * not '/'.
>>> */
>>> if ((*pathp) != '/') {
>>>
>>> code is trying to read it which is causing this kernel bug:
>>> Oops: kernel access of bad area, sig: 11
>>>
>>> It means fdt_next_node(is doing something wrong)
>>>
>>> Any easy way how to debug it?
>>
>> I didn't think fdt_get_path should fail. Can you add a print of
>> *poffset and pathp values.
I think I've fixed this now and updated the branch. Please test again
when you have a chance.
Thanks,
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 09/20] of/fdt: create common debugfs
2014-04-07 0:42 ` Rob Herring
@ 2014-04-07 7:04 ` Michal Simek
0 siblings, 0 replies; 11+ messages in thread
From: Michal Simek @ 2014-04-07 7:04 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]
On 04/07/2014 02:42 AM, Rob Herring wrote:
> On Fri, Apr 4, 2014 at 9:11 AM, Michal Simek <monstr@monstr.eu> wrote:
>> On 04/04/2014 03:32 PM, Rob Herring wrote:
>>> On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
>>>> On 04/04/2014 03:00 PM, Rob Herring wrote:
>>>>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>>>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>>>>> From: Rob Herring <robh@kernel.org>
>>>>>>>
>>>>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>>>>> Move this to common location and remove the powerpc and microblaze
>>>>>>> implementations. This feature could become more useful when FDT
>>>>>>> overlay support is added.
>>>>>
>>>>> [snip]
>>>
>>>> Anyway I am testing it for microblaze and getting problem
>>>> caused by this patch:
>>>> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
>>>> Author: Rob Herring <robh@kernel.org>
>>>> Date: Wed Apr 2 15:10:14 2014 -0500
>>>>
>>>> of/fdt: Convert FDT functions to use libfdt
>>>>
>>>> And reason is that in unflatten_dt_node()
>>>>
>>>> pathp = fdt_get_name(blob, *poffset, &l);
>>>>
>>>> is returning NULL
>>>> and here
>>>> /* version 0x10 has a more compact unit name here instead of the full
>>>> * path. we accumulate the full path size using "fpsize", we'll rebuild
>>>> * it later. We detect this because the first character of the name is
>>>> * not '/'.
>>>> */
>>>> if ((*pathp) != '/') {
>>>>
>>>> code is trying to read it which is causing this kernel bug:
>>>> Oops: kernel access of bad area, sig: 11
>>>>
>>>> It means fdt_next_node(is doing something wrong)
>>>>
>>>> Any easy way how to debug it?
>>>
>>> I didn't think fdt_get_path should fail. Can you add a print of
>>> *poffset and pathp values.
>
> I think I've fixed this now and updated the branch. Please test again
> when you have a chance.
yep. The updated branch works for Microblaze.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-04-07 7:05 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 22:16 [PATCH 00/20] FDT clean-ups and libfdt support Rob Herring
2014-04-03 22:16 ` [PATCH 09/20] of/fdt: create common debugfs Rob Herring
2014-04-04 12:16 ` Michal Simek
2014-04-04 12:22 ` Michal Simek
2014-04-04 13:00 ` Rob Herring
2014-04-04 13:22 ` Michal Simek
2014-04-04 13:32 ` Rob Herring
2014-04-04 14:11 ` Michal Simek
2014-04-07 0:42 ` Rob Herring
2014-04-07 7:04 ` Michal Simek
2014-04-03 22:17 ` [PATCH 20/20] of: push struct boot_param_header and defines into powerpc Rob Herring
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).