All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
@ 2014-04-15  5:53 Dongsheng Wang
  2014-04-15  5:53 ` [PATCH v2 2/2] fsl/corenet_generic: add t104x platform diu special initialization Dongsheng Wang
  2014-04-15 19:39 ` [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Scott Wood
  0 siblings, 2 replies; 8+ messages in thread
From: Dongsheng Wang @ 2014-04-15  5:53 UTC (permalink / raw)
  To: scottwood; +Cc: linuxppc-dev, haokexin, prabhakar, jason.jin, Wang Dongsheng

From: Wang Dongsheng <dongsheng.wang@freescale.com>

Corenet_generic is a generic platform initialization. Those based on
the corenet_generic board maybe need a particular initialize to
enable/set some IP-Blocks. So add "Fix Generic Initialization" to solve
this kind of special cases.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
---
*v2*
 1/ Split DIU code.
 2/ make fix.c as a independent driver.
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c17aae8..fce2341 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -269,6 +269,17 @@ config CORENET_GENERIC
 	  The following boards are supported for both 32bit and 64bit kernel:
 	    P5020 DS and P5040 DS
 
+config FIX_GENERIC_PLATFORM_INIT
+	bool "Fix Generic Initialization"
+	depends on CORENET_GENERIC
+	default y
+	help
+	  This option will create a initialization that is a append initialization
+	  for a particular platfrom. And this particular platform also based on
+	  "Freescale CoreNet Generic".
+
+	  e.g. DIU need a special initialization at T104x platform.
+
 endif # FSL_SOC_BOOKE
 
 config TQM85xx
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 25cebe7..1162ac7 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_P1022_RDK)   += p1022_rdk.o
 obj-$(CONFIG_P1023_RDS)   += p1023_rds.o
 obj-$(CONFIG_TWR_P102x)   += twr_p102x.o
 obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
+obj-$(CONFIG_FIX_GENERIC_PLATFORM_INIT) += fix/
 obj-$(CONFIG_STX_GP3)	  += stx_gp3.o
 obj-$(CONFIG_TQM85xx)	  += tqm85xx.o
 obj-$(CONFIG_SBC8548)     += sbc8548.o
