arch/arm/mach-omap2/cm_common.c

Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/cm_common.c

File Facts

System
Linux kernel
Corpus path
arch/arm/mach-omap2/cm_common.c
Extension
.c
Size
10704 bytes
Lines
380
Domain
Architecture Layer
Bucket
arch/arm
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

if (ret) {
			of_node_put(np);
			return ret;
		}

		if (data->index == TI_CLKM_CM)
			mem = &cm_base;

		if (data->index == TI_CLKM_CM2)
			mem = &cm2_base;

		data->mem = ioremap(res.start, resource_size(&res));

		if (mem) {
			mem->pa = res.start + data->offset;
			mem->va = data->mem + data->offset;
			mem->offset = data->offset;
		}

		data->np = np;

		if (data->init && (data->flags & CM_SINGLE_INSTANCE ||
				   (cm_base.va && cm2_base.va)))
			data->init(data);
	}

	return 0;
}

/**
 * omap_cm_init - low level init for the CM drivers
 *
 * Initializes the low level clock infrastructure for CM drivers.
 * Returns 0 in success, negative error value in failure.
 */
int __init omap_cm_init(void)
{
	struct device_node *np;
	const struct of_device_id *match;
	const struct omap_prcm_init_data *data;
	int ret;

	for_each_matching_node_and_match(np, omap_cm_dt_match_table, &match) {
		data = match->data;

		if (data->flags & CM_NO_CLOCKS)
			continue;

		ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
		if (ret) {
			of_node_put(np);
			return ret;
		}
	}

	return 0;
}

Annotation

Implementation Notes