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

Merge tag 'm68knommu-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu

Pull m68knommu updates from Greg Ungerer:
"A collection of fixes:

- flexcan platform support (for m5441x)

- fix CONFIG_ROMKERNEL linking

- fix compilation when CONFIG_ISA_DMA_API is set

- fix local ColdFire clk_enable() for NULL clk"

* tag 'm68knommu-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch
m68k: coldfire: return success for clk_enable(NULL)
m68k: m5441x: add flexcan support
m68k: stmark2: update board setup
m68k/nommu: prevent setting ROMKERNEL when ROM is not set

+74 -8
+1 -1
arch/m68k/Kconfig.bus
··· 63 63 64 64 endif 65 65 66 - if !MMU 66 + if COLDFIRE 67 67 68 68 config ISA_DMA_API 69 69 def_bool !M5272
+1
arch/m68k/Kconfig.machine
··· 465 465 466 466 config ROMKERNEL 467 467 bool "ROM" 468 + depends on ROM 468 469 help 469 470 The kernel will be resident in FLASH/ROM when running. This is 470 471 often referred to as Execute-in-Place (XIP), since the kernel
+1 -1
arch/m68k/coldfire/clk.c
··· 78 78 unsigned long flags; 79 79 80 80 if (!clk) 81 - return -EINVAL; 81 + return 0; 82 82 83 83 spin_lock_irqsave(&clk_lock, flags); 84 84 if ((clk->enabled++ == 0) && clk->clk_ops)
+44
arch/m68k/coldfire/device.c
··· 581 581 }; 582 582 #endif /* MCFSDHC_BASE */ 583 583 584 + #if IS_ENABLED(CONFIG_CAN_FLEXCAN) 585 + 586 + #include <linux/can/platform/flexcan.h> 587 + 588 + static struct flexcan_platform_data mcf5441x_flexcan_info = { 589 + .clk_src = 1, 590 + .clock_frequency = 120000000, 591 + }; 592 + 593 + static struct resource mcf5441x_flexcan0_resource[] = { 594 + { 595 + .start = MCFFLEXCAN_BASE0, 596 + .end = MCFFLEXCAN_BASE0 + MCFFLEXCAN_SIZE, 597 + .flags = IORESOURCE_MEM, 598 + }, 599 + { 600 + .start = MCF_IRQ_IFL0, 601 + .end = MCF_IRQ_IFL0, 602 + .flags = IORESOURCE_IRQ, 603 + }, 604 + { 605 + .start = MCF_IRQ_BOFF0, 606 + .end = MCF_IRQ_BOFF0, 607 + .flags = IORESOURCE_IRQ, 608 + }, 609 + { 610 + .start = MCF_IRQ_ERR0, 611 + .end = MCF_IRQ_ERR0, 612 + .flags = IORESOURCE_IRQ, 613 + }, 614 + }; 615 + 616 + static struct platform_device mcf_flexcan0 = { 617 + .name = "flexcan-mcf5441x", 618 + .id = 0, 619 + .num_resources = ARRAY_SIZE(mcf5441x_flexcan0_resource), 620 + .resource = mcf5441x_flexcan0_resource, 621 + .dev.platform_data = &mcf5441x_flexcan_info, 622 + }; 623 + #endif /* IS_ENABLED(CONFIG_CAN_FLEXCAN) */ 624 + 584 625 static struct platform_device *mcf_devices[] __initdata = { 585 626 &mcf_uart, 586 627 #if IS_ENABLED(CONFIG_FEC) ··· 656 615 #endif 657 616 #ifdef MCFSDHC_BASE 658 617 &mcf_esdhc, 618 + #endif 619 + #if IS_ENABLED(CONFIG_CAN_FLEXCAN) 620 + &mcf_flexcan0, 659 621 #endif 660 622 }; 661 623
+4 -4
arch/m68k/coldfire/m5441x.c
··· 19 19 #include <asm/mcfclk.h> 20 20 21 21 DEFINE_CLK(0, "flexbus", 2, MCF_CLK); 22 - DEFINE_CLK(0, "mcfcan.0", 8, MCF_CLK); 23 - DEFINE_CLK(0, "mcfcan.1", 9, MCF_CLK); 22 + DEFINE_CLK(0, "flexcan.0", 8, MCF_CLK); 23 + DEFINE_CLK(0, "flexcan.1", 9, MCF_CLK); 24 24 DEFINE_CLK(0, "imx1-i2c.1", 14, MCF_CLK); 25 25 DEFINE_CLK(0, "mcfdspi.1", 15, MCF_CLK); 26 26 DEFINE_CLK(0, "edma", 17, MCF_CLK); ··· 142 142 143 143 static struct clk * const enable_clks[] __initconst = { 144 144 /* make sure these clocks are enabled */ 145 + &__clk_0_8, /* flexcan.0 */ 146 + &__clk_0_9, /* flexcan.1 */ 145 147 &__clk_0_15, /* dspi.1 */ 146 148 &__clk_0_17, /* eDMA */ 147 149 &__clk_0_18, /* intc0 */ ··· 164 162 &__clk_1_37, /* gpio */ 165 163 }; 166 164 static struct clk * const disable_clks[] __initconst = { 167 - &__clk_0_8, /* can.0 */ 168 - &__clk_0_9, /* can.1 */ 169 165 &__clk_0_14, /* i2c.1 */ 170 166 &__clk_0_22, /* i2c.0 */ 171 167 &__clk_0_23, /* dspi.0 */
+4 -2
arch/m68k/coldfire/stmark2.c
··· 111 111 __raw_writeb(0x00, MCFGPIO_PAR_BE); 112 112 __raw_writeb(0x00, MCFGPIO_PAR_FBCTL); 113 113 __raw_writeb(0x00, MCFGPIO_PAR_CS); 114 - __raw_writeb(0x00, MCFGPIO_PAR_CANI2C); 114 + 115 + /* CAN pads */ 116 + __raw_writeb(0x50, MCFGPIO_PAR_CANI2C); 115 117 116 118 platform_add_devices(stmark2_devices, ARRAY_SIZE(stmark2_devices)); 117 119 ··· 123 121 return 0; 124 122 } 125 123 126 - late_initcall(init_stmark2); 124 + device_initcall(init_stmark2);
+19
arch/m68k/include/asm/m5441xsim.h
··· 73 73 #define MCFINT0_FECENTC1 55 74 74 75 75 /* on interrupt controller 1 */ 76 + #define MCFINT1_FLEXCAN0_IFL 0 77 + #define MCFINT1_FLEXCAN0_BOFF 1 78 + #define MCFINT1_FLEXCAN0_ERR 3 79 + #define MCFINT1_FLEXCAN1_IFL 4 80 + #define MCFINT1_FLEXCAN1_BOFF 5 81 + #define MCFINT1_FLEXCAN1_ERR 7 76 82 #define MCFINT1_UART4 48 77 83 #define MCFINT1_UART5 49 78 84 #define MCFINT1_UART6 50 ··· 319 313 #define MCFINT2_SDHC 31 320 314 #define MCF_IRQ_SDHC (MCFINT2_VECBASE + MCFINT2_SDHC) 321 315 #define MCFSDHC_CLK (MCFSDHC_BASE + 0x2c) 316 + 317 + /* 318 + * Flexcan module 319 + */ 320 + #define MCFFLEXCAN_BASE0 0xfc020000 321 + #define MCFFLEXCAN_BASE1 0xfc024000 322 + #define MCFFLEXCAN_SIZE 0x4000 323 + #define MCF_IRQ_IFL0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_IFL) 324 + #define MCF_IRQ_BOFF0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_BOFF) 325 + #define MCF_IRQ_ERR0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_ERR) 326 + #define MCF_IRQ_IFL1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_IFL) 327 + #define MCF_IRQ_BOFF1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_BOFF) 328 + #define MCF_IRQ_ERR1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_ERR) 322 329 323 330 #endif /* m5441xsim_h */