|
@@ -0,0 +1,130 @@
|
|
|
+/*
|
|
|
+ * linux/arch/arm/mach-sa1100/assabet.c
|
|
|
+ *
|
|
|
+ * Author: Nicolas Pitre
|
|
|
+ *
|
|
|
+ * This file contains all Assabet-specific tweaks.
|
|
|
+ *
|
|
|
+ * 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 <linux/init.h>
|
|
|
+#include <linux/kernel.h>
|
|
|
+#include <linux/module.h>
|
|
|
+#include <linux/errno.h>
|
|
|
+#include <linux/ioport.h>
|
|
|
+#include <linux/platform_data/sa11x0-serial.h>
|
|
|
+#include <linux/serial_core.h>
|
|
|
+#include <linux/mfd/ucb1x00.h>
|
|
|
+#include <linux/mtd/mtd.h>
|
|
|
+#include <linux/mtd/partitions.h>
|
|
|
+#include <linux/delay.h>
|
|
|
+#include <linux/mm.h>
|
|
|
+#include <linux/leds.h>
|
|
|
+#include <linux/slab.h>
|
|
|
+
|
|
|
+#include <video/sa1100fb.h>
|
|
|
+
|
|
|
+#include <mach/hardware.h>
|
|
|
+#include <asm/mach-types.h>
|
|
|
+#include <asm/setup.h>
|
|
|
+#include <asm/page.h>
|
|
|
+#include <asm/pgtable-hwdef.h>
|
|
|
+#include <asm/pgtable.h>
|
|
|
+#include <asm/tlbflush.h>
|
|
|
+
|
|
|
+#include <asm/mach/arch.h>
|
|
|
+#include <asm/mach/flash.h>
|
|
|
+#include <asm/mach/irda.h>
|
|
|
+#include <asm/mach/map.h>
|
|
|
+#include <mach/assabet.h>
|
|
|
+#include <linux/platform_data/mfd-mcp-sa11x0.h>
|
|
|
+#include <mach/irqs.h>
|
|
|
+
|
|
|
+#include "generic.h"
|
|
|
+
|
|
|
+#define ASSABET_BCR_DB1110 \
|
|
|
+ (ASSABET_BCR_SPK_OFF | \
|
|
|
+ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
|
|
|
+ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
|
|
|
+ ASSABET_BCR_IRDA_MD0)
|
|
|
+
|
|
|
+#define ASSABET_BCR_DB1111 \
|
|
|
+ (ASSABET_BCR_SPK_OFF | \
|
|
|
+ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
|
|
|
+ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
|
|
|
+ ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
|
|
|
+ ASSABET_BCR_IRDA_MD0 | ASSABET_BCR_CF_RST)
|
|
|
+
|
|
|
+unsigned long SCR_value = ASSABET_SCR_INIT;
|
|
|
+EXPORT_SYMBOL(SCR_value);
|
|
|
+
|
|
|
+static unsigned long BCR_value = ASSABET_BCR_DB1110;
|
|
|
+
|
|
|
+void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
|
|
|
+{
|
|
|
+ unsigned long flags;
|
|
|
+
|
|
|
+ local_irq_save(flags);
|
|
|
+ BCR_value = (BCR_value & ~mask) | val;
|
|
|
+ ASSABET_BCR = BCR_value;
|
|
|
+ local_irq_restore(flags);
|
|
|
+}
|
|
|
+
|
|
|
+EXPORT_SYMBOL(ASSABET_BCR_frob);
|
|
|
+
|
|
|
+static void assabet_ucb1x00_reset(enum ucb1x00_reset state)
|
|
|
+{
|
|
|
+ if (state == UCB_RST_PROBE)
|
|
|
+ ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ * Assabet flash support code.
|
|
|
+ */
|
|
|
+
|
|
|
+#ifdef ASSABET_REV_4
|
|
|
+/*
|
|
|
+ * Phase 4 Assabet has two 28F160B3 flash parts in bank 0:
|
|
|
+ */
|
|
|
+static struct mtd_partition assabet_partitions[] = {
|
|
|
+ {
|
|
|
+ .name = "bootloader",
|
|
|
+ .size = 0x00020000,
|
|
|
+ .offset = 0,
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
+ }, {
|
|
|
+ .name = "bootloader params",
|
|
|
+ .size = 0x00020000,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
+ }, {
|
|
|
+ .name = "jffs",
|
|
|
+ .size = MTDPART_SIZ_FULL,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }
|
|
|
+};
|
|
|
+#else
|
|
|
+/*
|
|
|
+ * Phase 5 Assabet has two 28F128J3A flash parts in bank 0:
|
|
|
+ */
|
|
|
+static struct mtd_partition assabet_partitions[] = {
|
|
|
+ {
|
|
|
+ .name = "bootloader",
|
|
|
+ .size = 0x00040000,
|
|
|
+ .offset = 0,
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
+ }, {
|
|
|
+ .name = "bootloader params",
|
|
|
+ .size = 0x00040000,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
+ }, {
|
|
|
+ .name = "jffs",
|
|
|
+ .size = MTDPART_SIZ_FULL,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }
|
|
|
+};
|
|
|
+#endif
|