linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Initial steps to compile AMBA for x86
@ 2012-03-01 13:28 Alessandro Rubini
  2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Alessandro Rubini @ 2012-03-01 13:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Giancarlo Asnaghi, Alan Cox, Russell King - ARM Linux

I'm working on the sta2x11 I/O Hub, which is basically a bridge from
PCIe to AMBA.  While current code uses PCI drivers for all the
PrimeCell devices (with a lot of code duplication), I think we should
be able to compile native amba drivers. The chip has uart, spi, mmc, i2c
and dma cells, for which an AMBA driver is already in the kernel.

This patch-set is the first steps needed to build amba drivers for
x86.  I'm currently using the pl011 UART as a testbed, and it's up on
my system (with other not-ready-to-be-published patches).

As for sizes, there are a number of users of <asm/sizes.h>. If these
initial patches are accepted, I'll take care to convert other stuff,
add a #warning to asm/sizes.h and remove it after a pair of releases.

The patches have been build-tested under ARM with versatile_defconfig,
at91sam9263_defconfig, vexpress_defconfig and realview-smp_defconfig
-- as well as sta2x11 on x86.

Alessandro Rubini (4):
  x86: add NO_IRQ macro
  sizes.h: move from asm-generic to <linux/sizes.h>
  amba: use the new linux/sizes.h
  ARM: use the new linux/sizes.h

 arch/arm/include/asm/memory.h |    2 +-
 arch/arm/mm/dma-mapping.c     |    2 +-
 arch/arm/mm/init.c            |    2 +-
 arch/arm/mm/ioremap.c         |    2 +-
 arch/arm/mm/mmu.c             |    2 +-
 arch/x86/include/asm/irq.h    |    2 +
 drivers/amba/bus.c            |    2 +-
 include/asm-generic/sizes.h   |   49 +---------------------------------------
 include/linux/sizes.h         |   47 +++++++++++++++++++++++++++++++++++++++
 9 files changed, 57 insertions(+), 53 deletions(-)
 create mode 100644 include/linux/sizes.h

-- 
1.7.7.2

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

* [PATCH 1/4] x86: add NO_IRQ macro
  2012-03-01 13:28 [PATCH 0/4] Initial steps to compile AMBA for x86 Alessandro Rubini
