Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+238 -14
+1 -1
arch/m68k/Kconfig.cpu
··· 284 284 285 285 config M5441x 286 286 bool "MCF5441x" 287 - depends on !MMU 287 + select MMU_COLDFIRE if MMU 288 288 select GENERIC_CLOCKEVENTS 289 289 select HAVE_CACHE_CB 290 290 help
+6
arch/m68k/Kconfig.machine
··· 266 266 help 267 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 275 config FIREBEE 270 276 bool "FireBee board support" 271 277 depends on M547x
+2 -1
arch/m68k/coldfire/Makefile
··· 35 35 obj-$(CONFIG_CLEOPATRA) += nettel.o 36 36 obj-$(CONFIG_FIREBEE) += firebee.o 37 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 41 obj-$(CONFIG_PCI) += pci.o 41 42
+2 -1
arch/m68k/coldfire/m5441x.c
··· 27 27 DEFINE_CLK(0, "intc.1", 19, MCF_CLK); 28 28 DEFINE_CLK(0, "intc.2", 20, MCF_CLK); 29 29 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); 31 31 DEFINE_CLK(0, "mcfuart.0", 24, MCF_BUSCLK); 32 32 DEFINE_CLK(0, "mcfuart.1", 25, MCF_BUSCLK); 33 33 DEFINE_CLK(0, "mcfuart.2", 26, MCF_BUSCLK); ··· 140 140 &__clk_0_18, /* intc0 */ 141 141 &__clk_0_19, /* intc0 */ 142 142 &__clk_0_20, /* intc0 */ 143 + &__clk_0_23, /* dspi.0 */ 143 144 &__clk_0_24, /* uart0 */ 144 145 &__clk_0_25, /* uart1 */ 145 146 &__clk_0_26, /* uart2 */
-4
arch/m68k/coldfire/m54xx.c
··· 96 96 97 97 void __init config_BSP(char *commandp, int size) 98 98 { 99 - #ifdef CONFIG_MMU 100 - cf_bootmem_alloc(); 101 - mmu_context_init(); 102 - #endif 103 99 mach_reset = mcf54xx_reset; 104 100 mach_sched_init = hw_timer_init; 105 101 m54xx_uarts_init();
+119
arch/m68k/coldfire/stmark2.c
··· 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);
+92
arch/m68k/configs/stmark2_defconfig
··· 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
+6
arch/m68k/include/asm/m5441xsim.h
··· 278 278 #define MCFGPIO_IRQ_VECBASE (MCFINT_VECBASE - MCFGPIO_IRQ_MIN) 279 279 #define MCFGPIO_PIN_MAX 87 280 280 281 + /* 282 + * DSPI module. 283 + */ 284 + #define MCFDSPI_BASE0 0xfc05c000 285 + #define MCF_IRQ_DSPI0 (MCFINT0_VECBASE + MCFINT0_DSPI0) 286 + 281 287 #endif /* m5441xsim_h */
+1
arch/m68k/include/asm/mcfmmu.h
··· 106 106 } 107 107 108 108 void cf_bootmem_alloc(void); 109 + void cf_mmu_context_init(void); 109 110 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word); 110 111 111 112 #endif
-1
arch/m68k/include/asm/mmu_context.h
··· 92 92 93 93 #define deactivate_mm(tsk, mm) do { } while (0) 94 94 95 - extern void mmu_context_init(void); 96 95 #define prepare_arch_switch(next) load_ksp_mmu(next) 97 96 98 97 static inline void load_ksp_mmu(struct task_struct *task)
+5
arch/m68k/kernel/setup.c
··· 4 4 #else 5 5 #include "setup_no.c" 6 6 #endif 7 + 8 + #if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) 9 + void (*mach_beep)(unsigned int, unsigned int); 10 + EXPORT_SYMBOL(mach_beep); 11 + #endif
+2 -4
arch/m68k/kernel/setup_mm.c
··· 106 106 #ifdef CONFIG_M68K_L2_CACHE 107 107 void (*mach_l2_flush) (int); 108 108 #endif 109 - #if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) 110 - void (*mach_beep)(unsigned int, unsigned int); 111 - EXPORT_SYMBOL(mach_beep); 112 - #endif 113 109 #if defined(CONFIG_ISA) && defined(MULTI_ISA) 114 110 int isa_type; 115 111 int isa_sex; ··· 340 344 #ifdef CONFIG_COLDFIRE 341 345 case MACH_M54XX: 342 346 case MACH_M5441X: 347 + cf_bootmem_alloc(); 348 + cf_mmu_context_init(); 343 349 config_BSP(NULL, 0); 344 350 break; 345 351 #endif
+2 -2
arch/m68k/mm/mcfmmu.c
··· 170 170 max_pfn = max_low_pfn = PFN_DOWN(_ramend); 171 171 high_memory = (void *)_ramend; 172 172 173 - m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; 173 + m68k_virt_to_node_shift = fls(_ramend - 1) - 6; 174 174 module_fixup(NULL, __start_fixup, __stop_fixup); 175 175 176 176 /* setup bootmem data */ ··· 184 184 * Initialize the context management stuff. 185 185 * The following was taken from arch/ppc/mmu_context.c 186 186 */ 187 - void __init mmu_context_init(void) 187 + void __init cf_mmu_context_init(void) 188 188 { 189 189 /* 190 190 * Some processors have too few contexts to reserve one for