mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/7] device: introduce resource structure to simplify resource declaration
@ 2011-07-16 10:45 Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 2/7] at91: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

and add multi resource per device support

for now we keep the old map_base and size temporary but will switch all of
the used step by step to them resource way

and mirror the first resource to the map_base and size if available

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 include/driver.h       |    4 ++
 include/linux/ioport.h |  115 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/driver.c           |    9 ++++
 3 files changed, 128 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/ioport.h

diff --git a/include/driver.h b/include/driver.h
index 6a4d45e..ed3df16 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -24,6 +24,7 @@
 #define DRIVER_H
 
 #include <linux/list.h>
+#include <linux/ioport.h>
 
 #define MAX_DRIVER_NAME		32
 #define FORMAT_DRIVER_MANE_ID	"%s%d"
@@ -76,6 +77,9 @@ struct device_d {
 	 * Flash or SDRAM. */
 	resource_size_t map_base;
 
+	struct resource *resource;
+	int num_resources;
+
 	void *platform_data; /*! board specific information about this device */
 
 	/*! Devices of a particular class normaly need to store more
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
new file mode 100644
index 0000000..5143115
--- /dev/null
+++ b/include/linux/ioport.h
@@ -0,0 +1,115 @@
+/*
+ * ioport.h	Definitions of routines for detecting, reserving and
+ *		allocating system resources.
+ *
+ * Authors:	Linus Torvalds
+ */
+
+#ifndef _LINUX_IOPORT_H
+#define _LINUX_IOPORT_H
+
+#ifndef __ASSEMBLY__
+#include <linux/compiler.h>
+#include <linux/types.h>
+/*
+ * Resources are tree-like, allowing
+ * nesting etc..
+ */
+struct resource {
+	resource_size_t start;
+	resource_size_t size;
+	const char *name;
+	unsigned long flags;
+};
+
+/*
+ * IO resources have these defined flags.
+ */
+#define IORESOURCE_BITS		0x000000ff	/* Bus-specific bits */
+
+#define IORESOURCE_TYPE_BITS	0x00001f00	/* Resource type */
+#define IORESOURCE_IO		0x00000100
+#define IORESOURCE_MEM		0x00000200
+#define IORESOURCE_IRQ		0x00000400
+#define IORESOURCE_DMA		0x00000800
+#define IORESOURCE_BUS		0x00001000
+
+#define IORESOURCE_PREFETCH	0x00002000	/* No side effects */
+#define IORESOURCE_READONLY	0x00004000
+#define IORESOURCE_CACHEABLE	0x00008000
+#define IORESOURCE_RANGELENGTH	0x00010000
+#define IORESOURCE_SHADOWABLE	0x00020000
+
+#define IORESOURCE_SIZEALIGN	0x00040000	/* size indicates alignment */
+#define IORESOURCE_STARTALIGN	0x00080000	/* start field is alignment */
+
+#define IORESOURCE_MEM_64	0x00100000
+#define IORESOURCE_WINDOW	0x00200000	/* forwarded by bridge */
+#define IORESOURCE_MUXED	0x00400000	/* Resource is software muxed */
+
+#define IORESOURCE_EXCLUSIVE	0x08000000	/* Userland may not map this resource */
+#define IORESOURCE_DISABLED	0x10000000
+#define IORESOURCE_UNSET	0x20000000
+#define IORESOURCE_AUTO		0x40000000
+#define IORESOURCE_BUSY		0x80000000	/* Driver has marked this resource busy */
+
+/* PnP IRQ specific bits (IORESOURCE_BITS) */
+#define IORESOURCE_IRQ_HIGHEDGE		(1<<0)
+#define IORESOURCE_IRQ_LOWEDGE		(1<<1)
+#define IORESOURCE_IRQ_HIGHLEVEL	(1<<2)
+#define IORESOURCE_IRQ_LOWLEVEL		(1<<3)
+#define IORESOURCE_IRQ_SHAREABLE	(1<<4)
+#define IORESOURCE_IRQ_OPTIONAL		(1<<5)
+
+/* PnP DMA specific bits (IORESOURCE_BITS) */
+#define IORESOURCE_DMA_TYPE_MASK	(3<<0)
+#define IORESOURCE_DMA_8BIT		(0<<0)
+#define IORESOURCE_DMA_8AND16BIT	(1<<0)
+#define IORESOURCE_DMA_16BIT		(2<<0)
+
+#define IORESOURCE_DMA_MASTER		(1<<2)
+#define IORESOURCE_DMA_BYTE		(1<<3)
+#define IORESOURCE_DMA_WORD		(1<<4)
+
+#define IORESOURCE_DMA_SPEED_MASK	(3<<6)
+#define IORESOURCE_DMA_COMPATIBLE	(0<<6)
+#define IORESOURCE_DMA_TYPEA		(1<<6)
+#define IORESOURCE_DMA_TYPEB		(2<<6)
+#define IORESOURCE_DMA_TYPEF		(3<<6)
+
+/* PnP memory I/O specific bits (IORESOURCE_BITS) */
+#define IORESOURCE_MEM_WRITEABLE	(1<<0)	/* dup: IORESOURCE_READONLY */
+#define IORESOURCE_MEM_CACHEABLE	(1<<1)	/* dup: IORESOURCE_CACHEABLE */
+#define IORESOURCE_MEM_RANGELENGTH	(1<<2)	/* dup: IORESOURCE_RANGELENGTH */
+#define IORESOURCE_MEM_TYPE_MASK	(3<<3)
+#define IORESOURCE_MEM_8BIT		(0<<3)
+#define IORESOURCE_MEM_16BIT		(1<<3)
+#define IORESOURCE_MEM_8AND16BIT	(2<<3)
+#define IORESOURCE_MEM_32BIT		(3<<3)
+#define IORESOURCE_MEM_SHADOWABLE	(1<<5)	/* dup: IORESOURCE_SHADOWABLE */
+#define IORESOURCE_MEM_EXPANSIONROM	(1<<6)
+
+/* PnP I/O specific bits (IORESOURCE_BITS) */
+#define IORESOURCE_IO_16BIT_ADDR	(1<<0)
+#define IORESOURCE_IO_FIXED		(1<<1)
+
+/* PCI ROM control bits (IORESOURCE_BITS) */
+#define IORESOURCE_ROM_ENABLE		(1<<0)	/* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
+#define IORESOURCE_ROM_SHADOW		(1<<1)	/* ROM is copy at C000:0 */
+#define IORESOURCE_ROM_COPY		(1<<2)	/* ROM is alloc'd copy, resource field overlaid */
+#define IORESOURCE_ROM_BIOS_COPY	(1<<3)	/* ROM is BIOS copy, resource field overlaid */
+
+/* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
+#define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
+
+static inline resource_size_t resource_size(const struct resource *res)
+{
+	return res->size;
+}
+static inline unsigned long resource_type(const struct resource *res)
+{
+	return res->flags & IORESOURCE_TYPE_BITS;
+}
+
+#endif /* __ASSEMBLY__ */
+#endif	/* _LINUX_IOPORT_H */
diff --git a/lib/driver.c b/lib/driver.c
index 4c10a49..ee5e850 100644
--- a/lib/driver.c
+++ b/lib/driver.c
@@ -103,6 +103,15 @@ int register_device(struct device_d *new_device)
 {
 	struct driver_d *drv;
 
+	/* if no map_base available use the first resource if available
+	 * so we do not need to duplicate it
+	 * Temporary fixup until we get rid of map_base and size
+	 */
+	if (new_device->map_base == 0 && new_device->resource) {
+		new_device->map_base = new_device->resource[0].start;
+		new_device->size = new_device->resource[0].size;
+	}
+
 	if (new_device->id < 0) {
 		new_device->id = get_free_deviceid(new_device->name);
 	} else {
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/7] at91: switch to all resource declaration to "struct resource"
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 3/7] at91/serial: switch " Jean-Christophe PLAGNIOL-VILLARD
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 arch/arm/boards/at91rm9200ek/init.c      |    9 ++-
 arch/arm/boards/at91sam9261ek/init.c     |   11 ++-
 arch/arm/boards/at91sam9263ek/init.c     |   11 ++-
 arch/arm/boards/mmccpu/init.c            |   10 ++-
 arch/arm/boards/pm9261/init.c            |   11 ++-
 arch/arm/boards/pm9263/init.c            |   11 ++-
 arch/arm/mach-at91/at91rm9200_devices.c  |   88 ++++++++++++++++++----
 arch/arm/mach-at91/at91sam9260_devices.c |  121 ++++++++++++++++++++++++------
 arch/arm/mach-at91/at91sam9261_devices.c |   77 +++++++++++++++----
 arch/arm/mach-at91/at91sam9263_devices.c |  101 ++++++++++++++++++++-----
 arch/arm/mach-at91/at91sam9g45_devices.c |  110 ++++++++++++++++++++++-----
 11 files changed, 458 insertions(+), 102 deletions(-)

diff --git a/arch/arm/boards/at91rm9200ek/init.c b/arch/arm/boards/at91rm9200ek/init.c
index a449326..b21dc5f 100644
--- a/arch/arm/boards/at91rm9200ek/init.c
+++ b/arch/arm/boards/at91rm9200ek/init.c
@@ -34,10 +34,17 @@
 #include <mach/gpio.h>
 #include <mach/io.h>
 
+static struct resource cfi_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_0,
+	},
+};
+
 static struct device_d cfi_dev = {
 	.id		= 0,
 	.name		= "cfi_flash",
-	.map_base	= AT91_CHIPSELECT_0,
+	.num_resources	= ARRAY_SIZE(cfi_resources),
+	.resource	= cfi_resources,
 };
 
 static struct at91_ether_platform_data ether_pdata = {
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index b1388e1..3def38e 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -95,11 +95,18 @@ static struct dm9000_platform_data dm9000_data = {
 	.srom		= 0,
 };
 
+static struct resource dm9000_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_2,
+		.size	= 8,
+	},
+};
+
 static struct device_d dm9000_dev = {
 	.id		= 0,
 	.name		= "dm9000",
-	.map_base	= AT91_CHIPSELECT_2,
-	.size		= 8,
+	.num_resources	= ARRAY_SIZE(dm9000_resources),
+	.resource	= dm9000_resources,
 	.platform_data	= &dm9000_data,
 };
 
diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c
index 9a763b3..fe69305 100644
--- a/arch/arm/boards/at91sam9263ek/init.c
+++ b/arch/arm/boards/at91sam9263ek/init.c
@@ -87,11 +87,18 @@ static void ek_add_device_nand(void)
 	at91_add_device_nand(&nand_pdata);
 }
 
+static struct resource cfi_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_0,
+		.size	= 8 * 1024 * 1024,
+	},
+};
+
 static struct device_d cfi_dev = {
 	.id		= -1,
 	.name		= "cfi_flash",
-	.map_base	= AT91_CHIPSELECT_0,
-	.size		= 8 * 1024 * 1024,
+	.num_resources	= ARRAY_SIZE(cfi_resources),
+	.resource	= cfi_resources,
 };
 
 static struct at91_ether_platform_data macb_pdata = {
diff --git a/arch/arm/boards/mmccpu/init.c b/arch/arm/boards/mmccpu/init.c
index 7cba01c..b79062e 100644
--- a/arch/arm/boards/mmccpu/init.c
+++ b/arch/arm/boards/mmccpu/init.c
@@ -37,11 +37,17 @@
 #include <mach/gpio.h>
 #include <mach/io.h>
 
+static struct resource cfi_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_0,
+	},
+};
+
 static struct device_d cfi_dev = {
 	.id		= -1,
 	.name		= "cfi_flash",
-	.map_base	= AT91_CHIPSELECT_0,
-	.size		= 0,	/* zero means autodetect size */
+	.num_resources	= ARRAY_SIZE(cfi_resources),
+	.resource	= cfi_resources,
 };
 
 static struct at91_ether_platform_data macb_pdata = {
diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c
index 6fb14f7..af92835 100644
--- a/arch/arm/boards/pm9261/init.c
+++ b/arch/arm/boards/pm9261/init.c
@@ -95,11 +95,18 @@ static struct dm9000_platform_data dm9000_data = {
 	.srom		= 1,
 };
 
+static struct resource dm9000_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_2,
+		.size	= 8,
+	},
+};
+
 static struct device_d dm9000_dev = {
 	.id		= 0,
 	.name		= "dm9000",
-	.map_base	= AT91_CHIPSELECT_2,
-	.size		= 8,
+	.num_resources	= ARRAY_SIZE(dm9000_resources),
+	.resource	= dm9000_resources,
 	.platform_data	= &dm9000_data,
 };
 
diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c
index abe8def..6544837 100644
--- a/arch/arm/boards/pm9263/init.c
+++ b/arch/arm/boards/pm9263/init.c
@@ -86,11 +86,18 @@ static void pm_add_device_nand(void)
 	at91_add_device_nand(&nand_pdata);
 }
 
+static struct resource cfi_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_0,
+		.size	= 4 * 1024 * 1024,
+	},
+};
+
 static struct device_d cfi_dev = {
 	.id	  = -1,
 	.name     = "cfi_flash",
-	.map_base = AT91_CHIPSELECT_0,
-	.size     = 4 * 1024 * 1024,
+	.num_resources	= ARRAY_SIZE(cfi_resources),
+	.resource	= cfi_resources,
 };
 
 static struct at91_ether_platform_data macb_pdata = {
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index f45008a..7585b27 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -20,6 +20,12 @@
 
 #include "generic.h"
 
+static struct resource sdram_dev_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_1,
+	},
+};
+
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
 	.flags = DEVFS_RDWR,
@@ -28,13 +34,14 @@ static struct memory_platform_data ram_pdata = {
 static struct device_d sdram_dev = {
 	.id = -1,
 	.name = "mem",
-	.map_base = AT91_CHIPSELECT_1,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 	.platform_data = &ram_pdata,
 };
 
 void at91_add_device_sdram(u32 size)
 {
-	sdram_dev.size = size;
+	sdram_dev_resources[0].size = size;
 	register_device(&sdram_dev);
 	armlinux_add_dram(&sdram_dev);
 }
@@ -44,11 +51,18 @@ void at91_add_device_sdram(u32 size)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_DRIVER_NET_AT91_ETHER)
+static struct resource eth_resources[] = {
+	[0] = {
+		.start	= AT91_VA_BASE_EMAC,
+		.size	= 0x1000,
+	},
+};
+
 static struct device_d at91rm9200_eth_device = {
 	.id		= 0,
 	.name		= "at91_ether",
-	.map_base	= AT91_VA_BASE_EMAC,
-	.size		= 0x1000,
+	.resource	= eth_resources,
+	.num_resources	= ARRAY_SIZE(eth_resources),
 };
 
 void __init at91_add_device_eth(struct at91_ether_platform_data *data)
@@ -91,11 +105,18 @@ void __init at91_add_device_eth(struct at91_ether_platform_data *data) {}
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= 0x10,
+	},
+};
+
 static struct device_d at91rm9200_nand_device = {
 	.id		= -1,
 	.name		= "atmel_nand",
-	.map_base	= AT91_CHIPSELECT_3,
-	.size		= 0x10,
+	.resource	= nand_resources,
+	.num_resources	= ARRAY_SIZE(nand_resources),
 };
 
 void __init at91_add_device_nand(struct atmel_nand_data *data)
@@ -143,11 +164,18 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) {}
  *  UART
  * -------------------------------------------------------------------- */
 
+static struct resource dbgu_resources[] = {
+	[0] = {
+		.start	= AT91_BASE_SYS + AT91_DBGU,
+		.size	= 4096,
+	},
+};
+
 static struct device_d dbgu_serial_device = {
 	.id		= 0,
 	.name		= "atmel_serial",
-	.map_base	= (AT91_BASE_SYS + AT91_DBGU),
-	.size		= 4096,
+	.resource	= dbgu_resources,
+	.num_resources	= ARRAY_SIZE(dbgu_resources),
 };
 
 static inline void configure_dbgu_pins(void)
@@ -156,11 +184,18 @@ static inline void configure_dbgu_pins(void)
 	at91_set_A_periph(AT91_PIN_PA31, 1);		/* DTXD */
 }
 
+static struct resource uart0_resources[] = {
+	[0] = {
+		.start	= AT91RM9200_BASE_US0,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart0_serial_device = {
 	.id		= 1,
 	.name		= "atmel_serial",
-	.map_base	= AT91RM9200_BASE_US0,
-	.size		= 4096,
+	.resource	= uart0_resources,
+	.num_resources	= ARRAY_SIZE(uart0_resources),
 };
 
 static inline void configure_usart0_pins(unsigned pins)
@@ -180,11 +215,18 @@ static inline void configure_usart0_pins(unsigned pins)
 	}
 }
 
+static struct resource uart1_resources[] = {
+	[0] = {
+		.start	= AT91RM9200_BASE_US1,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart1_serial_device = {
 	.id		= 2,
 	.name		= "atmel_serial",
-	.map_base	= AT91RM9200_BASE_US1,
-	.size		= 4096,
+	.resource	= uart1_resources,
+	.num_resources	= ARRAY_SIZE(uart1_resources),
 };
 
 static inline void configure_usart1_pins(unsigned pins)
@@ -206,11 +248,18 @@ static inline void configure_usart1_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PB26, 0);	/* RTS1 */
 }
 
+static struct resource uart2_resources[] = {
+	[0] = {
+		.start	= AT91RM9200_BASE_US2,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart2_serial_device = {
 	.id		= 3,
 	.name		= "atmel_serial",
-	.map_base	= AT91RM9200_BASE_US2,
-	.size		= 4096,
+	.resource	= uart2_resources,
+	.num_resources	= ARRAY_SIZE(uart2_resources),
 };
 
 static inline void configure_usart2_pins(unsigned pins)
@@ -224,11 +273,18 @@ static inline void configure_usart2_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PA31, 0);	/* RTS2 */
 }
 
