aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/config-2.6.282
-rw-r--r--target/linux/ar71xx/config-2.6.292
-rw-r--r--target/linux/ar71xx/config-2.6.302
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c4
-rw-r--r--target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h10
-rw-r--r--target/linux/ar71xx/files/drivers/mtd/maps/ar91xx_flash.c268
-rw-r--r--target/linux/ar71xx/patches-2.6.28/007-ar91xx_flash_driver.patch26
-rw-r--r--target/linux/ar71xx/patches-2.6.29/007-ar91xx_flash_driver.patch26
-rw-r--r--target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch26
9 files changed, 361 insertions, 5 deletions
diff --git a/target/linux/ar71xx/config-2.6.28 b/target/linux/ar71xx/config-2.6.28
index 6148e60d26..824dd3bd58 100644
--- a/target/linux/ar71xx/config-2.6.28
+++ b/target/linux/ar71xx/config-2.6.28
@@ -121,8 +121,8 @@ CONFIG_MIPS_MT_DISABLED=y
# CONFIG_MIPS_MT_SMP is not set
# CONFIG_MIPS_MT_SMTC is not set
# CONFIG_MIPS_SIM is not set
+CONFIG_MTD_AR91XX_FLASH=y
# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_MYLOADER_PARTS=y
diff --git a/target/linux/ar71xx/config-2.6.29 b/target/linux/ar71xx/config-2.6.29
index 9f54da924b..e3e75b0f74 100644
--- a/target/linux/ar71xx/config-2.6.29
+++ b/target/linux/ar71xx/con
/*
 *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
 *
 *  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.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>     /* for unlink() */
#include <libgen.h>
#include <getopt.h>     /* for getopt() */
#include <stdarg.h>
#include <errno.h>
#include <sys/stat.h>

#define DNI_HDR_LEN	128

/*
 * Globals
 */
static char *ifname;
static char *progname;
static char *ofname;
static char *version = "1.00.00";
static char *region = "";
static char *hd_id;

static char *board_id;
/*
 * Message macros
 */
#define ERR(fmt, ...) do { \
	fflush(0); \
	fprintf(stderr, "[%s] *** error: " fmt "\n", \
			progname, ## __VA_ARGS__ ); \
} while (0)

#define ERRS(fmt, ...) do { \
	int save = errno; \
	fflush(0); \
	fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \
			progname, ## __VA_ARGS__, strerror(save)); \
} while (0)

void usage(int status)
{
	FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
	struct board_info *board;

	fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
	fprintf(stream,
"\n"
"Options:\n"
"  -B <board>      create image for the board specified with <board>\n"
"  -i <file>       read input from the file <file>\n"
"  -o <file>       write output to the file <file>\n"
"  -v <version>    set image version to <version>\n"
"  -r <region>     set image region to <region>\n"
"  -H <hd_id>      set image hardware id to <hd_id>\n"
"  -h              show this screen\n"
	);

	exit(status);
}

