arch/m68k/atari/config.c

Source file repositories/reference/linux-study-clean/arch/m68k/atari/config.c

File Facts

System
Linux kernel
Corpus path
arch/m68k/atari/config.c
Extension
.c
Size
24628 bytes
Lines
930
Domain
Architecture Layer
Bucket
arch/m68k
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

if (strncmp(p, "ov_", 3) == 0) {
			p += 3;
			ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
		}

		if (strcmp(p, "ikbd") == 0) {
			/* RTS line of IKBD ACIA */
			atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
		} else if (strcmp(p, "midi") == 0) {
			/* RTS line of MIDI ACIA */
			atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
		} else if (strcmp(p, "snd6") == 0) {
			atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
		} else if (strcmp(p, "snd7") == 0) {
			atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
		}
	}
	return 0;
}

early_param("switches", atari_switches_setup);


    /*
     *  Setup the Atari configuration info
     */

void __init config_atari(void)
{
	unsigned short tos_version;

	memset(&atari_hw_present, 0, sizeof(atari_hw_present));

	/* Change size of I/O space from 64KB to 4GB. */
	ioport_resource.end  = 0xFFFFFFFF;

	mach_sched_init      = atari_sched_init;
	mach_init_IRQ        = atari_init_IRQ;
	mach_get_model	 = atari_get_model;
	mach_get_hardware_list = atari_get_hardware_list;
	mach_reset           = atari_reset;
#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP)
	mach_beep          = atari_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
	mach_heartbeat = atari_heartbeat;
#endif

	/* Set switches as requested by the user */
	if (atari_switches & ATARI_SWITCH_IKBD)
		acia.key_ctrl = ACIA_DIV64 | ACIA_D8N1S | ACIA_RHTID;
	if (atari_switches & ATARI_SWITCH_MIDI)
		acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | ACIA_RHTID;
	if (atari_switches & (ATARI_SWITCH_SND6|ATARI_SWITCH_SND7)) {
		sound_ym.rd_data_reg_sel = 14;
		sound_ym.wd_data = sound_ym.rd_data_reg_sel |
				   ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
				   ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
	}

	/* ++bjoern:
	 * Determine hardware present
	 */

	pr_info("Atari hardware found:");
	if (MACH_IS_MEDUSA) {
		/* There's no Atari video hardware on the Medusa, but all the
		 * addresses below generate a DTACK so no bus error occurs! */
	} else if (hwreg_present(f030_xreg)) {
		ATARIHW_SET(VIDEL_SHIFTER);
		pr_cont(" VIDEL");
		/* This is a temporary hack: If there is Falcon video
		 * hardware, we assume that the ST-DMA serves SCSI instead of
		 * ACSI. In the future, there should be a better method for
		 * this...
		 */
		ATARIHW_SET(ST_SCSI);
		pr_cont(" STDMA-SCSI");
	} else if (hwreg_present(tt_palette)) {
		ATARIHW_SET(TT_SHIFTER);
		pr_cont(" TT_SHIFTER");
	} else if (hwreg_present(&shifter_st.bas_hi)) {
		if (hwreg_present(&shifter_st.bas_lo) &&
		    (shifter_st.bas_lo = 0x0aau, shifter_st.bas_lo == 0x0aau)) {
			ATARIHW_SET(EXTD_SHIFTER);
			pr_cont(" EXTD_SHIFTER");
		} else {
			ATARIHW_SET(STND_SHIFTER);
			pr_cont(" STND_SHIFTER");
		}

Annotation

Implementation Notes