@ 2012-03-01 13:28 ` Alessandro Rubini
  2012-03-01 13:30   ` Russell King - ARM Linux
  2012-03-01 14:07   ` Alan Cox
  2012-03-01 13:28 ` [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h> Alessandro Rubini
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Alessandro Rubini @ 2012-03-01 13:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Giancarlo Asnaghi, Alan Cox, Russell King - ARM Linux

This is needed to compile AMBA drivers. Most architectures define
NO_IRQ as -1, and this does the same for the PC.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 arch/x86/include/asm/irq.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index ba870bb..c9072f5 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -10,6 +10,8 @@
 #include <asm/apicdef.h>
 #include <asm/irq_vectors.h>
 
+#define NO_IRQ	(-1)
+
 static inline int irq_canonicalize(int irq)
 {
 	return ((irq == 2) ? 9 : irq);
-- 
1.7.7.2

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

* [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h>
  2012-03-01 13:28 [PATCH 0/4] Initial steps to compile AMBA for x86 Alessandro Rubini
  2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
@ 2012-03-01 13:28 ` Alessandro Rubini
  2012-03-01 13:55   ` Arnd Bergmann
  2012-03-01 13:28 ` [PATCH 3/4] amba: use the new linux/sizes.h Alessandro Rubini
  2012-03-01 13:29 ` [PATCH 4/4] ARM: " Alessandro Rubini
  3 siblings, 1 reply; 9+ messages in thread
From: Alessandro Rubini @ 2012-03-01 13:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Giancarlo Asnaghi, Alan Cox, Russell King - ARM Linux

sizes.h is used throughout the AMBA code and drivers, so the header
should be available to everyone in order to driver AMBA/PrimeCell
peripherals behind a PCI bridge where the host can be any platform
(I'm doing it under x86).

At this step <asm-generic/sizes.h> includes <linux/sizes.h>,
to allow a grace period for both in-tree and out-of-tree drivers.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 include/asm-generic/sizes.h |   49 +-----------------------------------------
 include/linux/sizes.h       |   47 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 47 deletions(-)
 create mode 100644 include/linux/sizes.h

diff --git a/include/asm-generic/sizes.h b/include/asm-generic/sizes.h
index ea5d4ef..1dcfad9 100644
--- a/include/asm-generic/sizes.h
+++ b/include/asm-generic/sizes.h
@@ -1,47 +1,2 @@
-/*
- * linux/include/asm-generic/sizes.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef __ASM_GENERIC_SIZES_H__
-#define __ASM_GENERIC_SIZES_H__
-
-#define SZ_1				0x00000001
-#define SZ_2				0x00000002
-#define SZ_4				0x00000004
-#define SZ_8				0x00000008
-#define SZ_16				0x00000010
-#define SZ_32				0x00000020
-#define SZ_64				0x00000040
-#define SZ_128				0x00000080
-#define SZ_256				0x00000100
-#define SZ_512				0x00000200
-
-#define SZ_1K				0x00000400
-#define SZ_2K				0x00000800
-#define SZ_4K				0x00001000
-#define SZ_8K				0x00002000
-#define SZ_16K				0x00004000
-#define SZ_32K				0x00008000
-#define SZ_64K				0x00010000
-#define SZ_128K				0x00020000
-#define SZ_256K				0x00040000
-#define SZ_512K				0x00080000
-
-#define SZ_1M				0x00100000
-#define SZ_2M				0x00200000
-#define SZ_4M				0x00400000
-#define SZ_8M				0x00800000
-#define SZ_16M				0x01000000
-#define SZ_32M				0x02000000
-#define SZ_64M				0x04000000
-#define SZ_128M				0x08000000
-#define SZ_256M				0x10000000
-#define SZ_512M				0x20000000
-
-#define SZ_1G				0x40000000
-#define SZ_2G				0x80000000
-
-#endif /* __ASM_GENERIC_SIZES_H__ */
+/* This is a placeholder, to be removed over time */
+#include <linux/sizes.h>
diff --git a/include/linux/sizes.h b/include/linux/sizes.h
new file mode 100644
index 0000000..ce3e815
--- /dev/null
+++ b/include/linux/sizes.h
@@ -0,0 +1,47 @@
+/*
+ * include/linux/sizes.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_SIZES_H__
+#define __LINUX_SIZES_H__
+
+#define SZ_1				0x00000001
+#define SZ_2				0x00000002
+#define SZ_4				0x00000004
+#define SZ_8				0x00000008
+#define SZ_16				0x00000010
+#define SZ_32				0x00000020
+#define SZ_64				0x00000040
+#define SZ_128				0x00000080
+#define SZ_256				0x00000100
+#define SZ_512				0x00000200
+
+#define SZ_1K				0x00000400
+#define SZ_2K				0x00000800
+#define SZ_4K				0x00001000
+#define SZ_8K				0x00002000
+#define SZ_16K				0x00004000
+#define SZ_32K				0x00008000
+#define SZ_64K				0x00010000
+#define SZ_128K				0x00020000
+#define SZ_256K				0x00040000
+#define SZ_512K				0x00080000
+
+#define SZ_1M				0x00100000
+#define SZ_2M				0x00200000
+#define SZ_4M				0x00400000
+#define SZ_8M				0x00800000
+#define SZ_16M				0x01000000
+#define SZ_32M				0x02000000
+#define SZ_64M				0x04000000
+#define SZ_128M				0x08000000
+#define SZ_256M				0x10000000
+#define SZ_512M				0x20000000
+
+#define SZ_1G				0x40000000
+#define SZ_2G				0x80000000
+
+#endif /* __LINUX_SIZES_H__ */
-- 
1.7.7.2

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

* [PATCH 3/4] amba: use the new linux/sizes.h
  2012-03-01 13:28 [PATCH 0/4] Initial steps to compile AMBA for x86 Alessandro Rubini
  2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
  2012-03-01 13:28 ` [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h> Alessandro Rubini
@ 2012-03-01 13:28 ` Alessandro Rubini
  2012-03-01 13:29 ` [PATCH 4/4] ARM: " Alessandro Rubini
  3 siblings, 0 replies; 9+ messages in thread
From: Alessandro Rubini @ 2012-03-01 13:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Giancarlo Asnaghi, Alan Cox, Russell King - ARM Linux

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 drivers/amba/bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 01c2cf4..d7fe84a 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -18,7 +18,7 @@
 #include <linux/amba/bus.h>
 
 #include <asm/irq.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 
 #define to_amba_driver(d)	container_of(d, struct amba_driver, drv)
 
-- 
1.7.7.2

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

* [PATCH 4/4] ARM: use the new linux/sizes.h
  2012-03-01 13:28 [PATCH 0/4] Initial steps to compile AMBA for x86 Alessandro Rubini
                   ` (2 preceding siblings ...)
  2012-03-01 13:28 ` [PATCH 3/4] amba: use the new linux/sizes.h Alessandro Rubini
@ 2012-03-01 13:29 ` Alessandro Rubini
  3 siblings, 0 replies; 9+ messages in thread
From: Alessandro Rubini @ 2012-03-01 13:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Giancarlo Asnaghi, Alan Cox, Russell King - ARM Linux

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 arch/arm/include/asm/memory.h |    2 +-
 arch/arm/mm/dma-mapping.c     |    2 +-
 arch/arm/mm/init.c            |    2 +-
 arch/arm/mm/ioremap.c         |    2 +-
 arch/arm/mm/mmu.c             |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index a8997d7..5848eba 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -16,7 +16,7 @@
 #include <linux/compiler.h>
 #include <linux/const.h>
 #include <linux/types.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 
 #ifdef CONFIG_NEED_MACH_MEMORY_H
 #include <mach/memory.h>
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index db23ae4..364defd 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -19,12 +19,12 @@
 #include <linux/dma-mapping.h>
 #include <linux/highmem.h>
 #include <linux/slab.h>
+#include <linux/sizes.h>
 
 #include <asm/memory.h>
 #include <asm/highmem.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
-#include <asm/sizes.h>
 #include <asm/mach/arch.h>
 
 #include "mm.h"
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 595079f..288b77d 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -20,13 +20,13 @@
 #include <linux/highmem.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
+#include <linux/sizes.h>
 
 #include <asm/mach-types.h>
 #include <asm/memblock.h>
 #include <asm/prom.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
-#include <asm/sizes.h>
 #include <asm/tlb.h>
 #include <asm/fixmap.h>
 
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 66daf17..1d24bef 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -25,6 +25,7 @@
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/io.h>
+#include <linux/sizes.h>
 
 #include <asm/cp15.h>
 #include <asm/cputype.h>
@@ -32,7 +33,6 @@
 #include <asm/mmu_context.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
-#include <asm/sizes.h>
 
 #include <asm/mach/map.h>
 #include "mm.h"
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index f77f1db..f3ee2b8 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -16,13 +16,13 @@
 #include <linux/memblock.h>
 #include <linux/fs.h>
 #include <linux/vmalloc.h>
+#include <linux/sizes.h>
 
 #include <asm/cp15.h>
 #include <asm/cputype.h>
 #include <asm/sections.h>
 #include <asm/cachetype.h>
 #include <asm/setup.h>
-#include <asm/sizes.h>
 #include <asm/smp_plat.h>
 #include <asm/tlb.h>
 #include <asm/highmem.h>
-- 
1.7.7.2

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

* Re: [PATCH 1/4] x86: add NO_IRQ macro
  2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
@ 2012-03-01 13:30   ` Russell King - ARM Linux
  2012-03-01 14:07   ` Alan Cox
  1 sibling, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2012-03-01 13:30 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: linux-kernel, linux-arm-kernel, Giancarlo Asnaghi, Alan Cox

On Thu, Mar 01, 2012 at 02:28:36PM +0100, Alessandro Rubini wrote:
> This is needed to compile AMBA drivers. Most architectures define
> NO_IRQ as -1, and this does the same for the PC.

No.  We're getting rid of NO_IRQ, and it will be gone from AMBA stuff
probably for 3.5.

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

* Re: [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h>
  2012-03-01 13:28 ` [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h> Alessandro Rubini
@ 2012-03-01 13:55   ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2012-03-01 13:55 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Alessandro Rubini, linux-kernel, Giancarlo Asnaghi,
	Russell King - ARM Linux, Alan Cox

On Thursday 01 March 2012, Alessandro Rubini wrote:
> sizes.h is used throughout the AMBA code and drivers, so the header
> should be available to everyone in order to driver AMBA/PrimeCell
> peripherals behind a PCI bridge where the host can be any platform
> (I'm doing it under x86).
> 
> At this step <asm-generic/sizes.h> includes <linux/sizes.h>,
> to allow a grace period for both in-tree and out-of-tree drivers.
> 
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Alan Cox <alan@linux.intel.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

For the asm-generic part of this.

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

* Re: [PATCH 1/4] x86: add NO_IRQ macro
  2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
  2012-03-01 13:30   ` Russell King - ARM Linux
@ 2012-03-01 14:07   ` Alan Cox
  2012-03-01 14:11     ` Russell King - ARM Linux
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Cox @ 2012-03-01 14:07 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: linux-kernel, linux-arm-kernel, Giancarlo Asnaghi, Alan Cox,
	Russell King - ARM Linux

On Thu, 1 Mar 2012 14:28:36 +0100
Alessandro Rubini <rubini@gnudd.com> wrote:

> This is needed to compile AMBA drivers. Most architectures define
> NO_IRQ as -1, and this does the same for the PC.

NAK

"No IRQ" is 0. There are a few platforms which incorrectly still define it
as -1 but they are broken and in fact many drivers won't work with
platforms that still incorrectly use -1. Nothing should be using a
NO_IRQ define.

Fix the users.


Alan

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

* Re: [PATCH 1/4] x86: add NO_IRQ macro
  2012-03-01 14:07   ` Alan Cox
@ 2012-03-01 14:11     ` Russell King - ARM Linux
  0 siblings, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2012-03-01 14:11 UTC (permalink / raw)
  To: Alan Cox
  Cc: Alessandro Rubini, linux-kernel, linux-arm-kernel,
	Giancarlo Asnaghi, Alan Cox

On Thu, Mar 01, 2012 at 02:07:53PM +0000, Alan Cox wrote:
> On Thu, 1 Mar 2012 14:28:36 +0100
> Alessandro Rubini <rubini@gnudd.com> wrote:
> 
> > This is needed to compile AMBA drivers. Most architectures define
> > NO_IRQ as -1, and this does the same for the PC.
> 
> NAK
> 
> "No IRQ" is 0. There are a few platforms which incorrectly still define it
> as -1 but they are broken and in fact many drivers won't work with
> platforms that still incorrectly use -1. Nothing should be using a
> NO_IRQ define.
> 
> Fix the users.

The users in this area are fixed and have been 'fixed' since December, it's
just going to take a couple of kernel cycles to get rid of it in a sane way
without causing breakage.  And yes, this has fallen squarely on my shoulders
to 'fix' because no one else is the least bit interested in the problem.

So, as I'm about the only one who has done any work towards this, you can
expect NO_IRQ to take a long time to finally go away.

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

end of thread, other threads:[~2012-03-01 14:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 13:28 [PATCH 0/4] Initial steps to compile AMBA for x86 Alessandro Rubini
2012-03-01 13:28 ` [PATCH 1/4] x86: add NO_IRQ macro Alessandro Rubini
2012-03-01 13:30   ` Russell King - ARM Linux
2012-03-01 14:07   ` Alan Cox
2012-03-01 14:11     ` Russell King - ARM Linux
2012-03-01 13:28 ` [PATCH 2/4] sizes.h: move from asm-generic to <linux/sizes.h> Alessandro Rubini
2012-03-01 13:55   ` Arnd Bergmann
2012-03-01 13:28 ` [PATCH 3/4] amba: use the new linux/sizes.h Alessandro Rubini
2012-03-01 13:29 ` [PATCH 4/4] ARM: " Alessandro Rubini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).