mtd/drivers/mtd/maps ocotea.c, NONE, 1.1 Kconfig, 1.30, 1.31 Makefile.common, 1.14, 1.15 ebony.c, 1.10, 1.11

mporter at infradead.org mporter at infradead.org
Mon Aug 23 16:38:29 EDT 2004


Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv21177/drivers/mtd/maps

Modified Files:
	Kconfig Makefile.common ebony.c 
Added Files:
	ocotea.c 
Log Message:


Update PPC44x MTD mappings


--- NEW FILE ocotea.c ---
/*
 * Mapping for Ocotea user flash
 *
 * Matt Porter <mporter at kernel.crashing.org>
 *
 * Copyright 2002-2004 MontaVista Software Inc.
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/config.h>
#include <linux/version.h>
#include <asm/io.h>
#include <asm/ibm44x.h>
#include <platforms/4xx/ocotea.h>

static struct mtd_info *flash;

static struct map_info ocotea_small_map = {
	.name =		"Ocotea small flash",
	.size =		OCOTEA_SMALL_FLASH_SIZE,
	.buswidth =	1,
};

static struct map_info ocotea_large_map = {
	.name =		"Ocotea large flash",
	.size =		OCOTEA_LARGE_FLASH_SIZE,
	.buswidth =	1,
};

static struct mtd_partition ocotea_small_partitions[] = {
	{
		.name =   "pibs",
		.offset = 0x0,
		.size =   0x100000,
	}
};

static struct mtd_partition ocotea_large_partitions[] = {
	{
		.name =   "fs",
		.offset = 0,
		.size =   0x300000,
	},
	{
		.name =   "firmware",
		.offset = 0x300000,
		.size =   0x100000,
	}
};

#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))

int __init init_ocotea(void)
{
	u8 fpga0_reg;
	u8 *fpga0_adr;
	unsigned long long small_flash_base, large_flash_base;

	fpga0_adr = ioremap64(OCOTEA_FPGA_ADDR, 16);
	if (!fpga0_adr)
		return -ENOMEM;

	fpga0_reg = readb((unsigned long)fpga0_adr);
	iounmap(fpga0_adr);

	if (OCOTEA_BOOT_LARGE_FLASH(fpga0_reg)) {
		small_flash_base = OCOTEA_SMALL_FLASH_HIGH;
		large_flash_base = OCOTEA_LARGE_FLASH_LOW;
	}
	else {
		small_flash_base = OCOTEA_SMALL_FLASH_LOW;
		large_flash_base = OCOTEA_LARGE_FLASH_HIGH;
	}

	ocotea_small_map.phys = small_flash_base;
	ocotea_small_map.virt =
		(unsigned long)ioremap64(small_flash_base,
					 ocotea_small_map.size);

	if (!ocotea_small_map.virt) {
		printk("Failed to ioremap flash\n");
		return -EIO;
	}

	simple_map_init(&ocotea_small_map);

	flash = do_map_probe("map_rom", &ocotea_small_map);
	if (flash) {
		flash->owner = THIS_MODULE;
		add_mtd_partitions(flash, ocotea_small_partitions,
					NB_OF(ocotea_small_partitions));
	} else {
		printk("map probe failed for flash\n");
		return -ENXIO;
	}

	ocotea_large_map.phys = large_flash_base;
	ocotea_large_map.virt =
		(unsigned long)ioremap64(large_flash_base,
					 ocotea_large_map.size);

	if (!ocotea_large_map.virt) {
		printk("Failed to ioremap flash\n");
		return -EIO;
	}

	simple_map_init(&ocotea_large_map);

	flash = do_map_probe("cfi_probe", &ocotea_large_map);
	if (flash) {
		flash->owner = THIS_MODULE;
		add_mtd_partitions(flash, ocotea_large_partitions,
					NB_OF(ocotea_large_partitions));
	} else {
		printk("map probe failed for flash\n");
		return -ENXIO;
	}

	return 0;
}

static void __exit cleanup_ocotea(void)
{
	if (flash) {
		del_mtd_partitions(flash);
		map_destroy(flash);
	}

	if (ocotea_small_map.virt) {
		iounmap((void *)ocotea_small_map.virt);
		ocotea_small_map.virt = 0;
	}

	if (ocotea_large_map.virt) {
		iounmap((void *)ocotea_large_map.virt);
		ocotea_large_map.virt = 0;
	}
}

module_init(init_ocotea);
module_exit(cleanup_ocotea);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Matt Porter <mporter at kernel.crashing.org>");
MODULE_DESCRIPTION("MTD map and partitions for IBM 440GX Ocotea boards");

Index: Kconfig
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/Kconfig,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Kconfig	21 Jul 2004 00:16:14 -0000	1.30
+++ Kconfig	23 Aug 2004 20:38:26 -0000	1.31
@@ -355,13 +355,21 @@
 	  use the flash chips on it, say 'Y'.
 
 config MTD_EBONY
-	tristate "CFI Flash device mapped on IBM 440GP Ebony"
-	depends on MTD_CFI && PPC32 && 440 && EBONY
+	tristate "Flash devices mapped on IBM 440GP Ebony"
+	depends on MTD_CFI && PPC32 && 44x && EBONY
 	help
 	  This enables access routines for the flash chips on the IBM 440GP
 	  Ebony board. If you have one of these boards and would like to
 	  use the flash chips on it, say 'Y'.
 
+config MTD_OCOTEA
+	tristate "Flash devices mapped on IBM 440GX Ocotea"
+	depends on MTD_CFI && PPC32 && 44x && OCOTEA
+	help
+	  This enables access routines for the flash chips on the IBM 440GX
+	  Ocotea board. If you have one of these boards and would like to
+	  use the flash chips on it, say 'Y'.
+
 config MTD_REDWOOD
 	tristate "CFI Flash devices mapped on IBM Redwood"
 	depends on MTD_CFI && PPC32 && 4xx && 40x && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 )

Index: Makefile.common
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/Makefile.common,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Makefile.common	12 Jul 2004 16:07:31 -0000	1.14
+++ Makefile.common	23 Aug 2004 20:38:26 -0000	1.15
@@ -55,6 +55,7 @@
 obj-$(CONFIG_MTD_NETtel)	+= nettel.o
 obj-$(CONFIG_MTD_SCB2_FLASH)	+= scb2_flash.o
 obj-$(CONFIG_MTD_EBONY)		+= ebony.o
+obj-$(CONFIG_MTD_OCOTEA)	+= ocotea.o
 obj-$(CONFIG_MTD_BEECH)		+= beech-mtd.o
 obj-$(CONFIG_MTD_ARCTIC)	+= arctic-mtd.o
 obj-$(CONFIG_MTD_H720X)		+= h720x-flash.o

Index: ebony.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/ebony.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ebony.c	12 Jul 2004 21:59:44 -0000	1.10
+++ ebony.c	23 Aug 2004 20:38:26 -0000	1.11
@@ -3,9 +3,9 @@
  * 
  * Mapping for Ebony user flash
  *
- * Matt Porter <mporter at mvista.com>
+ * Matt Porter <mporter at kernel.crashing.org>
  *
- * Copyright 2002 MontaVista Software Inc.
+ * Copyright 2002-2004 MontaVista Software Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -21,9 +21,10 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
+#include <linux/version.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
-#include <platforms/ebony.h>
+#include <platforms/4xx/ebony.h>
 
 static struct mtd_info *flash;
 
@@ -63,7 +64,7 @@
 int __init init_ebony(void)
 {
 	u8 fpga0_reg;
-	unsigned long fpga0_adr;
+	u8 *fpga0_adr;
 	unsigned long long small_flash_base, large_flash_base;
 
 	fpga0_adr = ioremap64(EBONY_FPGA_ADDR, 16);
@@ -160,5 +161,5 @@
 module_exit(cleanup_ebony);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Matt Porter <mporter at mvista.com>");
+MODULE_AUTHOR("Matt Porter <mporter at kernel.crashing.org>");
 MODULE_DESCRIPTION("MTD map and partitions for IBM 440GP Ebony boards");





More information about the linux-mtd-cvs mailing list