LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/6]] POWERPC: fix memset size error
From: Li Zefan @ 2007-11-05  2:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, paulus, LKML


The size passing to memset is wrong.

Signed-off-by Li Zefan <lizf@cn.fujitsu.com>

---
 arch/powerpc/kernel/prom_init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 1db10f7..1add6ef 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1244,7 +1244,7 @@ static void __init prom_initialize_tce_table(void)
 			local_alloc_bottom = base;
 
 		/* It seems OF doesn't null-terminate the path :-( */
-		memset(path, 0, sizeof(path));
+		memset(path, 0, PROM_SCRATCH_SIZE);
 		/* Call OF to setup the TCE hardware */
 		if (call_prom("package-to-path", 3, 1, node,
 			      path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {
-- 
1.5.3.rc7

^ permalink raw reply related

* libfdt: Add more documentation (patch the fourth)
From: David Gibson @ 2007-11-05  3:29 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

This patch documents a few more functions in libfdt.h.  It also makes
a slight update to the description of the FDT_ERR_INTERNAL error code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/libfdt/libfdt.h
===================================================================
--- dtc.orig/libfdt/libfdt.h	2007-11-05 14:08:10.000000000 +1100
+++ dtc/libfdt/libfdt.h	2007-11-05 14:23:17.000000000 +1100
@@ -110,7 +110,8 @@
 /* "Can't happen" error indicating a bug in libfdt */
 #define FDT_ERR_INTERNAL	12
 	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
-	 * Indicates a bug in libfdt itself. */
+	 * Should never be returned, if it is, it indicates a bug in
+	 * libfdt itself. */
 
 #define FDT_ERR_MAX		12
 
@@ -437,9 +438,81 @@ static inline void *fdt_getprop_w(void *
  */
 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
 
+/**
+ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ * @supernodedepth: depth of the ancestor to find
+ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+ * at a specific depth from the root (where the root itself has depth
+ * 0, its immediate subnodes depth 1 and so forth).  So
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+ * will always return 0, the offset of the root node.  If the node at
+ * nodeoffset has depth D, then:
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+ * will return nodeoffset itself.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+
+ *	structure block offset of the node at node offset's ancestor
+ *		of depth supernodedepth (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+*	-FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
 				 int supernodedepth, int *nodedepth);
+
+/**
+ * fdt_node_depth - find the depth of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_node_depth() finds the depth of a given node.  The root node
+ * has depth 0, its immediate subnodes depth 1 and so forth.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	depth of the node at nodeoffset (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
 int fdt_node_depth(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_parent_offset - find the parent of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_parent_offset() locates the parent node of a given node (that
+ * is, it finds the offset of the node which contains the node at
+ * nodeoffset as a subnode).
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset, *twice*.
+ *
+ * returns:
+ *	stucture block offset of the parent of the node at nodeoffset
+ *		(>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
 int fdt_parent_offset(const void *fdt, int nodeoffset);
 
 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: libfdt: Add more documentation (patch the third)
From: David Gibson @ 2007-11-05  3:29 UTC (permalink / raw)
  To: Jon Loeliger, linuxppc-dev
In-Reply-To: <20071102044716.GK19839@localhost.localdomain>

libfdt: Add more documentation (patch the third)

This patch adds documentation in libfdt.h for a few more libfdt
functions.  It also makes a slight update to the documentation of
fdt_get_name().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---

Just the same as before, but now with S-o-b line.

Index: dtc/libfdt/libfdt.h
===================================================================
--- dtc.orig/libfdt/libfdt.h	2007-11-02 15:44:58.000000000 +1100
+++ dtc/libfdt/libfdt.h	2007-11-02 15:46:37.000000000 +1100
@@ -319,28 +319,54 @@ int fdt_path_offset(const void *fdt, con
  * fdt_get_name - retreive the name of a given node
  * @fdt: pointer to the device tree blob
  * @nodeoffset: structure block offset of the starting node
- * @len: pointer to an intger variable (will be overwritten) or NULL
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
  *
  * fdt_get_name() retrieves the name (including unit address) of the
- * device tree node at structure block offset nodeoffset.  If len is
+ * device tree node at structure block offset nodeoffset.  If lenp is
  * non-NULL, the length of this name is also returned, in the integer
- * pointed to by len.
+ * pointed to by lenp.
  *
  * returns:
  *	pointer to the node's name, on success
- *		*len contains the length of that name (>=0)
+ *		If lenp is non-NULL, *lenp contains the length of that name (>=0)
  *	NULL, on error
- *		*len contains an error code (<0):
+ *		if lenp is non-NULL *lenp contains an error code (<0):
  *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
  *		-FDT_ERR_BADMAGIC,
  *		-FDT_ERR_BADVERSION,
  *		-FDT_ERR_BADSTATE, standard meanings
  */
-const char *fdt_get_name(const void *fdt, int nodeoffset, int *len);
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
 
+/**
+ * fdt_get_property - find a given property in a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property() retrieves a pointer to the fdt_property
+ * structure within the device tree blob corresponding to the property
+ * named 'name' of the node at offset nodeoffset.  If lenp is
+ * non-NULL, the length of the property value also returned, in the
+ * integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the structure representing the property
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
 					    const char *name, int *lenp);
-
 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
 						      const char *name,
 						      int *lenp)
@@ -349,6 +375,33 @@ static inline struct fdt_property *fdt_g
 						       name, lenp);
 }
 
+/**
+ * fdt_getprop - retrieve the value of a given property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
 const void *fdt_getprop(const void *fdt, int nodeoffset,
 			const char *name, int *lenp);
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
@@ -357,6 +410,31 @@ static inline void *fdt_getprop_w(void *
 	return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
 }
 
+/**
+ * fdt_get_path - determine the full path of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose path to find
+ * @buf: character buffer to contain the returned path (will be overwritten)
+ * @buflen: size of the character buffer at buf
+ *
+ * fdt_get_path() computes the full path of the node at offset
+ * nodeoffset, and records that path in the buffer at buf.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	0, on success
+ *		buf contains the absolute path of the node at
+ *		nodeoffset, as a NUL-terminated string.
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+ *		characters and will not fit in the given buffer.
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
 
 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] [POWERPC] pasemi: Broaden specific references to 1682M
From: Olof Johansson @ 2007-11-05  3:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Doug Thompson

[POWERPC] pasemi: Broaden specific references to 1682M
    
There will be more product numbers in the future than just PA6T-1682M,
but they will share much of the features. Remove some of the explicit
references and compatibility checks with 1682M, and replace most of them
with the more generic term "PWRficient".
    

Signed-off-by: Olof Johansson <olof@lixom.net>

---

This one touches drivers/char/hw_random and drivers/edac, but I'd prefer
to just merge it up through the powerpc merge path since the changes
are trivial.

(Michael, Doug, if you disagree let me know and I can submit separate
patches. This is 2.6.25 material anyway).


-Olof


diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index 735e153..2f4dd6e 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -17,7 +17,7 @@ config PPC_PASEMI_IOMMU
 	bool "PA Semi IOMMU support"
 	depends on PPC_PASEMI
 	help
-	  IOMMU support for PA6T-1682M
+	  IOMMU support for PA Semi PWRficient
 
 config PPC_PASEMI_IOMMU_DMA_FORCE
 	bool "Force DMA engine to use IOMMU"
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c
index 1cfb8b0..8caa166 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -147,7 +147,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	if (!cpu)
 		goto out;
 
-	dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
+	dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
+	if (!dn)
+		dn = of_find_compatible_node(NULL, NULL,
+					     "pasemi,pwrficient-sdc");
 	if (!dn)
 		goto out;
 	err = of_address_to_resource(dn, 0, &res);
@@ -160,7 +163,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		goto out;
 	}
 
-	dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
+	dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
+	if (!dn)
+		dn = of_find_compatible_node(NULL, NULL,
+					     "pasemi,pwrficient-gizmo");
 	if (!dn) {
 		err = -ENODEV;
 		goto out_unmap_sdcasr;
@@ -292,7 +298,8 @@ static struct cpufreq_driver pas_cpufreq_driver = {
 
 static int __init pas_cpufreq_init(void)
 {
-	if (!machine_is_compatible("PA6T-1682M"))
+	if (!machine_is_compatible("PA6T-1682M") &&
+	    !machine_is_compatible("pasemi,pwrficient"))
 		return -ENODEV;
 
 	return cpufreq_register_driver(&pas_cpufreq_driver);
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 95d0c78..b029804 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -333,7 +333,10 @@ int gpio_mdio_init(void)
 {
 	struct device_node *np;
 
-	np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
+	np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
+	if (!np)
+		np = of_find_compatible_node(NULL, NULL,
+					     "pasemi,pwrficient-gpio");
 	if (!np)
 		return -ENODEV;
 	gpio_regs = of_iomap(np, 0);
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 3a5d112..aeafe98 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -362,8 +362,11 @@ static inline void pasemi_pcmcia_init(void)
 
 
 static struct of_device_id pasemi_bus_ids[] = {
+	/* Unfortunately needed for legacy firmwares */
 	{ .type = "localbus", },
 	{ .type = "sdc", },
+	{ .compatible = "pasemi,localbus", },
+	{ .compatible = "pasemi,sdc", },
 	{},
 };
 
@@ -389,7 +392,8 @@ static int __init pas_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (!of_flat_dt_is_compatible(root, "PA6T-1682M"))
+	if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
+	    !of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
 		return 0;
 
 	hpte_init_native();
@@ -400,7 +404,7 @@ static int __init pas_probe(void)
 }
 
 define_machine(pasemi) {
-	.name			= "PA Semi PA6T-1682M",
+	.name			= "PA Semi PWRficient",
 	.probe			= pas_probe,
 	.setup_arch		= pas_setup_arch,
 	.init_early		= pas_init_early,
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 2d7cd48..6bbd4fa 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -98,7 +98,7 @@ config HW_RANDOM_PASEMI
 	default HW_RANDOM
 	---help---
 	  This driver provides kernel-side support for the Random Number
-	  Generator hardware found on PA6T-1682M processor.
+	  Generator hardware found on PA Semi PWRficient SoCs.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called pasemi-rng.
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c
index fa6040b..24ae307 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -126,10 +126,9 @@ static int __devexit rng_remove(struct of_device *dev)
 }
 
 static struct of_device_id rng_match[] = {
-	{
-		.compatible      = "1682m-rng",
-	},
-	{},
+	{ .compatible      = "1682m-rng", },
+	{ .compatible      = "pasemi,pwrficient-rng", },
+	{ },
 };
 
 static struct of_platform_driver rng_driver = {
diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c
index 9007d06..9032091 100644
--- a/drivers/edac/pasemi_edac.c
+++ b/drivers/edac/pasemi_edac.c
@@ -225,7 +225,7 @@ static int __devinit pasemi_edac_probe(struct pci_dev *pdev,
 		EDAC_FLAG_NONE;
 	mci->mod_name = MODULE_NAME;
 	mci->dev_name = pci_name(pdev);
-	mci->ctl_name = "pasemi,1682m-mc";
+	mci->ctl_name = "pasemi,pwrficient-mc";
 	mci->edac_check = pasemi_edac_check;
 	mci->ctl_page_to_phys = NULL;
 	pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub);
@@ -297,4 +297,4 @@ module_exit(pasemi_edac_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
-MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller");
+MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");

^ permalink raw reply related

* Re: [PATCH v2 01/12] [POWERPC] Add 'model: ...' line to common show_cpuinfo()
From: Olof Johansson @ 2007-11-05  1:40 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235216.31906.62666.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:52:16AM +0100, Marian Balakowicz wrote:
> Print out 'model' property of '/' node as a machine name
> in generic show_cpuinfo() routine.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

Acked-by: Olof Johansson <olof@lixom.net>

(just as the previous posting of it)


-Olof

^ permalink raw reply

* Re: [PATCH] pasemi: clean up gpio_mdio init
From: Olof Johansson @ 2007-11-05  1:10 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Roel Kluin
In-Reply-To: <20071105112307.13d4b8bb.sfr@canb.auug.org.au>

Hi,

On Mon, Nov 05, 2007 at 11:23:07AM +1100, Stephen Rothwell wrote:

> Just a couple of small things ...

Thanks! Unless someone finds something bigger, I'll update this before
I push it out through git, but I won't repost.

> On Sun, 4 Nov 2007 15:37:09 -0600 Olof Johansson <olof@lixom.net> wrote:
> >
> > +		ip = of_get_property(phy_dn, "interrupts", NULL);
> > +		regp = of_get_property(phy_dn, "reg", NULL);
> > +		if (!ip || !regp)
> > +			continue;
> > +		new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
> 
> Paranoid me says to check that *regp is in range.

Yeah, good point.

> 
> >  int gpio_mdio_init(void)
> >  {
> > +	struct device_node *np;
> > +
> > +	np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
> > +	if (!np)
> > +		return -ENODEV;
> > +	gpio_regs = of_iomap(np, 0);
> 
> 	of_node_put(np);		?

Yup.


Thanks for the review,

-Olof

^ permalink raw reply

* Re: [PATCH v2 11/12] [POWERPC] Promess Motion-PRO DTS
From: David Gibson @ 2007-11-05  0:56 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235317.31906.46911.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:53:17AM +0100, Marian Balakowicz wrote:
> Add device tree source file for Motion-PRO board.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

Same comments as for the other two device trees, plus those below:

[snip]
> +		motionpro-statusled@660 {	// Motion-PRO status LED
> +			compatible = "promess,motionpro-statusled";
> +			cell-index = <6>;
> +			reg = <660 10>;
> +			interrupts = <1 f 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +			blink-delay = <64>; // 100 msec
> +		};
> +
> +		motionpro-readyled@670 {	// Motion-PRO ready LED
> +			compatible = "promess,motionpro-readyled";
> +			cell-index = <7>;

These cell-index values for the LEDs look very strange.  How are they
used?

> +			reg = <670 10>;
> +			interrupts = <1 10 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};
> +
> +		rtc@800 {	// Real time clock
> +			compatible = "mpc5200b-rtc","mpc5200-rtc";
> +			device_type = "rtc";
> +			reg = <800 100>;
> +			interrupts = <1 5 0 1 6 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};
> +
> +		mscan@980 {
> +			compatible = "mpc5200b-mscan","mpc5200-mscan";
> +			cell-index = <1>;

As for serial and gpt, is cell-index really suitable here?

> +			interrupts = <2 12 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +			reg = <980 80>;
> +		};

[snip]
> +		spi@f00 {
> +			device_type = "spi";
> +			compatible = "mpc5200b-spi","mpc5200-spi";
> +			reg = <f00 20>;
> +			interrupts = <2 d 0 2 e 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};
[snip]
> +		// PSC2 in spi master mode 
> +		spi@2200 {		// PSC2
> +			device_type = "spi";
> +			compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
> +			cell-index = <1>;

cell-index present for one spi, but not the other makes be even more
suspicious about it's applicability here...

> +			reg = <2200 100>;
> +			interrupts = <2 2 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};

[snip]
> +	lpb {
> +		model = "fsl,lpb";
> +		compatible = "fsl,lpb";

Is lpb another one of these chipselect/offset configurable bus bridge
things?  If so, you should use a 2-cell addressing convention for the
subnodes like fsl localbus and 4xx EBC.

> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges = <50000000 50000000 00030000
> +			  ff000000 ff000000 01000000>;
> +
> +		// 8-bit DualPort SRAM on LocalPlus Bus CS1
> +		kollmorgen@50000000 {
> +			compatible = "promess,motionpro-kollmorgen";
> +			reg = <50000000 ffff>;
> +			interrupts = <1 1 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};
> +
> +		// 8-bit board CPLD on LocalPlus Bus CS2
> +		cpld@50010000 {
> +			compatible = "promess,motionpro-cpld";
> +			reg = <50010000 ffff>;
> +		};
> +
> +		// 8-bit custom Anybus Module on LocalPlus Bus CS3
> +		anybus50020000 {

Missing '@'.

> +			compatible = "promess,motionpro-anybus";
> +			reg = <50020000 ffff>;
> +		};
> +		pro_module_general@50020000 {
> +			compatible = "promess,pro_module_general";
> +			reg = <50020000 3>;
> +		};
> +		pro_module_dio@50020800 {
> +			compatible = "promess,pro_module_dio";
> +			reg = <50020800 2>;
> +		};
> +	};

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH v2 08/12] [POWERPC] CM5200 DTS
From: David Gibson @ 2007-11-05  0:50 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235259.31906.54116.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:52:59AM +0100, Marian Balakowicz wrote:
> Add device tree source file for CM5200 board.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

Same comments as the TQM device tree, plus those below.

[snip]
> +		rtc@800 {	// Real time clock
> +			compatible = "mpc5200b-rtc","mpc5200-rtc";
> +			device_type = "rtc";

No device_type here.

[snip]
> +		spi@f00 {
> +			device_type = "spi";

Definitely no device_type here.

> +			compatible = "mpc5200b-spi","mpc5200-spi";
> +			reg = <f00 20>;
> +			interrupts = <2 d 0 2 e 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +		};

[snip]
> +		i2c@3d40 {
> +			device_type = "i2c";

No device_type here.


> +			compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
> +			reg = <3d40 40>;
> +			interrupts = <2 10 0>;
> +			interrupt-parent = <&mpc5200_pic>;
> +			fsl5200-clocking;
> +		};
> +
> +		sram@8000 {
> +			compatible = "mpc5200b-sram","mpc5200-sram","sram";
> +			reg = <8000 4000>;
> +		};
> +	};
> +};

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH v2 06/12] [POWERPC] TQM5200 DTS
From: David Gibson @ 2007-11-05  0:47 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235247.31906.76777.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:52:47AM +0100, Marian Balakowicz wrote:
> Add device tree source file for TQM5200 board.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

[snip]
> +	soc5200@f0000000 {

soc@address is the new convention, I believe, but I guess you need
compatibility with older bootstraps.

> +		model = "fsl,mpc5200";
> +		compatible = "mpc5200";

This compatible looks bogus; it should have the "fsl," at least.

[snip]
> +		mpc5200_pic: pic@500 {
> +			// 5200 interrupts are encoded into two levels;
> +			interrupt-controller;
> +			#interrupt-cells = <3>;
> +			device_type = "interrupt-controller";

No device_type here.

> +			compatible = "mpc5200-pic";
> +			reg = <500 80>;
> +		};
> +
> +		gpt@600 {	// General Purpose Timer
> +			compatible = "fsl,mpc5200-gpt";
> +			cell-index = <0>;

Ok, is this actually a suitable usage for cell-index?  It should only
be used when the cell-index number is used to program some soc-global
register.  It should not be used just for ordering or logical-indexing
purposes.

[snip]
> +		serial@2000 {		// PSC1
> +			device_type = "serial";
> +			compatible = "mpc5200-psc-uart";
> +			port-number = <0>;  // Logical port assignment
> +			cell-index = <0>;

Ditto w.r.t. cell-index.

port-number also looks bogus - the device tree should not generally
contain logical numbering information in this manner.  How and what
uses the port-number property?

> +		sram@8000 {
> +			compatible = "mpc5200-sram","sram";

Uh.. is there an "sram" binding?  "sram" doesn't look specific enough
for a compatible property.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH] pasemi: clean up gpio_mdio init
From: Stephen Rothwell @ 2007-11-05  0:23 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, Roel Kluin
In-Reply-To: <20071104213709.GA13266@lixom.net>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Hi Olof,

Just a couple of small things ...

On Sun, 4 Nov 2007 15:37:09 -0600 Olof Johansson <olof@lixom.net> wrote:
>
> +		ip = of_get_property(phy_dn, "interrupts", NULL);
> +		regp = of_get_property(phy_dn, "reg", NULL);
> +		if (!ip || !regp)
> +			continue;
> +		new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);

Paranoid me says to check that *regp is in range.

>  int gpio_mdio_init(void)
>  {
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
> +	if (!np)
> +		return -ENODEV;
> +	gpio_regs = of_iomap(np, 0);

	of_node_put(np);		?

> +	if (!gpio_regs)
> +		return -ENODEV;
> +
>  	return of_register_platform_driver(&gpio_mdio_driver);
>  }
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [U-Boot-Users] use of aliases in device trees
From: Grant Likely @ 2007-11-04 23:32 UTC (permalink / raw)
  To: Grant Likely, Kumar Gala, linux-ppc list, U-Boot Users List
In-Reply-To: <20071104224256.GC15444@localhost.localdomain>

On 11/4/07, David Gibson <david@gibson.dropbear.id.au> wrote:
> On Sat, Nov 03, 2007 at 09:29:48PM -0600, Grant Likely wrote:
> > Maybe something like:
> > aliases {
> >       enet0,phandle = <&enet0>;
> >       enet1,phandle = <&enet1>;
> >       ...
> > };
>
> The fairly small advantages of using phandles here are not worth the
> hassle of defining a new alias format, when the OF one with full paths
> already exists.
>
> I would, however, like to extend dtc so that we can do something like:
>         aliases {
>                 enet0 = &enet0;
>         };
> and the reference in non-cell context will expand to the full path.
> That could be used for things like linux,stdout-path in /chosen, too.
>
> I'd also like to extend dtc so that the label can be tagged somehow, say:
>         *enet0: { ... };
> and as well as creating a normal dtc label, an alias will also be
> automatically added to /aliases.

Yeah, okay!  I like both of those ideas.  That certainly addresses my
ease of maintenance concerns.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [U-Boot-Users] use of aliases in device trees
From: David Gibson @ 2007-11-04 22:42 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-ppc list, U-Boot Users List
In-Reply-To: <fa686aa40711032029x3871b76m5b44a6e93d8d7217@mail.gmail.com>

On Sat, Nov 03, 2007 at 09:29:48PM -0600, Grant Likely wrote:
> On 11/3/07, Kumar Gala <galak@kernel.crashing.org> wrote:
> > In some discussion on the u-boot dev list it became clear that having
> > aliases in the device tree might be useful as a common way to deal
> > with finding specific nodes that need fixing up by the firmware.
> > This problem also exists in the kernel bootwrappers.
> >
> > The common example is how to associate a given MAC address with the
> > proper ethernet node.  In u-boot an explicit path is hard coded into
> > the u-boot build for each ethernet device.  In the bootwrapper we use
> > "linux,network-index = <N>" in the given ethernet node.
> >
> > One common solution would be having a top level aliases like the pmac
> > tree's have:
> >
> > aliases {
> >         enet0 = "...";
> >         enet1 = "...";
> >         pci0 = "...";
> >         pci1 = "...";
> > };
> 
> One question to ask is do we use full paths or phandles to point at nodes?
> 
> OF, of course, uses full paths, but that does require more memory and
> processing power, but it might not be significant enough to worry
> about.
> 
> If we use phandles, then we should use names that don't conflict with
> full path alias names.  It would also be desirable to be able to
> generate a phandle alias from the full path alias in order to maintain
> some level of compatibility with OF.  It also think it will make
> maintaining aliases in .dts files simpler because trivial changes to
> node paths won't break the phandle alias.
> 
> Maybe something like:
> aliases {
>       enet0,phandle = <&enet0>;
>       enet1,phandle = <&enet1>;
>       ...
> };

The fairly small advantages of using phandles here are not worth the
hassle of defining a new alias format, when the OF one with full paths
already exists.

I would, however, like to extend dtc so that we can do something like:
	aliases {
		enet0 = &enet0;
	};
and the reference in non-cell context will expand to the full path.
That could be used for things like linux,stdout-path in /chosen, too.

I'd also like to extend dtc so that the label can be tagged somehow, say:
	*enet0: { ... };
and as well as creating a normal dtc label, an alias will also be
automatically added to /aliases.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH v2 02/12] [POWERPC] Add 'fsl, lpb' bus type for MPC5200 LocalPlus Bus
From: David Gibson @ 2007-11-04 22:18 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235222.31906.44523.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:52:22AM +0100, Marian Balakowicz wrote:
> Define MPC52xx specific device id list, add new
> 'fsl,lpb' compatible id for LocalPlus Bus.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH v2 01/12] [POWERPC] Add 'model: ...' line to common show_cpuinfo()
From: David Gibson @ 2007-11-04 22:17 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <20071103235216.31906.62666.stgit@hekate.izotz.org>

On Sun, Nov 04, 2007 at 12:52:16AM +0100, Marian Balakowicz wrote:
> Print out 'model' property of '/' node as a machine name
> in generic show_cpuinfo() routine.
> 
> Signed-off-by: Marian Balakowicz <m8@semihalf.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] pasemi: clean up gpio_mdio init
From: Olof Johansson @ 2007-11-04 21:37 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linuxppc-dev
In-Reply-To: <472E0569.7070601@tiscali.nl>

pasemi: clean up mdio_gpio driver init

Misc cleanups of mdio_gpio:
* Better error handling/unrolling in case of init/alloc failures
* Go through child nodes and get their interrupts instead of using
  hardcoded values
* Remap the GPIO registers at module load/driver init instead of during probe
* Coding style and other misc cleanups

Signed-off-by: Olof Johansson <olof@lixom.net>

---

On Sun, Nov 04, 2007 at 06:46:17PM +0100, Roel Kluin wrote:
> Olof Johansson wrote:
> > On Sun, Nov 04, 2007 at 05:53:40PM +0100, Roel Kluin wrote:
> >> I think this is how it should be done, but
> >> please review: it was not tested.
> > 
> > Hi,
> > 
> > Thanks for the bug report. The mdio driver needs a set of other cleanups
> > as well. I have a more comprehensive patch that I'll post tomorrow after
> > I have a chance to test them.
> 
> Ok, that's fine with me,

This is what I'll queue up for 2.6.25.


-Olof

diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index dae9f65..2254091 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -218,45 +218,27 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
 				     const struct of_device_id *match)
 {
 	struct device *dev = &ofdev->dev;
-	struct device_node *np = ofdev->node;
-	struct device_node *gpio_np;
+	struct device_node *phy_dn, *np = ofdev->node;
 	struct mii_bus *new_bus;
-	struct resource res;
 	struct gpio_priv *priv;
 	const unsigned int *prop;
-	int err = 0;
+	int err;
 	int i;
 
-	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
-
-	if (!gpio_np)
-		return -ENODEV;
-
-	err = of_address_to_resource(gpio_np, 0, &res);
-	of_node_put(gpio_np);
-
-	if (err)
-		return -EINVAL;
-
-	if (!gpio_regs)
-		gpio_regs = ioremap(res.start, 0x100);
-
-	if (!gpio_regs)
-		return -EPERM;
-
+	err = -ENOMEM;
 	priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
-	if (priv == NULL)
-		return -ENOMEM;
+	if (!priv)
+		goto out;
 
 	new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
 
-	if (new_bus == NULL)
-		return -ENOMEM;
+	if (!new_bus)
+		goto out_free_priv;
 
-	new_bus->name = "pasemi gpio mdio bus",
-	new_bus->read = &gpio_mdio_read,
-	new_bus->write = &gpio_mdio_write,
-	new_bus->reset = &gpio_mdio_reset,
+	new_bus->name = "pasemi gpio mdio bus";
+	new_bus->read = &gpio_mdio_read;
+	new_bus->write = &gpio_mdio_write;
+	new_bus->reset = &gpio_mdio_reset;
 
 	prop = of_get_property(np, "reg", NULL);
 	new_bus->id = *prop;
@@ -265,9 +247,24 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
 	new_bus->phy_mask = 0;
 
 	new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
-	for(i = 0; i < PHY_MAX_ADDR; ++i)
-		new_bus->irq[i] = irq_create_mapping(NULL, 10);
 
+	if (!new_bus->irq)
+		goto out_free_bus;
+
+	for (i = 0; i < PHY_MAX_ADDR; i++)
+		new_bus->irq[i] = NO_IRQ;
+
+	for (phy_dn = of_get_next_child(np, NULL);
+	     phy_dn != NULL;
+	     phy_dn = of_get_next_child(np, phy_dn)) {
+		const int *ip, *regp;
+
+		ip = of_get_property(phy_dn, "interrupts", NULL);
+		regp = of_get_property(phy_dn, "reg", NULL);
+		if (!ip || !regp)
+			continue;
+		new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
+	}
 
 	prop = of_get_property(np, "mdc-pin", NULL);
 	priv->mdc_pin = *prop;
@@ -280,17 +277,21 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
 
 	err = mdiobus_register(new_bus);
 
-	if (0 != err) {
+	if (err != 0) {
 		printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
 				new_bus->name, err);
-		goto bus_register_fail;
+		goto out_free_irq;
 	}
 
 	return 0;
 
-bus_register_fail:
+out_free_irq:
+	kfree(new_bus->irq);
+out_free_bus:
 	kfree(new_bus);
-
+out_free_priv:
+	kfree(priv);
+out:
 	return err;
 }
 