+static struct resource uart3_resources[] = {
+	[0] = {
+		.start	= AT91RM9200_BASE_US3,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart3_serial_device = {
 	.id		= 4,
 	.name		= "atmel_serial",
-	.map_base	= AT91RM9200_BASE_US3,
-	.size		= 4096,
+	.resource	= uart3_resources,
+	.num_resources	= ARRAY_SIZE(uart3_resources),
 };
 
 static inline void configure_usart3_pins(unsigned pins)
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index d44e280..85f7578 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -21,6 +21,12 @@
 
 #include "generic.h"
 
+static struct resource sdram_dev_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_1,
+	},
+};
+
 static struct memory_platform_data sram_pdata = {
 	.name = "sram0",
 	.flags = DEVFS_RDWR,
@@ -29,23 +35,31 @@ static struct memory_platform_data sram_pdata = {
 static struct device_d sdram_dev = {
 	.id	  = -1,
 	.name     = "mem",
-	.map_base = AT91_CHIPSELECT_1,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 	.platform_data = &sram_pdata,
 };
 
 void at91_add_device_sdram(u32 size)
 {
-	sdram_dev.size = size;
+	sdram_dev_resources[0].size = size;
 	register_device(&sdram_dev);
 	armlinux_add_dram(&sdram_dev);
 }
 
 #if defined(CONFIG_DRIVER_NET_MACB)
+static struct resource eth_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_EMAC,
+		.size	= 0x1000,
+	},
+};
+
 static struct device_d macb_dev = {
 	.id	  = -1,
 	.name     = "macb",
-	.map_base = AT91SAM9260_BASE_EMAC,
-	.size     = 0x1000,
+	.resource	= eth_resources,
+	.num_resources	= ARRAY_SIZE(eth_resources),
 };
 
 void at91_add_device_eth(struct at91_ether_platform_data *data)
@@ -84,11 +98,18 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= 0x10,
+	},
+};
+
 static struct device_d nand_dev = {
 	.id	  = -1,
 	.name     = "atmel_nand",
-	.map_base = AT91_CHIPSELECT_3,
-	.size     = 0x10,
+	.resource	= nand_resources,
+	.num_resources	= ARRAY_SIZE(nand_resources),
 };
 
 void at91_add_device_nand(struct atmel_nand_data *data)
@@ -120,11 +141,18 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 void at91_add_device_nand(struct atmel_nand_data *data) {}
 #endif
 
+static struct resource dbgu_resources[] = {
+	[0] = {
+		.start	= AT91_BASE_SYS + AT91_DBGU,
+		.size	= 4096,
+	},
+};
+
 static struct device_d dbgu_serial_device = {
 	.id	  = 0,
 	.name     = "atmel_serial",
-	.map_base = AT91_BASE_SYS + AT91_DBGU,
-	.size     = 4096,
+	.resource	= dbgu_resources,
+	.num_resources	= ARRAY_SIZE(dbgu_resources),
 };
 
 static inline void configure_dbgu_pins(void)
@@ -133,11 +161,18 @@ static inline void configure_dbgu_pins(void)
 	at91_set_A_periph(AT91_PIN_PB15, 1);		/* DTXD */
 }
 
+static struct resource uart0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US0,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart0_serial_device = {
 	.id	  = 1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US0,
-	.size     = 4096,
+	.resource	= uart0_resources,
+	.num_resources	= ARRAY_SIZE(uart0_resources),
 };
 
 static inline void configure_usart0_pins(unsigned pins)
@@ -159,11 +194,18 @@ static inline void configure_usart0_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PB25, 0);	/* RI0 */
 }
 
+static struct resource uart1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US1,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart1_serial_device = {
 	.id	  = 2,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US1,
-	.size     = 4096,
+	.resource	= uart1_resources,
+	.num_resources	= ARRAY_SIZE(uart1_resources),
 };
 
 static inline void configure_usart1_pins(unsigned pins)
@@ -177,11 +219,18 @@ static inline void configure_usart1_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PB29, 0);	/* CTS1 */
 }
 
+static struct resource uart2_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US2,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart2_serial_device = {
 	.id	  = 3,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US2,
-	.size     = 4096,
+	.resource	= uart2_resources,
+	.num_resources	= ARRAY_SIZE(uart2_resources),
 };
 
 static inline void configure_usart2_pins(unsigned pins)
@@ -195,11 +244,18 @@ static inline void configure_usart2_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PA5, 0);	/* CTS2 */
 }
 
+static struct resource uart3_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US3,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart3_serial_device = {
 	.id	  = 4,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US3,
-	.size     = 4096,
+	.resource	= uart3_resources,
+	.num_resources	= ARRAY_SIZE(uart3_resources),
 };
 
 static inline void configure_usart3_pins(unsigned pins)
@@ -213,11 +269,18 @@ static inline void configure_usart3_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PC10, 0);	/* CTS3 */
 }
 
+static struct resource uart4_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US4,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart4_serial_device = {
 	.id	  = 5,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US4,
-	.size     = 4096,
+	.resource	= uart4_resources,
+	.num_resources	= ARRAY_SIZE(uart4_resources),
 };
 
 static inline void configure_usart4_pins(void)
@@ -226,11 +289,18 @@ static inline void configure_usart4_pins(void)
 	at91_set_B_periph(AT91_PIN_PA30, 0);		/* RXD4 */
 }
 
+static struct resource uart5_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_US5,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart5_serial_device = {
 	.id	  = 6,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9260_BASE_US5,
-	.size     = 4096,
+	.resource	= uart5_resources,
+	.num_resources	= ARRAY_SIZE(uart5_resources),
 };
 
 static inline void configure_usart5_pins(void)
@@ -283,11 +353,18 @@ void at91_register_uart(unsigned id, unsigned pins)
 }
 
 #if defined(CONFIG_MCI_ATMEL)
+static struct resource mci_resources[] = {
+	[0] = {
+		.start	= AT91SAM9260_BASE_MCI,
+		.size	= SZ_16K,
+	},
+};
+
 static struct device_d mci_device = {
 	.id		= -1,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9260_BASE_MCI,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci_resources),
+	.resource	= mci_resources,
 };
 
 /* Consider only one slot : slot 0 */
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index d8b70a3..bf726bc 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -21,6 +21,12 @@
 
 #include "generic.h"
 
+static struct resource sdram_dev_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_1,
+	},
+};
+
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
 	.flags = DEVFS_RDWR,
@@ -29,23 +35,31 @@ static struct memory_platform_data ram_pdata = {
 static struct device_d sdram_dev = {
 	.id		= -1,
 	.name		= "mem",
-	.map_base	= AT91_CHIPSELECT_1,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 	.platform_data	= &ram_pdata,
 };
 
 void at91_add_device_sdram(u32 size)
 {
-	sdram_dev.size = size;
+	sdram_dev_resources[0].size = size;
 	register_device(&sdram_dev);
 	armlinux_add_dram(&sdram_dev);
 }
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= 0x10,
+	},
+};
+
 static struct device_d nand_dev = {
 	.id		= 0,
 	.name		= "atmel_nand",
-	.map_base	= AT91_CHIPSELECT_3,
-	.size		= 0x10,
+	.resource	= nand_resources,
+	.num_resources	= ARRAY_SIZE(nand_resources),
 };
 
 void at91_add_device_nand(struct atmel_nand_data *data)
@@ -80,11 +94,18 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 void at91_add_device_nand(struct atmel_nand_data *data) {}
 #endif
 
+static struct resource dbgu_resources[] = {
+	[0] = {
+		.start	= (AT91_BASE_SYS + AT91_DBGU),
+		.size	= 4096,
+	},
+};
+
 static struct device_d dbgu_serial_device = {
 	.id		= 0,
 	.name		= "atmel_serial",
-	.map_base	= (AT91_BASE_SYS + AT91_DBGU),
-	.size		= 4096,
+	.resource	= dbgu_resources,
+	.num_resources	= ARRAY_SIZE(dbgu_resources),
 };
 
 static inline void configure_dbgu_pins(void)
@@ -93,11 +114,18 @@ static inline void configure_dbgu_pins(void)
 	at91_set_A_periph(AT91_PIN_PA10, 1);		/* DTXD */
 }
 
+static struct resource uart0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9261_BASE_US0,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart0_serial_device = {
 	.id		= 1,
 	.name		= "atmel_serial",
-	.map_base	= AT91SAM9261_BASE_US0,
-	.size		= 4096,
+	.resource	= uart0_resources,
+	.num_resources	= ARRAY_SIZE(uart0_resources),
 };
 
 static inline void configure_usart0_pins(unsigned pins)
@@ -111,11 +139,18 @@ static inline void configure_usart0_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PC11, 0);	/* CTS0 */
 }
 
+static struct resource uart1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9261_BASE_US1,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart1_serial_device = {
 	.id		= 2,
 	.name		= "atmel_serial",
-	.map_base	= AT91SAM9261_BASE_US1,
-	.size		= 4096,
+	.resource	= uart1_resources,
+	.num_resources	= ARRAY_SIZE(uart1_resources),
 };
 
 static inline void configure_usart1_pins(unsigned pins)
@@ -129,11 +164,18 @@ static inline void configure_usart1_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PA13, 0);	/* CTS1 */
 }
 
+static struct resource uart2_resources[] = {
+	[0] = {
+		.start	= AT91SAM9261_BASE_US2,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart2_serial_device = {
 	.id		= 3,
 	.name		= "atmel_serial",
-	.map_base	= AT91SAM9261_BASE_US2,
-	.size		= 4096,
+	.resource	= uart2_resources,
+	.num_resources	= ARRAY_SIZE(uart2_resources),
 };
 
 static inline void configure_usart2_pins(unsigned pins)
@@ -176,11 +218,18 @@ void at91_register_uart(unsigned id, unsigned pins)
 }
 
 #if defined(CONFIG_MCI_ATMEL)
+static struct resource mci_resources[] = {
+	[0] = {
+		.start	= AT91SAM9261_BASE_MCI,
+		.size	= SZ_16K,
+	},
+};
+
 static struct device_d mci_device = {
 	.id		= -1,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9261_BASE_MCI,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci_resources),
+	.resource	= mci_resources,
 };
 
 /* Consider only one slot : slot 0 */
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 04fb79e..9b87425 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -21,6 +21,12 @@
 
 #include "generic.h"
 
