lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Sep 2006 16:34:21 +0200
From:	Haavard Skinnemoen <hskinnemoen@...el.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [-mm patch 4/4] AVR32 MTD: AT49BV6416 platform device for atstk1000

Register a platform device for the AT49BV6416 NOR flash chip on the
ATSTK1000 development board for use by the ATSTK1000 MTD map driver.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@...el.com>
---
 arch/avr32/boards/atstk1000/atstk1002.c |   46 ++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

Index: linux-2.6.18-rc5-mm1/arch/avr32/boards/atstk1000/atstk1002.c
===================================================================
--- linux-2.6.18-rc5-mm1.orig/arch/avr32/boards/atstk1000/atstk1002.c	2006-09-07 15:18:55.000000000 +0200
+++ linux-2.6.18-rc5-mm1/arch/avr32/boards/atstk1000/atstk1002.c	2006-09-07 15:21:18.000000000 +0200
@@ -8,6 +8,9 @@
  * published by the Free Software Foundation.
  */
 #include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
 
 #include <asm/arch/board.h>
 
@@ -20,6 +23,47 @@ struct eth_platform_data __initdata eth0
 
 extern struct lcdc_platform_data atstk1000_fb0_data;
 
+static struct mtd_partition flash_parts[] = {
+	{
+		.name           = "u-boot",
+		.offset         = 0x00000000,
+		.size           = 0x00020000,           /* 128 KiB */
+		.mask_flags     = MTD_WRITEABLE,
+	},
+	{
+		.name           = "root",
+		.offset         = 0x00020000,
+		.size           = 0x007d0000,
+	},
+	{
+		.name           = "env",
+		.offset         = 0x007f0000,
+		.size           = 0x00010000,
+		.mask_flags     = MTD_WRITEABLE,
+	},
+};
+
+static struct flash_platform_data flash_data = {
+	.nr_parts	= ARRAY_SIZE(flash_parts),
+	.parts		= flash_parts,
+};
+
+struct resource flash_resource = {
+	.start		= 0x00000000,
+	.end		= 0x007fffff,
+	.flags		= IORESOURCE_MEM,
+};
+
+struct platform_device flash_device = {
+	.name		= "atstk1000-flash",
+	.id		= 0,
+	.resource	= &flash_resource,
+	.num_resources	= 1,
+	.dev		= {
+		.platform_data = &flash_data,
+	},
+};
+
 static int __init atstk1002_init(void)
 {
 	at32_add_system_devices();
@@ -32,6 +76,8 @@ static int __init atstk1002_init(void)
 	at32_add_device_spi(0);
 	at32_add_device_lcdc(0, &atstk1000_fb0_data);
 
+	platform_device_register(&flash_device);
+
 	return 0;
 }
 postcore_initcall(atstk1002_init);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