diff --git a/arch/powerpc/platforms/85xx/fix/Makefile b/arch/powerpc/platforms/85xx/fix/Makefile
new file mode 100644
index 0000000..a8e8154
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/fix/Makefile
@@ -0,0 +1 @@
+obj-y += fix.o
diff --git a/arch/powerpc/platforms/85xx/fix/fix.c b/arch/powerpc/platforms/85xx/fix/fix.c
new file mode 100644
index 0000000..7b59a52
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/fix/fix.c
@@ -0,0 +1,26 @@
+/*
+ * Fix Different Boards Particular Initialization
+ *
+ * Author: Wang Dongsheng <dongsheng.wang@freescale.com>
+ *
+ * Copyright 2014 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/kernel.h>
+
+#include <asm/mpc85xx.h>
+#include <asm/reg.h>
+#include <asm/reg_booke.h>
+
+#include "fix.h"
+
+static int fix_platform_init(void)
+{
+	return 0;
+}
+early_initcall(fix_platform_init);
diff --git a/arch/powerpc/platforms/85xx/fix/fix.h b/arch/powerpc/platforms/85xx/fix/fix.h
new file mode 100644
index 0000000..5a8c80e3
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/fix/fix.h
@@ -0,0 +1,4 @@
+#ifndef __CORENET_GENERIC_FIX_H__
+#define __CORENET_GENERIC_FIX_H__
+
+#endif
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] fsl/corenet_generic: add t104x platform diu special initialization
  2014-04-15  5:53 [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Dongsheng Wang
@ 2014-04-15  5:53 ` Dongsheng Wang
  2014-04-15 19:39 ` [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Scott Wood
  1 sibling, 0 replies; 8+ messages in thread
From: Dongsheng Wang @ 2014-04-15  5:53 UTC (permalink / raw)
  To: scottwood; +Cc: linuxppc-dev, haokexin, prabhakar, jason.jin, Wang Dongsheng

From: Wang Dongsheng <dongsheng.wang@freescale.com>

T104x Platforms based on corenet_generic. The platforms DIU-block
that need a special initialization to solve some callback functions,
those functions depend on platform handle.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
---
This patch is *depends on* Prabhakar Kushwaha support T104x patchset.

v2: No change.
diff --git a/arch/powerpc/platforms/85xx/fix/Makefile b/arch/powerpc/platforms/85xx/fix/Makefile
index a8e8154..0530acd 100644
--- a/arch/powerpc/platforms/85xx/fix/Makefile
+++ b/arch/powerpc/platforms/85xx/fix/Makefile
@@ -1 +1,3 @@
 obj-y += fix.o
+
+obj-y += t104x_diu.o
diff --git a/arch/powerpc/platforms/85xx/fix/fix.c b/arch/powerpc/platforms/85xx/fix/fix.c
index 7b59a52..c278eb1 100644
--- a/arch/powerpc/platforms/85xx/fix/fix.c
+++ b/arch/powerpc/platforms/85xx/fix/fix.c
@@ -21,6 +21,19 @@
 
 static int fix_platform_init(void)
 {
+	u32 svr;
+
+	svr = SVR_SOC_VER(mfspr(SPRN_SVR));
+
+	switch (svr) {
+	case SVR_T1040:
+	case SVR_T1042:
+		fix_t104x_diu_init();
+		break;
+	default:
+		pr_info("Platform is not need to fix anything\n");
+	}
+
 	return 0;
 }
 early_initcall(fix_platform_init);
diff --git a/arch/powerpc/platforms/85xx/fix/fix.h b/arch/powerpc/platforms/85xx/fix/fix.h
index 5a8c80e3..d27635f 100644
--- a/arch/powerpc/platforms/85xx/fix/fix.h
+++ b/arch/powerpc/platforms/85xx/fix/fix.h
@@ -1,4 +1,6 @@
 #ifndef __CORENET_GENERIC_FIX_H__
 #define __CORENET_GENERIC_FIX_H__
 
+extern void fix_t104x_diu_init(void);
+
 #endif
diff --git a/arch/powerpc/platforms/85xx/fix/t104x_diu.c b/arch/powerpc/platforms/85xx/fix/t104x_diu.c
new file mode 100644
index 0000000..39c7242
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/fix/t104x_diu.c
@@ -0,0 +1,155 @@
+/*
+ * T104x RDB Particular Setup
+ * Should apply for RDB platform of T1040 and it's personalities.
+ * viz T1040/T1042
+ *
+ * Copyright 2014 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include <asm/io.h>
+#include <sysdev/fsl_soc.h>
+
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
+/*DIU Pixel ClockCR offset in scfg*/
+#define CCSR_SCFG_PIXCLKCR      0x28
+
+/* DIU Pixel Clock bits of the PIXCLKCR */
+#define PIXCLKCR_PXCKEN		0x80000000
+#define PIXCLKCR_PXCKINV	0x40000000
+#define PIXCLKCR_PXCKDLY	0x0000FF00
+#define PIXCLKCR_PXCLK_MASK	0x00FF0000
+
+/* Some CPLD register definitions */
+#define CPLD_DIUCSR		0x16
+#define CPLD_DIUCSR_DVIEN	0x80
+#define CPLD_DIUCSR_BACKLIGHT	0x0f
+
+/**
+ * t104xrdb_set_monitor_port: switch the output to a different monitor port
+ */
+static void t104xrdb_set_monitor_port(enum fsl_diu_monitor_port port)
+{
+	struct device_node *cpld_node;
+	static void __iomem *cpld_base;
+
+	cpld_node = of_find_compatible_node(NULL, NULL, "fsl,t104xrdb-cpld");
+	if (!cpld_node) {
+		pr_err("T104xRDB: missing CPLD node\n");
+		return;
+	}
+
+	cpld_base = of_iomap(cpld_node, 0);
+	if (!cpld_base) {
+		pr_err("T104xRDB: could not map cpld registers\n");
+		goto exit;
+	}
+
+	switch (port) {
+	case FSL_DIU_PORT_DVI:
+		/* Enable the DVI(HDMI) port, disable the DFP and
+		 * the backlight
+		 */
+		clrbits8(cpld_base + CPLD_DIUCSR, CPLD_DIUCSR_DVIEN);
+		break;
+	case FSL_DIU_PORT_LVDS:
+		/*
+		 * LVDS also needs backlight enabled, otherwise the display
+		 * will be blank.
+		 */
+		/* Enable the DFP port, disable the DVI*/
+		setbits8(cpld_base + CPLD_DIUCSR, 0x01 << 8);
+		setbits8(cpld_base + CPLD_DIUCSR, 0x01 << 4);
+		setbits8(cpld_base + CPLD_DIUCSR, CPLD_DIUCSR_BACKLIGHT);
+		break;
+	default:
+		pr_err("T104xRDB: unsupported monitor port %i\n", port);
+	}
+
+exit:
+	of_node_put(cpld_node);
+}
+
+/**
+ * t104xrdb_set_pixel_clock: program the DIU's clock
+ *
+ * @pixclock: the wavelength, in picoseconds, of the clock
+ */
+static void t104xrdb_set_pixel_clock(unsigned int pixclock)
+{
+	struct device_node *scfg_np = NULL;
+	void __iomem *scfg;
+	unsigned long freq;
+	u64 temp;
+	u32 pxclk;
+
+	/* Map the global utilities registers. */
+	scfg_np = of_find_compatible_node(NULL, NULL, "fsl,t1040-scfg");
+	if (!scfg_np) {
+		freq = temp;
+		pr_err("T104xRDB: missing supplemental configuration unit device node\n");
+		return;
+	}
+
+	scfg = of_iomap(scfg_np, 0);
+	of_node_put(scfg_np);
+	if (!scfg) {
+		pr_err("T104xRDB: could not map device\n");
+		return;
+	}
+
+	/* Convert pixclock from a wavelength to a frequency */
+	temp = 1000000000000ULL;
+	do_div(temp, pixclock);
+	freq = temp;
+
+	/*
+	 * 'pxclk' is the ratio of the platform clock to the pixel clock.
+	 * This number is programmed into the PIXCLKCR register, and the valid
+	 * range of values is 2-255.
+	 */
+	pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq);
+	pxclk = clamp_t(u32, pxclk, 2, 255);
+
+	/* Disable the pixel clock, and set it to non-inverted and no delay */
+	clrbits32(scfg + CCSR_SCFG_PIXCLKCR,
+		  PIXCLKCR_PXCKEN | PIXCLKCR_PXCKDLY | PIXCLKCR_PXCLK_MASK);
+
+	/* Enable the clock and set the pxclk */
+	setbits32(scfg + CCSR_SCFG_PIXCLKCR, PIXCLKCR_PXCKEN | (pxclk << 16));
+
+	iounmap(scfg);
+}
+
+/**
+ * t104xrdb_valid_monitor_port: set the monitor port for sysfs
+ */
+static enum fsl_diu_monitor_port
+t104xrdb_valid_monitor_port(enum fsl_diu_monitor_port port)
+{
+	switch (port) {
+	case FSL_DIU_PORT_DVI:
+	case FSL_DIU_PORT_LVDS:
+		return port;
+	default:
+		return FSL_DIU_PORT_DVI; /* Dual-link LVDS is not supported */
+	}
+}
+#endif
+
+void fix_t104x_diu_init(void)
+{
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
+	diu_ops.set_monitor_port	= t104xrdb_set_monitor_port;
+	diu_ops.set_pixel_clock		= t104xrdb_set_pixel_clock;
+	diu_ops.valid_monitor_port	= t104xrdb_valid_monitor_port;
+#endif
+}
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-15  5:53 [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Dongsheng Wang
  2014-04-15  5:53 ` [PATCH v2 2/2] fsl/corenet_generic: add t104x platform diu special initialization Dongsheng Wang
@ 2014-04-15 19:39 ` Scott Wood
  2014-04-16  2:58   ` Dongsheng.Wang
  1 sibling, 1 reply; 8+ messages in thread
From: Scott Wood @ 2014-04-15 19:39 UTC (permalink / raw)
  To: Dongsheng Wang; +Cc: linuxppc-dev, haokexin, prabhakar, jason.jin

On Tue, 2014-04-15 at 13:53 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
> 
> Corenet_generic is a generic platform initialization. Those based on
> the corenet_generic board maybe need a particular initialize to
> enable/set some IP-Blocks. So add "Fix Generic Initialization" to solve
> this kind of special cases.

I still don't understand what you mean by "fix".  What are you fixing,
or what is fixed?

There is no need for adding an infrastructure layer here.  Just add a
new piece of code for t104x diu, and have it be called by an appropriate
initfunc.

> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> ---
> *v2*
>  1/ Split DIU code.
>  2/ make fix.c as a independent driver.
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
> index c17aae8..fce2341 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -269,6 +269,17 @@ config CORENET_GENERIC
>  	  The following boards are supported for both 32bit and 64bit kernel:
>  	    P5020 DS and P5040 DS
>  
> +config FIX_GENERIC_PLATFORM_INIT
> +	bool "Fix Generic Initialization"
> +	depends on CORENET_GENERIC

Why does this depend on CORENET_GENERIC?

> +	default y

No.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-15 19:39 ` [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Scott Wood
@ 2014-04-16  2:58   ` Dongsheng.Wang
  2014-04-16 19:36     ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Dongsheng.Wang @ 2014-04-16  2:58 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, haokexin, prabhakar, Jason.Jin

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogV2VkbmVzZGF5LCBBcHJpbCAxNiwgMjAxNCAzOjM5IEFNDQo+IFRvOiBXYW5n
IERvbmdzaGVuZy1CNDA1MzQNCj4gQ2M6IEppbiBaaGVuZ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0aW9ucyBpZiB0aGVyZSBpcyBub3QgYW55IGJvYXJkcyBuZWVk
IGZpeC4NCllvdSBjYW4gc2VlIG15IGZpeC5jIGNvZGUuDQoNClJlZ2FyZHMsDQotRG9uZ3NoZW5n
DQoNCj4gLVNjb3R0DQo+IA0KDQo=

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-16  2:58   ` Dongsheng.Wang
@ 2014-04-16 19:36     ` Scott Wood
  2014-04-24  6:43       ` Dongsheng.Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2014-04-16 19:36 UTC (permalink / raw)
  To: Wang Dongsheng-B40534
  Cc: linuxppc-dev, haokexin, Kushwaha Prabhakar-B32579, Jin Zhengxiong-R64188

On Tue, 2014-04-15 at 21:58 -0500, Wang Dongsheng-B40534 wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Wednesday, April 16, 2014 3:39 AM
> > To: Wang Dongsheng-B40534
> > Cc: Jin Zhengxiong-R64188; haokexin@gmail.com; Kushwaha Prabhakar-B32579;
> > linuxppc-dev@lists.ozlabs.org
> > Subject: Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization
> > for platform
> > 
> > On Tue, 2014-04-15 at 13:53 +0800, Dongsheng Wang wrote:
> > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > >
> > > Corenet_generic is a generic platform initialization. Those based on
> > > the corenet_generic board maybe need a particular initialize to
> > > enable/set some IP-Blocks. So add "Fix Generic Initialization" to solve
> > > this kind of special cases.
> > 
> > I still don't understand what you mean by "fix".  What are you fixing,
> > or what is fixed?
> > 
> > There is no need for adding an infrastructure layer here.  Just add a
> > new piece of code for t104x diu, and have it be called by an appropriate
> > initfunc.
> > 
> 
> "fix" is means to handle some boards those based on corenet_generic config file,
> But those boards may need some special handle. Perhaps these used to handle
> special feature codes not have an appropriate initfunc we cannot *just find*
> an appropriate place,

I'm not asking you to "just find" anything.  I'm asking you to add an
initfunc in a standalone file.

> if more and more boards need to do this, at that time maybe *initfunc*
> looks very complicated.

They would each have their own initfunc.  There is no reason to tie this
in with anything else.

> > > --- a/arch/powerpc/platforms/85xx/Kconfig
> > > +++ b/arch/powerpc/platforms/85xx/Kconfig
> > > @@ -269,6 +269,17 @@ config CORENET_GENERIC
> > >  	  The following boards are supported for both 32bit and 64bit kernel:
> > >  	    P5020 DS and P5040 DS
> > >
> > > +config FIX_GENERIC_PLATFORM_INIT
> > > +	bool "Fix Generic Initialization"
> > > +	depends on CORENET_GENERIC
> > 
> > Why does this depend on CORENET_GENERIC?
> > 
> 
> Because CORENET_GENERIC is a multiboards file, This is designed to handle this situation.

This DIU code is going to be just as applicable to a custom T104x board
which may or may not use CORENET_GENERIC.

> > > +	default y
> > 
> > No.
> > 
> 
> Why not? This will not increase any redundant operations if there is not any boards need fix.
> You can see my fix.c code.

default y should not be used for hardware specific code.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-16 19:36     ` Scott Wood
@ 2014-04-24  6:43       ` Dongsheng.Wang
  2014-04-24 18:46         ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Dongsheng.Wang @ 2014-04-24  6:43 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, haokexin, prabhakar, Jason.Jin

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogVGh1cnNkYXksIEFwcmlsIDE3LCAyMDE0IDM6MzYgQU0NCj4gVG86IFdhbmcg
RG9uZ3NoZW5nLUI0MDUzNA0KPiBDYzogSmluIFpoZW5neGlvbmctUjY0MTg4OyBoYW9rZXhpbkBn
bWFpbC5jb207IEt1c2h3YWhhIFByYWJoYWthci1CMzI1Nzk7DQo+IGxpbnV4cHBjLWRldkBsaXN0
cy5vem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gY29k
ZS4NCj4gDQoNCmZpeC5jIGFuZCBoYXJkd2FyZSBubyByZWxhdGlvbnNoaXAgYXQgYWxsLiA6KSwg
SXQncyBqdXN0IGEgc29mdHdhcmUgbGF5ZXIuDQoNClJlZ2FyZHMsDQotRG9uZ3NoZW5nDQoNCj4g
LVNjb3R0DQo+IA0KDQo=

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-24  6:43       ` Dongsheng.Wang
@ 2014-04-24 18:46         ` Scott Wood
  2014-04-24 18:47           ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2014-04-24 18:46 UTC (permalink / raw)
  To: Wang Dongsheng-B40534
  Cc: linuxppc-dev, haokexin, Kushwaha Prabhakar-B32579, Jin Zhengxiong-R64188

On Thu, 2014-04-24 at 01:43 -0500, Wang Dongsheng-B40534 wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, April 17, 2014 3:36 AM
> > To: Wang Dongsheng-B40534
> > Cc: Jin Zhengxiong-R64188; haokexin@gmail.com; Kushwaha Prabhakar-B32579;
> > linuxppc-dev@lists.ozlabs.org
> > Subject: Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization
> > for platform
> > 
> > On Tue, 2014-04-15 at 21:58 -0500, Wang Dongsheng-B40534 wrote:
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Wednesday, April 16, 2014 3:39 AM
> > > > To: Wang Dongsheng-B40534
> > > > Cc: Jin Zhengxiong-R64188; haokexin@gmail.com; Kushwaha
> > > > Prabhakar-B32579; linuxppc-dev@lists.ozlabs.org
> > > > Subject: Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular
> > > > initialization for platform
> > > >
> > > > On Tue, 2014-04-15 at 13:53 +0800, Dongsheng Wang wrote:
> > > > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > >
> > > > > Corenet_generic is a generic platform initialization. Those based
> > > > > on the corenet_generic board maybe need a particular initialize to
> > > > > enable/set some IP-Blocks. So add "Fix Generic Initialization" to
> > > > > solve this kind of special cases.
> > > >
> > > > I still don't understand what you mean by "fix".  What are you
> > > > fixing, or what is fixed?
> > > >
> > > > There is no need for adding an infrastructure layer here.  Just add
> > > > a new piece of code for t104x diu, and have it be called by an
> > > > appropriate initfunc.
> > > >
> > >
> > > "fix" is means to handle some boards those based on corenet_generic
> > > config file, But those boards may need some special handle. Perhaps
> > > these used to handle special feature codes not have an appropriate
> > > initfunc we cannot *just find* an appropriate place,
> > 
> > I'm not asking you to "just find" anything.  I'm asking you to add an initfunc
> > in a standalone file.
> > 
> > > if more and more boards need to do this, at that time maybe *initfunc*
> > > looks very complicated.
> > 
> > They would each have their own initfunc.  There is no reason to tie this in with
> > anything else.
> > 
> 
> Sorry, if those platforms are using corenet_generic, I don’t see any standalone file
> for initfunc of platform. That's why I'm adding "fix" layer.

It's totally unnecessary.

Just do this:

t104x_diu_init(void)
{
	if (t104x diu not in the device tree)
		return;

	...
}

early_initcall(t104x_diu_init);

> > > > > +config FIX_GENERIC_PLATFORM_INIT
> > > > > +	bool "Fix Generic Initialization"
> > > > > +	depends on CORENET_GENERIC
> > > >
> > > > Why does this depend on CORENET_GENERIC?
> > > >
> > >
> > > Because CORENET_GENERIC is a multiboards file, This is designed to handle this
> > situation.
> > 
> > This DIU code is going to be just as applicable to a custom T104x board which
> > may or may not use CORENET_GENERIC.
> > 
> 
> "fix" is a middle layer, it's not only for T104xrdb-DIU.

My point is a custom t104x board might not use CORENET_GENERIC.

> > > > > +	default y
> > > >
> > > > No.
> > > >
> > >
> > > Why not? This will not increase any redundant operations if there is not any
> > boards need fix.
> > > You can see my fix.c code.
> > 
> > default y should not be used for hardware specific code.
> > 
> 
> fix.c and hardware no relationship at all. :), It's just a software layer.

No relationship to hardware, yet it depends on CORENET_GENERIC, reads a
Freescale-specific SPR, and lives in arch/powerpc/platforms/85xx. :-)

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
  2014-04-24 18:46         ` Scott Wood
@ 2014-04-24 18:47           ` Scott Wood
  0 siblings, 0 replies; 8+ messages in thread
