-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merisc is the family name for a range of AVR32-based boards. The boards are designed to be used in a man-machine interfacing environment, utilizing a touch-based graphical user interface. They host a vast range of I/O peripherals as well as a large SDRAM & Flash memory bank. For more information see: http://www.martinsson.se/merisc Signed-off-by: Jonas Larsson <jonas.larsson@martinsson.se> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
- Loading branch information
Jonas Larsson
authored and
Haavard Skinnemoen
committed
Mar 27, 2009
1 parent
9477ab2
commit a16fffd
Showing
10 changed files
with
1,834 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Merisc customization | ||
|
||
if BOARD_MERISC | ||
|
||
endif # BOARD_MERISC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
obj-y += setup.o flash.o display.o merisc_sysfs.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Display setup code for the Merisc board | ||
* | ||
* Copyright (C) 2008 Martinsson Elektronik AB | ||
* | ||
* 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/platform_device.h> | ||
#include <linux/fb.h> | ||
#include <video/atmel_lcdc.h> | ||
#include <asm/setup.h> | ||
#include <mach/board.h> | ||
#include "merisc.h" | ||
|
||
static struct fb_videomode merisc_fb_videomode[] = { | ||
{ | ||
.refresh = 44, | ||
.xres = 640, | ||
.yres = 480, | ||
.left_margin = 96, | ||
.right_margin = 96, | ||
.upper_margin = 34, | ||
.lower_margin = 8, | ||
.hsync_len = 64, | ||
.vsync_len = 64, | ||
.name = "640x480 @ 44", | ||
.pixclock = KHZ2PICOS(25180), | ||
.sync = 0, | ||
.vmode = FB_VMODE_NONINTERLACED, | ||
}, | ||
}; | ||
|
||
static struct fb_monspecs merisc_fb_monspecs = { | ||
.manufacturer = "Kyo", | ||
.monitor = "TCG075VG2AD", | ||
.modedb = merisc_fb_videomode, | ||
.modedb_len = ARRAY_SIZE(merisc_fb_videomode), | ||
.hfmin = 30000, | ||
.hfmax = 33333, | ||
.vfmin = 60, | ||
.vfmax = 90, | ||
.dclkmax = 30000000, | ||
}; | ||
|
||
struct atmel_lcdfb_info merisc_lcdc_data = { | ||
.default_bpp = 24, | ||
.default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, | ||
.default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT | ||
| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE | ||
| ATMEL_LCDC_MEMOR_BIG), | ||
.default_monspecs = &merisc_fb_monspecs, | ||
.guard_time = 2, | ||
}; | ||
|
||
static int __init merisc_display_init(void) | ||
{ | ||
at32_add_device_lcdc(0, &merisc_lcdc_data, fbmem_start, | ||
fbmem_size, 0); | ||
|
||
return 0; | ||
} | ||
device_initcall(merisc_display_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/* | ||
* Merisc board-specific flash initialization | ||
* | ||
* Copyright (C) 2008 Martinsson Elektronik AB | ||
* | ||
* 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/platform_device.h> | ||
#include <linux/mtd/mtd.h> | ||
#include <linux/mtd/partitions.h> | ||
#include <linux/mtd/physmap.h> | ||
#include <mach/smc.h> | ||
|
||
/* Will be translated to units of 14.3 ns, rounded up */ | ||
static struct smc_timing flash_timing __initdata = { | ||
.ncs_read_setup = 1 * 14, | ||
.nrd_setup = 5 * 14, | ||
.ncs_write_setup = 1 * 14, | ||
.nwe_setup = 2 * 14, | ||
|
||
.ncs_read_pulse = 12 * 14, | ||
.nrd_pulse = 7 * 14, | ||
.ncs_write_pulse = 8 * 14, | ||
.nwe_pulse = 4 * 14, | ||
|
||
.read_cycle = 14 * 14, | ||
.write_cycle = 10 * 14, | ||
}; | ||
|
||
static struct smc_config flash_config __initdata = { | ||
.bus_width = 2, | ||
.nrd_controlled = 1, | ||
.nwe_controlled = 1, | ||
.byte_write = 1, | ||
.tdf_cycles = 3, | ||
}; | ||
|
||
static struct mtd_partition flash_0_parts[] = { | ||
{ | ||
.name = "boot", | ||
.offset = 0x00000000, | ||
.size = 0x00060000, | ||
.mask_flags = 0, | ||
}, | ||
{ | ||
.name = "kernel", | ||
.offset = 0x00060000, | ||
.size = 0x00200000, | ||
.mask_flags = 0, | ||
}, | ||
{ | ||
.name = "root", | ||
.offset = 0x00260000, | ||
.size = MTDPART_SIZ_FULL, | ||
.mask_flags = 0, | ||
}, | ||
}; | ||
|
||
static struct mtd_partition flash_1_parts[] = { | ||
{ | ||
.name = "2ndflash", | ||
.offset = 0x00000000, | ||
.size = MTDPART_SIZ_FULL, | ||
.mask_flags = 0, | ||
}, | ||
}; | ||
|
||
static struct physmap_flash_data flash_data[] = { | ||
{ | ||
.width = 2, | ||
.nr_parts = ARRAY_SIZE(flash_0_parts), | ||
.parts = flash_0_parts, | ||
}, | ||
{ | ||
.width = 2, | ||
.nr_parts = ARRAY_SIZE(flash_1_parts), | ||
.parts = flash_1_parts, | ||
} | ||
}; | ||
|
||
static struct resource flash_resource[] = { | ||
{ | ||
.start = 0x00000000, | ||
.end = 0x03ffffff, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
{ | ||
.start = 0x04000000, | ||
.end = 0x07ffffff, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
}; | ||
|
||
static struct platform_device flash_device[] = { | ||
{ | ||
.name = "physmap-flash", | ||
.id = 0, | ||
.resource = &flash_resource[0], | ||
.num_resources = 1, | ||
.dev = { | ||
.platform_data = &flash_data[0], | ||
}, | ||
}, | ||
{ | ||
.name = "physmap-flash", | ||
.id = 1, | ||
.resource = &flash_resource[1], | ||
.num_resources = 1, | ||
.dev = { | ||
.platform_data = &flash_data[1], | ||
}, | ||
}, | ||
}; | ||
|
||
static int __init merisc_flash_init(void) | ||
{ | ||
int ret; | ||
smc_set_timing(&flash_config, &flash_timing); | ||
|
||
ret = smc_set_configuration(0, &flash_config); | ||
if (ret < 0) { | ||
printk(KERN_ERR "Merisc: failed to set NOR flash timing #0\n"); | ||
return ret; | ||
} | ||
|
||
ret = smc_set_configuration(4, &flash_config); | ||
if (ret < 0) { | ||
printk(KERN_ERR "Merisc: failed to set NOR flash timing #1\n"); | ||
return ret; | ||
} | ||
|
||
platform_device_register(&flash_device[0]); | ||
platform_device_register(&flash_device[1]); | ||
return 0; | ||
} | ||
device_initcall(merisc_flash_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Merisc exports | ||
* | ||
* Copyright (C) 2008 Martinsson Elektronik AB | ||
* | ||
* 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. | ||
*/ | ||
#ifndef __ARCH_AVR32_BOARDS_MERISC_MERISC_H | ||
#define __ARCH_AVR32_BOARDS_MERISC_MERISC_H | ||
|
||
const char *merisc_revision(void); | ||
const char *merisc_model(void); | ||
|
||
extern struct class merisc_class; | ||
|
||
#endif /* __ARCH_AVR32_BOARDS_MERISC_MERISC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Merisc sysfs exports | ||
* | ||
* Copyright (C) 2008 Martinsson Elektronik AB | ||
* | ||
* 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/module.h> | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/list.h> | ||
#include <linux/spinlock.h> | ||
#include <linux/device.h> | ||
#include <linux/sysdev.h> | ||
#include <linux/timer.h> | ||
#include <linux/err.h> | ||
#include <linux/ctype.h> | ||
#include "merisc.h" | ||
|
||
static ssize_t merisc_model_show(struct class *class, char *buf) | ||
{ | ||
ssize_t ret = 0; | ||
|
||
sprintf(buf, "%s\n", merisc_model()); | ||
ret = strlen(buf) + 1; | ||
|
||
return ret; | ||
} | ||
|
||
static ssize_t merisc_revision_show(struct class *class, char *buf) | ||
{ | ||
ssize_t ret = 0; | ||
|
||
sprintf(buf, "%s\n", merisc_revision()); | ||
ret = strlen(buf) + 1; | ||
|
||
return ret; | ||
} | ||
|
||
static struct class_attribute merisc_class_attrs[] = { | ||
__ATTR(model, S_IRUGO, merisc_model_show, NULL), | ||
__ATTR(revision, S_IRUGO, merisc_revision_show, NULL), | ||
__ATTR_NULL, | ||
}; | ||
|
||
struct class merisc_class = { | ||
.name = "merisc", | ||
.owner = THIS_MODULE, | ||
.class_attrs = merisc_class_attrs, | ||
}; | ||
|
||
static int __init merisc_sysfs_init(void) | ||
{ | ||
int status; | ||
|
||
status = class_register(&merisc_class); | ||
if (status < 0) | ||
return status; | ||
|
||
return 0; | ||
} | ||
|
||
postcore_initcall(merisc_sysfs_init); |
Oops, something went wrong.