static void __init soc_cpm_setup(void) { __cpm_idle_mode(); __cpm_enable_cko1(); __cpm_start_all(); /* get system clocks */ sysclocks_setup(); }
static int boot_of(void) { int fd, rc, len, i, checksum = 0; void (*kernel_entry)(int, void*, void*); printf("Mounting disk..."); rc = disk_mount_all(); if (rc <= 0) error(EDISK, rc, true); /* TODO: get this from the NAND flash instead of SD */ fd = open("/ccpmp.bin", O_RDONLY); if(fd < 0) return EFILE_NOT_FOUND; lseek(fd, 4, SEEK_SET); rc = read(fd, (char*)&len, 4); /* CPU is LE */ if(rc < 4) return EREAD_IMAGE_FAILED; len += 8; printf("Reading %d bytes...", len); lseek(fd, 0, SEEK_SET); rc = read(fd, (void*)0x80004000, len); if(rc < len) return EREAD_IMAGE_FAILED; close(fd); for(i=0; i<len; i++) checksum += ((unsigned char*)0x80004000)[i]; *((unsigned int*)0x80004000) = checksum; printf("Starting the OF..."); /* OF requires all clocks on */ __cpm_start_all(); disable_interrupt(); __dcache_writeback_all(); __icache_invalidate_all(); for(i=8000; i>0; i--) asm volatile("nop\n"); kernel_entry = (void*) 0x80004008; kernel_entry(0, "Jan 10 2008", "15:34:42"); /* Reversed from the SPL */ return 0; /* Shouldn't happen */ }
static void __init soc_cpm_setup(void) { /* Start all module clocks */ __cpm_start_all(); /* Enable CKO to external memory */ __cpm_enable_cko(); /* CPU enters IDLE mode when executing 'wait' instruction */ __cpm_idle_mode(); /* Setup system clocks */ sysclocks_setup(); }