arch/sh/kernel/cpu/sh4/setup-sh7750.c

Source file repositories/reference/linux-study-clean/arch/sh/kernel/cpu/sh4/setup-sh7750.c

File Facts

System
Linux kernel
Corpus path
arch/sh/kernel/cpu/sh4/setup-sh7750.c
Extension
.c
Size
9951 bytes
Lines
360
Domain
Architecture Layer
Bucket
arch/sh
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * SH7091/SH7750/SH7750S/SH7750R/SH7751/SH7751R Setup
 *
 *  Copyright (C) 2006  Paul Mundt
 *  Copyright (C) 2006  Jamie Lenehan
 */
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/serial.h>
#include <linux/io.h>
#include <linux/sh_timer.h>
#include <linux/sh_intc.h>
#include <linux/serial_sci.h>
#include <generated/machtypes.h>
#include <asm/platform_early.h>

static struct resource rtc_resources[] = {
	[0] = {
		.start	= 0xffc80000,
		.end	= 0xffc80000 + 0x58 - 1,
		.flags	= IORESOURCE_IO,
	},
	[1] = {
		/* Shared Period/Carry/Alarm IRQ */
		.start	= evt2irq(0x480),
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device rtc_device = {
	.name		= "sh-rtc",
	.id		= -1,
	.num_resources	= ARRAY_SIZE(rtc_resources),
	.resource	= rtc_resources,
};

static struct plat_sci_port sci_platform_data = {
	.type		= PORT_SCI,
};

static struct resource sci_resources[] = {
	DEFINE_RES_MEM(0xffe00000, 0x20),
	DEFINE_RES_IRQ(evt2irq(0x4e0)),
};

static struct platform_device sci_device = {
	.name		= "sh-sci",
	.id		= 0,
	.resource	= sci_resources,
	.num_resources	= ARRAY_SIZE(sci_resources),
	.dev		= {
		.platform_data	= &sci_platform_data,
	},
};

static struct plat_sci_port scif_platform_data = {
	.scscr		= SCSCR_REIE,
	.type		= PORT_SCIF,
};

static struct resource scif_resources[] = {
	DEFINE_RES_MEM(0xffe80000, 0x100),
	DEFINE_RES_IRQ(evt2irq(0x700)),
};

static struct platform_device scif_device = {
	.name		= "sh-sci",
	.id		= 1,
	.resource	= scif_resources,
	.num_resources	= ARRAY_SIZE(scif_resources),
	.dev		= {
		.platform_data	= &scif_platform_data,
	},
};

static struct sh_timer_config tmu0_platform_data = {
	.channels_mask = 7,
};

static struct resource tmu0_resources[] = {
	DEFINE_RES_MEM(0xffd80000, 0x30),
	DEFINE_RES_IRQ(evt2irq(0x400)),
	DEFINE_RES_IRQ(evt2irq(0x420)),
	DEFINE_RES_IRQ(evt2irq(0x440)),
};

static struct platform_device tmu0_device = {
	.name		= "sh-tmu",
	.id		= 0,

Annotation

Implementation Notes