All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
@ 2011-07-28  3:32 Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 1/3] ARM: include mach headers before common arm headers Rob Herring
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Rob Herring @ 2011-07-28  3:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

This is a relatively simple way to remove the platform requirement for
some header files without making changes in every existing platform.
It's perhaps not a solution for the difficult cases, but can get the
simple cases out of the way making it clear what remains to be fixed.
I've done this for system.h and uncompress.h so far. timex.h and io.h
may be additional candidates.

One downside is you lose print capability in the decompressor. However,
I don't think the complexity that adds is worth the 1 line print. Perhaps
the include path ordering could be conditionalized on a config setting
for multi-platform kernels such that the platform's headers are used
on single machine kernels. There's already such a limitation on LL_DEBUG.

Rob

Rob Herring (3):
  ARM: include mach headers before common arm headers
  ARM: add a default mach/uncompress.h header
  ARM: add a default mach/system.h header

 arch/arm/Makefile                  |    4 ++--
 arch/arm/include/mach/system.h     |   13 +++++++++++++
 arch/arm/include/mach/uncompress.h |    9 +++++++++
 arch/arm/kernel/process.c          |    5 ++++-
 4 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/mach/system.h
 create mode 100644 arch/arm/include/mach/uncompress.h

-- 
1.7.4.1

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

* [RFC PATCH 1/3] ARM: include mach headers before common arm headers
  2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
@ 2011-07-28  3:32 ` Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 2/3] ARM: add a default mach/uncompress.h header Rob Herring
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2011-07-28  3:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

In preparation to add an arch/arm/include/mach directory for default
mach headers, make arch/arm/mach-*/include path be searched before
arch/arm/include. This allows platforms to override default header
implementation.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 30a19b6..1c41a2e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -234,9 +234,9 @@ machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y))
 
 ifeq ($(KBUILD_SRC),)
-KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
+LINUXINCLUDE := $(patsubst %,-I%include,$(machdirs) $(platdirs)) $(LINUXINCLUDE)
 else
-KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
+LINUXINCLUDE := $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs)) $(LINUXINCLUDE)
 endif
 
 export	TEXT_OFFSET GZFLAGS MMUEXT
-- 
1.7.4.1

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

* [RFC PATCH 2/3] ARM: add a default mach/uncompress.h header
  2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 1/3] ARM: include mach headers before common arm headers Rob Herring
@ 2011-07-28  3:32 ` Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 3/3] ARM: add a default mach/system.h header Rob Herring
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2011-07-28  3:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Add default empty functions to allow platforms to use a default
uncompress.h header. This helps enable support of multi-platform kernels,
you lose serial output in the decompressor. Only a couple of platforms
need arch_decomp_setup and/or arch_decomp_wdog.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/mach/uncompress.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/mach/uncompress.h

diff --git a/arch/arm/include/mach/uncompress.h b/arch/arm/include/mach/uncompress.h
new file mode 100644
index 0000000..9277c85
--- /dev/null
+++ b/arch/arm/include/mach/uncompress.h
@@ -0,0 +1,9 @@
+#ifndef __MACH_UNCOMPRESS_H
+#define __MACH_UNCOMPRESS_H
+
+static inline void putc(char) {}
+static inline void flush(void) {}
+static inline void arch_decomp_setup(void) {}
+static inline void arch_decomp_wdog(void) {}
+
+#endif
-- 
1.7.4.1

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

* [RFC PATCH 3/3] ARM: add a default mach/system.h header
  2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 1/3] ARM: include mach headers before common arm headers Rob Herring
  2011-07-28  3:32 ` [RFC PATCH 2/3] ARM: add a default mach/uncompress.h header Rob Herring
@ 2011-07-28  3:32 ` Rob Herring
  2011-07-28  4:40 ` [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Nicolas Pitre
  2011-07-28  9:52 ` Russell King - ARM Linux
  4 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2011-07-28  3:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

This adds default implementations of arch_idle and arch_reset. Any
platform with a system.h will pickup their version of the functions.

Platforms needing custom idle and reset functions can set pm_idle and
machine_reset, respectively, to custom implementations at boot time.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/mach/system.h |   13 +++++++++++++
 arch/arm/kernel/process.c      |    5 ++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/mach/system.h