+static struct resource sdram_dev_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_1,
+	},
+};
+
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
 	.flags = DEVFS_RDWR,
@@ -29,23 +35,31 @@ static struct memory_platform_data ram_pdata = {
 static struct device_d sdram_dev = {
 	.id	  = -1,
 	.name     = "mem",
-	.map_base = AT91_CHIPSELECT_1,
-	.platform_data = &ram_pdata,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
+	.platform_data	= &ram_pdata,
 };
 
 void at91_add_device_sdram(u32 size)
 {
-	sdram_dev.size = size;
+	sdram_dev_resources[0].size = size;
 	register_device(&sdram_dev);
 	armlinux_add_dram(&sdram_dev);
 }
 
 #if defined(CONFIG_DRIVER_NET_MACB)
+static struct resource eth_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_EMAC,
+		.size	= 0x1000,
+	},
+};
+
 static struct device_d macb_dev = {
 	.id	  = -1,
 	.name     = "macb",
-	.map_base = AT91SAM9263_BASE_EMAC,
-	.size     = 0x1000,
+	.resource	= eth_resources,
+	.num_resources	= ARRAY_SIZE(eth_resources),
 };
 
 void at91_add_device_eth(struct at91_ether_platform_data *data)
@@ -83,11 +97,18 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= 0x10,
+	},
+};
+
 static struct device_d nand_dev = {
 	.id	  = -1,
 	.name     = "atmel_nand",
-	.map_base = AT91_CHIPSELECT_3,
-	.size     = 0x10,
+	.resource	= nand_resources,
+	.num_resources	= ARRAY_SIZE(nand_resources),
 };
 
 void at91_add_device_nand(struct atmel_nand_data *data)
@@ -119,11 +140,18 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 void at91_add_device_nand(struct atmel_nand_data *data) {}
 #endif
 
+static struct resource dbgu_resources[] = {
+	[0] = {
+		.start	= (AT91_BASE_SYS + AT91_DBGU),
+		.size	= 4096,
+	},
+};
+
 static struct device_d dbgu_serial_device = {
 	.id	  = 0,
 	.name     = "atmel_serial",
-	.map_base = (AT91_BASE_SYS + AT91_DBGU),
-	.size     = 4096,
+	.resource	= dbgu_resources,
+	.num_resources	= ARRAY_SIZE(dbgu_resources),
 };
 
 static inline void configure_dbgu_pins(void)
@@ -132,11 +160,18 @@ static inline void configure_dbgu_pins(void)
 	at91_set_A_periph(AT91_PIN_PC31, 1);		/* DTXD */
 }
 
+static struct resource uart0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_US0,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart0_serial_device = {
 	.id	  = 1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9263_BASE_US0,
-	.size     = 4096,
+	.resource	= uart0_resources,
+	.num_resources	= ARRAY_SIZE(uart0_resources),
 };
 
 static inline void configure_usart0_pins(unsigned pins)
@@ -150,11 +185,18 @@ static inline void configure_usart0_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PA29, 0);	/* CTS0 */
 }
 
+static struct resource uart1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_US1,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart1_serial_device = {
 	.id	  = 2,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9263_BASE_US1,
-	.size     = 4096,
+	.resource	= uart1_resources,
+	.num_resources	= ARRAY_SIZE(uart1_resources),
 };
 
 static inline void configure_usart1_pins(unsigned pins)
@@ -168,11 +210,18 @@ static inline void configure_usart1_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PD8, 0);	/* CTS1 */
 }
 
+static struct resource uart2_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_US2,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart2_serial_device = {
 	.id	  = 3,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9263_BASE_US2,
-	.size     = 4096,
+	.resource	= uart2_resources,
+	.num_resources	= ARRAY_SIZE(uart2_resources),
 };
 
 static inline void configure_usart2_pins(unsigned pins)
@@ -216,18 +265,32 @@ void at91_register_uart(unsigned id, unsigned pins)
 }
 
 #if defined(CONFIG_MCI_ATMEL)
+static struct resource mci0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_MCI0,
+		.size	= SZ_16K,
+	},
+};
+
 static struct device_d mci0_device = {
 	.id		= 0,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9263_BASE_MCI0,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci0_resources),
+	.resource	= mci0_resources,
+};
+
+static struct resource mci1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9263_BASE_MCI1,
+		.size	= SZ_16K,
+	},
 };
 
 static struct device_d mci1_device = {
 	.id		= 1,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9263_BASE_MCI1,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci1_resources),
+	.resource	= mci1_resources,
 };
 
 /* Consider only one slot : slot 0 */
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index a474bd7..b2e633b 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -21,6 +21,12 @@
 
 #include "generic.h"
 
+static struct resource sdram_dev_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_6,
+	},
+};
+
 static struct memory_platform_data ram_pdata = {
 	.name = "ram0",
 	.flags = DEVFS_RDWR,
@@ -29,23 +35,31 @@ static struct memory_platform_data ram_pdata = {
 static struct device_d sdram_dev = {
 	.id		= -1,
 	.name		= "mem",
-	.map_base	= AT91_CHIPSELECT_6,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 	.platform_data	= &ram_pdata,
 };
 
 void at91_add_device_sdram(u32 size)
 {
-	sdram_dev.size = size;
+	sdram_dev_resources[0].size = size;
 	register_device(&sdram_dev);
 	armlinux_add_dram(&sdram_dev);
 }
 
 #if defined(CONFIG_DRIVER_NET_MACB)
+static struct resource eth_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_EMAC,
+		.size	= 0x1000,
+	},
+};
+
 static struct device_d macb_dev = {
 	.id		= 0,
 	.name		= "macb",
-	.map_base	= AT91SAM9G45_BASE_EMAC,
-	.size		= 0x1000,
+	.resource	= eth_resources,
+	.num_resources	= ARRAY_SIZE(eth_resources),
 };
 
 void at91_add_device_eth(struct at91_ether_platform_data *data)
@@ -84,11 +98,18 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= 0x10,
+	},
+};
+
 static struct device_d nand_dev = {
 	.id		= -1,
 	.name		= "atmel_nand",
-	.map_base	= AT91_CHIPSELECT_3,
-	.size		= 0x10,
+	.resource	= nand_resources,
+	.num_resources	= ARRAY_SIZE(nand_resources),
 };
 
 void at91_add_device_nand(struct atmel_nand_data *data)
@@ -123,11 +144,18 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 void at91_add_device_nand(struct atmel_nand_data *data) {}
 #endif
 
+static struct resource dbgu_resources[] = {
+	[0] = {
+		.start	= (AT91_BASE_SYS + AT91_DBGU),
+		.size	= 4096,
+	},
+};
+
 static struct device_d dbgu_serial_device = {
 	.id	  = -1,
 	.name     = "atmel_serial",
-	.map_base = (AT91_BASE_SYS + AT91_DBGU),
-	.size     = 4096,
+	.resource	= dbgu_resources,
+	.num_resources	= ARRAY_SIZE(dbgu_resources),
 };
 
 static inline void configure_dbgu_pins(void)
@@ -136,11 +164,18 @@ static inline void configure_dbgu_pins(void)
 	at91_set_A_periph(AT91_PIN_PB13, 1);		/* DTXD */
 }
 
+static struct resource uart0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_US0,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart0_serial_device = {
 	.id	  = -1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9G45_BASE_US0,
-	.size     = 4096,
+	.resource	= uart0_resources,
+	.num_resources	= ARRAY_SIZE(uart0_resources),
 };
 
 static inline void configure_usart0_pins(unsigned pins)
@@ -154,11 +189,18 @@ static inline void configure_usart0_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PB15, 0);	/* CTS0 */
 }
 
+static struct resource uart1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_US1,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart1_serial_device = {
 	.id	  = -1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9G45_BASE_US1,
-	.size     = 4096,
+	.resource	= uart1_resources,
+	.num_resources	= ARRAY_SIZE(uart1_resources),
 };
 
 static inline void configure_usart1_pins(unsigned pins)
@@ -172,11 +214,18 @@ static inline void configure_usart1_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PD17, 0);	/* CTS1 */
 }
 
+static struct resource uart2_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_US2,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart2_serial_device = {
 	.id	  = -1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9G45_BASE_US2,
-	.size     = 4096,
+	.resource	= uart2_resources,
+	.num_resources	= ARRAY_SIZE(uart2_resources),
 };
 
 static inline void configure_usart2_pins(unsigned pins)
@@ -190,11 +239,18 @@ static inline void configure_usart2_pins(unsigned pins)
 		at91_set_B_periph(AT91_PIN_PC11, 0);	/* CTS2 */
 }
 
+static struct resource uart3_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_US3,
+		.size	= 4096,
+	},
+};
+
 static struct device_d uart3_serial_device = {
 	.id	  = -1,
 	.name     = "atmel_serial",
-	.map_base = AT91SAM9G45_ID_US3,
-	.size     = 4096,
+	.resource	= uart3_resources,
+	.num_resources	= ARRAY_SIZE(uart3_resources),
 };
 
 static inline void configure_usart3_pins(unsigned pins)
