arch/sh/boards/board-apsh4a3a.c

Source file repositories/reference/linux-study-clean/arch/sh/boards/board-apsh4a3a.c

File Facts

System
Linux kernel
Corpus path
arch/sh/boards/board-apsh4a3a.c
Extension
.c
Size
4287 bytes
Lines
183
Domain
Architecture Layer
Bucket
arch/sh
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration 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

device_initcall(apsh4a3a_devices_setup);

static int apsh4a3a_clk_init(void)
{
	struct clk *clk;
	int ret;

	clk = clk_get(NULL, "extal");
	if (IS_ERR(clk))
		return PTR_ERR(clk);
	ret = clk_set_rate(clk, 33333000);
	clk_put(clk);

	return ret;
}

/* Initialize the board */
static void __init apsh4a3a_setup(char **cmdline_p)
{
	printk(KERN_INFO "Alpha Project AP-SH4A-3A support:\n");
}

static void __init apsh4a3a_init_irq(void)
{
	plat_irq_setup_pins(IRQ_MODE_IRQ7654);
}

/* Return the board specific boot mode pin configuration */
static int apsh4a3a_mode_pins(void)
{
	int value = 0;

	/* These are the factory default settings of SW1 and SW2.
	 * If you change these dip switches then you will need to
	 * adjust the values below as well.
	 */
	value &= ~MODE_PIN0;  /* Clock Mode 16 */
	value &= ~MODE_PIN1;
	value &= ~MODE_PIN2;
	value &= ~MODE_PIN3;
	value |=  MODE_PIN4;
	value &= ~MODE_PIN5;  /* 16-bit Area0 bus width */
	value |=  MODE_PIN6;  /* Area 0 SRAM interface */
	value |=  MODE_PIN7;
	value |=  MODE_PIN8;  /* Little Endian */
	value |=  MODE_PIN9;  /* Master Mode */
	value |=  MODE_PIN10; /* Crystal resonator */
	value |=  MODE_PIN11; /* Display Unit */
	value |=  MODE_PIN12;
	value &= ~MODE_PIN13; /* 29-bit address mode */
	value |=  MODE_PIN14; /* No PLL step-up */

	return value;
}

/*
 * The Machine Vector
 */
static struct sh_machine_vector mv_apsh4a3a __initmv = {
	.mv_name		= "AP-SH4A-3A",
	.mv_setup		= apsh4a3a_setup,
	.mv_clk_init		= apsh4a3a_clk_init,
	.mv_init_irq		= apsh4a3a_init_irq,
	.mv_mode_pins		= apsh4a3a_mode_pins,
};

Annotation

Implementation Notes