diff --git a/arch/arm/include/mach/system.h b/arch/arm/include/mach/system.h
new file mode 100644
index 0000000..9ab0684
--- /dev/null
+++ b/arch/arm/include/mach/system.h
@@ -0,0 +1,13 @@
+#ifndef __MACH_SYSTEM_H
+#define __MACH_SYSTEM_H
+
+static inline void arch_idle(void)
+{
+	cpu_do_idle();
+}
+
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
+
+#endif
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 5e1e541..b3b10bc 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -91,6 +91,9 @@ static int __init hlt_setup(char *__unused)
 __setup("nohlt", nohlt_setup);
 __setup("hlt", hlt_setup);
 
+void (*machine_reset)(char mode, const char *cmd) = arch_reset;
+EXPORT_SYMBOL(machine_reset);
+
 void arm_machine_restart(char mode, const char *cmd)
 {
 	/* Disable interrupts first */
@@ -116,7 +119,7 @@ void arm_machine_restart(char mode, const char *cmd)
 	/*
 	 * Now call the architecture specific reboot code.
 	 */
-	arch_reset(mode, cmd);
+	machine_reset(mode, cmd);
 
 	/*
 	 * Whoops - the architecture was unable to reboot.
-- 
1.7.4.1

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

* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
  2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
                   ` (2 preceding siblings ...)
  2011-07-28  3:32 ` [RFC PATCH 3/3] ARM: add a default mach/system.h header Rob Herring
@ 2011-07-28  4:40 ` Nicolas Pitre
  2011-07-28 13:53   ` Rob Herring
  2011-07-28  9:52 ` Russell King - ARM Linux
  4 siblings, 1 reply; 9+ messages in thread
From: Nicolas Pitre @ 2011-07-28  4:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 27 Jul 2011, Rob Herring wrote:

> From: Rob Herring <rob.herring@calxeda.com>
> 
> This is a relatively simple way to remove the platform requirement for
> some header files without making changes in every existing platform.
> It's perhaps not a solution for the difficult cases, but can get the
> simple cases out of the way making it clear what remains to be fixed.
> I've done this for system.h and uncompress.h so far. timex.h and io.h
> may be additional candidates.

I'm of two minds about this.  It is true that this makes things easy and 
would avoid some of the #ifdef'ery that is otherwise necessary.  On the 
other hand this gives us more opportunity for procrastinating and not 
really do a complete and thorough job.  It would also be easier for some 
platform to sneak in some of those header files to work around some 
shortcomings in the generic version which is not helping maintainers 
keeping a good discipline.  AS we are working on this, I might prefer 
that mistakes do break the build rather than silently causing a 
fallback with a dummy generic version to be picked up which might only 
cause problems at run time much later.

A Linaro event is taking place next week in England where a focused 
effort will be deployed to work on this.  Let's see how much we'll be 
able to clean up.


Nicolas

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

* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
  2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
                   ` (3 preceding siblings ...)
  2011-07-28  4:40 ` [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Nicolas Pitre
@ 2011-07-28  9:52 ` Russell King - ARM Linux
  2011-07-28 13:21   ` Rob Herring
  4 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2011-07-28  9:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 27, 2011 at 10:32:11PM -0500, Rob Herring wrote:
> One downside is you lose print capability in the decompressor. However,
> I don't think the complexity that adds is worth the 1 line print.

You're wrong there - it's very very useful to have that from the
decompressor.  It's saved many people (including us) a lot of wasted
time caused by faulty hardware implementation.

Normally, if the design of the SDRAM connections is poor, the first
thing which catches it is the decompressor, and so its that which we
really want error information from.

So no, losing that ability is not an option.  Really.

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

* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
  2011-07-28  9:52 ` Russell King - ARM Linux
@ 2011-07-28 13:21   ` Rob Herring
  2011-07-28 15:01     ` Russell King - ARM Linux
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2011-07-28 13:21 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/28/2011 04:52 AM, Russell King - ARM Linux wrote:
> On Wed, Jul 27, 2011 at 10:32:11PM -0500, Rob Herring wrote:
>> One downside is you lose print capability in the decompressor. However,
>> I don't think the complexity that adds is worth the 1 line print.
> 
> You're wrong there - it's very very useful to have that from the
> decompressor.  It's saved many people (including us) a lot of wasted
> time caused by faulty hardware implementation.
> 
> Normally, if the design of the SDRAM connections is poor, the first
> thing which catches it is the decompressor, and so its that which we
> really want error information from.
> 
Agreed. I have seen that case as well, but generally only very early on
in board/chip bringup. Really, bootloaders need a decent memory test or
ability to load one.

> So no, losing that ability is not an option.  Really.

If a platform has an uncompress.h, then you don't lose anything. Is it
something that has to *always* be available? Are you opposed to a config
option here? It can be available only for single arch/machine builds
similar to DEBUG_LL.

Rob

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

* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
  2011-07-28  4:40 ` [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Nicolas Pitre
@ 2011-07-28 13:53   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2011-07-28 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Nicolas,

On 07/27/2011 11:40 PM, Nicolas Pitre wrote:
> On Wed, 27 Jul 2011, Rob Herring wrote:
> 
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> This is a relatively simple way to remove the platform requirement for
>> some header files without making changes in every existing platform.
>> It's perhaps not a solution for the difficult cases, but can get the
>> simple cases out of the way making it clear what remains to be fixed.
>> I've done this for system.h and uncompress.h so far. timex.h and io.h
>> may be additional candidates.
> 
> I'm of two minds about this.  It is true that this makes things easy and 
> would avoid some of the #ifdef'ery that is otherwise necessary.  On the 
> other hand this gives us more opportunity for procrastinating and not 
> really do a complete and thorough job.  It would also be easier for some 
> platform to sneak in some of those header files to work around some 
> shortcomings in the generic version which is not helping maintainers 
> keeping a good discipline.  AS we are working on this, I might prefer 
> that mistakes do break the build rather than silently causing a 
> fallback with a dummy generic version to be picked up which might only 
> cause problems at run time much later.
> 
I just threw this out as an option.

I certainly view this as somewhat temporary, but just longer lived than
a single patch series and simpler that a bunch of temporary
HAVE_FOO_HEADER defines. Ultimately, the headers could just get rolled
into their parent asm header once all the platforms are converted over.
I don't view it as procrastinating, but allows platforms to be cleaned
up independently and spreads the work to others. The decision to move
gpio code into drivers/gpio is a good example. There was clear path and
it all went very quickly. It also allows focusing on the harder problems
while people are F2F.

> A Linaro event is taking place next week in England where a focused 
> effort will be deployed to work on this.  Let's see how much we'll be 
> able to clean up.
> 
Yes, I'm well aware of that. I'll participate remotely as much as I can.
Let me know how I can help.

Rob

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

* [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h
  2011-07-28 13:21   ` Rob Herring
@ 2011-07-28 15:01     ` Russell King - ARM Linux
  0 siblings, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2011-07-28 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 28, 2011 at 08:21:23AM -0500, Rob Herring wrote:
> On 07/28/2011 04:52 AM, Russell King - ARM Linux wrote:
> > So no, losing that ability is not an option.  Really.
> 
> If a platform has an uncompress.h, then you don't lose anything. Is it
> something that has to *always* be available? Are you opposed to a config
> option here? It can be available only for single arch/machine builds
> similar to DEBUG_LL.

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

end of thread, other threads:[~2011-07-28 15:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28  3:32 [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Rob Herring
2011-07-28  3:32 ` [RFC PATCH 1/3] ARM: include mach headers before common arm headers Rob Herring
2011-07-28  3:32 ` [RFC PATCH 2/3] ARM: add a default mach/uncompress.h header Rob Herring
2011-07-28  3:32 ` [RFC PATCH 3/3] ARM: add a default mach/system.h header Rob Herring
2011-07-28  4:40 ` [RFC PATCH 0/3] ARM: Add default system.h and uncompress.h Nicolas Pitre
2011-07-28 13:53   ` Rob Herring
2011-07-28  9:52 ` Russell King - ARM Linux
2011-07-28 13:21   ` Rob Herring
2011-07-28 15:01     ` Russell King - ARM Linux

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.