@@ -330,12 +331,23 @@ static struct of_platform_driver gpio_mdio_driver =
 
 int gpio_mdio_init(void)
 {
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
+	if (!np)
+		return -ENODEV;
+	gpio_regs = of_iomap(np, 0);
+	if (!gpio_regs)
+		return -ENODEV;
+
 	return of_register_platform_driver(&gpio_mdio_driver);
 }
+module_init(gpio_mdio_init);
 
 void gpio_mdio_exit(void)
 {
 	of_unregister_platform_driver(&gpio_mdio_driver);
+	if (gpio_regs)
+		iounmap(gpio_regs);
 }
-device_initcall(gpio_mdio_init);
-
+module_exit(gpio_mdio_exit);

^ permalink raw reply related

* Re: [PATCH 0/3] Add device-tree aware NDFC driver
From: Thomas Gleixner @ 2007-11-04 20:48 UTC (permalink / raw)
  To: Valentine Barshak; +Cc: linuxppc-dev, sr, linux-mtd
In-Reply-To: <47273BF4.80001@ru.mvista.com>

Valentine,

On Tue, 30 Oct 2007, Valentine Barshak wrote:
> Thomas Gleixner wrote:
> > On Mon, 29 Oct 2007, Valentine Barshak wrote:
> > 
> > > This adds a device-tree aware PowerPC 44x NanD Flash Controller driver
> > > The code is based on the original NDFC driver by Thomas Gleixner, but
> > > since it's been changed much and has initialization/clean-up completely
> > > reworked it's been put into a separate ndfc_of.c file. This version
> > > supports both separate mtd devices on each chip attached to NDFC banks and
> > > single mtd device spread across identical chips (not using mtdconcat) as
> > > well.
> > > The choice is selected with device tree settings. This has been tested
> > > on PowerPC 440EPx Sequoia board.
> > > Any comments are greatly appreciated.
> > 
> > Did I express myself not clear enough in my first reply or is this
> > just a repeated epiphany in my inbox ? 
> > You got plenty of comments to your patches, but you decided to ignore
> > them silently.
> > 
> > Darn, fix it the right way once and forever and please don't try to
> > tell me another heartrending "why I did it my way" story.
> > 
> > This all can be done with a nice series of incremental patches
> > including a fixup to the existing users.
> > 
> > We have enough dump and run shit in the kernel already.
> > 
> > No thanks,
> > 
> >    tglx
> 
> You know, you're really too tense Thomas. I'm not sure of the reason why
> you're being a complete nerve, but I'm feeling sorry for you.

