arch/mips/cavium-octeon/executive/octeon-model.c

Source file repositories/reference/linux-study-clean/arch/mips/cavium-octeon/executive/octeon-model.c

File Facts

System
Linux kernel
Corpus path
arch/mips/cavium-octeon/executive/octeon-model.c
Extension
.c
Size
11865 bytes
Lines
513
Domain
Architecture Layer
Bucket
arch/mips
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 (l2d_fus3) {
			/*
			 * For some unknown reason, the 16 core one is
			 * called 37 instead of 36.
			 */
			if (num_cores >= 16)
				family = "37";
			else
				family = "36";
		} else
			family = "38";
		/*
		 * This series of chips didn't follow the standard
		 * pass numbering.
		 */
		switch (chip_id & 0xf) {
		case 0:
			strscpy(pass, "1.X");
			break;
		case 1:
			strscpy(pass, "2.X");
			break;
		case 3:
			strscpy(pass, "3.X");
			break;
		default:
			strscpy(pass, "X.X");
			break;
		}
		break;
	case 1:		/* CN31XX or CN3020 */
		if ((chip_id & 0x10) || l2d_fus3)
			family = "30";
		else
			family = "31";
		/*
		 * This series of chips didn't follow the standard
		 * pass numbering.
		 */
		switch (chip_id & 0xf) {
		case 0:
			strscpy(pass, "1.0");
			break;
		case 2:
			strscpy(pass, "1.1");
			break;
		default:
			strscpy(pass, "X.X");
			break;
		}
		break;
	case 2:		/* CN3010 or CN3005 */
		family = "30";
		/* A chip with half cache is an 05 */
		if (l2d_fus3)
			core_model = "05";
		/*
		 * This series of chips didn't follow the standard
		 * pass numbering.
		 */
		switch (chip_id & 0xf) {
		case 0:
			strscpy(pass, "1.0");
			break;
		case 2:
			strscpy(pass, "1.1");
			break;
		default:
			strscpy(pass, "X.X");
			break;
		}
		break;
	case 3:		/* CN58XX */
		family = "58";
		/* Special case. 4 core, half cache (CP with half cache) */
		if ((num_cores == 4) && l2d_fus3 && !strncmp(suffix, "CP", 2))
			core_model = "29";

		/* Pass 1 uses different encodings for pass numbers */
		if ((chip_id & 0xFF) < 0x8) {
			switch (chip_id & 0x3) {
			case 0:
				strscpy(pass, "1.0");
				break;
			case 1:
				strscpy(pass, "1.1");
				break;
			case 3:
				strscpy(pass, "1.2");
				break;

Annotation

Implementation Notes