// ***************** init.c ****************************************** // Risc-Dsp runtime library // // This file implements functions for initialization of risc-dsp co-work // // (c) multicore.ru // // ******************************************************************* #include "init.h" #include "mcom02.h" #include "overlay.h" // // @name: config_overlay // @description: init dsp description entries, set page mode, setup overlay config // // @in unsigned num - dsp num (0..3) // @in unsigned page_mode - (0,2,3) - sets ratio between pram:xram memory size // void config_overlay(unsigned num, unsigned page_mode) { init_dsp_entry(); add_dsp_entry(0x0, page_mode, 0x3, 0x3a600000, 0x3a400000); // dsp0 entry add_dsp_entry(0x1, page_mode, 0xB, 0x3a620000, 0x3a420000); // dsp1 entry print_dsp_memory_info(); CSR_DSP |= ((page_mode << 2) & 0xC); init_overlay(num); // init overlay for DSP0 set_curr_dsp(num); } // // @name: cache_config // @description: setup mips cache config // int cache_config() { return 0; } // // @name: enable_dsp_interrupt // @description: allow interrupts handling from dsp cores in mips // void enable_dsp_interrupt() { }