You have a perception problem. I'm not tense, I'm grumpy.

Rest assured, that my nerves are completely fine despite of the fact
that you try to rack them.

> I'm not saying my approach is the best, but I was hoping for a discussion.
> I've reworked the patches according to the comments to the previous version
> and used my arguments to explain why I don't see much reason to mess with the
> code we currently have and added a separate _of version.

This is the exact point. You were asked to fix up the existing driver
instead of replacing it and to do it with a series of incremental
patches. You copied the old code anyway and modified it, so we want to
have this documented in the history. This is not my obsession, it's
common kernel coding practise. The fact that you do not see much
reason to do it does not change this at all.

> I'm sure you'd find some time to do it yourself "the right way once and
> forever" with a "nice series of incremental patches" to fix what we currently
> have (call it a "dump" or anything you like) and even maybe add new device
> tree support.

It might be time for you to try to understand how OSS development
works.

> I'm sorry if for some reason I've made you feel bad.

What do you expect, after you abused my Signed-off-by in a way which
might have tricked David into pulling your code as is? This was
pointed out to you and you did not even bother to apologize.

> This is the last time I disturb you with my e-mail, so please, forget it.

Interesting. I thought you wanted to get the patch in, so you probably
should ask yourself whether it is a good idea _not_ to talk to the
responsible maintainer.

