Skip to content

Commit 6104dde

Browse files
committed
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
2 parents c07f191 + db87db6 commit 6104dde

File tree

7 files changed

+74
-8
lines changed

7 files changed

+74
-8
lines changed

arch/m68k/Kconfig.bus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ source "drivers/zorro/Kconfig"
6363

6464
endif
6565

66-
if !MMU
66+
if COLDFIRE
6767

6868
config ISA_DMA_API
6969
def_bool !M5272

arch/m68k/Kconfig.machine

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ config RAMKERNEL
465465

466466
config ROMKERNEL
467467
bool "ROM"
468+
depends on ROM
468469
help
469470
The kernel will be resident in FLASH/ROM when running. This is
470471
often referred to as Execute-in-Place (XIP), since the kernel

arch/m68k/coldfire/clk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int clk_enable(struct clk *clk)
7878
unsigned long flags;
7979

8080
if (!clk)
81-
return -EINVAL;
81+
return 0;
8282

8383
spin_lock_irqsave(&clk_lock, flags);
8484
if ((clk->enabled++ == 0) && clk->clk_ops)

arch/m68k/coldfire/device.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,47 @@ static struct platform_device mcf_esdhc = {
581581
};
582582
#endif /* MCFSDHC_BASE */
583583

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+
584625
static struct platform_device *mcf_devices[] __initdata = {
585626
&mcf_uart,
586627
#if IS_ENABLED(CONFIG_FEC)
@@ -616,6 +657,9 @@ static struct platform_device *mcf_devices[] __initdata = {
616657
#ifdef MCFSDHC_BASE
617658
&mcf_esdhc,
618659
#endif
660+
#if IS_ENABLED(CONFIG_CAN_FLEXCAN)
661+
&mcf_flexcan0,
662+
#endif
619663
};
620664

621665
/*

arch/m68k/coldfire/m5441x.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include <asm/mcfclk.h>
2020

2121
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);
2424
DEFINE_CLK(0, "imx1-i2c.1", 14, MCF_CLK);
2525
DEFINE_CLK(0, "mcfdspi.1", 15, MCF_CLK);
2626
DEFINE_CLK(0, "edma", 17, MCF_CLK);
@@ -142,6 +142,8 @@ static struct clk_lookup m5411x_clk_lookup[] = {
142142

143143
static struct clk * const enable_clks[] __initconst = {
144144
/* make sure these clocks are enabled */
145+
&__clk_0_8, /* flexcan.0 */
146+
&__clk_0_9, /* flexcan.1 */
145147
&__clk_0_15, /* dspi.1 */
146148
&__clk_0_17, /* eDMA */
147149
&__clk_0_18, /* intc0 */
@@ -162,8 +164,6 @@ static struct clk * const enable_clks[] __initconst = {
162164
&__clk_1_37, /* gpio */
163165
};
164166
static struct clk * const disable_clks[] __initconst = {
165-
&__clk_0_8, /* can.0 */
166-
&__clk_0_9, /* can.1 */
167167
&__clk_0_14, /* i2c.1 */
168168
&__clk_0_22, /* i2c.0 */
169169
&__clk_0_23, /* dspi.0 */

arch/m68k/coldfire/stmark2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ static int __init init_stmark2(void)
111111
__raw_writeb(0x00, MCFGPIO_PAR_BE);
112112
__raw_writeb(0x00, MCFGPIO_PAR_FBCTL);
113113
__raw_writeb(0x00, MCFGPIO_PAR_CS);
114-
__raw_writeb(0x00, MCFGPIO_PAR_CANI2C);
114+
115+
/* CAN pads */
116+
__raw_writeb(0x50, MCFGPIO_PAR_CANI2C);
115117

116118
platform_add_devices(stmark2_devices, ARRAY_SIZE(stmark2_devices));
117119

@@ -121,4 +123,4 @@ static int __init init_stmark2(void)
121123
return 0;
122124
}
123125

124-
late_initcall(init_stmark2);
126+
device_initcall(init_stmark2);

arch/m68k/include/asm/m5441xsim.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@
7373
#define MCFINT0_FECENTC1 55
7474

7575
/* 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
7682
#define MCFINT1_UART4 48
7783
#define MCFINT1_UART5 49
7884
#define MCFINT1_UART6 50
@@ -314,4 +320,17 @@
314320
#define MCF_IRQ_SDHC (MCFINT2_VECBASE + MCFINT2_SDHC)
315321
#define MCFSDHC_CLK (MCFSDHC_BASE + 0x2c)
316322

323+
/*
324+
* Flexcan module
325+
*/
326+
#define MCFFLEXCAN_BASE0 0xfc020000
327+
#define MCFFLEXCAN_BASE1 0xfc024000
328+
#define MCFFLEXCAN_SIZE 0x4000
329+
#define MCF_IRQ_IFL0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_IFL)
330+
#define MCF_IRQ_BOFF0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_BOFF)
331+
#define MCF_IRQ_ERR0 (MCFINT1_VECBASE + MCFINT1_FLEXCAN0_ERR)
332+
#define MCF_IRQ_IFL1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_IFL)
333+
#define MCF_IRQ_BOFF1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_BOFF)
334+
#define MCF_IRQ_ERR1 (MCFINT1_VECBASE + MCFINT1_FLEXCAN1_ERR)
335+
317336
#endif /* m5441xsim_h */

0 commit comments

Comments
 (0)