diff options
author | Angelo Dureghello <angelo@sysam.it> | 2017-10-12 18:42:51 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@linux-m68k.org> | 2017-11-06 22:27:38 -0500 |
commit | c8b61d508986b7e77bab11f8252b67e6e2b9a7cc (patch) | |
tree | b7f289c6c2d05a37bee8779c381ff4bf6c69dc9f | |
parent | 08fe92e2052c79e79d0570902f64bf991d6dd563 (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.machine | 6 | ||||
-rw-r--r-- | arch/m68k/coldfire/Makefile | 3 | ||||
-rw-r--r-- | arch/m68k/coldfire/stmark2.c | 119 | ||||
-rw-r--r-- | arch/m68k/configs/stmark2_defconfig | 92 |
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 | ||
269 | config STMARK2 | ||
270 | bool "Sysam stmark2 board support" | ||
271 | depends on M5441x | ||
272 | help | ||
273 | Support for the Sysam stmark2 open-hardware generic board. | ||
274 | |||
269 | config FIREBEE | 275 | config 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 | |||
35 | obj-$(CONFIG_CLEOPATRA) += nettel.o | 35 | obj-$(CONFIG_CLEOPATRA) += nettel.o |
36 | obj-$(CONFIG_FIREBEE) += firebee.o | 36 | obj-$(CONFIG_FIREBEE) += firebee.o |
37 | obj-$(CONFIG_MCF8390) += mcf8390.o | 37 | obj-$(CONFIG_MCF8390) += mcf8390.o |
38 | obj-$(CONFIG_AMCORE) += amcore.o | 38 | obj-$(CONFIG_AMCORE) += amcore.o |
39 | obj-$(CONFIG_STMARK2) += stmark2.o | ||
39 | 40 | ||
40 | obj-$(CONFIG_PCI) += pci.o | 41 | obj-$(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 | */ | ||
21 | static 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 | |||
37 | static 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 | |||
44 | static 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) */ | ||
56 | static 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 | |||
63 | static 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 */ | ||
82 | static 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 | |||
92 | static 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 | */ | ||
99 | static 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 | |||
119 | late_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 @@ | |||
1 | CONFIG_LOCALVERSION="stmark2-001" | ||
2 | CONFIG_DEFAULT_HOSTNAME="stmark2" | ||
3 | CONFIG_SYSVIPC=y | ||
4 | # CONFIG_FHANDLE is not set | ||
5 | CONFIG_LOG_BUF_SHIFT=14 | ||
6 | CONFIG_NAMESPACES=y | ||
7 | CONFIG_BLK_DEV_INITRD=y | ||
8 | CONFIG_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 | ||
14 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
15 | # CONFIG_AIO is not set | ||
16 | # CONFIG_ADVISE_SYSCALLS is not set | ||
17 | # CONFIG_MEMBARRIER is not set | ||
18 | CONFIG_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 | ||
23 | CONFIG_BLK_CMDLINE_PARSER=y | ||
24 | # CONFIG_MMU is not set | ||
25 | CONFIG_M5441x=y | ||
26 | CONFIG_CLOCK_FREQ=240000000 | ||
27 | CONFIG_STMARK2=y | ||
28 | CONFIG_RAMBASE=0x40000000 | ||
29 | CONFIG_RAMSIZE=0x8000000 | ||
30 | CONFIG_VECTORBASE=0x40000000 | ||
31 | CONFIG_KERNELBASE=0x40001000 | ||
32 | CONFIG_BINFMT_FLAT=y | ||
33 | CONFIG_BINFMT_MISC=y | ||
34 | # CONFIG_UEVENT_HELPER is not set | ||
35 | CONFIG_DEVTMPFS=y | ||
36 | CONFIG_DEVTMPFS_MOUNT=y | ||
37 | CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y | ||
38 | # CONFIG_ALLOW_DEV_COREDUMP is not set | ||
39 | CONFIG_MTD=y | ||
40 | CONFIG_MTD_CMDLINE_PARTS=y | ||
41 | CONFIG_MTD_BLOCK=y | ||
42 | CONFIG_MTD_CFI=y | ||
43 | CONFIG_MTD_JEDECPROBE=y | ||
44 | CONFIG_MTD_CFI_ADV_OPTIONS=y | ||
45 | CONFIG_MTD_CFI_LE_BYTE_SWAP=y | ||
46 | CONFIG_MTD_CFI_GEOMETRY=y | ||
47 | # CONFIG_MTD_CFI_I2 is not set | ||
48 | CONFIG_MTD_CFI_AMDSTD=y | ||
49 | CONFIG_MTD_CFI_STAA=y | ||
50 | CONFIG_MTD_ROM=y | ||
51 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
52 | CONFIG_MTD_PLATRAM=y | ||
53 | CONFIG_MTD_M25P80=y | ||
54 | CONFIG_MTD_SPI_NOR=y | ||
55 | # CONFIG_INPUT_KEYBOARD is not set | ||
56 | # CONFIG_INPUT_MOUSE is not set | ||
57 | CONFIG_SERIO_LIBPS2=y | ||
58 | # CONFIG_UNIX98_PTYS is not set | ||
59 | # CONFIG_DEVMEM is not set | ||
60 | CONFIG_SERIAL_MCF=y | ||
61 | CONFIG_SERIAL_MCF_BAUDRATE=115200 | ||
62 | CONFIG_SERIAL_MCF_CONSOLE=y | ||
63 | # CONFIG_HW_RANDOM is not set | ||
64 | CONFIG_SPI=y | ||
65 | CONFIG_SPI_DEBUG=y | ||
66 | CONFIG_SPI_FSL_DSPI=y | ||
67 | CONFIG_DEBUG_GPIO=y | ||
68 | CONFIG_GPIO_SYSFS=y | ||
69 | CONFIG_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 | ||
77 | CONFIG_FSCACHE=y | ||
78 | # CONFIG_PROC_SYSCTL is not set | ||
79 | CONFIG_PRINTK_TIME=y | ||
80 | # CONFIG_ENABLE_WARN_DEPRECATED is not set | ||
81 | # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set | ||
82 | CONFIG_SLUB_DEBUG_ON=y | ||
83 | CONFIG_PANIC_ON_OOPS=y | ||
84 | # CONFIG_SCHED_DEBUG is not set | ||
85 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
86 | CONFIG_BOOTPARAM=y | ||
87 | CONFIG_BOOTPARAM_STRING="console=ttyS0,115200 root=/dev/ram0 rw rootfstype=ramfs rdinit=/bin/init devtmpfs.mount=1" | ||
88 | CONFIG_CRYPTO=y | ||
89 | # CONFIG_CRYPTO_ECHAINIV is not set | ||
90 | CONFIG_CRYPTO_ANSI_CPRNG=y | ||
91 | # CONFIG_CRYPTO_HW is not set | ||
92 | CONFIG_CRC16=y | ||