If you gave up on that, it just makes it more obvious that you do not
want to work with the community and just wanted to dump your patch and
move along.

     tglx

^ permalink raw reply

* Re: [PATCH] Balance alloc/free and ioremap/iounmap in gpio_mdio_probe (powerpc/platforms/pasemi/gpio_mdio.c)
From: Roel Kluin @ 2007-11-04 17:46 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev
In-Reply-To: <20071104174701.GB10191@lixom.net>

Olof Johansson wrote:
> On Sun, Nov 04, 2007 at 05:53:40PM +0100, Roel Kluin wrote:
>> I think this is how it should be done, but
>> please review: it was not tested.
> 
> Hi,
> 
> Thanks for the bug report. The mdio driver needs a set of other cleanups
> as well. I have a more comprehensive patch that I'll post tomorrow after
> I have a chance to test them.

Ok, that's fine with me,

Roel

^ permalink raw reply

* Re: [PATCH] Balance alloc/free and ioremap/iounmap in gpio_mdio_probe (powerpc/platforms/pasemi/gpio_mdio.c)
From: Roel Kluin @ 2007-11-04 17:44 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev
In-Reply-To: <20071104171814.GI9695@localdomain>

Nathan Lynch wrote:
> Hi,

I moved res to the wrong function, that's fixed as well as the unlikely's and
the extra new lines.