From: Scott Wood @ 2014-04-24 18:47 UTC (permalink / raw)
  To: Wang Dongsheng-B40534
  Cc: linuxppc-dev, haokexin, Kushwaha Prabhakar-B32579, Jin Zhengxiong-R64188

On Thu, 2014-04-24 at 13:46 -0500, Scott Wood wrote:
> On Thu, 2014-04-24 at 01:43 -0500, Wang Dongsheng-B40534 wrote:
> > 
> > > -----Original Message-----
> > > From: Wood Scott-B07421
> > > Sent: Thursday, April 17, 2014 3:36 AM
> > > To: Wang Dongsheng-B40534
> > > Cc: Jin Zhengxiong-R64188; haokexin@gmail.com; Kushwaha Prabhakar-B32579;
> > > linuxppc-dev@lists.ozlabs.org
> > > Subject: Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization
> > > for platform
> > > 
> > > On Tue, 2014-04-15 at 21:58 -0500, Wang Dongsheng-B40534 wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Wood Scott-B07421
> > > > > Sent: Wednesday, April 16, 2014 3:39 AM
> > > > > To: Wang Dongsheng-B40534
> > > > > Cc: Jin Zhengxiong-R64188; haokexin@gmail.com; Kushwaha
> > > > > Prabhakar-B32579; linuxppc-dev@lists.ozlabs.org
> > > > > Subject: Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular
> > > > > initialization for platform
> > > > >
> > > > > On Tue, 2014-04-15 at 13:53 +0800, Dongsheng Wang wrote:
> > > > > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > > >
> > > > > > Corenet_generic is a generic platform initialization. Those based
> > > > > > on the corenet_generic board maybe need a particular initialize to
> > > > > > enable/set some IP-Blocks. So add "Fix Generic Initialization" to
> > > > > > solve this kind of special cases.
> > > > >
> > > > > I still don't understand what you mean by "fix".  What are you
> > > > > fixing, or what is fixed?
> > > > >
> > > > > There is no need for adding an infrastructure layer here.  Just add
> > > > > a new piece of code for t104x diu, and have it be called by an
> > > > > appropriate initfunc.
> > > > >
> > > >
> > > > "fix" is means to handle some boards those based on corenet_generic
> > > > config file, But those boards may need some special handle. Perhaps
> > > > these used to handle special feature codes not have an appropriate
> > > > initfunc we cannot *just find* an appropriate place,
> > > 
> > > I'm not asking you to "just find" anything.  I'm asking you to add an initfunc
> > > in a standalone file.
> > > 
> > > > if more and more boards need to do this, at that time maybe *initfunc*
> > > > looks very complicated.
> > > 
> > > They would each have their own initfunc.  There is no reason to tie this in with
> > > anything else.
> > > 
> > 
> > Sorry, if those platforms are using corenet_generic, I don’t see any standalone file
> > for initfunc of platform. That's why I'm adding "fix" layer.
> 
> It's totally unnecessary.
> 
> Just do this:
> 
> t104x_diu_init(void)
> {

s/t104x_diu_init/static void t104x_diu_init/ of course.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-24 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15  5:53 [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Dongsheng Wang
2014-04-15  5:53 ` [PATCH v2 2/2] fsl/corenet_generic: add t104x platform diu special initialization Dongsheng Wang
2014-04-15 19:39 ` [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform Scott Wood
2014-04-16  2:58   ` Dongsheng.Wang
2014-04-16 19:36     ` Scott Wood
2014-04-24  6:43       ` Dongsheng.Wang
2014-04-24 18:46         ` Scott Wood
2014-04-24 18:47           ` Scott Wood

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.