Skip to content

Commit 2101dd6

Browse files
committed
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Pull m68k updates from Greg Ungerer: "The bulk of the changes are to support the ColdFire 5441x SoC family with their MMU enabled. The parts have been supported for a long time now, but only in no-MMU mode. Angelo Dureghello has a new board with a 5441x and we have ironed out the last problems with MMU enabled on it. So there is also some changes to properly support that board too. Also a fix for a link problem when selecting the traditional 68k beep device in no-MMU configurations" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: add Sysam stmark2 open board support m68k: coldfire: add dspi0 module support m68k: pull mach_beep in setup.c m68k: allow ColdFire m5441x parts to run with MMU enabled m68k: fix ColdFire node shift size calculation m68k: move coldfire MMU initialization code
2 parents b33e3cc + c8b61d5 commit 2101dd6

13 files changed

Lines changed: 238 additions & 14 deletions

File tree

‎arch/m68k/Kconfig.cpu‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ config M548x
284284

285285
config M5441x
286286
bool "MCF5441x"
287-
depends on !MMU
287+
select MMU_COLDFIRE if MMU
288288
select GENERIC_CLOCKEVENTS
289289
select HAVE_CACHE_CB
290290
help

‎arch/m68k/Kconfig.machine‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ config AMCORE
266266
help
267267
Support for the Sysam AMCORE open-hardware generic board.
268268

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+
269275
config FIREBEE
270276
bool "FireBee board support"
271277
depends on M547x

‎arch/m68k/coldfire/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ obj-$(CONFIG_NETtel) += nettel.o
3535
obj-$(CONFIG_CLEOPATRA) += nettel.o
3636
obj-$(CONFIG_FIREBEE) += firebee.o
3737
obj-$(CONFIG_MCF8390) += mcf8390.o
38-
obj-$(CONFIG_AMCORE) += amcore.o
38+
obj-$(CONFIG_AMCORE) += amcore.o
39+
obj-$(CONFIG_STMARK2) += stmark2.o
3940

4041
obj-$(CONFIG_PCI) += pci.o
4142

‎arch/m68k/coldfire/m5441x.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ DEFINE_CLK(0, "intc.0", 18, MCF_CLK);
2727
DEFINE_CLK(0, "intc.1", 19, MCF_CLK);
2828
DEFINE_CLK(0, "intc.2", 20, MCF_CLK);
2929
DEFINE_CLK(0, "imx1-i2c.0", 22, MCF_CLK);
30-
DEFINE_CLK(0, "mcfdspi.0", 23, MCF_CLK);
30+
DEFINE_CLK(0, "fsl-dspi.0", 23, MCF_CLK);
3131
DEFINE_CLK(0, "mcfuart.0", 24, MCF_BUSCLK);
3232
DEFINE_CLK(0, "mcfuart.1", 25, MCF_BUSCLK);
3333
DEFINE_CLK(0, "mcfuart.2", 26, MCF_BUSCLK);
@@ -140,6 +140,7 @@ static struct clk * const enable_clks[] __initconst = {
140140
&__clk_0_18, /* intc0 */
141141
&__clk_0_19, /* intc0 */
142142
&__clk_0_20, /* intc0 */
143+
&__clk_0_23, /* dspi.0 */
143144
&__clk_0_24, /* uart0 */
144145
&__clk_0_25, /* uart1 */
145146
&__clk_0_26, /* uart2 */

‎arch/m68k/coldfire/m54xx.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ static void mcf54xx_reset(void)
9696

9797
void __init config_BSP(char *commandp, int size)
9898
{
99-
#ifdef CONFIG_MMU
100-
cf_bootmem_alloc();
101-
mmu_context_init();
102-
#endif
10399
mach_reset = mcf54xx_reset;
104100
mach_sched_init = hw_timer_init;
105101
m54xx_uarts_init();

‎arch/m68k/coldfire/stmark2.c‎

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

‎arch/m68k/include/asm/m5441xsim.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,10 @@
278278
#define MCFGPIO_IRQ_VECBASE (MCFINT_VECBASE - MCFGPIO_IRQ_MIN)
279279
#define MCFGPIO_PIN_MAX 87
280280

281+
/*
282+
* DSPI module.
283+
*/
284+
#define MCFDSPI_BASE0 0xfc05c000
285+
#define MCF_IRQ_DSPI0 (MCFINT0_VECBASE + MCFINT0_DSPI0)
286+
281287
#endif /* m5441xsim_h */

‎arch/m68k/include/asm/mcfmmu.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ static inline void mmu_write(u32 a, u32 v)
106106
}
107107

108108
void cf_bootmem_alloc(void);
109+
void cf_mmu_context_init(void);
109110
int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word);
110111

111112
#endif

‎arch/m68k/include/asm/mmu_context.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ static inline void activate_mm(struct mm_struct *active_mm,
9292

9393
#define deactivate_mm(tsk, mm) do { } while (0)
9494

95-
extern void mmu_context_init(void);
9695
#define prepare_arch_switch(next) load_ksp_mmu(next)
9796

9897
static inline void load_ksp_mmu(struct task_struct *task)

0 commit comments

Comments
 (0)