Thanks for your quick response. Here is an updated version:
--
Upon errors gpio_regs was not iounmapped, and later priv nor new_bus->irq was
freed. Testing succes of the allocation of new_bus->irq was missing as well.

This patch creates a new function __gpio_mdio_register_bus to allow the 
iounmapping after an ioremap.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---

diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index dae9f65..af5b241 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -208,68 +208,50 @@ static int gpio_mdio_write(struct mii_bus *bus, int phy_id, int location, u16 va
 }
 
 static int gpio_mdio_reset(struct mii_bus *bus)
 {
 	/*nothing here - dunno how to reset it*/
 	return 0;
 }
 
-
-static int __devinit gpio_mdio_probe(struct of_device *ofdev,
-				     const struct of_device_id *match)
+static int __devinit __gpio_mdio_register_bus(struct of_device *ofdev,
+					const struct of_device_id *match)
 {
 	struct device *dev = &ofdev->dev;
 	struct device_node *np = ofdev->node;
-	struct device_node *gpio_np;
 	struct mii_bus *new_bus;
-	struct resource res;
 	struct gpio_priv *priv;
 	const unsigned int *prop;
-	int err = 0;
 	int i;
 
-	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
-
-	if (!gpio_np)
-		return -ENODEV;
-
-	err = of_address_to_resource(gpio_np, 0, &res);
-	of_node_put(gpio_np);
-
-	if (err)
-		return -EINVAL;
-
-	if (!gpio_regs)
-		gpio_regs = ioremap(res.start, 0x100);
-
-	if (!gpio_regs)
-		return -EPERM;
-
 	priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
 	if (priv == NULL)
 		return -ENOMEM;
 
 	new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
 
 	if (new_bus == NULL)
-		return -ENOMEM;
+		goto free_priv;
 
 	new_bus->name = "pasemi gpio mdio bus",
 	new_bus->read = &gpio_mdio_read,
 	new_bus->write = &gpio_mdio_write,
 	new_bus->reset = &gpio_mdio_reset,
 
 	prop = of_get_property(np, "reg", NULL);
 	new_bus->id = *prop;
 	new_bus->priv = priv;
 
 	new_bus->phy_mask = 0;
 
 	new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
+	if (new_bus->irq == NULL)
+		goto free_new_bus;
+
 	for(i = 0; i < PHY_MAX_ADDR; ++i)
 		new_bus->irq[i] = irq_create_mapping(NULL, 10);
 
 
 	prop = of_get_property(np, "mdc-pin", NULL);
 	priv->mdc_pin = *prop;
 
 	prop = of_get_property(np, "mdio-pin", NULL);
@@ -284,17 +266,54 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
 		printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
 				new_bus->name, err);
 		goto bus_register_fail;
 	}
 
 	return 0;
 
 bus_register_fail:
+	kfree(new_bus->irq);
+free_new_bus:
 	kfree(new_bus);
