aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Dureghello <angelo@sysam.it>2017-10-12 18:42:51 -0400
committerGreg Ungerer <gerg@linux-m68k.org>2017-11-06 22:27:38 -0500
commitc8b61d508986b7e77bab11f8252b67e6e2b9a7cc (patch)
treeb7f289c6c2d05a37bee8779c381ff4bf6c69dc9f
parent08fe92e2052c79e79d0570902f64bf991d6dd563 (diff)
m68k: add Sysam stmark2 open board support
Add support for Sysam stmark2 board, an open hardware embedded Linux board, see http://sysam.it/cff_stmark2.html for any info. Signed-off-by: Angelo Dureghello <angelo@sysam.it> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
-rw-r--r--arch/m68k/Kconfig.machine6
-rw-r--r--arch/m68k/coldfire/Makefile3
-rw-r--r--arch/m68k/coldfire/stmark2.c119
-rw-r--r--arch/m68k/configs/stmark2_defconfig92
4 files changed, 219 insertions, 1 deletions
diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 5cd57b4d3615..64a641467736 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -266,6 +266,12 @@ config AMCORE
266 help 266 help
267 Support for the Sysam AMCORE open-hardware generic board. 267 Support for the Sysam AMCORE open-hardware generic board.
268 268
269config STMARK2
270 bool "Sysam stmark2 board support"
271 depends on M5441x
272 help
273 Support for the Sysam stmark2 open-hardware generic board.
274
269config FIREBEE 275config FIREBEE
270 bool "FireBee board support" 276 bool "FireBee board support"
271 depends on M547x 277 depends on M547x
diff --git a/arch/m68k/coldfire/Makefile b/arch/m68k/coldfire/Makefile
index f8cef9681416..573eabca1a3a 100644
--- a/arch/m68k/coldfire/Makefile
+++ b/arch/m68k/coldfire/Makefile
@@ -35,7 +35,8 @@ obj-$(CONFIG_NETtel) += nettel.o
35obj-$(CONFIG_CLEOPATRA) += nettel.o 35obj-$(CONFIG_CLEOPATRA) += nettel.o
36obj-$(CONFIG_FIREBEE) += firebee.o 36obj-$(CONFIG_FIREBEE) += firebee.o
37obj-$(CONFIG_MCF8390) += mcf8390.o 37obj-$(CONFIG_MCF8390) += mcf8390.o
38obj-$(CONFIG_AMCORE) += amcore.o 38obj-$(CONFIG_AMCORE) += amcore.o
39obj-$(CONFIG_STMARK2) += stmark2.o
39 40
40obj-$(CONFIG_PCI) += pci.o 41obj-$(CONFIG_PCI) += pci.o
41 42
diff --git a/arch/m68k/coldfire/stmark2.c b/arch/m68k/coldfire/stmark2.c
new file mode 100644
index 000000000000..a8d2b3d172f9
--- /dev/null
+++ b/arch/m68k/coldfire/stmark2.c
@@ -0,0 +1,119 @@
1/*
2 * stmark2.c -- Support for Sysam AMCORE open board
3 *
4 * (C) Copyright 2017, Angelo Dureghello <angelo@sysam.it>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/mtd/partitions.h>
13#include <linux/spi/spi.h>
14#include <linux/spi/spi-fsl-dspi.h>
15#include <linux/spi/flash.h>
16#include <asm/mcfsim.h>
17
18/*
19 * Partitioning of parallel NOR flash (39VF3201B)
20 */
21static struct mtd_partition stmark2_partitions[] = {
22 {
23 .name = "U-Boot (1024K)",
24 .size = 0x100000,
25 .offset = 0x0
26 }, {
27 .name = "Kernel+initramfs (7168K)",
28 .size = 0x700000,
29 .offset = MTDPART_OFS_APPEND
30 }, {
31 .name = "Flash Free Space (8192K)",
32 .size = MTDPART_SIZ_FULL,
33 .offset = MTDPART_OFS_APPEND
34 }
35};
36
37static struct flash_platform_data stmark2_spi_flash_data = {
38 .name = "is25lp128",
39 .parts = stmark2_partitions,
40 .nr_parts = ARRAY_SIZE(stmark2_partitions),
41 .type = "is25lp128",
42};
43
44static struct spi_board_info stmark2_board_info[] __initdata = {
45 {
46 .modalias = "m25p80",
47 .max_speed_hz = 5000000,
48 .bus_num = 0,
49 .chip_select = 1,
50 .platform_data = &stmark2_spi_flash_data,
51 .mode = SPI_MODE_3,
52 }
53};
54
55/* SPI controller data, SPI (0) */
56static struct fsl_dspi_platform_data dspi_spi0_info = {
57 .cs_num = 4,
58 .bus_num = 0,
59 .sck_cs_delay = 100,
60 .cs_sck_delay = 100,
61};
62
63static struct resource dspi_spi0_resource[] = {
64 [0] = {
65 .start = MCFDSPI_BASE0,
66 .end = MCFDSPI_BASE0 + 0xFF,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = 12,
71 .end = 13,
72 .flags = IORESOURCE_DMA,
73 },
74 [2] = {
75 .start = MCF_IRQ_DSPI0,
76 .end = MCF_IRQ_DSPI0,
77 .flags = IORESOURCE_IRQ,
78 },
79};
80
81/* SPI controller, id = bus number */
82static struct platform_device dspi_spi0_device = {
83 .name = "fsl-dspi",
84 .id = 0,
85 .num_resources = ARRAY_SIZE(dspi_spi0_resource),
86 .resource = dspi_spi0_resource,
87 .dev = {
88 .platform_data = &dspi_spi0_info,
89 },
90};
91
92static struct platform_device *stmark2_devices[] __initdata = {
93 &dspi_spi0_device,
94};
95
96/*
97 * Note: proper pin-mux setup is mandatory for proper SPI functionality.
98 */
99static int __init init_stmark2(void)
100{
101 /* DSPI0, all pins as DSPI, and using CS1 */
102 __raw_writeb(0x80, MCFGPIO_PAR_DSPIOWL);
103 __raw_writeb(0xfc, MCFGPIO_PAR_DSPIOWH);
104
105 /* Board gpio setup */
106 __raw_writeb(0x00, MCFGPIO_PAR_BE);
107 __raw_writeb(0x00, MCFGPIO_PAR_FBCTL);
108 __raw_writeb(0x00, MCFGPIO_PAR_CS);
109 __raw_writeb(0x00, MCFGPIO_PAR_CANI2C);
110
111 platform_add_devices(stmark2_devices, ARRAY_SIZE(stmark2_devices));
112
113 spi_register_board_info(stmark2_board_info,
114 ARRAY_SIZE(stmark2_board_info));
115
116 return 0;
117}
118
119late_initcall(init_stmark2);
diff --git a/arch/m68k/configs/stmark2_defconfig b/arch/m68k/configs/stmark2_defconfig
new file mode 100644
index 000000000000..55e55dbc2fb6
--- /dev/null
+++ b/arch/m68k/configs/stmark2_defconfig
@@ -0,0 +1,92 @@
1CONFIG_LOCALVERSION="stmark2-001"
2CONFIG_DEFAULT_HOSTNAME="stmark2"
3CONFIG_SYSVIPC=y
4# CONFIG_FHANDLE is not set
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_NAMESPACES=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_INITRAMFS_SOURCE="../uClinux-dist/romfs"
9# CONFIG_RD_BZIP2 is not set
10# CONFIG_RD_LZMA is not set
11# CONFIG_RD_XZ is not set
12# CONFIG_RD_LZO is not set
13# CONFIG_RD_LZ4 is not set
14CONFIG_CC_OPTIMIZE_FOR_SIZE=y
15# CONFIG_AIO is not set
16# CONFIG_ADVISE_SYSCALLS is not set
17# CONFIG_MEMBARRIER is not set
18CONFIG_EMBEDDED=y
19# CONFIG_VM_EVENT_COUNTERS is not set
20# CONFIG_COMPAT_BRK is not set
21# CONFIG_LBDAF is not set
22# CONFIG_BLK_DEV_BSG is not set
23CONFIG_BLK_CMDLINE_PARSER=y
24# CONFIG_MMU is not set
25CONFIG_M5441x=y
26CONFIG_CLOCK_FREQ=240000000
27CONFIG_STMARK2=y
28CONFIG_RAMBASE=0x40000000
29CONFIG_RAMSIZE=0x8000000
30CONFIG_VECTORBASE=0x40000000
31CONFIG_KERNELBASE=0x40001000
32CONFIG_BINFMT_FLAT=y
33CONFIG_BINFMT_MISC=y
34# CONFIG_UEVENT_HELPER is not set
35CONFIG_DEVTMPFS=y
36CONFIG_DEVTMPFS_MOUNT=y
37CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
38# CONFIG_ALLOW_DEV_COREDUMP is not set
39CONFIG_MTD=y
40CONFIG_MTD_CMDLINE_PARTS=y
41CONFIG_MTD_BLOCK=y
42CONFIG_MTD_CFI=y
43CONFIG_MTD_JEDECPROBE=y
44CONFIG_MTD_CFI_ADV_OPTIONS=y
45CONFIG_MTD_CFI_LE_BYTE_SWAP=y
46CONFIG_MTD_CFI_GEOMETRY=y
47# CONFIG_MTD_CFI_I2 is not set
48CONFIG_MTD_CFI_AMDSTD=y
49CONFIG_MTD_CFI_STAA=y
50CONFIG_MTD_ROM=y
51CONFIG_MTD_COMPLEX_MAPPINGS=y
52CONFIG_MTD_PLATRAM=y
53CONFIG_MTD_M25P80=y
54CONFIG_MTD_SPI_NOR=y
55# CONFIG_INPUT_KEYBOARD is not set
56# CONFIG_INPUT_MOUSE is not set
57CONFIG_SERIO_LIBPS2=y
58# CONFIG_UNIX98_PTYS is not set
59# CONFIG_DEVMEM is not set
60CONFIG_SERIAL_MCF=y
61CONFIG_SERIAL_MCF_BAUDRATE=115200
62CONFIG_SERIAL_MCF_CONSOLE=y
63# CONFIG_HW_RANDOM is not set
64CONFIG_SPI=y
65CONFIG_SPI_DEBUG=y
66CONFIG_SPI_FSL_DSPI=y
67CONFIG_DEBUG_GPIO=y
68CONFIG_GPIO_SYSFS=y
69CONFIG_GPIO_GENERIC_PLATFORM=y
70# CONFIG_HWMON is not set
71# CONFIG_RC_CORE is not set
72# CONFIG_HID is not set
73# CONFIG_USB_SUPPORT is not set
74# CONFIG_FILE_LOCKING is not set
75# CONFIG_DNOTIFY is not set
76# CONFIG_INOTIFY_USER is not set
77CONFIG_FSCACHE=y
78# CONFIG_PROC_SYSCTL is not set
79CONFIG_PRINTK_TIME=y
80# CONFIG_ENABLE_WARN_DEPRECATED is not set
81# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
82CONFIG_SLUB_DEBUG_ON=y
83CONFIG_PANIC_ON_OOPS=y
84# CONFIG_SCHED_DEBUG is not set
85# CONFIG_DEBUG_BUGVERBOSE is not set
86CONFIG_BOOTPARAM=y
87CONFIG_BOOTPARAM_STRING="console=ttyS0,115200 root=/dev/ram0 rw rootfstype=ramfs rdinit=/bin/init devtmpfs.mount=1"
88CONFIG_CRYPTO=y
89# CONFIG_CRYPTO_ECHAINIV is not set
90CONFIG_CRYPTO_ANSI_CPRNG=y
91# CONFIG_CRYPTO_HW is not set
92CONFIG_CRC16=y