@@ -243,18 +299,32 @@ void at91_register_uart(unsigned id, unsigned pins)
 }
 
 #if defined(CONFIG_MCI_ATMEL)
+static struct resource mci0_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_MCI0,
+		.size	= SZ_16K,
+	},
+};
+
 static struct device_d mci0_device = {
 	.id		= 0,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9G45_BASE_MCI0,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci0_resources),
+	.resource	= mci0_resources,
+};
+
+static struct resource mci1_resources[] = {
+	[0] = {
+		.start	= AT91SAM9G45_BASE_MCI1,
+		.size	= SZ_16K,
+	},
 };
 
 static struct device_d mci1_device = {
 	.id		= 1,
 	.name		= "atmel_mci",
-	.map_base	= AT91SAM9G45_BASE_MCI1,
-	.size		= SZ_16K,
+	.num_resources	= ARRAY_SIZE(mci1_resources),
+	.resource	= mci1_resources,
 };
 
 /* Consider only one slot : slot 0 */
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/7] at91/serial: switch to "struct resource"
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 2/7] at91: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 4/7] macb: " Jean-Christophe PLAGNIOL-VILLARD
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 drivers/serial/atmel.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 1098952..d8713b3 100644
--- a/drivers/serial/atmel.c
+++ b/drivers/serial/atmel.c
@@ -313,6 +313,7 @@
  * We wrap our port structure around the generic console_device.
  */
 struct atmel_uart_port {
+	void __iomem		*base;
 	struct console_device	uart;		/* uart */
 	struct clk		*clk;		/* uart clock */
 	u32			uartclk;
@@ -326,31 +327,30 @@ to_atmel_uart_port(struct console_device *uart)
 
 static void atmel_serial_putc(struct console_device *cdev, char c)
 {
-	struct device_d *dev = cdev->dev;
+	struct atmel_uart_port *uart = to_atmel_uart_port(cdev);
 
-	while (!(readl(dev->map_base + USART3_CSR) & USART3_BIT(TXRDY)));
+	while (!(readl(uart->base + USART3_CSR) & USART3_BIT(TXRDY)));
 
-	writel(c, dev->map_base + USART3_THR);
+	writel(c, uart->base + USART3_THR);
 }
 
 static int atmel_serial_tstc(struct console_device *cdev)
 {
-	struct device_d *dev = cdev->dev;
+	struct atmel_uart_port *uart = to_atmel_uart_port(cdev);
 
-	return (readl(dev->map_base + USART3_CSR) & USART3_BIT(RXRDY)) != 0;
+	return (readl(uart->base + USART3_CSR) & USART3_BIT(RXRDY)) != 0;
 }
 
 static int atmel_serial_getc(struct console_device *cdev)
 {
-	struct device_d *dev = cdev->dev;
+	struct atmel_uart_port *uart = to_atmel_uart_port(cdev);
 
-	while (!(readl(dev->map_base + USART3_CSR) & USART3_BIT(RXRDY))) ;
-	return readl(dev->map_base + USART3_RHR);
+	while (!(readl(uart->base + USART3_CSR) & USART3_BIT(RXRDY))) ;
+	return readl(uart->base + USART3_RHR);
 }
 
 static int atmel_serial_setbaudrate(struct console_device *cdev, int baudrate)
 {
-	struct device_d *dev = cdev->dev;
 	struct atmel_uart_port *uart = to_atmel_uart_port(cdev);
 	unsigned long divisor;
 
@@ -360,7 +360,7 @@ static int atmel_serial_setbaudrate(struct console_device *cdev, int baudrate)
 	 *                16 * CD
 	 */
 	divisor = (uart->uartclk / 16 + baudrate / 2) / baudrate;
-	writel(USART3_BF(CD, divisor), dev->map_base + USART3_BRGR);
+	writel(USART3_BF(CD, divisor), uart->base + USART3_BRGR);
 
 	return 0;
 }
@@ -375,20 +375,21 @@ static int atmel_serial_init_port(struct console_device *cdev)
 	struct device_d *dev = cdev->dev;
 	struct atmel_uart_port *uart = to_atmel_uart_port(cdev);
 
+	uart->base = (void __iomem *)dev->resource[0].start;
 	uart->clk = clk_get(dev, "usart");
 	clk_enable(uart->clk);
 	uart->uartclk = clk_get_rate(uart->clk);
 
-	writel(USART3_BIT(RSTRX) | USART3_BIT(RSTTX), dev->map_base + USART3_CR);
+	writel(USART3_BIT(RSTRX) | USART3_BIT(RSTTX), uart->base + USART3_CR);
 
 	atmel_serial_setbaudrate(cdev, 115200);
 
-	writel(USART3_BIT(RXEN) | USART3_BIT(TXEN), dev->map_base + USART3_CR);
+	writel(USART3_BIT(RXEN) | USART3_BIT(TXEN), uart->base + USART3_CR);
 	writel((USART3_BF(USART_MODE, USART3_USART_MODE_NORMAL)
 			   | USART3_BF(USCLKS, USART3_USCLKS_MCK)
 			   | USART3_BF(CHRL, USART3_CHRL_8)
 			   | USART3_BF(PAR, USART3_PAR_NONE)
-			   | USART3_BF(NBSTOP, USART3_NBSTOP_1)), dev->map_base + USART3_MR);
+			   | USART3_BF(NBSTOP, USART3_NBSTOP_1)), uart->base + USART3_MR);
 
 	return 0;
 }
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/7] macb: switch to "struct resource"
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 2/7] at91: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 3/7] at91/serial: switch " Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 5/7] atmel_mci: " Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 drivers/net/macb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index bc6618b..e030154 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -85,7 +85,7 @@ struct macb_dma_desc {
 #define TXBUF_USED		0x80000000
 
 struct macb_device {
-	void			*regs;
+	void			__iomem *regs;
 
 	unsigned int		rx_tail;
 	unsigned int		tx_tail;
@@ -446,7 +446,7 @@ static int macb_probe(struct device_d *dev)
 	macb->rx_ring = xmalloc(CFG_MACB_RX_RING_SIZE * sizeof(struct macb_dma_desc));
 	macb->tx_ring = xmalloc(sizeof(struct macb_dma_desc));
 
-	macb->regs = (void *)dev->map_base;
+	macb->regs = (void __iomem *)dev->resource[0].start;
 
 	/*
 	 * Do some basic initialization so that we at least can talk
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 5/7] atmel_mci: switch to "struct resource"
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 preceding siblings ...)
  2011-07-16 10:45 ` [PATCH 4/7] macb: " Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 6/7] atmel_nand: " Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 drivers/mci/atmel_mci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index d8bcf81..70041ba 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -456,7 +456,7 @@ static int mci_probe(struct device_d *hw_dev)
 	if (pd->bus_width == 8)
 		host->mci.host_caps |= MMC_MODE_8BIT;
 
-	host->base = (void __iomem *)hw_dev->map_base;
+	host->base = (void __iomem *)hw_dev->resource[0].start;
 	host->hw_dev = hw_dev;
 	hw_dev->priv = host;
 	host->clk = clk_get(hw_dev, "mci_clk");
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 6/7] atmel_nand: switch to "struct resource"
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 preceding siblings ...)
  2011-07-16 10:45 ` [PATCH 5/7] atmel_mci: " Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-16 10:45 ` [PATCH 7/7] dm9200: use "struct resource" instead of platform_data Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index e8f85fc..937bb70 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -381,7 +381,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
 	if (!host)
 		return -ENOMEM;
 
-	host->io_base = (void __iomem *)dev->map_base;
+	host->io_base = (void __iomem *)dev->resource[0].start;
 
 	mtd = &host->mtd;
 	nand_chip = &host->nand_chip;
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 7/7] dm9200: use "struct resource" instead of platform_data
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 preceding siblings ...)
  2011-07-16 10:45 ` [PATCH 6/7] atmel_nand: " Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-16 10:45 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-17 15:28   ` Sascha Hauer
  2011-07-17 15:37 ` [PATCH 1/7] device: introduce resource structure to simplify resource declaration Sascha Hauer
  2011-07-19 13:40 ` Antony Pavlov
  7 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-16 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

drop iobase and iodata in favor of resources

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 arch/arm/boards/at91sam9261ek/init.c            |    8 +++++---
 arch/arm/boards/mini2440/env/welcome_en.bmp.lzo |  Bin 0 -> 26285 bytes
 arch/arm/boards/mini2440/mini2440.c             |   17 +++++++++++++----
 arch/arm/boards/pm9261/init.c                   |    8 +++++---
 arch/arm/boards/scb9328/scb9328.c               |   23 ++++++++++++++++-------
 drivers/net/dm9000.c                            |   10 ++++++++--
 include/dm9000.h                                |    2 --
 7 files changed, 47 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/boards/mini2440/env/welcome_en.bmp.lzo

diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 3def38e..4e52ab8 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -89,8 +89,6 @@ static void ek_add_device_nand(void)
  */
 #if defined(CONFIG_DRIVER_NET_DM9000)
 static struct dm9000_platform_data dm9000_data = {
-	.iobase		= AT91_CHIPSELECT_2,
-	.iodata		= AT91_CHIPSELECT_2 + 4,
 	.buswidth	= DM9000_WIDTH_16,
 	.srom		= 0,
 };
@@ -98,7 +96,11 @@ static struct dm9000_platform_data dm9000_data = {
 static struct resource dm9000_resources[] = {
 	[0] = {
 		.start	= AT91_CHIPSELECT_2,
-		.size	= 8,
+		.size	= 4,
+	},
+	[1] = {
+		.start	= AT91_CHIPSELECT_2 + 4,
+		.size	= 4,
 	},
 };
 
diff --git a/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo b/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo
new file mode 100644
index 0000000000000000000000000000000000000000..8d4b743d934ed19c63ae1c6738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a5(CuFjRHCHxkf7-8EgPvjW-)yI;8NpQ8i6
z)Ls<UFM_}kmE7sYFTS{=j=|V<8}{lx3?f?5P#HoBMzX5(oB6mBq-^ZivA81)o}$jb
zhQtNjrPH6=#R5F7rBj+|h(hE~OG+^q-5C{~-GUn+h1E8ImXHi_U%fIU%)5v^W~ptg
z*Xh;`*Gcyqya=Pe(E2jW1R)_IP~y?j58s56OxJTw_vtmPoUWt8OTY|=BqABzc3qUD
zx>|sPZ!bexH}&AUJp>AMp#wq0wxz^sdmh4JdgCjhvqZc?tE#D%srwnY2-ggbVh+zI
z%7482Dq7x%RS4|>Dn`Zd`Fgb0*REZ2@K;fg|Is!3(Q!Z|bbAZbgq1A3OxSuH>N`y}
zZu;2i74HViZ?k7I@G$kUI~pYL68dv9q(ZeZ^qs|rKNZh9nqL`sj-yRJ95xJ?{A?{4
zqk~c~6?7C%f!BQtv%RQ&k0qjfm)v@dl~~|X!Da|iQtJ}H%E#x<k5PxN0XeACSDQbd
zCtf24EQ8ByBuEkJDSKSA8LR_cSXMY-0NvoDUpFfhX?a`4oa@1zh`G5rHf~#DW)m8v
zUCM;&hc}UWXt^x)#iJN&x<_JZd^q*upoD~Y$4SY4>A?uBQyEiOI9UtHkh(U@v7fnZ
z=HjJZZEA9J>@YKK?KCd*igkuCyh)RR6MA~v$H%o}iKbv4Bg!o&LDs5r^nNW^7W-L8
zSEr>u&M5boyCrt1H>*gJ-a~XfYn_B--z(v66B7O9@9$Rl-xpbU(_e46WvRdH@RuF_
z+6@2asDW4`GCGnQ0QS-x_m1z6{ogV=c<QfB_SYu+%L)F^o9zG7Ued|_Z~rGT6Z_)_
HX88XAF7rza

literal 0
HcmV?d00001

diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index dcc7c3f..b487082 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -75,16 +75,25 @@ static struct device_d nand_dev = {
  * Area 2: Offset 0x304...0x307
  */
 static struct dm9000_platform_data dm9000_data = {
-	.iobase   = CS4_BASE + 0x300,
-	.iodata   = CS4_BASE + 0x304,
 	.buswidth = DM9000_WIDTH_16,
 	.srom     = 1,
 };
 
+static struct resource dm9000_resources[] = {
+	[0] = {
+		.start	= CS4_BASE + 0x300,
+		.size	= 4,
+	},
+	[1] = {
+		.start	= CS4_BASE + 0x304,
+		.size	= 4,
+	},
+};
+
 static struct device_d dm9000_dev = {
 	.name     = "dm9000",
-	.map_base = CS4_BASE + 0x300,
-	.size     = 8,
+	.num_resources	= ARRAY_SIZE(dm9000_resources),
+	.resource	= dm9000_resources,
 	.platform_data = &dm9000_data,
 };
 
diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c
index af92835..4811c73 100644
--- a/arch/arm/boards/pm9261/init.c
+++ b/arch/arm/boards/pm9261/init.c
@@ -89,8 +89,6 @@ static void pm_add_device_nand(void)
  */
 #if defined(CONFIG_DRIVER_NET_DM9000)
 static struct dm9000_platform_data dm9000_data = {
-	.iobase		= AT91_CHIPSELECT_2,
-	.iodata		= AT91_CHIPSELECT_2 + 4,
 	.buswidth	= DM9000_WIDTH_16,
 	.srom		= 1,
 };
@@ -98,7 +96,11 @@ static struct dm9000_platform_data dm9000_data = {
 static struct resource dm9000_resources[] = {
 	[0] = {
 		.start	= AT91_CHIPSELECT_2,
-		.size	= 8,
+		.size	= 4,
+	},
+	[1] = {
+		.start	= AT91_CHIPSELECT_2 + 4,
+		.size	= 4,
 	},
 };
 
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index a98d9fe..69d0589 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -55,18 +55,27 @@ static struct device_d sdram_dev = {
 };
 
 static struct dm9000_platform_data dm9000_data = {
-	.iobase   = 0x16000000,
-	.iodata   = 0x16000004,
 	.buswidth = DM9000_WIDTH_16,
 	.srom     = 1,
 };
 
+static struct resource dm9000_resources[] = {
+	[0] = {
+		.start	= 0x16000000,
+		.size	= 4,
+	},
+	[1] = {
+		.start	= 0x16000004,
+		.size	= 4,
+	},
+};
+
 static struct device_d dm9000_dev = {
-	.id	  = -1,
-	.name     = "dm9000",
-	.map_base = 0x16000000,
-	.size     = 8,
-	.platform_data = &dm9000_data,
+	.id		= -1,
+	.name		= "dm9000",
+	.num_resources	= ARRAY_SIZE(dm9000_resources),
+	.resource	= dm9000_resources,
+	.platform_data	= &dm9000_data,
 };
 
 struct gpio_led leds[] = {
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index c8d8517..416525b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -491,12 +491,18 @@ static int dm9000_probe(struct device_d *dev)
 		printf("dm9000: no platform_data\n");
 		return -ENODEV;
 	}
+
+	if (!dev->num_resources < 2) {
+		printf("dm9000: need 2 resources base and data");
+		return -ENODEV;
+	}
+
 	pdata = dev->platform_data;
 
 	priv = edev->priv;
 	priv->buswidth = pdata->buswidth;
-	priv->iodata = (void *)pdata->iodata;
-	priv->iobase = (void *)pdata->iobase;
+	priv->iodata = (void __iomem *)dev->resource[1].start;
+	priv->iobase = (void __iomem *)dev->resource[0].start;
 	priv->srom = pdata->srom;
 
 	edev->init = dm9000_init_dev;
diff --git a/include/dm9000.h b/include/dm9000.h
index b4a04b1..0991ab5 100644
--- a/include/dm9000.h
+++ b/include/dm9000.h
@@ -7,8 +7,6 @@
 #define DM9000_WIDTH_32		3
 
 struct dm9000_platform_data {
-	unsigned long iobase;
-	unsigned long iodata;
 	int buswidth;
 	int srom;
 };
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 7/7] dm9200: use "struct resource" instead of platform_data
  2011-07-16 10:45 ` [PATCH 7/7] dm9200: use "struct resource" instead of platform_data Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-17 15:28   ` Sascha Hauer
  2011-07-18  4:36     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2011-07-17 15:28 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On Sat, Jul 16, 2011 at 12:45:32PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> drop iobase and iodata in favor of resources
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> ---
>  arch/arm/boards/at91sam9261ek/init.c            |    8 +++++---
>  arch/arm/boards/mini2440/env/welcome_en.bmp.lzo |  Bin 0 -> 26285 bytes
>  arch/arm/boards/mini2440/mini2440.c             |   17 +++++++++++++----
>  arch/arm/boards/pm9261/init.c                   |    8 +++++---
>  arch/arm/boards/scb9328/scb9328.c               |   23 ++++++++++++++++-------
>  drivers/net/dm9000.c                            |   10 ++++++++--
>  include/dm9000.h                                |    2 --
>  7 files changed, 47 insertions(+), 21 deletions(-)
>  create mode 100644 arch/arm/boards/mini2440/env/welcome_en.bmp.lzo
> 
> diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
> index 3def38e..4e52ab8 100644
> --- a/arch/arm/boards/at91sam9261ek/init.c
> +++ b/arch/arm/boards/at91sam9261ek/init.c
> @@ -89,8 +89,6 @@ static void ek_add_device_nand(void)
>   */
>  #if defined(CONFIG_DRIVER_NET_DM9000)
>  static struct dm9000_platform_data dm9000_data = {
> -	.iobase		= AT91_CHIPSELECT_2,
> -	.iodata		= AT91_CHIPSELECT_2 + 4,
>  	.buswidth	= DM9000_WIDTH_16,
>  	.srom		= 0,
>  };
> @@ -98,7 +96,11 @@ static struct dm9000_platform_data dm9000_data = {
>  static struct resource dm9000_resources[] = {
>  	[0] = {
>  		.start	= AT91_CHIPSELECT_2,
> -		.size	= 8,
> +		.size	= 4,
> +	},
> +	[1] = {
> +		.start	= AT91_CHIPSELECT_2 + 4,
> +		.size	= 4,
>  	},
>  };
>  
> diff --git a/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo b/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo

Ups ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] device: introduce resource structure to simplify resource declaration
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
                   ` (5 preceding siblings ...)
  2011-07-16 10:45 ` [PATCH 7/7] dm9200: use "struct resource" instead of platform_data Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-17 15:37 ` Sascha Hauer
  2011-07-18  4:43   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-19 13:40 ` Antony Pavlov
  7 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2011-07-17 15:37 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On Sat, Jul 16, 2011 at 12:45:26PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> and add multi resource per device support
> 
> for now we keep the old map_base and size temporary but will switch all of
> the used step by step to them resource way
> 
> and mirror the first resource to the map_base and size if available
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> ---
>  include/driver.h       |    4 ++
>  include/linux/ioport.h |  115 ++++++++++++++++++++++++++++++++++++++++++++++++
>  lib/driver.c           |    9 ++++
>  3 files changed, 128 insertions(+), 0 deletions(-)
>  create mode 100644 include/linux/ioport.h
> 
> diff --git a/include/driver.h b/include/driver.h
> index 6a4d45e..ed3df16 100644
> --- a/include/driver.h
> +++ b/include/driver.h
> @@ -24,6 +24,7 @@
>  #define DRIVER_H
>  
>  #include <linux/list.h>
> +#include <linux/ioport.h>
>  
>  #define MAX_DRIVER_NAME		32
>  #define FORMAT_DRIVER_MANE_ID	"%s%d"
> @@ -76,6 +77,9 @@ struct device_d {
>  	 * Flash or SDRAM. */
>  	resource_size_t map_base;
>  
> +	struct resource *resource;
> +	int num_resources;
> +
>  	void *platform_data; /*! board specific information about this device */
>  
>  	/*! Devices of a particular class normaly need to store more
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> new file mode 100644
> index 0000000..5143115
> --- /dev/null
> +++ b/include/linux/ioport.h
> @@ -0,0 +1,115 @@
> +/*
> + * ioport.h	Definitions of routines for detecting, reserving and
> + *		allocating system resources.
> + *
> + * Authors:	Linus Torvalds
> + */
> +
> +#ifndef _LINUX_IOPORT_H
> +#define _LINUX_IOPORT_H
> +
> +#ifndef __ASSEMBLY__
> +#include <linux/compiler.h>
> +#include <linux/types.h>
> +/*
> + * Resources are tree-like, allowing
> + * nesting etc..
> + */
> +struct resource {
> +	resource_size_t start;
> +	resource_size_t size;
> +	const char *name;
> +	unsigned long flags;
> +};
> +
> +/*
> + * IO resources have these defined flags.
> + */
> +#define IORESOURCE_BITS		0x000000ff	/* Bus-specific bits */
> +
> +#define IORESOURCE_TYPE_BITS	0x00001f00	/* Resource type */
> +#define IORESOURCE_IO		0x00000100
> +#define IORESOURCE_MEM		0x00000200
> +#define IORESOURCE_IRQ		0x00000400
> +#define IORESOURCE_DMA		0x00000800
> +#define IORESOURCE_BUS		0x00001000
> +
> +#define IORESOURCE_PREFETCH	0x00002000	/* No side effects */
> +#define IORESOURCE_READONLY	0x00004000
> +#define IORESOURCE_CACHEABLE	0x00008000
> +#define IORESOURCE_RANGELENGTH	0x00010000
> +#define IORESOURCE_SHADOWABLE	0x00020000
> +
> +#define IORESOURCE_SIZEALIGN	0x00040000	/* size indicates alignment */
> +#define IORESOURCE_STARTALIGN	0x00080000	/* start field is alignment */
> +
> +#define IORESOURCE_MEM_64	0x00100000
> +#define IORESOURCE_WINDOW	0x00200000	/* forwarded by bridge */
> +#define IORESOURCE_MUXED	0x00400000	/* Resource is software muxed */
> +
> +#define IORESOURCE_EXCLUSIVE	0x08000000	/* Userland may not map this resource */
> +#define IORESOURCE_DISABLED	0x10000000
> +#define IORESOURCE_UNSET	0x20000000
> +#define IORESOURCE_AUTO		0x40000000
> +#define IORESOURCE_BUSY		0x80000000	/* Driver has marked this resource busy */
> +
> +/* PnP IRQ specific bits (IORESOURCE_BITS) */
> +#define IORESOURCE_IRQ_HIGHEDGE		(1<<0)
> +#define IORESOURCE_IRQ_LOWEDGE		(1<<1)
> +#define IORESOURCE_IRQ_HIGHLEVEL	(1<<2)
> +#define IORESOURCE_IRQ_LOWLEVEL		(1<<3)
> +#define IORESOURCE_IRQ_SHAREABLE	(1<<4)
> +#define IORESOURCE_IRQ_OPTIONAL		(1<<5)
> +
> +/* PnP DMA specific bits (IORESOURCE_BITS) */
> +#define IORESOURCE_DMA_TYPE_MASK	(3<<0)
> +#define IORESOURCE_DMA_8BIT		(0<<0)
> +#define IORESOURCE_DMA_8AND16BIT	(1<<0)
> +#define IORESOURCE_DMA_16BIT		(2<<0)
> +
> +#define IORESOURCE_DMA_MASTER		(1<<2)
> +#define IORESOURCE_DMA_BYTE		(1<<3)
> +#define IORESOURCE_DMA_WORD		(1<<4)
> +
> +#define IORESOURCE_DMA_SPEED_MASK	(3<<6)
> +#define IORESOURCE_DMA_COMPATIBLE	(0<<6)
> +#define IORESOURCE_DMA_TYPEA		(1<<6)
> +#define IORESOURCE_DMA_TYPEB		(2<<6)
> +#define IORESOURCE_DMA_TYPEF		(3<<6)
> +
> +/* PnP memory I/O specific bits (IORESOURCE_BITS) */
> +#define IORESOURCE_MEM_WRITEABLE	(1<<0)	/* dup: IORESOURCE_READONLY */
> +#define IORESOURCE_MEM_CACHEABLE	(1<<1)	/* dup: IORESOURCE_CACHEABLE */
> +#define IORESOURCE_MEM_RANGELENGTH	(1<<2)	/* dup: IORESOURCE_RANGELENGTH */
> +#define IORESOURCE_MEM_TYPE_MASK	(3<<3)
> +#define IORESOURCE_MEM_8BIT		(0<<3)
> +#define IORESOURCE_MEM_16BIT		(1<<3)
> +#define IORESOURCE_MEM_8AND16BIT	(2<<3)
> +#define IORESOURCE_MEM_32BIT		(3<<3)
> +#define IORESOURCE_MEM_SHADOWABLE	(1<<5)	/* dup: IORESOURCE_SHADOWABLE */
> +#define IORESOURCE_MEM_EXPANSIONROM	(1<<6)
> +
> +/* PnP I/O specific bits (IORESOURCE_BITS) */
> +#define IORESOURCE_IO_16BIT_ADDR	(1<<0)
> +#define IORESOURCE_IO_FIXED		(1<<1)
> +
> +/* PCI ROM control bits (IORESOURCE_BITS) */
> +#define IORESOURCE_ROM_ENABLE		(1<<0)	/* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
> +#define IORESOURCE_ROM_SHADOW		(1<<1)	/* ROM is copy at C000:0 */
> +#define IORESOURCE_ROM_COPY		(1<<2)	/* ROM is alloc'd copy, resource field overlaid */
> +#define IORESOURCE_ROM_BIOS_COPY	(1<<3)	/* ROM is BIOS copy, resource field overlaid */
> +
> +/* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
> +#define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
> +
> +static inline resource_size_t resource_size(const struct resource *res)
> +{
> +	return res->size;
> +}
> +static inline unsigned long resource_type(const struct resource *res)
> +{
> +	return res->flags & IORESOURCE_TYPE_BITS;
> +}
> +
> +#endif /* __ASSEMBLY__ */
> +#endif	/* _LINUX_IOPORT_H */
> diff --git a/lib/driver.c b/lib/driver.c
> index 4c10a49..ee5e850 100644
> --- a/lib/driver.c
> +++ b/lib/driver.c
> @@ -103,6 +103,15 @@ int register_device(struct device_d *new_device)
>  {
>  	struct driver_d *drv;
>  
> +	/* if no map_base available use the first resource if available
> +	 * so we do not need to duplicate it
> +	 * Temporary fixup until we get rid of map_base and size
> +	 */
> +	if (new_device->map_base == 0 && new_device->resource) {
> +		new_device->map_base = new_device->resource[0].start;
> +		new_device->size = new_device->resource[0].size;
> +	}

I think we don't need this. What we need though is the other way round:

	if (new_device->map_base) {
		dev_warn(new_device, "uses map_base. Please convert to use resources\n")
		new_device->resource = xzalloc(sizeof(struct resource));
		new_device->resource[0].start = new_device->map_base;
		new_device->resource[0].size = new_device->size;
	}

This way all devices have resources, we can convert the drivers and
devices to use resources one by one.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 7/7] dm9200: use "struct resource" instead of platform_data
  2011-07-17 15:28   ` Sascha Hauer
@ 2011-07-18  4:36     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-18  4:36 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On 17:28 Sun 17 Jul     , Sascha Hauer wrote:
> On Sat, Jul 16, 2011 at 12:45:32PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > drop iobase and iodata in favor of resources
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> > ---
> >  arch/arm/boards/at91sam9261ek/init.c            |    8 +++++---
> >  arch/arm/boards/mini2440/env/welcome_en.bmp.lzo |  Bin 0 -> 26285 bytes
> >  arch/arm/boards/mini2440/mini2440.c             |   17 +++++++++++++----
> >  arch/arm/boards/pm9261/init.c                   |    8 +++++---
> >  arch/arm/boards/scb9328/scb9328.c               |   23 ++++++++++++++++-------
> >  drivers/net/dm9000.c                            |   10 ++++++++--
> >  include/dm9000.h                                |    2 --
> >  7 files changed, 47 insertions(+), 21 deletions(-)
> >  create mode 100644 arch/arm/boards/mini2440/env/welcome_en.bmp.lzo
> > 
> > diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
> > index 3def38e..4e52ab8 100644
> > --- a/arch/arm/boards/at91sam9261ek/init.c
> > +++ b/arch/arm/boards/at91sam9261ek/init.c
> > @@ -89,8 +89,6 @@ static void ek_add_device_nand(void)
> >   */
> >  #if defined(CONFIG_DRIVER_NET_DM9000)
> >  static struct dm9000_platform_data dm9000_data = {
> > -	.iobase		= AT91_CHIPSELECT_2,
> > -	.iodata		= AT91_CHIPSELECT_2 + 4,
> >  	.buswidth	= DM9000_WIDTH_16,
> >  	.srom		= 0,
> >  };
> > @@ -98,7 +96,11 @@ static struct dm9000_platform_data dm9000_data = {
> >  static struct resource dm9000_resources[] = {
> >  	[0] = {
> >  		.start	= AT91_CHIPSELECT_2,
> > -		.size	= 8,
> > +		.size	= 4,
> > +	},
> > +	[1] = {
> > +		.start	= AT91_CHIPSELECT_2 + 4,
> > +		.size	= 4,
> >  	},
> >  };
> >  
> > diff --git a/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo b/arch/arm/boards/mini2440/env/welcome_en.bmp.lzo
> 
> Ups ;)
Yeah ups

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] device: introduce resource structure to simplify resource declaration
  2011-07-17 15:37 ` [PATCH 1/7] device: introduce resource structure to simplify resource declaration Sascha Hauer
@ 2011-07-18  4:43   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-07-18  6:26     ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-18  4:43 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

> > +#endif /* __ASSEMBLY__ */
> > +#endif	/* _LINUX_IOPORT_H */
> > diff --git a/lib/driver.c b/lib/driver.c
> > index 4c10a49..ee5e850 100644
> > --- a/lib/driver.c
> > +++ b/lib/driver.c
> > @@ -103,6 +103,15 @@ int register_device(struct device_d *new_device)
> >  {
> >  	struct driver_d *drv;
> >  
> > +	/* if no map_base available use the first resource if available
> > +	 * so we do not need to duplicate it
> > +	 * Temporary fixup until we get rid of map_base and size
> > +	 */
> > +	if (new_device->map_base == 0 && new_device->resource) {
> > +		new_device->map_base = new_device->resource[0].start;
> > +		new_device->size = new_device->resource[0].size;
> > +	}
> 
> I think we don't need this. What we need though is the other way round:
> 
> 	if (new_device->map_base) {
> 		dev_warn(new_device, "uses map_base. Please convert to use resources\n")
> 		new_device->resource = xzalloc(sizeof(struct resource));
> 		new_device->resource[0].start = new_device->map_base;
> 		new_device->resource[0].size = new_device->size;
> 	}
> 
> This way all devices have resources, we can convert the drivers and
> devices to use resources one by one.
ok for the warning

but if we do not keep the map_base uptodate the core device drivers will be
broken so if no map_base is specified we must update it with the first
resource

how about this

	if (new_device->map_base) {
		if (new_device->resource) {
			dev_err(new_device, "map_base and resource specifed\n");
			return -EIO;
		}
		dev_warn(new_device, "uses map_base. Please convert to use resources\n")
		new_device->resource = xzalloc(sizeof(struct resource));
		new_device->resource[0].start = new_device->map_base;
		new_device->resource[0].size = new_device->size;
		new_device->numresources = 1;
	} else if (new_device->resource) {
		new_device->map_base = new_device->resource[0].start;
		new_device->size = new_device->resource[0].size;
	}

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] device: introduce resource structure to simplify resource declaration
  2011-07-18  4:43   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-18  6:26     ` Sascha Hauer
  0 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2011-07-18  6:26 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On Mon, Jul 18, 2011 at 06:43:47AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > +#endif /* __ASSEMBLY__ */
> > > +#endif	/* _LINUX_IOPORT_H */
> > > diff --git a/lib/driver.c b/lib/driver.c
> > > index 4c10a49..ee5e850 100644
> > > --- a/lib/driver.c
> > > +++ b/lib/driver.c
> > > @@ -103,6 +103,15 @@ int register_device(struct device_d *new_device)
> > >  {
> > >  	struct driver_d *drv;
> > >  
> > > +	/* if no map_base available use the first resource if available
> > > +	 * so we do not need to duplicate it
> > > +	 * Temporary fixup until we get rid of map_base and size
> > > +	 */
> > > +	if (new_device->map_base == 0 && new_device->resource) {
> > > +		new_device->map_base = new_device->resource[0].start;
> > > +		new_device->size = new_device->resource[0].size;
> > > +	}
> > 
> > I think we don't need this. What we need though is the other way round:
> > 
> > 	if (new_device->map_base) {
> > 		dev_warn(new_device, "uses map_base. Please convert to use resources\n")
> > 		new_device->resource = xzalloc(sizeof(struct resource));
> > 		new_device->resource[0].start = new_device->map_base;
> > 		new_device->resource[0].size = new_device->size;
> > 	}
> > 
> > This way all devices have resources, we can convert the drivers and
> > devices to use resources one by one.
> ok for the warning
> 
> but if we do not keep the map_base uptodate the core device drivers will be
> broken so if no map_base is specified we must update it with the first
> resource

You're right.

> 
> how about this
> 
> 	if (new_device->map_base) {
> 		if (new_device->resource) {
> 			dev_err(new_device, "map_base and resource specifed\n");
> 			return -EIO;
> 		}
> 		dev_warn(new_device, "uses map_base. Please convert to use resources\n")
> 		new_device->resource = xzalloc(sizeof(struct resource));
> 		new_device->resource[0].start = new_device->map_base;
> 		new_device->resource[0].size = new_device->size;
> 		new_device->numresources = 1;
> 	} else if (new_device->resource) {
> 		new_device->map_base = new_device->resource[0].start;
> 		new_device->size = new_device->resource[0].size;
> 	}

Ok, this looks good.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] device: introduce resource structure to simplify resource declaration
  2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
                   ` (6 preceding siblings ...)
  2011-07-17 15:37 ` [PATCH 1/7] device: introduce resource structure to simplify resource declaration Sascha Hauer
@ 2011-07-19 13:40 ` Antony Pavlov
  2011-07-19 15:45   ` Jean-Christophe PLAGNIOL-VILLARD
  7 siblings, 1 reply; 14+ messages in thread
From: Antony Pavlov @ 2011-07-19 13:40 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On 16/07/2011, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> and add multi resource per device support
>
> for now we keep the old map_base and size temporary but will switch all of
> the used step by step to them resource way
>
> and mirror the first resource to the map_base and size if available
>

> +++ b/include/linux/ioport.h
...
> +struct resource {
> +	resource_size_t start;
> +	resource_size_t size;
> +	const char *name;
> +	unsigned long flags;
> +};

In linux-2.6.39/include/linux/ioport.h:

struct resource {
        resource_size_t start;
        resource_size_t end;
        const char *name;
        unsigned long flags;
        struct resource *parent, *sibling, *child;
};

So there is incompatability: barebox has 'size' field, but linux  has
'end' field instead.

Can you comment this, please?

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] device: introduce resource structure to simplify resource declaration
  2011-07-19 13:40 ` Antony Pavlov
@ 2011-07-19 15:45   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-19 15:45 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On 17:40 Tue 19 Jul     , Antony Pavlov wrote:
> On 16/07/2011, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> > and add multi resource per device support
> >
> > for now we keep the old map_base and size temporary but will switch all of
> > the used step by step to them resource way
> >
> > and mirror the first resource to the map_base and size if available
> >
> 
> > +++ b/include/linux/ioport.h
> ...
> > +struct resource {
> > +	resource_size_t start;
> > +	resource_size_t size;
> > +	const char *name;
> > +	unsigned long flags;
> > +};
> 
> In linux-2.6.39/include/linux/ioport.h:
> 
> struct resource {
>         resource_size_t start;
>         resource_size_t end;
>         const char *name;
>         unsigned long flags;
>         struct resource *parent, *sibling, *child;
> };
> 
> So there is incompatability: barebox has 'size' field, but linux  has
> 'end' field instead.
> 
> Can you comment this, please?
in barebox we use size no end in the resource since the begenning

so I choose to keep it this way

and avoid the calcul end - start

if u use helper resource_size() you will no notice

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-07-19 16:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-16 10:45 [PATCH 1/7] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 2/7] at91: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 3/7] at91/serial: switch " Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 4/7] macb: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 5/7] atmel_mci: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 6/7] atmel_nand: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-16 10:45 ` [PATCH 7/7] dm9200: use "struct resource" instead of platform_data Jean-Christophe PLAGNIOL-VILLARD
2011-07-17 15:28   ` Sascha Hauer
2011-07-18  4:36     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-17 15:37 ` [PATCH 1/7] device: introduce resource structure to simplify resource declaration Sascha Hauer
2011-07-18  4:43   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-18  6:26     ` Sascha Hauer
2011-07-19 13:40 ` Antony Pavlov
2011-07-19 15:45   ` Jean-Christophe PLAGNIOL-VILLARD

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