+free_priv:
+	kfree(priv);
+
+	return -ENOMEM;
+}
+
+
+static int __devinit gpio_mdio_probe(struct of_device *ofdev,
+				     const struct of_device_id *match)
+{
+	struct device_node *gpio_np;
+	struct resource res;
+	int err;
+
+	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
+
+	if (!gpio_np)
+		return -ENODEV;
+
+	err = of_address_to_resource(gpio_np, 0, &res);
+	of_node_put(gpio_np);
+
+	if (err)
+		return -EINVAL;
+
+	if (!gpio_regs) {
+		gpio_regs = ioremap(res.start, 0x100);
+		if (unlikely(!gpio_regs))
+			return -EPERM;
+
+		err = __gpio_mdio_register_bus(ofdev, match);
+		if (err < 0)
+			iounmap(gpio_regs);
+	} else
+		err = __gpio_mdio_register_bus(ofdev, match);
 
 	return err;
 }
 
 
 static int gpio_mdio_remove(struct of_device *dev)
 {
 	struct mii_bus *bus = dev_get_drvdata(&dev->dev);

^ permalink raw reply related

* Re: [PATCH] Balance alloc/free and ioremap/iounmap in gpio_mdio_probe (powerpc/platforms/pasemi/gpio_mdio.c)
From: Olof Johansson @ 2007-11-04 17:47 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linuxppc-dev
In-Reply-To: <472DF914.7020601@tiscali.nl>

On Sun, Nov 04, 2007 at 05:53:40PM +0100, Roel Kluin wrote:
> I think this is how it should be done, but
> please review: it was not tested.

Hi,

Thanks for the bug report. The mdio driver needs a set of other cleanups
as well. I have a more comprehensive patch that I'll post tomorrow after
I have a chance to test them.


-Olof

^ permalink raw reply

* Re: [PATCH] Balance alloc/free and ioremap/iounmap in gpio_mdio_probe (powerpc/platforms/pasemi/gpio_mdio.c)
From: Nathan Lynch @ 2007-11-04 17:18 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linuxppc-dev
In-Reply-To: <472DF914.7020601@tiscali.nl>

Hi,

Roel Kluin wrote:
> I think this is how it should be done, but
> please review: it was not tested.
> --
> Balance alloc/free and ioremap/iounmap

It would be more helpful if your changelog identified the objects
which could be leaked.  More comments below.


> -static int __devinit gpio_mdio_probe(struct of_device *ofdev,
> -				     const struct of_device_id *match)
> +static int __devinit __gpio_mdio_register_bus(struct of_device *ofdev,
> +					const struct of_device_id *match)
>  {
>  	struct device *dev = &ofdev->dev;
>  	struct device_node *np = ofdev->node;
> -	struct device_node *gpio_np;
>  	struct mii_bus *new_bus;
>  	struct resource res;
>  	struct gpio_priv *priv;
>  	const unsigned int *prop;
> -	int err = 0;
>  	int i;
>  
> -	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
> -
> -	if (!gpio_np)
> -		return -ENODEV;
> -
> -	err = of_address_to_resource(gpio_np, 0, &res);
> -	of_node_put(gpio_np);
> -
> -	if (err)
> -		return -EINVAL;
> -
> -	if (!gpio_regs)
> -		gpio_regs = ioremap(res.start, 0x100);
> -
> -	if (!gpio_regs)
> -		return -EPERM;
> -
>  	priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
> -	if (priv == NULL)
> +	if (unlikely(priv == NULL))
>  		return -ENOMEM;

Please don't add likely/unlikely to non-hot paths such as this.


>  	new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
>  
> -	if (new_bus == NULL)
> -		return -ENOMEM;
> +	if (unlikely(new_bus == NULL))
> +		goto free_priv;

again

>  
>  	new_bus->name = "pasemi gpio mdio bus",
>  	new_bus->read = &gpio_mdio_read,
>  	new_bus->write = &gpio_mdio_write,
>  	new_bus->reset = &gpio_mdio_reset,
>  
>  	prop = of_get_property(np, "reg", NULL);
>  	new_bus->id = *prop;
>  	new_bus->priv = priv;
>  
>  	new_bus->phy_mask = 0;
>  
>  	new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
> +	if (unlikely(new_bus->irq == NULL))
> +		goto free_new_bus;
> +

again

>  	for(i = 0; i < PHY_MAX_ADDR; ++i)
>  		new_bus->irq[i] = irq_create_mapping(NULL, 10);
>  
>  
>  	prop = of_get_property(np, "mdc-pin", NULL);
>  	priv->mdc_pin = *prop;
>  
>  	prop = of_get_property(np, "mdio-pin", NULL);
>  	priv->mdio_pin = *prop;
>  
>  	new_bus->dev = dev;
>  	dev_set_drvdata(dev, new_bus);
>  
>  	err = mdiobus_register(new_bus);
>  
> -	if (0 != err) {
> +	if (unlikely(0 != err)) {

again

>  		printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
>  				new_bus->name, err);
>  		goto bus_register_fail;
>  	}
>  
>  	return 0;
>  
>  bus_register_fail:
> +	kfree(new_bus->irq);
> +free_new_bus:
>  	kfree(new_bus);
> +free_priv:
> +	kfree(priv);
> +
> +	return -ENOMEM;
> +}
> +
> +
> +static int __devinit gpio_mdio_probe(struct of_device *ofdev,
> +				     const struct of_device_id *match)
> +{
> +	struct device_node *gpio_np;
> +	int err;
> +
> +	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
> +
> +	if (!gpio_np)
> +		return -ENODEV;
> +
> +	err = of_address_to_resource(gpio_np, 0, &res);

Hmm, where is "res" defined?


> +	of_node_put(gpio_np);
> +
> +	if (err)
> +		return -EINVAL;
> +
> +	if (!gpio_regs) {
> +

Unneeded newline


> +		gpio_regs = ioremap(res.start, 0x100);
> +		if (unlikely(!gpio_regs))
> +			return -EPERM;
> +
> +		err = __gpio_mdio_register_bus(ofdev, match);
> +		if (err < 0)
> +			iounmap(gpio_regs);
> +	} else
> +		err = __gpio_mdio_register_bus(ofdev, match);
>  
>  	return err;
> +

again

>  }
>  
>  
>  static int gpio_mdio_remove(struct of_device *dev)
>  {
>  	struct mii_bus *bus = dev_get_drvdata(&dev->dev);
>  
>  	mdiobus_unregister(bus);
> 

^ permalink raw reply

* Re: [PATCH] net: Add 405EX support to new EMAC driver
From: Olof Johansson @ 2007-11-04 17:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: netdev, Stefan Roese, linuxppc-dev
In-Reply-To: <1194147479.6511.11.camel@pasglop>

On Sun, Nov 04, 2007 at 02:37:59PM +1100, Benjamin Herrenschmidt wrote:
> 
> On Fri, 2007-11-02 at 11:03 -0500, Olof Johansson wrote:
> > On Fri, Nov 02, 2007 at 08:14:43AM +0100, Stefan Roese wrote:
> > > This patch adds support for the 405EX to the new EMAC driver. Some as on
> > > AXON, the 405EX handles the MDIO via the RGMII bridge.
> > 
> > Hi,
> > 
> > This isn't feedback on your patch as much as on "new-emac" in general:
> > 
> > Isn't this the case where there should really be device tree properties
> > instead? If you had an "ibm,emac-has-axon-stacr" property in the device
> > node, then you don't have to modify the driver for every new board out
> > there. Same for the other device properties, of course.
> > 
> > I thought this was what having the device tree was all about. :(
> 
> Somewhat yeah. There are subtle variations here or there we haven't
> totally indenfified... It might be a better option in our case here to
> add "has-mdio" to the rgmii nodes indeed.
> 
> Part of the problem with those cells is that the chip folks keep
> changing things subtly from one rev to another though, it's not even
> totally clear to me yet whether the RGMII registers are totally
> compatible betwee axon and 405ex, which is why I've pretty much stuck to
> "compatible" properties to identify the variants.
> 
> The device-tree can do both. It's still better than no device-tree since
> at least you know what cell variant is in there.

Well, it's better than compile-time ifdefs. Providing what version of
the device you have CAN be done without a device tree too. :-)

> As for the STACR, Axon isn't the first one to have that bit flipped, I
> think we should name the property differently, something like
> "stacr-oc-inverted".

Sure, it was the habit of having to modify the driver for platforms that
don't add any new features I was against. I don't really care what the
properties are called :-)

> We can still use properties that way for new things in fact. As for EMAC
> on cell, well, I can always put some fixup somewhere.

Sounds good (with s/can still/should/).


-Olof

^ permalink raw reply

* [PATCH] Balance alloc/free and ioremap/iounmap in gpio_mdio_probe (powerpc/platforms/pasemi/gpio_mdio.c)
From: Roel Kluin @ 2007-11-04 16:53 UTC (permalink / raw)
  To: linuxppc-dev

I think this is how it should be done, but
please review: it was not tested.
--
Balance alloc/free and ioremap/iounmap

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index dae9f65..f250ba4 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -208,95 +208,116 @@ static int gpio_mdio_write(struct mii_bus *bus, int phy_id, int location, u16 va
 }
 
 static int gpio_mdio_reset(struct mii_bus *bus)
 {
 	/*nothing here - dunno how to reset it*/
 	return 0;
 }
 
-
-static int __devinit gpio_mdio_probe(struct of_device *ofdev,
-				     const struct of_device_id *match)
+static int __devinit __gpio_mdio_register_bus(struct of_device *ofdev,
+					const struct of_device_id *match)
 {
 	struct device *dev = &ofdev->dev;
 	struct device_node *np = ofdev->node;
-	struct device_node *gpio_np;
 	struct mii_bus *new_bus;
 	struct resource res;
 	struct gpio_priv *priv;
 	const unsigned int *prop;
-	int err = 0;
 	int i;
 
-	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
-
-	if (!gpio_np)
-		return -ENODEV;
-
-	err = of_address_to_resource(gpio_np, 0, &res);
-	of_node_put(gpio_np);
-
-	if (err)
-		return -EINVAL;
-
-	if (!gpio_regs)
-		gpio_regs = ioremap(res.start, 0x100);
-
-	if (!gpio_regs)
-		return -EPERM;
-
 	priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
-	if (priv == NULL)
+	if (unlikely(priv == NULL))
 		return -ENOMEM;
 
 	new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
 
-	if (new_bus == NULL)
-		return -ENOMEM;
+	if (unlikely(new_bus == NULL))
+		goto free_priv;
 
 	new_bus->name = "pasemi gpio mdio bus",
 	new_bus->read = &gpio_mdio_read,
 	new_bus->write = &gpio_mdio_write,
 	new_bus->reset = &gpio_mdio_reset,
 
 	prop = of_get_property(np, "reg", NULL);
 	new_bus->id = *prop;
 	new_bus->priv = priv;
 
 	new_bus->phy_mask = 0;
 
 	new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
+	if (unlikely(new_bus->irq == NULL))
+		goto free_new_bus;
+
 	for(i = 0; i < PHY_MAX_ADDR; ++i)
 		new_bus->irq[i] = irq_create_mapping(NULL, 10);
 
 
 	prop = of_get_property(np, "mdc-pin", NULL);
 	priv->mdc_pin = *prop;
 
 	prop = of_get_property(np, "mdio-pin", NULL);
 	priv->mdio_pin = *prop;
 
 	new_bus->dev = dev;
 	dev_set_drvdata(dev, new_bus);
 
 	err = mdiobus_register(new_bus);
 
-	if (0 != err) {
+	if (unlikely(0 != err)) {
 		printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
 				new_bus->name, err);
 		goto bus_register_fail;
 	}
 
 	return 0;
 
 bus_register_fail:
+	kfree(new_bus->irq);
+free_new_bus:
 	kfree(new_bus);
+free_priv:
+	kfree(priv);
+
+	return -ENOMEM;
+}
+
+
+static int __devinit gpio_mdio_probe(struct of_device *ofdev,
+				     const struct of_device_id *match)
+{
+	struct device_node *gpio_np;
+	int err;
+
+	gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
+
+	if (!gpio_np)
+		return -ENODEV;
+
+	err = of_address_to_resource(gpio_np, 0, &res);
+	of_node_put(gpio_np);
+
+	if (err)
+		return -EINVAL;
+
+	if (!gpio_regs) {
+
+		gpio_regs = ioremap(res.start, 0x100);
+		if (unlikely(!gpio_regs))
+			return -EPERM;
+
+		err = __gpio_mdio_register_bus(ofdev, match);
+		if (err < 0)
+			iounmap(gpio_regs);
+	} else
+		err = __gpio_mdio_register_bus(ofdev, match);
 
 	return err;
+
 }
 
 
 static int gpio_mdio_remove(struct of_device *dev)
 {
 	struct mii_bus *bus = dev_get_drvdata(&dev->dev);
 
 	mdiobus_unregister(bus);

^ permalink raw reply related

* mpc852t boot question!
From: Kugel @ 2007-11-04 16:18 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

 I made a MPC852T board. I set the HW config word to 0x04600000(D5,D9,D10
pulled up).So the [ISB]=00, 
 
and the IMMR = 0x00000000. 
 
 When the CPU is power up, can it boot from external boot flash(39vf040)? Or
just run from internal 
 
memory space(because the IMMR=0x0)? 
 

[-- Attachment #2: Type: text/html, Size: 1306 bytes --]

^ permalink raw reply

* Problem replacing a Samsung K9F1208U0M NAND flash chip with ST NAND512W3A
From: Santanu Sen @ 2007-11-04 14:34 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

Facing some trouble replacing a SAMSUNG K9F1208U0M
with an ST NAND512W3A. I know it is criminal, but we
are still using the 2.4 kernel. The excuse is, it is
impossible to port all our code/drivers to 2.6 within
the project deadline.  


Here is the story. We could successfully install JFFS2
on a Samsung  K9F1208U0M NAND chip mounted on a board
running linux-2.4.20 on a ppc852 processor. But when
we replaced the Samsung chip with an ST NAND512W3A,
creating a JFFS2 partition will no longer work. Raw
read/write to the device is fine. We could even copy a
squashfs image to one of the partitions and mount it
without trouble. But whenever we create a JFFS2
partition, mount it, create a file on it, unmount it
and mount it again the file goes missing. Attaching a
screen-shot of the entire procedure. Note that, the
same steps work fine with Samsung chips. Also, neither
"eraseall" nor "eraseall --jffs2" is of much help in
case of ST. We found some document on the ST site
stating what to do to replace a Samsung chip with an
ST one. The chips are claimed to be equivalent except
that Samsung supports some additional multi-plane
commands. But we could not see those commands being
used anywhere in the mtd code.   

Are there anything special to be done for ST NAND
chips? 

Any help will be appreciated.  

Thanks and Regards, 
Santanu

NB: Posting this message here afetr several
unsuccessful attempts to post it on the "jffs2-dev"
mailing list. 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[-- Attachment #2: 1173074946-st_jffs2_error --]
[-- Type: application/octet-stream, Size: 7705 bytes --]

Tejas U-Boot PrivateBuild:santanu (Oct 10 2007 - 00:35:55)
                                                                                                                                                             
CPU:   XPC852TxxZPnn-VR66 at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
DRAM:  (64 MB SDRAM) 64 MB
I2C:   ready
Eeprom header mismatch ...
Board: ..?  00:+0x
Ethernet Address: 00:04:95:00:00:01
Date:  0/00/2000  0:00:00
Reserving 4096k for protected RAM at 03c00000
Top of RAM usable for U-Boot at: 03c00000
Reserving 178k for U-Boot at: 03bd3000
Reserving 2064k for malloc() at: 039cf000
Reserving 444 Bytes for Board Info at: 039cee44
Reserving 48 Bytes for Global Data at: 039cedf0
Stack Pointer at: 039cedd8
Eeprom header mismatch ...
New Stack Pointer is: 039cedd8
Now running in RAM - U-Boot at: 03bd3000
FLASH:  2 MB
Using default environment
                                                                                                                                                             
In:    serial
Out:   serial
Err:   serial
U-Boot relocated to 03bd3000
NAND:  Probing at 0xf8000000
Flash chip found:
         Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro 512W3A2BN6)
1 flash chips found. Total nand_chip size: 64 MB
NAND Flash:   64 MB
Net:   FEC ETHERNET
Hit'a' to stop, any other key to autoboot:  0
Tejas-pxat-uboot> boot initrd
                                                                                                                                                             
Loading from device 0: <NULL> at 0xf8000000 (offset 0x0)
   Image Name:   Linux Multiboot-Image
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    1509590 Bytes =  1.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
   Image 0:   700108 Bytes = 683.7 kB
   Image 1:   809470 Bytes = 790.5 kB
Automatic boot of image at addr 0x00200000 ...
## Booting image at 00200000 ...
   Image Name:   Linux Multiboot-Image
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    1509590 Bytes =  1.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
   Image 0:   700108 Bytes = 683.7 kB
   Image 1:   809470 Bytes = 790.5 kB
   Verifying Checksum ... OK
   Uncompressing Multi-File Image ... OK
   Loading Ramdisk to 03908000, end 039cd9fe ... OK
Linux version 2.4.20-denx-PrivateBuild:santanu  (santanu@sephia) (gcc version 2.95.4 20010319 (prerelease/franzo/20011204)) #2 Tue Oct 9 20:50:51 IST 2007
On node 0 totalpages: 15359
zone(0): 15359 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: slram=mtd_tjram01,0x3C00000,+0x400000 console=ttyS0,57600 init=/etc/rc.sh root=/dev/ram rw mtdsize0=0x00040000 mtdparts=a initrd
Decrementer Frequency = 187500000/60
Warning: real time clock seems stuck!
Calibrating delay loop... 49.66 BogoMIPS
Memory: 57584k available (1332k kernel code, 432k data, 56k init, 0k highmem)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
WDT_8xx: SWT not enabled by firmware, SYPCR=0xffffff89
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis Communications AB.
squashfs: version 3.1 (2006/08/19) Phillip Lougher
CPM UART driver version 0.04
ttyS0 on SMC1 at 0x0280, BRG1
pty: 256 Unix98 ptys configured
eth0: FEC ENET Version 0.3, FEC irq 11, with MDIO, addr 00:04:95:00:00:01
eth0: Phy @ 0x0, type RTL8201 (0x00008201)
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
tn100map flash device: 00200000 at 40000000
 Amd/Fujitsu Extended Query Table v1.0 at 0x0040
Physically mapped flash: JEDEC Device ID is 0xC4. Assuming broken CFI table.
Physically mapped flash: Swapping erase regions for broken CFI table.
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Using tn100_map partition definition
Creating 1 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "uboot"
NAND device: Manufacture ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V)
Creating 10 MTD partitions on "NAND 64MiB 3,3V":
0x00000000-0x00200000 : "linux_initrd"
0x00200000-0x00600000 : "rootfs"
0x00600000-0x00a00000 : "backroot"
0x00a00000-0x01e00000 : "software"
0x01e00000-0x03200000 : "backsoft"
0x03200000-0x03600000 : "tejas"
0x03600000-0x03e00000 : "log"
0x03e00000-0x03f00000 : "diag"
0x03f00000-0x03f40000 : "mapper"
0x03f40000-0x03fc0000 : "tomfpga"
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
IPv4 over IPv4 tunneling driver
Linux IP multicast router 0.06 plus PIM-SM
ip_conntrack version 2.1 (479 buckets, 3832 max) - 292 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
arp_tables: (C) 2002 David S. Miller
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 790k freed
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 56k init
/bin/mount -t proc proc /proc
mount -t ramfs none /var && mkdir /var/cron /var/lock /var/lock/subsys /var/log /var/run /var/tmp /var/dumps && touch /var/log/wtmp /var/run/utmp
cp -a /dev/* /tmp && mount -t ramfs none /dev && mv /tmp/* /dev
eth0: config: auto-negotiation on, 100HDX, 10HDX.
slram=mtd_tjram01,0x3C00000,+0x400000 console=ttyS0,57600 init=/etc/rc.sh root=/dev/ram rw mtdsize0=0x00040000 mtdparts=a initrd
init started:  BusyBox v0.60.5 (2006.05.15-11:55+0000) multi-call
                                                                                                                                                             
BusyBox v0.60.5 (2006.06.02-06:31+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
                                                                                                                                                             
source: not found
(none)> eth0: status: link up, 100 Mbps Half Duplex, auto-negotiation complete.
                                                                                                                                                             
(none)>
(none)> eraseall /dev/mtd8
Erasing 16 Kibyte @ 7fc000 -- 99 % complete.
(none)> mount -t jffs2 /dev/mtdblock8 /tmp/drive1
(none)> cd /tmp/drive1
(none)> echo "aa" > txt
(none)> cat txt
aa
(none)> sync
(none)> cd ..
(none)> umount drive1
(none)> mount -t jffs2 /dev/mtdblock8 drive1
Node header CRC failed at 007f8244. But it must have been OK earlier.
Node was: { ffff, ffff, ffffffff, ffffffff }
Eep. Unknown node type ffff at 007f8270 was marked REF_UNCHECKED
Node header CRC failed at 007f8270. But it must have been OK earlier.
Node was: { ffff, ffff, ffffffff, ffffffff }
(none)> Eep. Unknown node type ffff at 007f8200 was marked REF_UNCHECKED
Node header CRC failed at 007f8200. But it must have been OK earlier.
Node was: { ffff, ffff, ffffffff, ffffffff }
                                                                                                                                                             
(none)> cd drive1
(none)> ls
(none)>


^ permalink raw reply

* Re: [PATCH] Restore deterministic CPU accounting on powerpc
From: Michael Neuling @ 2007-11-04 12:11 UTC (permalink / raw)
  To: Balbir Singh
  Cc: Peter Zijlstra, Christian Borntraeger, linux-kernel, linuxppc-dev,
	Paul Mackerras, Martin Schwidefsky, Ingo Molnar, Thomas Gleixner
In-Reply-To: <661de9470711030202x24d0186cuc96a70156ecfa23f@mail.gmail.com>

> > +#ifndef CONFIG_VIRT_CPU_ACCOUNTING
> > +void account_process_tick(int user_tick)
> > +{
> > +       if (user_tick) {
> > +               account_user_time(p, jiffies_to_cputime(1));
> > +               account_user_time_scaled(p, jiffies_to_cputime(1));
> > +       } else {
> > +               account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1
));
> > +               account_system_time_scaled(p, jiffies_to_cputime(1));
> > +       }
> > +}
> > +#endif
> > +
> 
> Hi, Paul,
> 
> So, scaled accounting will not be available if
> CONFIG_VIRT_CPU_ACCOUNTING is defined? Am I reading this correctly

Balbir, 

Paulus' patch will have merge issues with the scaled time cleanup patch
I posted a week or so back.  My cleanup patch is only in akpm's tree at
this stage.

Mikey

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox