Beispiel #1
0
static int
module_handler(module_t mod, int what, void *arg)
{

	switch (what) {
	case MOD_LOAD:
		return (do_load_fw());
	case MOD_UNLOAD:
		return (do_unload_fw());
	}
	return (EOPNOTSUPP);
}
static int
module_handler(module_t mod, int what, void *arg)
{

	switch (what) {
	case MOD_LOAD:
		do_load_fw();
		break;
	case MOD_UNLOAD:
		do_unload_fw();
		break;
	case MOD_SHUTDOWN:
		break;
	default:
		return (EOPNOTSUPP);
	}
	return (0);
}
Beispiel #3
0
static int __init loader_init(void)
{
    int ret;
	void *va;
	void (*theUboot) (void);

    //va = ioremap_nocache(RT_BASE_ADDR, RT_MEM_SIZE);
	va = phys_to_virt(RT_BASE_ADDR);
    pr_info("get mapping :%p -> %08x, size: %08x\n", va, RT_BASE_ADDR, RT_MEM_SIZE);

    if(do_load_fw("/mnt/boot/u-boot.bin", (unsigned long)va, RT_MEM_SIZE) == 0){	
    	theUboot = (void (*)(void)) (va);
		printk("start boot zImage...\n");
		theUboot();
		printk("end boot zImage...\n");
    }

    return 0;
}