int i2s_codec_enable(i2s_config_type* ptri2s_config) { int AIn = 0, AOut = 0; /* Codec initialization */ audiohw_preinit(); #if defined(CONFIG_I2S_TXRX) if(ptri2s_config->bTxDMAEnable) AOut = 1; if(ptri2s_config->bRxDMAEnable) AIn = 1; audiohw_postinit(!(ptri2s_config->slave_en), AIn, AOut); #else #if defined(CONFIG_I2S_WM8750) audiohw_postinit(!(ptri2s_config->slave_en), 0, 1); #else if(ptri2s_config->slave_en==0) audiohw_postinit(1,1); else audiohw_postinit(0,1); #endif #endif return 0; }
void pcm_play_dma_postinit(void) { audiohw_postinit(); /* wake DSP */ // dsp_wake(); }
void pcm_play_dma_postinit(void) { /* Configure clock divider */ tsc2100_writereg(CONTROL_PAGE2, TSPP1_ADDRESS, 0x1120); tsc2100_writereg(CONTROL_PAGE2, TSAC3_ADDRESS, 0x0800); tsc2100_writereg(CONTROL_PAGE2, TSCPC_ADDRESS, 0x3B00); tsc2100_writereg(CONTROL_PAGE2, TSAC1_ADDRESS, 0x0300); tsc2100_writereg(CONTROL_PAGE2, TSCSC_ADDRESS, 0xC580); audiohw_postinit(); }
void OpenIBootStart() { setup_openiboot(); pmu_charge_settings(TRUE, FALSE, FALSE); #ifdef OPENIBOOT_INSTALLER framebuffer_setdisplaytext(FALSE); framebuffer_clear(); { int w, h; uint32_t *bgImg = framebuffer_load_image(datainstallerLogoPNG, sizeof(datainstallerLogoPNG), &w, &h, TRUE); if(bgImg) { int x = (framebuffer_width() - w)/2; int y = (framebuffer_height() - h)/3; framebuffer_draw_image(bgImg, x, y, w, h); } else { framebuffer_setdisplaytext(TRUE); bufferPrintf("Failed to load image...\n"); } } #else framebuffer_setdisplaytext(TRUE); framebuffer_clear(); bufferPrintf("Loading openiBoot..."); #ifndef SMALL #ifndef NO_STBIMAGE int defaultOS = 0; int tempOS = 0; const char* hideMenu = nvram_getvar("opib-hide-menu"); const char* sDefaultOS = nvram_getvar("opib-default-os"); const char* sTempOS = nvram_getvar("opib-temp-os"); if(sDefaultOS) defaultOS = parseNumber(sDefaultOS); if(sTempOS) tempOS = parseNumber(sTempOS); if(tempOS!=defaultOS) { switch (tempOS) { case 0: framebuffer_clear(); bufferPrintf("Loading iOS..."); reset_tempos(sDefaultOS); Image* image = images_get(fourcc("ibox")); if(image == NULL) image = images_get(fourcc("ibot")); void* imageData; images_read(image, &imageData); chainload((uint32_t)imageData); break; case 1: framebuffer_clear(); bufferPrintf("Loading iDroid..."); reset_tempos(sDefaultOS); #ifndef NO_HFS #ifndef CONFIG_IPOD radio_setup(); #endif nand_setup(); fs_setup(); if(globalFtlHasBeenRestored) { if(ftl_sync()) { bufferPrintf("ftl synced successfully"); } else { bufferPrintf("error syncing ftl"); } } pmu_set_iboot_stage(0); startScripting("linux"); //start script mode if there is a script file boot_linux_from_files(); #endif break; case 2: framebuffer_clear(); bufferPrintf("Loading Console..."); reset_tempos(sDefaultOS); hideMenu = "1"; break; } } else if(hideMenu && (strcmp(hideMenu, "1") == 0 || strcmp(hideMenu, "true") == 0)) { bufferPrintf("Boot menu hidden. Use 'setenv opib-hide-menu false' and then 'saveenv' to unhide.\r\n"); } else { framebuffer_setdisplaytext(FALSE); isMultitouchLoaded = load_multitouch_images(); framebuffer_clear(); const char* sMenuTimeout = nvram_getvar("opib-menu-timeout"); int menuTimeout = -1; if(sMenuTimeout) menuTimeout = parseNumber(sMenuTimeout); menu_setup(menuTimeout, defaultOS); } #endif #endif #endif //OPENIBOOT_INSTALLER startUSB(); #ifndef CONFIG_IPOD camera_setup(); radio_setup(); #endif sdio_setup(); wlan_setup(); accel_setup(); #ifndef CONFIG_IPOD als_setup(); #endif nand_setup(); #ifndef NO_HFS fs_setup(); #endif pmu_set_iboot_stage(0); startScripting("openiboot"); //start script mode if there is a file bufferPrintf("version: %s\r\n", OPENIBOOT_VERSION_STR); bufferPrintf("-----------------------------------------------\r\n"); bufferPrintf(" WELCOME TO OPENIBOOT\r\n"); bufferPrintf("-----------------------------------------------\r\n"); DebugPrintf(" DEBUG MODE\r\n"); audiohw_postinit(); setReady(TRUE); // Process command queue while(TRUE) { char* command = NULL; CommandQueue* cur; EnterCriticalSection(); if(commandQueue != NULL) { cur = commandQueue; command = cur->command; commandQueue = commandQueue->next; free(cur); } LeaveCriticalSection(); if(command) { setReady(FALSE); processCommand(command); setReady(TRUE); free(command); } } // should not reach here }
void pcm_play_dma_postinit(void) { audiohw_postinit(); }
void pcm_postinit(void) { audiohw_postinit(); }
void OpenIBootStart() { setup_openiboot(); pmu_charge_settings(TRUE, FALSE, FALSE); framebuffer_setdisplaytext(TRUE); framebuffer_clear(); #ifndef SMALL #ifndef NO_STBIMAGE const char* hideMenu = nvram_getvar("opib-hide-menu"); if(hideMenu && (strcmp(hideMenu, "1") == 0 || strcmp(hideMenu, "true") == 0)) { bufferPrintf("Boot menu hidden. Use 'setenv opib-hide-menu false' and then 'saveenv' to unhide.\r\n"); } else { framebuffer_setdisplaytext(FALSE); const char* sMenuTimeout = nvram_getvar("opib-menu-timeout"); int menuTimeout = -1; if(sMenuTimeout) menuTimeout = parseNumber(sMenuTimeout); menu_setup(menuTimeout); } #endif #endif startUSB(); radio_setup(); sdio_setup(); wlan_setup(); accel_setup(); als_setup(); nand_setup(); #ifndef NO_HFS fs_setup(); #endif pmu_set_iboot_stage(0); startScripting("openiboot"); //start script mode if there is a file bufferPrintf("-----------------------------------------------\r\n"); bufferPrintf(" WELCOME TO OPENIBOOT\r\n"); bufferPrintf("-----------------------------------------------\r\n"); DebugPrintf(" DEBUG MODE\r\n"); audiohw_postinit(); // Process command queue while(TRUE) { char* command = NULL; CommandQueue* cur; EnterCriticalSection(); if(commandQueue != NULL) { cur = commandQueue; command = cur->command; commandQueue = commandQueue->next; free(cur); } LeaveCriticalSection(); if(command) { processCommand(command); free(command); } } // should not reach here }
void OpenIBootStart() { setup_openiboot(); framebuffer_hook(); framebuffer_setdisplaytext(TRUE); #ifndef CONFIG_IPHONE_4 pmu_charge_settings(TRUE, FALSE, FALSE); framebuffer_setdisplaytext(TRUE); framebuffer_clear(); bufferPrintf("Loading openiBoot..."); #ifndef SMALL #ifndef NO_STBIMAGE int defaultOS = 0; int tempOS = 0; const char* hideMenu = nvram_getvar("opib-hide-menu"); const char* sDefaultOS = nvram_getvar("opib-default-os"); const char* sTempOS = nvram_getvar("opib-temp-os"); if(sDefaultOS) defaultOS = parseNumber(sDefaultOS); if(sTempOS) tempOS = parseNumber(sTempOS); if(tempOS!=defaultOS) { switch (tempOS) { case 0: framebuffer_clear(); bufferPrintf("Loading iOS..."); reset_tempos(sDefaultOS); Image* image = images_get(fourcc("ibox")); if(image == NULL) image = images_get(fourcc("ibot")); void* imageData; images_read(image, &imageData); chainload((uint32_t)imageData); break; case 1: framebuffer_clear(); bufferPrintf("Loading iDroid..."); reset_tempos(sDefaultOS); #ifndef NO_HFS #ifndef CONFIG_IPOD radio_setup(); #endif nand_setup(); fs_setup(); if(globalFtlHasBeenRestored) { if(ftl_sync()) { bufferPrintf("ftl synced successfully"); } else { bufferPrintf("error syncing ftl"); } } pmu_set_iboot_stage(0); startScripting("linux"); //start script mode if there is a script file boot_linux_from_files(); #endif break; case 2: framebuffer_clear(); bufferPrintf("Loading Console..."); reset_tempos(sDefaultOS); hideMenu = "1"; break; } } else if(hideMenu && (strcmp(hideMenu, "1") == 0 || strcmp(hideMenu, "true") == 0)) { bufferPrintf("Boot menu hidden. Use 'setenv opib-hide-menu false' and then 'saveenv' to unhide.\r\n"); } else { framebuffer_setdisplaytext(FALSE); isMultitouchLoaded = load_multitouch_images(); framebuffer_clear(); const char* sMenuTimeout = nvram_getvar("opib-menu-timeout"); int menuTimeout = -1; if(sMenuTimeout) menuTimeout = parseNumber(sMenuTimeout); menu_setup(menuTimeout, defaultOS); } #endif #endif #endif #ifndef CONFIG_IPAD startUSB(); #endif #ifndef CONFIG_IPHONE_4 #ifndef CONFIG_IPOD camera_setup(); radio_setup(); #endif sdio_setup(); wlan_setup(); accel_setup(); #ifndef CONFIG_IPOD als_setup(); #endif nand_setup(); #ifndef NO_HFS fs_setup(); #endif pmu_set_iboot_stage(0); startScripting("openiboot"); //start script mode if there is a file #endif bufferPrintf(" ___ _ ____ _ \r\n"); bufferPrintf(" / _ \\ _ __ ___ _ __ (_) __ ) ___ ___ | |_ \r\n"); bufferPrintf("| | | | '_ \\ / _ \\ '_ \\| | _ \\ / _ \\ / _ \\| __|\r\n"); bufferPrintf("| |_| | |_) | __/ | | | | |_) | (_) | (_) | |_ \r\n"); bufferPrintf(" \\___/| .__/ \\___|_| |_|_|____/ \\___/ \\___/ \\__|\r\n"); bufferPrintf(" |_| \r\n"); bufferPrintf("\r\n"); bufferPrintf("version: %s\r\n", OPENIBOOT_VERSION_STR); DebugPrintf(" DEBUG MODE\r\n"); #ifndef CONFIG_IPHONE_4 audiohw_postinit(); #endif // Process command queue while(TRUE) { char* command = NULL; CommandQueue* cur; EnterCriticalSection(); if(commandQueue != NULL) { cur = commandQueue; command = cur->command; commandQueue = commandQueue->next; free(cur); } LeaveCriticalSection(); if(command) { processCommand(command); free(command); } } // should not reach here }
void OpenIBootStart() { setup_openiboot(); pmu_charge_settings(TRUE, FALSE, FALSE); framebuffer_setdisplaytext(TRUE); framebuffer_clear(); //enable multitouch before displaying menu, only 3g first framebuffer_setdisplaytext(FALSE); nand_setup(); fs_setup(); int size; size = fs_extract(1, "/firmware/zephyr2.bin", (void*) 0x09000000); if(size < 0) { bufferPrintf("Cannot find zephyr bin.\r\n"); return; } multitouch_setup((uint8_t*) 0x09000000, size); #ifndef SMALL #ifndef NO_STBIMAGE const char* hideMenu = nvram_getvar("opib-hide-menu"); if(hideMenu && (strcmp(hideMenu, "1") == 0 || strcmp(hideMenu, "true") == 0)) { bufferPrintf("Boot menu hidden. Use 'setenv opib-hide-menu false' and then 'saveenv' to unhide.\r\n"); } else { framebuffer_setdisplaytext(FALSE); const char* sMenuTimeout = nvram_getvar("opib-menu-timeout"); int menuTimeout = -1; if(sMenuTimeout) menuTimeout = parseNumber(sMenuTimeout); menu_setup(menuTimeout); } #endif #endif startUSB(); #ifndef CONFIG_IPOD camera_setup(); radio_setup(); #endif sdio_setup(); wlan_setup(); accel_setup(); #ifndef CONFIG_IPOD als_setup(); #endif nand_setup(); #ifndef NO_HFS fs_setup(); #endif pmu_set_iboot_stage(0); startScripting("openiboot"); //start script mode if there is a file bufferPrintf("version: %s\r\n", OPENIBOOT_VERSION_STR); bufferPrintf("-----------------------------------------------\r\n"); bufferPrintf(" WELCOME TO OPENIBOOT\r\n"); bufferPrintf("-----------------------------------------------\r\n"); DebugPrintf(" DEBUG MODE\r\n"); audiohw_postinit(); // Process command queue while(TRUE) { char* command = NULL; CommandQueue* cur; EnterCriticalSection(); if(commandQueue != NULL) { cur = commandQueue; command = cur->command; commandQueue = commandQueue->next; free(cur); } LeaveCriticalSection(); if(command) { processCommand(command); free(command); } } // should not reach here }
void pcm_play_dma_postinit(void) { audiohw_postinit(); iis_play_reset(); }
static int i2s_dev_open(i2s_config_type* ptri2s_config) { int i, result, db, srate; unsigned int data = 0; MSG("i2s_dev_open \n"); /* set i2s clk */ data = i2s_inw(RALINK_SYSCTL_BASE+0x30); data &= 0xFFFF00FF; #ifdef I2S_MS_MODE #ifdef I2S_IN_CLKSRC data |= 0x00008000; /* for internal clock = 15.625 Mhz */ switch(ptri2s_config->srate) { case 8000: srate = 60<<8; break; case 11250: srate = 43<<8; break; case 16000: srate = 30<<8; break; case 22050: srate = 21<<8; break; case 24000: srate = 19<<8; break; case 32000: srate = 14<<8; break; case 44100: srate = 10<<8; break; case 48000: srate = 9<<8; break; case 88200: srate = 7<<8; break; case 96000: srate = 4<<8; break; default: srate = 10<<8; } #ifdef FPGA_BOARD_RT3052 /* for internal clock = 12.5Mhz */ switch(ptri2s_config->srate) { case 8000: srate = 48<<8; break; case 11250: srate = 34<<8; break; case 16000: srate = 23<<8; break; case 22050: srate = 17<<8; break; case 24000: srate = 15<<8; break; case 32000: srate = 11<<8; break; case 44100: srate = 8<<8; break; case 48000: srate = 7<<8; break; case 88200: srate = 5<<8; break; case 96000: srate = 3<<8; break; default: srate = 8<<8; } #endif #else data |= 0x0000C000; /* for external clock = 12.288Mhz */ switch(ptri2s_config->srate) { case 8000: srate = 48<<8; break; case 11250: srate = 34<<8; break; case 16000: srate = 23<<8; break; case 22050: srate = 17<<8; break; case 24000: srate = 15<<8; break; case 32000: srate = 11<<8; break; case 44100: srate = 8<<8; break; case 48000: srate = 7<<8; break; case 88200: srate = 5<<8; break; case 96000: srate = 3<<8; break; default: srate = 8<<8; } #endif data |= srate; #else /* for external clock = 12.288Mhz, I2S slave mode */ switch(ptri2s_config->srate) { case 8000: srate = 0x04; break; case 11250: srate = 0x10; break; case 16000: srate = 0x14; break; case 22050: srate = 0x38; break; case 24000: srate = 0x38; break; case 32000: srate = 0x18; break; case 44100: srate = 0x20; break; case 48000: srate = 0x00; break; case 88200: srate = 0x00; break; case 96000: srate = 0x1C; break; default: srate = 0x20; } #endif i2s_outw(RALINK_SYSCTL_BASE+0x30, data); MSG("RALINK_SYSCTL_BASE+0x30=0x%08X\n",data); /* set share pins to i2c */ data = i2s_inw(RALINK_REG_GPIOMODE); data &= 0xFFFFFFE0; data |= 0x00000008; i2s_outw(RALINK_REG_GPIOMODE, data); MSG("RALINK_REG_GPIOMODE=0x%08X\n",data); /* DAC initialization */ audiohw_preinit(); audiohw_postinit(); #ifdef I2S_MS_MODE #else audiohw_set_frequency(srate); #endif //saudiohw_enable_output(); //db = tenthdb2master(ptri2s_config->vol); //audiohw_set_lineout_vol(db, db); /* set I2S_I2SCFG */ data = i2s_inw(I2S_I2SCFG); data &= 0xFFFFFF80; data |= REGBIT(ptri2s_config->ff_thres, I2S_FF_THRES); data |= REGBIT(ptri2s_config->ch_swap, I2S_CH_SWAP); #ifdef I2S_MS_MODE data &= ~REGBIT(0x1, I2S_SLAVE_EN); data &= ~REGBIT(0x1, I2S_CLK_OUT_DIS); #else data |= REGBIT(0x1, I2S_SLAVE_EN); data |= REGBIT(0x1, I2S_CLK_OUT_DIS); #endif i2s_outw(I2S_I2SCFG, data); MSG("I2S_I2SCFG=%X\n",data); i2s_dev_enable(ptri2s_config); return I2S_OK; }