static int zynqmp_r5_rproc_start(struct rproc *rproc)
{
	struct device *dev = rproc->dev.parent;
	struct platform_device *pdev = to_platform_device(dev);
	struct zynqmp_r5_rproc_pdata *local = platform_get_drvdata(pdev);

	dev_dbg(dev, "%s\n", __func__);
	/* limit to two RPU support */
	if (local->rpu_id == 0)
		INIT_WORK(&local->workqueue, handle_event0);
	else
		INIT_WORK(&local->workqueue, handle_event1);

	flush_cache_all();
	remoteprocdev[local->rpu_id] = pdev;

	/* Set up R5 */
	local->rpu_ops->core_conf(local);
	local->rpu_ops->en_reset(local, true);
	local->rpu_ops->halt(local, true);
	local->rpu_ops->bootdev(local);
	/* Add delay before release from halt and reset */
	udelay(500);
	local->rpu_ops->en_reset(local, false);
	local->rpu_ops->halt(local, false);

	ipi_init(local);
	return 0;
}
static int zynqmp_r5_rproc_start(struct rproc *rproc)
{
	struct device *dev = rproc->dev.parent;
	struct platform_device *pdev = to_platform_device(dev);
	struct zynqmp_r5_rproc_pdata *local = platform_get_drvdata(pdev);
	u32 bootaddr = 0;
	int ret;

	dev_dbg(dev, "%s\n", __func__);
	/* limit to two RPU support */
	if (local->rpu_id == 0)
		INIT_WORK(&local->workqueue, handle_event0);
	else
		INIT_WORK(&local->workqueue, handle_event1);

	remoteprocdev[local->rpu_id] = pdev;

	/*
	 * Use memory barrier to make sure all write memory operations
	 * complemeted.
	 */
	wmb();
	/* Set up R5 */
	ret = get_firmware_entry_addr(local, &bootaddr);
	if (ret < 0) {
		dev_err(dev, "%s: failed to get RPU boot addr.\n", __func__);
		return ret;
	}
	if (!bootaddr)
		local->bootmem = TCM;
	else
		local->bootmem = OCM;
	dev_info(dev, "RPU boot from %s.",
		local->bootmem == OCM ? "OCM" : "TCM");

	local->rpu_ops->core_conf(local);
	local->rpu_ops->halt(local, true);
	local->rpu_ops->en_reset(local, true);
	local->rpu_ops->bootdev(local);
	/* Add delay before release from halt and reset */
	udelay(500);
	local->rpu_ops->en_reset(local, false);
	local->rpu_ops->halt(local, false);

	ipi_init(local);
	return 0;
}
Beispiel #3
0
void __init init_IRQ(void)
{
	ipi_init();
}
Beispiel #4
0
void
cpu_attach_common(device_t self, struct cpu_info *ci)
{
	const char * const xname = device_xname(self);

	/*
	 * Cross link cpu_info and its device together
	 */
	ci->ci_dev = self;
	self->dv_private = ci;
	KASSERT(ci->ci_idepth == 0);

	evcnt_attach_dynamic(&ci->ci_ev_count_compare,
		EVCNT_TYPE_INTR, NULL, xname,
		"int 5 (clock)");
	evcnt_attach_dynamic(&ci->ci_ev_count_compare_missed,
		EVCNT_TYPE_INTR, NULL, xname,
		"int 5 (clock) missed");
	evcnt_attach_dynamic(&ci->ci_ev_fpu_loads,
		EVCNT_TYPE_MISC, NULL, xname,
		"fpu loads");
	evcnt_attach_dynamic(&ci->ci_ev_fpu_saves,
		EVCNT_TYPE_MISC, NULL, xname,
		"fpu saves");
	evcnt_attach_dynamic(&ci->ci_ev_dsp_loads,
		EVCNT_TYPE_MISC, NULL, xname,
		"dsp loads");
	evcnt_attach_dynamic(&ci->ci_ev_dsp_saves,
		EVCNT_TYPE_MISC, NULL, xname,
		"dsp saves");
	evcnt_attach_dynamic(&ci->ci_ev_tlbmisses,
		EVCNT_TYPE_TRAP, NULL, xname,
		"tlb misses");

#ifdef MULTIPROCESSOR
	if (ci != &cpu_info_store) {
		/*
		 * Tail insert this onto the list of cpu_info's.
		 */
		KASSERT(cpuid_infos[ci->ci_cpuid] == NULL);
		cpuid_infos[ci->ci_cpuid] = ci;
		membar_producer();
	}
	KASSERT(cpuid_infos[ci->ci_cpuid] != NULL);
	evcnt_attach_dynamic(&ci->ci_evcnt_synci_activate_rqst,
	    EVCNT_TYPE_MISC, NULL, xname,
	    "syncicache activate request");
	evcnt_attach_dynamic(&ci->ci_evcnt_synci_deferred_rqst,
	    EVCNT_TYPE_MISC, NULL, xname,
	    "syncicache deferred request");
	evcnt_attach_dynamic(&ci->ci_evcnt_synci_ipi_rqst,
	    EVCNT_TYPE_MISC, NULL, xname,
	    "syncicache ipi request");
	evcnt_attach_dynamic(&ci->ci_evcnt_synci_onproc_rqst,
	    EVCNT_TYPE_MISC, NULL, xname,
	    "syncicache onproc request");

	/*
	 * Initialize IPI framework for this cpu instance
	 */
	ipi_init(ci);

	kcpuset_create(&ci->ci_multicastcpus, true);
	kcpuset_create(&ci->ci_watchcpus, true);
	kcpuset_create(&ci->ci_ddbcpus, true);
#endif
}
Beispiel #5
0
int kern_init(uint64_t mbmagic, uint64_t mbmem)
{
	extern char edata[], end[];
	memset(edata, 0, end - edata);

	/* percpu variable for CPU0 is preallocated */
	percpu_offsets[0] = __percpu_start;

	cons_init();		// init the console

	const char *message = "(THU.CST) os is loading ...";
	kprintf("%s\n\n", message);
	if(mbmagic == MULTIBOOT_BOOTLOADER_MAGIC){
		kprintf("Multiboot dectected: param %p\n", (void*)mbmem);
		mbmem2e820((Mbdata*)VADDR_DIRECT(mbmem));
		parse_initrd((Mbdata*)VADDR_DIRECT(mbmem));
	}

	print_kerninfo();

	/* get_cpu_var not available before tls_init() */
	hz_init();
	gdt_init(per_cpu_ptr(cpus, 0));
	tls_init(per_cpu_ptr(cpus, 0));
	acpitables_init();
	lapic_init();
	numa_init();

	pmm_init_numa();		// init physical memory management, numa awared
	/* map the lapic */
	lapic_init_late();

	//init the acpi stuff

	idt_init();		// init interrupt descriptor table
	pic_init();		// init interrupt controller

//	acpi_conf_init();


	percpu_init();
	cpus_init();
#ifdef UCONFIG_ENABLE_IPI
	ipi_init();
#endif

	refcache_init();

	vmm_init();		// init virtual memory management
	sched_init();		// init scheduler
	proc_init();		// init process table
	sync_init();		// init sync struct

	/* ext int */
	ioapic_init();
	acpi_init();

	ide_init();		// init ide devices
#ifdef UCONFIG_SWAP
	swap_init();		// init swap
#endif
	fs_init();		// init fs

	clock_init();		// init clock interrupt
	mod_init();

	trap_init();

	//XXX put here?
	bootaps();

	intr_enable();		// enable irq interrupt

#ifdef UCONFIG_HAVE_LINUX_DDE36_BASE
	dde_kit_init();
#endif

	/* do nothing */
	cpu_idle();		// run idle process
}