* [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-27 21:49 ` Dezhong Diao
0 siblings, 0 replies; 23+ messages in thread
From: Dezhong Diao @ 2010-07-27 21:49 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-mips, glikely, ralf, dvomlehn
V2:
Synchronize with test-devicetree branch of device tree.
V1:
Add common code to support device tree on MIPS.
Signed-off-by: Dezhong Diao <dediao@cisco.com>
---
arch/mips/Kconfig | 13 ++++
arch/mips/include/asm/prom.h | 61 ++++++++++++++++
arch/mips/kernel/Makefile | 2 +
arch/mips/kernel/prom.c | 158 ++++++++++++++++++++++++++++++++++++++++++
arch/mips/kernel/setup.c | 2 +
5 files changed, 236 insertions(+), 0 deletions(-)
create mode 100644 arch/mips/include/asm/prom.h
create mode 100644 arch/mips/kernel/prom.c
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index cdaae94..d85e8fb 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2083,6 +2083,19 @@ config SECCOMP
If unsure, say Y. Only embedded should say N here.
+config USE_OF
+ bool "Flattened Device Tree support"
+ select OF
+ select OF_FLATTREE
+ help
+ Include support for flattened device tree machine descriptions.
+
+config ARCH_HAS_DEVTREE_MEM
+ bool "Support user-defined memory scan function in device tree"
+ depends on OF
+ help
+ The user has a customized function to parse memory nodes.
+
endmenu
config LOCKDEP_SUPPORT
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
new file mode 100644
index 0000000..b798b19
--- /dev/null
+++ b/arch/mips/include/asm/prom.h
@@ -0,0 +1,61 @@
+/*
+ * arch/mips/include/asm/prom.h
+ *
+ * Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_MIPS_PROM_H
+#define __ASM_MIPS_PROM_H
+
+#ifdef CONFIG_OF
+#include <linux/init.h>
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/bootinfo.h>
+
+/* which is compatible with the flattened device tree (FDT) */
+#define cmd_line arcs_cmdline
+
+/*
+ * Use this value to indicate lack of interrupt
+ * capability
+ */
+#ifndef NO_IRQ
+#define NO_IRQ ((unsigned int)(-1))
+#endif
+
+static inline unsigned long pci_address_to_pio(phys_addr_t address)
+{
+ return (unsigned long)-1;
+}
+
+struct device_node;
+
+static inline int of_node_to_nid(struct device_node *device)
+{
+ return 0;
+}
+
+static inline void __init early_init_dt_scan_chosen_arch(unsigned long node)
+{
+}
+
+extern int __init early_init_dt_scan_memory_arch(unsigned long node,
+ const char *uname, int depth, void *data);
+
+extern int __init reserve_mem_mach(unsigned long addr, unsigned long size);
+extern void __init free_mem_mach(unsigned long addr, unsigned long size);
+
+extern void __init device_tree_init(void);
+#else /* CONFIG_OF */
+static inline void __init device_tree_init(void)
+{
+}
+#endif /* CONFIG_OF */
+
+#endif /* _ASM_MIPS_PROM_H */
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 7a6ac50..4d4ceb1 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -95,6 +95,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
+obj-$(CONFIG_OF) += prom.o
+
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
new file mode 100644
index 0000000..fb4adc2
--- /dev/null
+++ b/arch/mips/kernel/prom.c
@@ -0,0 +1,158 @@
+/*
+ * linux/arch/mips/kernel/prom.c
+ *
+ * Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/bootmem.h>
+#include <linux/initrd.h>
+#include <linux/debugfs.h>
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/page.h>
+#include <asm/prom.h>
+
+/*
+ * The list of OF IDs below is used for matching bus types in the
+ * system whose devices are to be exposed as of_platform_devices.
+ *
+ * This is the default list valid for most platforms. This file provides
+ * functions who can take an explicit list if necessary though
+ *
+ * The search is always performed recursively looking for children of
+ * the provided device_node and recursively if such a children matches
+ * a bus type in the list
+ */
+const struct of_device_id of_default_bus_ids[] = {
+ {},
+};
+
+#ifndef CONFIG_ARCH_HAS_DEVTREE_MEM
+int __init early_init_dt_scan_memory_arch(unsigned long node,
+ const char *uname, int depth,
+ void *data)
+{
+ return early_init_dt_scan_memory(node, uname, depth, data);
+}
+
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+ return add_memory_region(base, size, BOOT_MEM_RAM);
+}
+
+int __init reserve_mem_mach(unsigned long addr, unsigned long size)
+{
+ return reserve_bootmem(addr, size, BOOTMEM_DEFAULT);
+}
+
+void __init free_mem_mach(unsigned long addr, unsigned long size)
+{
+ return free_bootmem(addr, size);
+}
+#endif
+
+u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+ return virt_to_phys(
+ __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
+ );
+}
+
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init early_init_dt_setup_initrd_arch(unsigned long start,
+ unsigned long end)
+{
+ initrd_start = (unsigned long)__va(start);
+ initrd_end = (unsigned long)__va(end);
+ initrd_below_start_ok = 1;
+}
+#endif
+
+/*
+ * Interrupt remapper
+ */
+struct device_node *of_irq_find_parent_by_phandle(phandle p)
+{
+ return of_find_node_by_phandle(p);
+}
+
+/*
+ * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
+ *
+ * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
+ * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
+ * supported.
+ */
+unsigned int irq_create_of_mapping(struct device_node *controller,
+ const u32 *intspec, unsigned int intsize)
+{
+ return intspec[0];
+}
+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
+
+void __init early_init_devtree(void *params)
+{
+ /* Setup flat device-tree pointer */
+ initial_boot_params = params;
+
+ /* Retrieve various informations from the /chosen node of the
+ * device-tree, including the platform type, initrd location and
+ * size, and more ...
+ */
+ of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
+
+ /* Scan memory nodes */
+ of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
+}
+
+void __init device_tree_init(void)
+{
+ unsigned long base, size;
+
+ if (!initial_boot_params)
+ return;
+
+ base = virt_to_phys((void *)initial_boot_params);
+ size = initial_boot_params->totalsize;
+
+ /* Before we do anything, lets reserve the dt blob */
+ reserve_mem_mach(base, size);
+
+ unflatten_device_tree();
+
+ /* free the space reserved for the dt blob */
+ free_mem_mach(base, size);
+}
+
+#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
+static struct dentry *of_debugfs_root;
+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/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 85aef3f..a6b900f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -31,6 +31,7 @@
#include <asm/setup.h>
#include <asm/smp-ops.h>
#include <asm/system.h>
+#include <asm/prom.h>
struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
@@ -487,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
}
bootmem_init();
+ device_tree_init();
sparse_init();
paging_init();
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-27 21:49 ` Dezhong Diao
0 siblings, 0 replies; 23+ messages in thread
From: Dezhong Diao @ 2010-07-27 21:49 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA, glikely-s3s/WqlpOiPyB63q8FvJNQ,
ralf-6z/3iImG2C8G8FEW9MqTrA, dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w
V2:
Synchronize with test-devicetree branch of device tree.
V1:
Add common code to support device tree on MIPS.
Signed-off-by: Dezhong Diao <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
arch/mips/Kconfig | 13 ++++
arch/mips/include/asm/prom.h | 61 ++++++++++++++++
arch/mips/kernel/Makefile | 2 +
arch/mips/kernel/prom.c | 158 ++++++++++++++++++++++++++++++++++++++++++
arch/mips/kernel/setup.c | 2 +
5 files changed, 236 insertions(+), 0 deletions(-)
create mode 100644 arch/mips/include/asm/prom.h
create mode 100644 arch/mips/kernel/prom.c
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index cdaae94..d85e8fb 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2083,6 +2083,19 @@ config SECCOMP
If unsure, say Y. Only embedded should say N here.
+config USE_OF
+ bool "Flattened Device Tree support"
+ select OF
+ select OF_FLATTREE
+ help
+ Include support for flattened device tree machine descriptions.
+
+config ARCH_HAS_DEVTREE_MEM
+ bool "Support user-defined memory scan function in device tree"
+ depends on OF
+ help
+ The user has a customized function to parse memory nodes.
+
endmenu
config LOCKDEP_SUPPORT
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
new file mode 100644
index 0000000..b798b19
--- /dev/null
+++ b/arch/mips/include/asm/prom.h
@@ -0,0 +1,61 @@
+/*
+ * arch/mips/include/asm/prom.h
+ *
+ * Copyright (C) 2010 Cisco Systems Inc. <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_MIPS_PROM_H
+#define __ASM_MIPS_PROM_H
+
+#ifdef CONFIG_OF
+#include <linux/init.h>
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/bootinfo.h>
+
+/* which is compatible with the flattened device tree (FDT) */
+#define cmd_line arcs_cmdline
+
+/*
+ * Use this value to indicate lack of interrupt
+ * capability
+ */
+#ifndef NO_IRQ
+#define NO_IRQ ((unsigned int)(-1))
+#endif
+
+static inline unsigned long pci_address_to_pio(phys_addr_t address)
+{
+ return (unsigned long)-1;
+}
+
+struct device_node;
+
+static inline int of_node_to_nid(struct device_node *device)
+{
+ return 0;
+}
+
+static inline void __init early_init_dt_scan_chosen_arch(unsigned long node)
+{
+}
+
+extern int __init early_init_dt_scan_memory_arch(unsigned long node,
+ const char *uname, int depth, void *data);
+
+extern int __init reserve_mem_mach(unsigned long addr, unsigned long size);
+extern void __init free_mem_mach(unsigned long addr, unsigned long size);
+
+extern void __init device_tree_init(void);
+#else /* CONFIG_OF */
+static inline void __init device_tree_init(void)
+{
+}
+#endif /* CONFIG_OF */
+
+#endif /* _ASM_MIPS_PROM_H */
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 7a6ac50..4d4ceb1 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -95,6 +95,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
+obj-$(CONFIG_OF) += prom.o
+
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
new file mode 100644
index 0000000..fb4adc2
--- /dev/null
+++ b/arch/mips/kernel/prom.c
@@ -0,0 +1,158 @@
+/*
+ * linux/arch/mips/kernel/prom.c
+ *
+ * Copyright (C) 2010 Cisco Systems Inc. <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/bootmem.h>
+#include <linux/initrd.h>
+#include <linux/debugfs.h>
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/page.h>
+#include <asm/prom.h>
+
+/*
+ * The list of OF IDs below is used for matching bus types in the
+ * system whose devices are to be exposed as of_platform_devices.
+ *
+ * This is the default list valid for most platforms. This file provides
+ * functions who can take an explicit list if necessary though
+ *
+ * The search is always performed recursively looking for children of
+ * the provided device_node and recursively if such a children matches
+ * a bus type in the list
+ */
+const struct of_device_id of_default_bus_ids[] = {
+ {},
+};
+
+#ifndef CONFIG_ARCH_HAS_DEVTREE_MEM
+int __init early_init_dt_scan_memory_arch(unsigned long node,
+ const char *uname, int depth,
+ void *data)
+{
+ return early_init_dt_scan_memory(node, uname, depth, data);
+}
+
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+ return add_memory_region(base, size, BOOT_MEM_RAM);
+}
+
+int __init reserve_mem_mach(unsigned long addr, unsigned long size)
+{
+ return reserve_bootmem(addr, size, BOOTMEM_DEFAULT);
+}
+
+void __init free_mem_mach(unsigned long addr, unsigned long size)
+{
+ return free_bootmem(addr, size);
+}
+#endif
+
+u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+ return virt_to_phys(
+ __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
+ );
+}
+
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init early_init_dt_setup_initrd_arch(unsigned long start,
+ unsigned long end)
+{
+ initrd_start = (unsigned long)__va(start);
+ initrd_end = (unsigned long)__va(end);
+ initrd_below_start_ok = 1;
+}
+#endif
+
+/*
+ * Interrupt remapper
+ */
+struct device_node *of_irq_find_parent_by_phandle(phandle p)
+{
+ return of_find_node_by_phandle(p);
+}
+
+/*
+ * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
+ *
+ * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
+ * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
+ * supported.
+ */
+unsigned int irq_create_of_mapping(struct device_node *controller,
+ const u32 *intspec, unsigned int intsize)
+{
+ return intspec[0];
+}
+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
+
+void __init early_init_devtree(void *params)
+{
+ /* Setup flat device-tree pointer */
+ initial_boot_params = params;
+
+ /* Retrieve various informations from the /chosen node of the
+ * device-tree, including the platform type, initrd location and
+ * size, and more ...
+ */
+ of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
+
+ /* Scan memory nodes */
+ of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
+}
+
+void __init device_tree_init(void)
+{
+ unsigned long base, size;
+
+ if (!initial_boot_params)
+ return;
+
+ base = virt_to_phys((void *)initial_boot_params);
+ size = initial_boot_params->totalsize;
+
+ /* Before we do anything, lets reserve the dt blob */
+ reserve_mem_mach(base, size);
+
+ unflatten_device_tree();
+
+ /* free the space reserved for the dt blob */
+ free_mem_mach(base, size);
+}
+
+#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
+static struct dentry *of_debugfs_root;
+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/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 85aef3f..a6b900f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -31,6 +31,7 @@
#include <asm/setup.h>
#include <asm/smp-ops.h>
#include <asm/system.h>
+#include <asm/prom.h>
struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
@@ -487,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
}
bootmem_init();
+ device_tree_init();
sparse_init();
paging_init();
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 18:54 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-28 18:54 UTC (permalink / raw)
To: Dezhong Diao; +Cc: devicetree-discuss, linux-mips, ralf, dvomlehn
Hi Dezhong,
Thanks for the patches. Do you want me to carry these in my test tree
for a while? I won't be able to test them, but I'll be able to rework
as I make changes to the drivers/of core code. I'm still making
changes to reduce the number of symbols that architectures need to
implement in order to bring up CONFIG_OF support.
Comments below.
On Tue, Jul 27, 2010 at 3:49 PM, Dezhong Diao <dediao@cisco.com> wrote:
> V2:
> Synchronize with test-devicetree branch of device tree.
>
> V1:
> Add common code to support device tree on MIPS.
>
> Signed-off-by: Dezhong Diao <dediao@cisco.com>
> ---
> arch/mips/Kconfig | 13 ++++
> arch/mips/include/asm/prom.h | 61 ++++++++++++++++
> arch/mips/kernel/Makefile | 2 +
> arch/mips/kernel/prom.c | 158 ++++++++++++++++++++++++++++++++++++++++++
> arch/mips/kernel/setup.c | 2 +
> 5 files changed, 236 insertions(+), 0 deletions(-)
> create mode 100644 arch/mips/include/asm/prom.h
> create mode 100644 arch/mips/kernel/prom.c
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index cdaae94..d85e8fb 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2083,6 +2083,19 @@ config SECCOMP
>
> If unsure, say Y. Only embedded should say N here.
>
> +config USE_OF
> + bool "Flattened Device Tree support"
> + select OF
> + select OF_FLATTREE
> + help
> + Include support for flattened device tree machine descriptions.
> +
> +config ARCH_HAS_DEVTREE_MEM
> + bool "Support user-defined memory scan function in device tree"
> + depends on OF
> + help
> + The user has a customized function to parse memory nodes.
> +
Hmm, This is a little ugly. I should rework the memory functions
override code to not require this config symbol. I'll look into that.
> endmenu
>
> config LOCKDEP_SUPPORT
> diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
> new file mode 100644
> index 0000000..b798b19
> --- /dev/null
> +++ b/arch/mips/include/asm/prom.h
> @@ -0,0 +1,61 @@
> +/*
> + * arch/mips/include/asm/prom.h
> + *
> + * Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +#ifndef __ASM_MIPS_PROM_H
> +#define __ASM_MIPS_PROM_H
> +
> +#ifdef CONFIG_OF
> +#include <linux/init.h>
> +
> +#include <asm/setup.h>
> +#include <asm/irq.h>
> +#include <asm/bootinfo.h>
> +
> +/* which is compatible with the flattened device tree (FDT) */
> +#define cmd_line arcs_cmdline
> +
> +/*
> + * Use this value to indicate lack of interrupt
> + * capability
> + */
> +#ifndef NO_IRQ
> +#define NO_IRQ ((unsigned int)(-1))
> +#endif
> +
> +static inline unsigned long pci_address_to_pio(phys_addr_t address)
> +{
> + return (unsigned long)-1;
> +}
> +
> +struct device_node;
> +
> +static inline int of_node_to_nid(struct device_node *device)
> +{
> + return 0;
> +}
This should no longer be necessary in the current test-devicetree branch.
> +
> +static inline void __init early_init_dt_scan_chosen_arch(unsigned long node)
> +{
> +}
> +
> +extern int __init early_init_dt_scan_memory_arch(unsigned long node,
> + const char *uname, int depth, void *data);
> +
> +extern int __init reserve_mem_mach(unsigned long addr, unsigned long size);
> +extern void __init free_mem_mach(unsigned long addr, unsigned long size);
> +
> +extern void __init device_tree_init(void);
> +#else /* CONFIG_OF */
> +static inline void __init device_tree_init(void)
> +{
> +}
> +#endif /* CONFIG_OF */
> +
> +#endif /* _ASM_MIPS_PROM_H */
> diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
> index 7a6ac50..4d4ceb1 100644
> --- a/arch/mips/kernel/Makefile
> +++ b/arch/mips/kernel/Makefile
> @@ -95,6 +95,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
> obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
>
> +obj-$(CONFIG_OF) += prom.o
> +
> CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
>
> obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
> diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
> new file mode 100644
> index 0000000..fb4adc2
> --- /dev/null
> +++ b/arch/mips/kernel/prom.c
> @@ -0,0 +1,158 @@
> +/*
> + * linux/arch/mips/kernel/prom.c
> + *
> + * Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/errno.h>
> +#include <linux/types.h>
> +#include <linux/bootmem.h>
> +#include <linux/initrd.h>
> +#include <linux/debugfs.h>
> +#include <linux/of.h>
> +#include <linux/of_fdt.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/page.h>
> +#include <asm/prom.h>
> +
> +/*
> + * The list of OF IDs below is used for matching bus types in the
> + * system whose devices are to be exposed as of_platform_devices.
> + *
> + * This is the default list valid for most platforms. This file provides
> + * functions who can take an explicit list if necessary though
> + *
> + * The search is always performed recursively looking for children of
> + * the provided device_node and recursively if such a children matches
> + * a bus type in the list
> + */
> +const struct of_device_id of_default_bus_ids[] = {
> + {},
> +};
You can also remove this symbol now.
> +
> +#ifndef CONFIG_ARCH_HAS_DEVTREE_MEM
> +int __init early_init_dt_scan_memory_arch(unsigned long node,
> + const char *uname, int depth,
> + void *data)
> +{
> + return early_init_dt_scan_memory(node, uname, depth, data);
> +}
> +
> +void __init early_init_dt_add_memory_arch(u64 base, u64 size)
> +{
> + return add_memory_region(base, size, BOOT_MEM_RAM);
> +}
> +
> +int __init reserve_mem_mach(unsigned long addr, unsigned long size)
> +{
> + return reserve_bootmem(addr, size, BOOTMEM_DEFAULT);
> +}
> +
> +void __init free_mem_mach(unsigned long addr, unsigned long size)
> +{
> + return free_bootmem(addr, size);
> +}
> +#endif
> +
> +u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
> +{
> + return virt_to_phys(
> + __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
> + );
> +}
> +
> +#ifdef CONFIG_BLK_DEV_INITRD
> +void __init early_init_dt_setup_initrd_arch(unsigned long start,
> + unsigned long end)
> +{
> + initrd_start = (unsigned long)__va(start);
> + initrd_end = (unsigned long)__va(end);
> + initrd_below_start_ok = 1;
> +}
> +#endif
> +
> +/*
> + * Interrupt remapper
> + */
> +struct device_node *of_irq_find_parent_by_phandle(phandle p)
> +{
> + return of_find_node_by_phandle(p);
> +}
Also can be removed.
> +
> +/*
> + * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
> + *
> + * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
> + * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
> + * supported.
> + */
> +unsigned int irq_create_of_mapping(struct device_node *controller,
> + const u32 *intspec, unsigned int intsize)
> +{
> + return intspec[0];
> +}
> +EXPORT_SYMBOL_GPL(irq_create_of_mapping);
> +
> +void __init early_init_devtree(void *params)
> +{
> + /* Setup flat device-tree pointer */
> + initial_boot_params = params;
> +
> + /* Retrieve various informations from the /chosen node of the
> + * device-tree, including the platform type, initrd location and
> + * size, and more ...
> + */
> + of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
> +
> + /* Scan memory nodes */
> + of_scan_flat_dt(early_init_dt_scan_root, NULL);
> + of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
> +}
> +
> +void __init device_tree_init(void)
> +{
> + unsigned long base, size;
> +
> + if (!initial_boot_params)
> + return;
> +
> + base = virt_to_phys((void *)initial_boot_params);
> + size = initial_boot_params->totalsize;
> +
> + /* Before we do anything, lets reserve the dt blob */
> + reserve_mem_mach(base, size);
> +
> + unflatten_device_tree();
> +
> + /* free the space reserved for the dt blob */
> + free_mem_mach(base, size);
> +}
> +
> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> +static struct dentry *of_debugfs_root;
> +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
I'm probably also going to move the debugfs file into common code
(unless someone beats me to it). :-)
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index 85aef3f..a6b900f 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -31,6 +31,7 @@
> #include <asm/setup.h>
> #include <asm/smp-ops.h>
> #include <asm/system.h>
> +#include <asm/prom.h>
>
> struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
>
> @@ -487,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
> }
>
> bootmem_init();
> + device_tree_init();
> sparse_init();
> paging_init();
> }
Very nice clean patch, thanks! How/when would you like to see MIPS OF
support go into mainline?
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 18:54 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-28 18:54 UTC (permalink / raw)
To: Dezhong Diao
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
ralf-6z/3iImG2C8G8FEW9MqTrA, dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w
Hi Dezhong,
Thanks for the patches. Do you want me to carry these in my test tree
for a while? I won't be able to test them, but I'll be able to rework
as I make changes to the drivers/of core code. I'm still making
changes to reduce the number of symbols that architectures need to
implement in order to bring up CONFIG_OF support.
Comments below.
On Tue, Jul 27, 2010 at 3:49 PM, Dezhong Diao <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> wrote:
> V2:
> Synchronize with test-devicetree branch of device tree.
>
> V1:
> Add common code to support device tree on MIPS.
>
> Signed-off-by: Dezhong Diao <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> ---
> arch/mips/Kconfig | 13 ++++
> arch/mips/include/asm/prom.h | 61 ++++++++++++++++
> arch/mips/kernel/Makefile | 2 +
> arch/mips/kernel/prom.c | 158 ++++++++++++++++++++++++++++++++++++++++++
> arch/mips/kernel/setup.c | 2 +
> 5 files changed, 236 insertions(+), 0 deletions(-)
> create mode 100644 arch/mips/include/asm/prom.h
> create mode 100644 arch/mips/kernel/prom.c
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index cdaae94..d85e8fb 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2083,6 +2083,19 @@ config SECCOMP
>
> If unsure, say Y. Only embedded should say N here.
>
> +config USE_OF
> + bool "Flattened Device Tree support"
> + select OF
> + select OF_FLATTREE
> + help
> + Include support for flattened device tree machine descriptions.
> +
> +config ARCH_HAS_DEVTREE_MEM
> + bool "Support user-defined memory scan function in device tree"
> + depends on OF
> + help
> + The user has a customized function to parse memory nodes.
> +
Hmm, This is a little ugly. I should rework the memory functions
override code to not require this config symbol. I'll look into that.
> endmenu
>
> config LOCKDEP_SUPPORT
> diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
> new file mode 100644
> index 0000000..b798b19
> --- /dev/null
> +++ b/arch/mips/include/asm/prom.h
> @@ -0,0 +1,61 @@
> +/*
> + * arch/mips/include/asm/prom.h
> + *
> + * Copyright (C) 2010 Cisco Systems Inc. <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +#ifndef __ASM_MIPS_PROM_H
> +#define __ASM_MIPS_PROM_H
> +
> +#ifdef CONFIG_OF
> +#include <linux/init.h>
> +
> +#include <asm/setup.h>
> +#include <asm/irq.h>
> +#include <asm/bootinfo.h>
> +
> +/* which is compatible with the flattened device tree (FDT) */
> +#define cmd_line arcs_cmdline
> +
> +/*
> + * Use this value to indicate lack of interrupt
> + * capability
> + */
> +#ifndef NO_IRQ
> +#define NO_IRQ ((unsigned int)(-1))
> +#endif
> +
> +static inline unsigned long pci_address_to_pio(phys_addr_t address)
> +{
> + return (unsigned long)-1;
> +}
> +
> +struct device_node;
> +
> +static inline int of_node_to_nid(struct device_node *device)
> +{
> + return 0;
> +}
This should no longer be necessary in the current test-devicetree branch.
> +
> +static inline void __init early_init_dt_scan_chosen_arch(unsigned long node)
> +{
> +}
> +
> +extern int __init early_init_dt_scan_memory_arch(unsigned long node,
> + const char *uname, int depth, void *data);
> +
> +extern int __init reserve_mem_mach(unsigned long addr, unsigned long size);
> +extern void __init free_mem_mach(unsigned long addr, unsigned long size);
> +
> +extern void __init device_tree_init(void);
> +#else /* CONFIG_OF */
> +static inline void __init device_tree_init(void)
> +{
> +}
> +#endif /* CONFIG_OF */
> +
> +#endif /* _ASM_MIPS_PROM_H */
> diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
> index 7a6ac50..4d4ceb1 100644
> --- a/arch/mips/kernel/Makefile
> +++ b/arch/mips/kernel/Makefile
> @@ -95,6 +95,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
> obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
>
> +obj-$(CONFIG_OF) += prom.o
> +
> CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
>
> obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
> diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
> new file mode 100644
> index 0000000..fb4adc2
> --- /dev/null
> +++ b/arch/mips/kernel/prom.c
> @@ -0,0 +1,158 @@
> +/*
> + * linux/arch/mips/kernel/prom.c
> + *
> + * Copyright (C) 2010 Cisco Systems Inc. <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/errno.h>
> +#include <linux/types.h>
> +#include <linux/bootmem.h>
> +#include <linux/initrd.h>
> +#include <linux/debugfs.h>
> +#include <linux/of.h>
> +#include <linux/of_fdt.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/page.h>
> +#include <asm/prom.h>
> +
> +/*
> + * The list of OF IDs below is used for matching bus types in the
> + * system whose devices are to be exposed as of_platform_devices.
> + *
> + * This is the default list valid for most platforms. This file provides
> + * functions who can take an explicit list if necessary though
> + *
> + * The search is always performed recursively looking for children of
> + * the provided device_node and recursively if such a children matches
> + * a bus type in the list
> + */
> +const struct of_device_id of_default_bus_ids[] = {
> + {},
> +};
You can also remove this symbol now.
> +
> +#ifndef CONFIG_ARCH_HAS_DEVTREE_MEM
> +int __init early_init_dt_scan_memory_arch(unsigned long node,
> + const char *uname, int depth,
> + void *data)
> +{
> + return early_init_dt_scan_memory(node, uname, depth, data);
> +}
> +
> +void __init early_init_dt_add_memory_arch(u64 base, u64 size)
> +{
> + return add_memory_region(base, size, BOOT_MEM_RAM);
> +}
> +
> +int __init reserve_mem_mach(unsigned long addr, unsigned long size)
> +{
> + return reserve_bootmem(addr, size, BOOTMEM_DEFAULT);
> +}
> +
> +void __init free_mem_mach(unsigned long addr, unsigned long size)
> +{
> + return free_bootmem(addr, size);
> +}
> +#endif
> +
> +u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
> +{
> + return virt_to_phys(
> + __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
> + );
> +}
> +
> +#ifdef CONFIG_BLK_DEV_INITRD
> +void __init early_init_dt_setup_initrd_arch(unsigned long start,
> + unsigned long end)
> +{
> + initrd_start = (unsigned long)__va(start);
> + initrd_end = (unsigned long)__va(end);
> + initrd_below_start_ok = 1;
> +}
> +#endif
> +
> +/*
> + * Interrupt remapper
> + */
> +struct device_node *of_irq_find_parent_by_phandle(phandle p)
> +{
> + return of_find_node_by_phandle(p);
> +}
Also can be removed.
> +
> +/*
> + * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
> + *
> + * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
> + * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
> + * supported.
> + */
> +unsigned int irq_create_of_mapping(struct device_node *controller,
> + const u32 *intspec, unsigned int intsize)
> +{
> + return intspec[0];
> +}
> +EXPORT_SYMBOL_GPL(irq_create_of_mapping);
> +
> +void __init early_init_devtree(void *params)
> +{
> + /* Setup flat device-tree pointer */
> + initial_boot_params = params;
> +
> + /* Retrieve various informations from the /chosen node of the
> + * device-tree, including the platform type, initrd location and
> + * size, and more ...
> + */
> + of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
> +
> + /* Scan memory nodes */
> + of_scan_flat_dt(early_init_dt_scan_root, NULL);
> + of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
> +}
> +
> +void __init device_tree_init(void)
> +{
> + unsigned long base, size;
> +
> + if (!initial_boot_params)
> + return;
> +
> + base = virt_to_phys((void *)initial_boot_params);
> + size = initial_boot_params->totalsize;
> +
> + /* Before we do anything, lets reserve the dt blob */
> + reserve_mem_mach(base, size);
> +
> + unflatten_device_tree();
> +
> + /* free the space reserved for the dt blob */
> + free_mem_mach(base, size);
> +}
> +
> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> +static struct dentry *of_debugfs_root;
> +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
I'm probably also going to move the debugfs file into common code
(unless someone beats me to it). :-)
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index 85aef3f..a6b900f 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -31,6 +31,7 @@
> #include <asm/setup.h>
> #include <asm/smp-ops.h>
> #include <asm/system.h>
> +#include <asm/prom.h>
>
> struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
>
> @@ -487,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
> }
>
> bootmem_init();
> + device_tree_init();
> sparse_init();
> paging_init();
> }
Very nice clean patch, thanks! How/when would you like to see MIPS OF
support go into mainline?
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
2010-07-28 18:54 ` Grant Likely
(?)
@ 2010-07-28 19:19 ` David Daney
2010-07-28 19:25 ` Grant Likely
-1 siblings, 1 reply; 23+ messages in thread
From: David Daney @ 2010-07-28 19:19 UTC (permalink / raw)
To: Grant Likely; +Cc: Dezhong Diao, devicetree-discuss, linux-mips, ralf, dvomlehn
On 07/28/2010 11:54 AM, Grant Likely wrote:
> Hi Dezhong,
[...]
>
> Very nice clean patch, thanks! How/when would you like to see MIPS OF
> support go into mainline?
>
I can't speak for the patch authors, but my preference would be to have
MIPS OF support go in to 2.6.36 if possible.
How? To me it doesn't matter. I would let you and Ralf fight it out.
Thanks,
David Daney
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 19:25 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-28 19:25 UTC (permalink / raw)
To: David Daney; +Cc: Dezhong Diao, devicetree-discuss, linux-mips, ralf, dvomlehn
On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 07/28/2010 11:54 AM, Grant Likely wrote:
>>
>> Hi Dezhong,
>
> [...]
>>
>> Very nice clean patch, thanks! How/when would you like to see MIPS OF
>> support go into mainline?
>>
>
> I can't speak for the patch authors, but my preference would be to have MIPS
> OF support go in to 2.6.36 if possible.
>
> How? To me it doesn't matter. I would let you and Ralf fight it out.
It would probably be best if I at least pick up the first patch into
my test tree to give it a spin with the latest changes. I'd be happy
to take the 2nd too to avoid ordering issues.
Cheers,
g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 19:25 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-28 19:25 UTC (permalink / raw)
To: David Daney
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
ralf-6z/3iImG2C8G8FEW9MqTrA, dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w
On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org> wrote:
> On 07/28/2010 11:54 AM, Grant Likely wrote:
>>
>> Hi Dezhong,
>
> [...]
>>
>> Very nice clean patch, thanks! How/when would you like to see MIPS OF
>> support go into mainline?
>>
>
> I can't speak for the patch authors, but my preference would be to have MIPS
> OF support go in to 2.6.36 if possible.
>
> How? To me it doesn't matter. I would let you and Ralf fight it out.
It would probably be best if I at least pick up the first patch into
my test tree to give it a spin with the latest changes. I'd be happy
to take the 2nd too to avoid ordering issues.
Cheers,
g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 20:47 ` Dezhong Diao (dediao)
0 siblings, 0 replies; 23+ messages in thread
From: Dezhong Diao (dediao) @ 2010-07-28 20:47 UTC (permalink / raw)
To: Grant Likely, David Daney
Cc: devicetree-discuss, linux-mips, ralf, David VomLehn (dvomlehn)
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]
Grant,
I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
Thanks.
Dezhong
-----Original Message-----
From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely
Sent: Wednesday, July 28, 2010 12:26 PM
To: David Daney
Cc: Dezhong Diao (dediao); devicetree-discuss@lists.ozlabs.org; linux-mips@linux-mips.org; ralf@linux-mips.org; David VomLehn (dvomlehn)
Subject: Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 07/28/2010 11:54 AM, Grant Likely wrote:
>>
>> Hi Dezhong,
>
> [...]
>>
>> Very nice clean patch, thanks! How/when would you like to see MIPS
>> OF support go into mainline?
>>
>
> I can't speak for the patch authors, but my preference would be to
> have MIPS OF support go in to 2.6.36 if possible.
>
> How? To me it doesn't matter. I would let you and Ralf fight it out.
It would probably be best if I at least pick up the first patch into my test tree to give it a spin with the latest changes. I'd be happy to take the 2nd too to avoid ordering issues.
Cheers,
g.
[-- Attachment #2: 8KG6-DeviceTree-512MB.dts --]
[-- Type: application/octet-stream, Size: 1615 bytes --]
/dts-v1/;
/ {
model = "Explorer";
compatible = "Explorer", "Calliope";
copyright = "Copyright (c) 2008 Cisco Systems, Inc. All Rights Reserved.";
#address-cells = <0x1>;
#size-cells = <0x1>;
cpus {
name = "cpus";
#address-cells = <0x1>;
#size-cells = <0x0>;
24k@0 {
device_type = "cpu";
reg = <0x0>;
clock-frequency = <0x5f5e1000>;
timebase-frequency = <0x1fca055>;
i-cache-size = <0x8000>;
d-cache-size = <0x8000>;
};
};
memories {
name = "memories";
device_type = "memory";
#address-cells = <0x3>;
#size-cells = <0x0>;
memory@0 {
memory_type = "low";
reg = <0x10000000 0x20000000 0xfc00000>;
};
memory@1 {
memory_type = "MIPS reset vector";
reg = <0x1fc00000 0x7fcffff 0x400000>;
};
memory@2 {
memory_type = "gp-sram";
reg = <0x9040000 0x9040000 0x30000>;
};
memory@3 {
memory_type = "high";
reg = <0x2fc00000 0x2fc00000 0x400000>;
};
memory@4 {
memory_type = "high";
reg = <0x60000000 0x60000000 0x10000000>;
};
};
options {
name = "options";
moca-populated = "true";
hd-populated = "false";
ir-protocol = "MOT";
nvm-size = <0x100>;
front-panel-button = "button";
push-button-matrix = "matrix";
tuning-range = <0x33428f00>;
rear-usb = "true";
video-support = "true";
cable-card = "false";
ethernet = "true";
moca-range = "D1-D8";
usb-20-hub = "false";
second-qpsk-rx = "true";
front-panel = "four";
tuner-ic2-clock-freq = <0x32>;
memory-encryption-scheme = "fixed-key";
};
chosen {
name = "chosen";
bootargs = "root=/dev/sda2";
linux,platform = "1kg6";
};
};
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-28 20:47 ` Dezhong Diao (dediao)
0 siblings, 0 replies; 23+ messages in thread
From: Dezhong Diao (dediao) @ 2010-07-28 20:47 UTC (permalink / raw)
To: Grant Likely, David Daney
Cc: devicetree-discuss, linux-mips, ralf, David VomLehn (dvomlehn)
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]
Grant,
I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
Thanks.
Dezhong
-----Original Message-----
From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely
Sent: Wednesday, July 28, 2010 12:26 PM
To: David Daney
Cc: Dezhong Diao (dediao); devicetree-discuss@lists.ozlabs.org; linux-mips@linux-mips.org; ralf@linux-mips.org; David VomLehn (dvomlehn)
Subject: Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 07/28/2010 11:54 AM, Grant Likely wrote:
>>
>> Hi Dezhong,
>
> [...]
>>
>> Very nice clean patch, thanks! How/when would you like to see MIPS
>> OF support go into mainline?
>>
>
> I can't speak for the patch authors, but my preference would be to
> have MIPS OF support go in to 2.6.36 if possible.
>
> How? To me it doesn't matter. I would let you and Ralf fight it out.
It would probably be best if I at least pick up the first patch into my test tree to give it a spin with the latest changes. I'd be happy to take the 2nd too to avoid ordering issues.
Cheers,
g.
[-- Attachment #2: 8KG6-DeviceTree-512MB.dts --]
[-- Type: application/octet-stream, Size: 1615 bytes --]
/dts-v1/;
/ {
model = "Explorer";
compatible = "Explorer", "Calliope";
copyright = "Copyright (c) 2008 Cisco Systems, Inc. All Rights Reserved.";
#address-cells = <0x1>;
#size-cells = <0x1>;
cpus {
name = "cpus";
#address-cells = <0x1>;
#size-cells = <0x0>;
24k@0 {
device_type = "cpu";
reg = <0x0>;
clock-frequency = <0x5f5e1000>;
timebase-frequency = <0x1fca055>;
i-cache-size = <0x8000>;
d-cache-size = <0x8000>;
};
};
memories {
name = "memories";
device_type = "memory";
#address-cells = <0x3>;
#size-cells = <0x0>;
memory@0 {
memory_type = "low";
reg = <0x10000000 0x20000000 0xfc00000>;
};
memory@1 {
memory_type = "MIPS reset vector";
reg = <0x1fc00000 0x7fcffff 0x400000>;
};
memory@2 {
memory_type = "gp-sram";
reg = <0x9040000 0x9040000 0x30000>;
};
memory@3 {
memory_type = "high";
reg = <0x2fc00000 0x2fc00000 0x400000>;
};
memory@4 {
memory_type = "high";
reg = <0x60000000 0x60000000 0x10000000>;
};
};
options {
name = "options";
moca-populated = "true";
hd-populated = "false";
ir-protocol = "MOT";
nvm-size = <0x100>;
front-panel-button = "button";
push-button-matrix = "matrix";
tuning-range = <0x33428f00>;
rear-usb = "true";
video-support = "true";
cable-card = "false";
ethernet = "true";
moca-range = "D1-D8";
usb-20-hub = "false";
second-qpsk-rx = "true";
front-panel = "four";
tuner-ic2-clock-freq = <0x32>;
memory-encryption-scheme = "fixed-key";
};
chosen {
name = "chosen";
bootargs = "root=/dev/sda2";
linux,platform = "1kg6";
};
};
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
2010-07-28 19:25 ` Grant Likely
(?)
(?)
@ 2010-07-28 21:33 ` Ralf Baechle
-1 siblings, 0 replies; 23+ messages in thread
From: Ralf Baechle @ 2010-07-28 21:33 UTC (permalink / raw)
To: Grant Likely
Cc: David Daney, Dezhong Diao, devicetree-discuss, linux-mips,
dvomlehn
On Wed, Jul 28, 2010 at 01:25:52PM -0600, Grant Likely wrote:
> It would probably be best if I at least pick up the first patch into
> my test tree to give it a spin with the latest changes. I'd be happy
> to take the 2nd too to avoid ordering issues.
Makes sense and even though this patch applies to arch/mips it's probably
more of an DT than a MIPS patch.
That said a long standing problem is that code that is relevant to MIPS
tends to get tested only if it's in one of the MIPS trees but far less in
other trees such as -next.
Ralf
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-29 19:40 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-29 19:40 UTC (permalink / raw)
To: Dezhong Diao (dediao)
Cc: David Daney, devicetree-discuss, linux-mips, ralf,
David VomLehn (dvomlehn)
On Wed, Jul 28, 2010 at 2:47 PM, Dezhong Diao (dediao) <dediao@cisco.com> wrote:
> Grant,
>
> I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
It would be better if you respin and retest. I can compile MIPS
kernels, but I don't have any hardware to boot them on. And I'm busy,
so there is less likelyhood that I'll get around to reworking it. :-)
> It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
I'd be happy to merge it into 2.6.36. I've got a concern about the
2nd patch, but the first one looks pretty sane and should be
mergeable.
Comments on the .dts file follow...
> /dts-v1/;
>
> / {
> model = "Explorer";
> compatible = "Explorer", "Calliope";
Compatible values must be in the form "<vendor>,<model>", and ideally
in lowercase. Also, it is very unlikely that claiming compatibility
with other parts at the board level is a sane thing to do (what does
it really mean to be compatible with a different part? Is the new
board absolutely 100% backwards compatible with the previous board?).
> copyright = "Copyright (c) 2008 Cisco Systems, Inc. All Rights Reserved.";
Vendor specific property, prefix it with the vendor name:
cisco,copyright = "..."
> #address-cells = <0x1>;
> #size-cells = <0x1>;
>
> cpus {
> name = "cpus";
> #address-cells = <0x1>;
> #size-cells = <0x0>;
>
> 24k@0 {
follow the generic names recommended practice on node name:
cpu@0 {
> device_type = "cpu";
> reg = <0x0>;
> clock-frequency = <0x5f5e1000>;
> timebase-frequency = <0x1fca055>;
You can specify values in decimal too. Frequencies are usually best
represented in base 10:
clock-frequency = <1600000000>;
timebase-frequency = <33333333>;
> i-cache-size = <0x8000>;
> d-cache-size = <0x8000>;
> };
> };
>
> memories {
> name = "memories";
dtc automatically sets the name property for you. Drop this line.
> device_type = "memory";
> #address-cells = <0x3>;
> #size-cells = <0x0>;
This looks messed up.
>
> memory@0 {
> memory_type = "low";
> reg = <0x10000000 0x20000000 0xfc00000>;
> };
>
> memory@1 {
> memory_type = "MIPS reset vector";
> reg = <0x1fc00000 0x7fcffff 0x400000>;
> };
>
> memory@2 {
> memory_type = "gp-sram";
> reg = <0x9040000 0x9040000 0x30000>;
> };
>
> memory@3 {
> memory_type = "high";
> reg = <0x2fc00000 0x2fc00000 0x400000>;
> };
>
> memory@4 {
> memory_type = "high";
> reg = <0x60000000 0x60000000 0x10000000>;
> };
> };
I have no idea what is being done here. I need a description.
>
> options {
> name = "options";
> moca-populated = "true";
> hd-populated = "false";
> ir-protocol = "MOT";
> nvm-size = <0x100>;
> front-panel-button = "button";
> push-button-matrix = "matrix";
> tuning-range = <0x33428f00>;
> rear-usb = "true";
> video-support = "true";
> cable-card = "false";
> ethernet = "true";
> moca-range = "D1-D8";
> usb-20-hub = "false";
> second-qpsk-rx = "true";
> front-panel = "four";
> tuner-ic2-clock-freq = <0x32>;
> memory-encryption-scheme = "fixed-key";
> };
I see what you're doing here, but it is rather baroque. The node name
should probably be named something non-generic so that it won't be
accidentally mistaken for something parsable by common code.
Prefixing with "cisco," is a good idea. In fact, you should consider
moving this stuff into the chosen node and prefixing all of these
property names with "cisco," because it is very machine/arch specific.
Oh, and document what all of these mean on devicetree.org.
Do you plan on replacing any of this with proper device nodes that
describe each peripheral individually?
> chosen {
> name = "chosen";
Drop this line.
> bootargs = "root=/dev/sda2";
> linux,platform = "1kg6";
What does linux,platform mean?
> };
> };
Cheers,
g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-07-29 19:40 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-07-29 19:40 UTC (permalink / raw)
To: Dezhong Diao (dediao)
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
ralf-6z/3iImG2C8G8FEW9MqTrA, David VomLehn (dvomlehn)
On Wed, Jul 28, 2010 at 2:47 PM, Dezhong Diao (dediao) <dediao-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> wrote:
> Grant,
>
> I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
It would be better if you respin and retest. I can compile MIPS
kernels, but I don't have any hardware to boot them on. And I'm busy,
so there is less likelyhood that I'll get around to reworking it. :-)
> It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
I'd be happy to merge it into 2.6.36. I've got a concern about the
2nd patch, but the first one looks pretty sane and should be
mergeable.
Comments on the .dts file follow...
> /dts-v1/;
>
> / {
> model = "Explorer";
> compatible = "Explorer", "Calliope";
Compatible values must be in the form "<vendor>,<model>", and ideally
in lowercase. Also, it is very unlikely that claiming compatibility
with other parts at the board level is a sane thing to do (what does
it really mean to be compatible with a different part? Is the new
board absolutely 100% backwards compatible with the previous board?).
> copyright = "Copyright (c) 2008 Cisco Systems, Inc. All Rights Reserved.";
Vendor specific property, prefix it with the vendor name:
cisco,copyright = "..."
> #address-cells = <0x1>;
> #size-cells = <0x1>;
>
> cpus {
> name = "cpus";
> #address-cells = <0x1>;
> #size-cells = <0x0>;
>
> 24k@0 {
follow the generic names recommended practice on node name:
cpu@0 {
> device_type = "cpu";
> reg = <0x0>;
> clock-frequency = <0x5f5e1000>;
> timebase-frequency = <0x1fca055>;
You can specify values in decimal too. Frequencies are usually best
represented in base 10:
clock-frequency = <1600000000>;
timebase-frequency = <33333333>;
> i-cache-size = <0x8000>;
> d-cache-size = <0x8000>;
> };
> };
>
> memories {
> name = "memories";
dtc automatically sets the name property for you. Drop this line.
> device_type = "memory";
> #address-cells = <0x3>;
> #size-cells = <0x0>;
This looks messed up.
>
> memory@0 {
> memory_type = "low";
> reg = <0x10000000 0x20000000 0xfc00000>;
> };
>
> memory@1 {
> memory_type = "MIPS reset vector";
> reg = <0x1fc00000 0x7fcffff 0x400000>;
> };
>
> memory@2 {
> memory_type = "gp-sram";
> reg = <0x9040000 0x9040000 0x30000>;
> };
>
> memory@3 {
> memory_type = "high";
> reg = <0x2fc00000 0x2fc00000 0x400000>;
> };
>
> memory@4 {
> memory_type = "high";
> reg = <0x60000000 0x60000000 0x10000000>;
> };
> };
I have no idea what is being done here. I need a description.
>
> options {
> name = "options";
> moca-populated = "true";
> hd-populated = "false";
> ir-protocol = "MOT";
> nvm-size = <0x100>;
> front-panel-button = "button";
> push-button-matrix = "matrix";
> tuning-range = <0x33428f00>;
> rear-usb = "true";
> video-support = "true";
> cable-card = "false";
> ethernet = "true";
> moca-range = "D1-D8";
> usb-20-hub = "false";
> second-qpsk-rx = "true";
> front-panel = "four";
> tuner-ic2-clock-freq = <0x32>;
> memory-encryption-scheme = "fixed-key";
> };
I see what you're doing here, but it is rather baroque. The node name
should probably be named something non-generic so that it won't be
accidentally mistaken for something parsable by common code.
Prefixing with "cisco," is a good idea. In fact, you should consider
moving this stuff into the chosen node and prefixing all of these
property names with "cisco," because it is very machine/arch specific.
Oh, and document what all of these mean on devicetree.org.
Do you plan on replacing any of this with proper device nodes that
describe each peripheral individually?
> chosen {
> name = "chosen";
Drop this line.
> bootargs = "root=/dev/sda2";
> linux,platform = "1kg6";
What does linux,platform mean?
> };
> };
Cheers,
g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-16 20:42 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-08-16 20:42 UTC (permalink / raw)
To: Dezhong Diao (dediao)
Cc: David Daney, devicetree-discuss, linux-mips, ralf,
David VomLehn (dvomlehn)
On Wed, Jul 28, 2010 at 03:47:20PM -0500, Dezhong Diao (dediao) wrote:
> Grant,
>
> I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
>
> It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
Wasn't quite ready in time for 2.6.36, but .37 should be no problem. All of the pending devicetree core patches are now in Linus' tree, so it is a good time to rebase. When you repost I can pick them up into my tree to get some build test exposure.
I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
Cheers,
g.
>
>
> Thanks.
>
>
> Dezhong
>
> -----Original Message-----
> From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely
> Sent: Wednesday, July 28, 2010 12:26 PM
> To: David Daney
> Cc: Dezhong Diao (dediao); devicetree-discuss@lists.ozlabs.org; linux-mips@linux-mips.org; ralf@linux-mips.org; David VomLehn (dvomlehn)
> Subject: Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
>
> On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> > On 07/28/2010 11:54 AM, Grant Likely wrote:
> >>
> >> Hi Dezhong,
> >
> > [...]
> >>
> >> Very nice clean patch, thanks! How/when would you like to see MIPS
> >> OF support go into mainline?
> >>
> >
> > I can't speak for the patch authors, but my preference would be to
> > have MIPS OF support go in to 2.6.36 if possible.
> >
> > How? To me it doesn't matter. I would let you and Ralf fight it out.
>
> It would probably be best if I at least pick up the first patch into my test tree to give it a spin with the latest changes. I'd be happy to take the 2nd too to avoid ordering issues.
>
> Cheers,
> g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-16 20:42 ` Grant Likely
0 siblings, 0 replies; 23+ messages in thread
From: Grant Likely @ 2010-08-16 20:42 UTC (permalink / raw)
To: Dezhong Diao (dediao)
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
ralf-6z/3iImG2C8G8FEW9MqTrA, David VomLehn (dvomlehn)
On Wed, Jul 28, 2010 at 03:47:20PM -0500, Dezhong Diao (dediao) wrote:
> Grant,
>
> I agree with your approach. Please go ahead to make changes and get the patches working with latest code in test tree. Or I am able to make changes in terms of your comments too.
>
> It is best we can have MIPS OF support in 2.6.36, but I have you and Ralf decide it.
Wasn't quite ready in time for 2.6.36, but .37 should be no problem. All of the pending devicetree core patches are now in Linus' tree, so it is a good time to rebase. When you repost I can pick them up into my tree to get some build test exposure.
I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
Cheers,
g.
>
>
> Thanks.
>
>
> Dezhong
>
> -----Original Message-----
> From: glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org [mailto:glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org] On Behalf Of Grant Likely
> Sent: Wednesday, July 28, 2010 12:26 PM
> To: David Daney
> Cc: Dezhong Diao (dediao); devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org; linux-mips@linux-mips.org; ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org; David VomLehn (dvomlehn)
> Subject: Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
>
> On Wed, Jul 28, 2010 at 1:19 PM, David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org> wrote:
> > On 07/28/2010 11:54 AM, Grant Likely wrote:
> >>
> >> Hi Dezhong,
> >
> > [...]
> >>
> >> Very nice clean patch, thanks! How/when would you like to see MIPS
> >> OF support go into mainline?
> >>
> >
> > I can't speak for the patch authors, but my preference would be to
> > have MIPS OF support go in to 2.6.36 if possible.
> >
> > How? To me it doesn't matter. I would let you and Ralf fight it out.
>
> It would probably be best if I at least pick up the first patch into my test tree to give it a spin with the latest changes. I'd be happy to take the 2nd too to avoid ordering issues.
>
> Cheers,
> g.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-17 3:40 ` Stephen Rothwell
0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2010-08-17 3:40 UTC (permalink / raw)
To: Grant Likely
Cc: Dezhong Diao (dediao), linux-mips, devicetree-discuss,
David Daney, ralf, David VomLehn (dvomlehn)
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
Hi Grant,
On Mon, 16 Aug 2010 14:42:11 -0600 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
Linux-next does defconfig, allnoconfig, allmodconfig (which has failed
for a long time) and ip32_defconfig for mips and mipsel. I am not sure
if all these are still relevant.
(http://kisskb.ellerman.id.au/kisskb/branch/9/)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-17 3:40 ` Stephen Rothwell
0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2010-08-17 3:40 UTC (permalink / raw)
To: Grant Likely
Cc: Dezhong Diao (dediao), linux-mips, devicetree-discuss,
David Daney, ralf, David VomLehn (dvomlehn)
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
Hi Grant,
On Mon, 16 Aug 2010 14:42:11 -0600 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
Linux-next does defconfig, allnoconfig, allmodconfig (which has failed
for a long time) and ip32_defconfig for mips and mipsel. I am not sure
if all these are still relevant.
(http://kisskb.ellerman.id.au/kisskb/branch/9/)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-17 3:40 ` Stephen Rothwell
0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2010-08-17 3:40 UTC (permalink / raw)
To: Grant Likely
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
ralf-6z/3iImG2C8G8FEW9MqTrA, David VomLehn (dvomlehn)
[-- Attachment #1.1: Type: text/plain, Size: 595 bytes --]
Hi Grant,
On Mon, 16 Aug 2010 14:42:11 -0600 Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
>
> I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
Linux-next does defconfig, allnoconfig, allmodconfig (which has failed
for a long time) and ip32_defconfig for mips and mipsel. I am not sure
if all these are still relevant.
(http://kisskb.ellerman.id.au/kisskb/branch/9/)
--
Cheers,
Stephen Rothwell sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org
http://www.canb.auug.org.au/~sfr/
[-- Attachment #1.2: Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 14:39 ` Ralf Baechle
0 siblings, 0 replies; 23+ messages in thread
From: Ralf Baechle @ 2010-08-18 14:39 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Grant Likely, Dezhong Diao (dediao), linux-mips,
devicetree-discuss, David Daney, David VomLehn (dvomlehn)
On Tue, Aug 17, 2010 at 01:40:39PM +1000, Stephen Rothwell wrote:
> On Mon, 16 Aug 2010 14:42:11 -0600 Grant Likely <grant.likely@secretlab.ca> wrote:
> >
> > I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
>
> Linux-next does defconfig, allnoconfig, allmodconfig (which has failed
> for a long time) and ip32_defconfig for mips and mipsel. I am not sure
> if all these are still relevant.
>
> (http://kisskb.ellerman.id.au/kisskb/branch/9/)
Kconfig will pick the default machine which is an IP22 for allyesconfig
and allmodconfig. The makefile will then pick the right flags for the
compiler based on machine, processor and endian selection. so it'll
happily build a big endian kernel with a little endian compiler. All
that's really different between those compilers are the defaults. Building
more different defconfigs is a better investments of CPU cycles.
An issue with very large functionss for which I've posted a patch earlier
today used to break makeallconfig / makeallmodconfig on MIPS. I'll sort
those out but right now I just don't have the CPU cycles to regularly
build such monster kernel configs.
A suggested set of kernel defconfigs to test:
bigsur_defconfig
cavium-octeon_defconfig
ip22_defconfig
ip27_defconfig
ip32_defconfig
malta_defconfig
allmodconfig
These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
32-bit, 64-bit, little and big endian.
Ralf
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 14:39 ` Ralf Baechle
0 siblings, 0 replies; 23+ messages in thread
From: Ralf Baechle @ 2010-08-18 14:39 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
David VomLehn (dvomlehn)
On Tue, Aug 17, 2010 at 01:40:39PM +1000, Stephen Rothwell wrote:
> On Mon, 16 Aug 2010 14:42:11 -0600 Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> >
> > I'll also make sure to start build testing on MIPS. Ralf, any suggestions on defconfigs I should use?
>
> Linux-next does defconfig, allnoconfig, allmodconfig (which has failed
> for a long time) and ip32_defconfig for mips and mipsel. I am not sure
> if all these are still relevant.
>
> (http://kisskb.ellerman.id.au/kisskb/branch/9/)
Kconfig will pick the default machine which is an IP22 for allyesconfig
and allmodconfig. The makefile will then pick the right flags for the
compiler based on machine, processor and endian selection. so it'll
happily build a big endian kernel with a little endian compiler. All
that's really different between those compilers are the defaults. Building
more different defconfigs is a better investments of CPU cycles.
An issue with very large functionss for which I've posted a patch earlier
today used to break makeallconfig / makeallmodconfig on MIPS. I'll sort
those out but right now I just don't have the CPU cycles to regularly
build such monster kernel configs.
A suggested set of kernel defconfigs to test:
bigsur_defconfig
cavium-octeon_defconfig
ip22_defconfig
ip27_defconfig
ip32_defconfig
malta_defconfig
allmodconfig
These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
32-bit, 64-bit, little and big endian.
Ralf
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 15:18 ` Stephen Rothwell
0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2010-08-18 15:18 UTC (permalink / raw)
To: Ralf Baechle
Cc: Grant Likely, Dezhong Diao (dediao), linux-mips,
devicetree-discuss, David Daney, David VomLehn (dvomlehn)
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]
Hi Ralf,
On Wed, 18 Aug 2010 15:39:26 +0100 Ralf Baechle <ralf@linux-mips.org> wrote:
>
> Kconfig will pick the default machine which is an IP22 for allyesconfig
> and allmodconfig. The makefile will then pick the right flags for the
> compiler based on machine, processor and endian selection. so it'll
> happily build a big endian kernel with a little endian compiler. All
> that's really different between those compilers are the defaults. Building
> more different defconfigs is a better investments of CPU cycles.
>
> An issue with very large functionss for which I've posted a patch earlier
> today used to break makeallconfig / makeallmodconfig on MIPS. I'll sort
> those out but right now I just don't have the CPU cycles to regularly
> build such monster kernel configs.
>
> A suggested set of kernel defconfigs to test:
>
> bigsur_defconfig
> cavium-octeon_defconfig
> ip22_defconfig
> ip27_defconfig
> ip32_defconfig
> malta_defconfig
> allmodconfig
>
> These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
> 32-bit, 64-bit, little and big endian.
OK, I will adjust the MIPS builds tomorrow. Thanks for the suggestions.
Just be clear, I only need to build with one compiler (presumably what
gcc/binutils produces when I ask for a "mips" toolchain) and can drop the
other ("mipsel"), correct?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 15:18 ` Stephen Rothwell
0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2010-08-18 15:18 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
David VomLehn (dvomlehn)
[-- Attachment #1.1: Type: text/plain, Size: 1530 bytes --]
Hi Ralf,
On Wed, 18 Aug 2010 15:39:26 +0100 Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org> wrote:
>
> Kconfig will pick the default machine which is an IP22 for allyesconfig
> and allmodconfig. The makefile will then pick the right flags for the
> compiler based on machine, processor and endian selection. so it'll
> happily build a big endian kernel with a little endian compiler. All
> that's really different between those compilers are the defaults. Building
> more different defconfigs is a better investments of CPU cycles.
>
> An issue with very large functionss for which I've posted a patch earlier
> today used to break makeallconfig / makeallmodconfig on MIPS. I'll sort
> those out but right now I just don't have the CPU cycles to regularly
> build such monster kernel configs.
>
> A suggested set of kernel defconfigs to test:
>
> bigsur_defconfig
> cavium-octeon_defconfig
> ip22_defconfig
> ip27_defconfig
> ip32_defconfig
> malta_defconfig
> allmodconfig
>
> These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
> 32-bit, 64-bit, little and big endian.
OK, I will adjust the MIPS builds tomorrow. Thanks for the suggestions.
Just be clear, I only need to build with one compiler (presumably what
gcc/binutils produces when I ask for a "mips" toolchain) and can drop the
other ("mipsel"), correct?
--
Cheers,
Stephen Rothwell sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org
http://www.canb.auug.org.au/~sfr/
[-- Attachment #1.2: Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 15:36 ` Ralf Baechle
0 siblings, 0 replies; 23+ messages in thread
From: Ralf Baechle @ 2010-08-18 15:36 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Grant Likely, Dezhong Diao (dediao), linux-mips,
devicetree-discuss, David Daney, David VomLehn (dvomlehn)
On Thu, Aug 19, 2010 at 01:18:56AM +1000, Stephen Rothwell wrote:
> > A suggested set of kernel defconfigs to test:
> >
> > bigsur_defconfig
> > cavium-octeon_defconfig
> > ip22_defconfig
> > ip27_defconfig
> > ip32_defconfig
> > malta_defconfig
> > allmodconfig
> >
> > These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
> > 32-bit, 64-bit, little and big endian.
>
> OK, I will adjust the MIPS builds tomorrow. Thanks for the suggestions.
> Just be clear, I only need to build with one compiler (presumably what
> gcc/binutils produces when I ask for a "mips" toolchain) and can drop the
> other ("mipsel"), correct?
Yes, that's entirely correct.
For the sake of others reading this I should mention that some GCC version
apparently had a bug which resulted in bad code generation for the
non-default ABI. I don't know which versions were affected but for
just doing build tests it really doesn't matter.
Ralf
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/2] MIPS: Add device tree support to MIPS
@ 2010-08-18 15:36 ` Ralf Baechle
0 siblings, 0 replies; 23+ messages in thread
From: Ralf Baechle @ 2010-08-18 15:36 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, David Daney,
David VomLehn (dvomlehn)
On Thu, Aug 19, 2010 at 01:18:56AM +1000, Stephen Rothwell wrote:
> > A suggested set of kernel defconfigs to test:
> >
> > bigsur_defconfig
> > cavium-octeon_defconfig
> > ip22_defconfig
> > ip27_defconfig
> > ip32_defconfig
> > malta_defconfig
> > allmodconfig
> >
> > These cover a huge variety of features, UP, SMP & weirdo SMP, flatmem & NUMA,
> > 32-bit, 64-bit, little and big endian.
>
> OK, I will adjust the MIPS builds tomorrow. Thanks for the suggestions.
> Just be clear, I only need to build with one compiler (presumably what
> gcc/binutils produces when I ask for a "mips" toolchain) and can drop the
> other ("mipsel"), correct?
Yes, that's entirely correct.
For the sake of others reading this I should mention that some GCC version
apparently had a bug which resulted in bad code generation for the
non-default ABI. I don't know which versions were affected but for
just doing build tests it really doesn't matter.
Ralf
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2010-08-18 15:36 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 21:49 [PATCH v2 1/2] MIPS: Add device tree support to MIPS Dezhong Diao
2010-07-27 21:49 ` Dezhong Diao
2010-07-28 18:54 ` Grant Likely
2010-07-28 18:54 ` Grant Likely
2010-07-28 19:19 ` David Daney
2010-07-28 19:25 ` Grant Likely
2010-07-28 19:25 ` Grant Likely
2010-07-28 20:47 ` Dezhong Diao (dediao)
2010-07-28 20:47 ` Dezhong Diao (dediao)
2010-07-29 19:40 ` Grant Likely
2010-07-29 19:40 ` Grant Likely
2010-08-16 20:42 ` Grant Likely
2010-08-16 20:42 ` Grant Likely
2010-08-17 3:40 ` Stephen Rothwell
2010-08-17 3:40 ` Stephen Rothwell
2010-08-17 3:40 ` Stephen Rothwell
2010-08-18 14:39 ` Ralf Baechle
2010-08-18 14:39 ` Ralf Baechle
2010-08-18 15:18 ` Stephen Rothwell
2010-08-18 15:18 ` Stephen Rothwell
2010-08-18 15:36 ` Ralf Baechle
2010-08-18 15:36 ` Ralf Baechle
2010-07-28 21:33 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.