int main(int argc, char *argv[])
{
	int res = EXIT_FAILURE;
	int buflen;
	int err;
	struct stat st;
	char *buf;
	int pos, rem, i;
	uint8_t csum;

	FILE *outfile, *infile;

	progname = basename(argv[0]);

	while ( 1 ) {
		int c;

		c = getopt(argc, argv, "B:i:o:v:r:H:h");
		if (c == -1)
			break;

		switch (c) {
		case 'B':
			board_id = optarg;
			break;
		case 'i':
			ifname = optarg;
			break;
		case 'o':
			ofname = optarg;
			break;
		case 'v':
			version = optarg;
			break;
		case 'r':
			region = optarg;
			break;
		case 'H':
			hd_id = optarg;
			break;
		case 'h':
			usage(EXIT_SUCCESS);
			break;
		default:
			usage(EXIT_FAILURE);
			break;
		}
	}

	if (board_id == NULL) {
		ERR("no board specified");
		goto err;
	}

	if (ifname == NULL) {
		ERR("no input file specified");
		goto err;
end(info->mtd) == 0)
+ info->mtd->resume(info->mtd);
+}
+#else
+#define ar91xx_flash_suspend NULL
+#define ar91xx_flash_resume NULL
+#define ar91xx_flash_shutdown NULL
+#endif
+
+static struct platform_driver ar91xx_flash_driver = {
+ .probe = ar91xx_flash_probe,
+ .remove = ar91xx_flash_remove,
+ .suspend = ar91xx_flash_suspend,
+ .resume = ar91xx_flash_resume,
+ .shutdown = ar91xx_flash_shutdown,
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init ar91xx_flash_init(void)
+{
+ return platform_driver_register(&ar91xx_flash_driver);
+}
+
+static void __exit ar91xx_flash_exit(void)
+{
+ platform_driver_unregister(&ar91xx_flash_driver);
+}
+
+module_init(ar91xx_flash_init);
+module_exit(ar91xx_flash_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
+MODULE_DESCRIPTION("Parallel flash driver for the Atheros AR91xx SoC");
+MODULE_ALIAS("platform:" DRV_NAME);
@@ -0,0 +1,26 @@
+--- a/drivers/mtd/maps/Kconfig
++++ b/drivers/mtd/maps/Kconfig
+@@ -257,6 +257,13 @@ config MTD_ALCHEMY
+ help
+ Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
+
++config MTD_AR91XX_FLASH
++ tristate "Atheros AR91xx parallel flash support"
++ depends on ATHEROS_AR71XX
++ select MTD_COMPLEX_MAPPINGS
++ help
++ Parallel flash driver for the Atheros AR91xx based boards.
++
+ config MTD_DILNETPC
+ tristate "CFI Flash device mapped on DIL/Net PC"
+ depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
+--- a/drivers/mtd/maps/Makefile
++++ b/drivers/mtd/maps/Makefile
+@@ -42,6 +42,7 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.
+ obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
+ obj-$(CONFIG_MTD_PCI) += pci.o
+ obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o
++obj-$(CONFIG_MTD_AR91XX_FLASH) += ar91xx_flash.o
+ obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
+ obj-$(CONFIG_MTD_EDB7312) += edb7312.o
+ obj-$(CONFIG_MTD_IMPA7) += impa7.o
diff --git a/target/linux/ar71xx/patches-2.6.29/007-ar91xx_flash_driver.patch b/target/linux/ar71xx/patches-2.6.29/007-ar91xx_flash_driver.patch
new file mode 100644
index 0000000000..943af6e42f
--- /dev/null
+++ b/target/linux/ar71xx/patches-2.6.29/007-ar91xx_flash_driver.patch
@@ -0,0 +1,26 @@
+--- a/drivers/mtd/maps/Kconfig
++++ b/drivers/mtd/maps/Kconfig
+@@ -268,6 +268,13 @@ config MTD_ALCHEMY
+ help
+ Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
+
++config MTD_AR91XX_FLASH
++ tristate "Atheros AR91xx parallel flash support"
++ depends on ATHEROS_AR71XX
++ select MTD_COMPLEX_MAPPINGS
++ help
++ Parallel flash driver for the Atheros AR91xx based boards.
++
+ config MTD_DILNETPC
+ tristate "CFI Flash device mapped on DIL/Net PC"
+ depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
+--- a/drivers/mtd/maps/Makefile
++++ b/drivers/mtd/maps/Makefile
+@@ -42,6 +42,7 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.
+ obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
+ obj-$(CONFIG_MTD_PCI) += pci.o
+ obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o
++obj-$(CONFIG_MTD_AR91XX_FLASH) += ar91xx_flash.o
+ obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
+ obj-$(CONFIG_MTD_EDB7312) += edb7312.o
+ obj-$(CONFIG_MTD_IMPA7) += impa7.o
diff --git a/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch b/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch
new file mode 100644
index 0000000000..943af6e42f
--- /dev/null
+++ b/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch
@@ -0,0 +1,26 @@
+--- a/drivers/mtd/maps/Kconfig
++++ b/drivers/mtd/maps/Kconfig
+@@ -268,6 +268,13 @@ config MTD_ALCHEMY
+ help
+ Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
+
++config MTD_AR91XX_FLASH
++ tristate "Atheros AR91xx parallel flash support"
++ depends on ATHEROS_AR71XX
++ select MTD_COMPLEX_MAPPINGS
++ help
++ Parallel flash driver for the Atheros AR91xx based boards.
++
+ config MTD_DILNETPC
+ tristate "CFI Flash device mapped on DIL/Net PC"
+ depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
+--- a/drivers/mtd/maps/Makefile
++++ b/drivers/mtd/maps/Makefile
+@@ -42,6 +42,7 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.
+ obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
+ obj-$(CONFIG_MTD_PCI) += pci.o
+ obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o
++obj-$(CONFIG_MTD_AR91XX_FLASH) += ar91xx_flash.o
+ obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
+ obj-$(CONFIG_MTD_EDB7312) += edb7312.o
+ obj-$(CONFIG_MTD_IMPA7) += impa7.o