/** * Initialize the on-chip timer controller. We snag TMU channel 2 in its * highest resolution mode, and start it counting down from max_int. */ void timer_init() { unsigned int val = byte_read(TSTR); byte_write( TSTR, val & (~(1<<TMU_CHANNEL)) ); /* Stop counter */ long_write( TCOR(TMU_CHANNEL), 0xFFFFFFFF ); long_write( TCNT(TMU_CHANNEL), 0xFFFFFFFF ); word_write( TCR(TMU_CHANNEL), 0x00000000 ); }
//------------------------------------------------------------------------------ int board_init(void) { u32 v1, v2; //printf("board_init\n"); /* arch number of the board */ gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_EVM; /* address of boot parameters */ gd->bd->bi_boot_params = 0x0000100; //LINUX_BOOT_PARAM_ADDR; /* if workarounds are needed */ ka_errata_workarounds(); /* Disable SSI Clock */ word_write(KA_REGIF_BASE, word_read(KA_REGIF_BASE) & 0xffdfffff); // printf("Status %x\n", word_read(SDSW_M1_STATUS)); //setenv ("bootdelay", "8"); v1 = word_read(0x1ffc00); v2 = word_read(0x208000); #ifndef BOOT_FROM_SD if (v2 == 0xe1a00000 || v2 == 0xe3a00000) setenv ("bootf", "mmc init; go 208000"); else if (v2 == 0x56190527) setenv ("bootf", "mmc init; bootm 208000"); else if (v1 == 0xe1a00000 || v1 == 0xe3a00000) setenv ("bootf", "mmc init; go 1ffc00"); else if (v1 == 0x56190527) setenv ("bootf", "mmc init; bootm 1ffc00"); else #endif { //setenv ("bootf", "mmc init; fatload mmc 1 208000 image; go 208000"); setenv ("bootf", "run boot_sd"); //printf("v1 %x v2 %x\n", v1, v2); buzzer_off(); } /* Enable UART */ /*word_write(UART_LCR, 0x83); word_write(UART_INTR, 0x00); word_write(UART_RECV, 0x28); //baudrate=19200,12MHz word_write(UART_LCR, 0x03); */ /* Close PLL */ /* Power on required peripherals */ //timer_init(); //word_write(GPIO_OUTPUT, 0x66); return(0); }
void do_remap(unsigned int src_base, unsigned int dest_base, int length) { int i; //transfer data for(i = 0; i < length; i++) writel(readl(src_base + i), (dest_base + i)); //set remap reg to compelete remap word_write(0xa0000010, 0x1); return (0); }