void splash_showerr() { if( !get_board_desc()->vga ) { printf("E: No VGA support on this board\n"); return; } int x, y; unsigned short color = 0xF800; if(splash_fb == NULL) return; for(y=0;y<5;y++) for(x=0;x<splash_hres;x++) splash_fb[splash_hres*y+x] = color; for(;y<(splash_vres-5);y++) { for(x=0;x<5;x++) splash_fb[splash_hres*y+x] = color; for(x=splash_hres-5;x<splash_hres;x++) splash_fb[splash_hres*y+x] = color; } for(;y<splash_vres;y++) for(x=0;x<splash_hres;x++) splash_fb[splash_hres*y+x] = color; if( !get_memctrl_desc()->cacheflush_required ) { get_memctrl_desc()->cacheflush_function(0); } }
int bbssel_main(void) { xml_header("bbssel"); printf("<bbssel "); print_session(); printf(">"); char *brd = getparm("brd"); if (*brd != '\0') { struct boardheader *bp; int found = 0; for (int i = 0; i < MAXBOARD; i++) { bp = bcache + i; if (!hasreadperm(¤tuser, bp)) continue; if (strcasestr(bp->filename, brd) || strcasestr(bp->title, brd)) { printf("<brd dir='%d' title='%s' desc='%s' />", is_board_dir(bp), bp->filename, get_board_desc(bp)); found++; } } if (!found) printf("<notfound />"); } printf("</bbssel>"); return 0; }
void splash_display(void *fbadr) { if( !get_board_desc()->vga ) { printf("E: No VGA support on this board\n"); return; } int i; unsigned short *splash_src = (unsigned short *)65536; printf("I: Displaying splash screen..."); splash_fb = (unsigned short *)fbadr; splash_hres = 640; splash_vres = 480; for(i=0;i<splash_hres*splash_vres;i++) splash_fb[i] = splash_src[i]; if( !get_memctrl_desc()->cacheflush_required ) { get_memctrl_desc()->cacheflush_function(0); } CSR_VGA_BASEADDRESS = (unsigned int)splash_fb; CSR_VGA_RESET = 0; printf("OK\n"); }
int main(int i, char **c) { char buffer[64]; brd_desc = get_board_desc(); /* Check for double baud rate */ if(brd_desc != NULL) { if(CSR_GPIO_IN & GPIO_DIP2) CSR_UART_DIVISOR = brd_desc->clk_frequency/230400/16; } /* Display a banner as soon as possible to show that the system is alive */ putsnonl(banner); crcbios(); display_board(); display_capabilities(); boot_sequence(); splash_showerr(); while(1) { putsnonl("\e[1mBIOS>\e[0m "); readstr(buffer, 64); do_command(buffer); } return 0; }
static __inline__ void store_block (unsigned block, unsigned char * src, unsigned len) { unsigned long offset = block * 512; unsigned long newsize = offset + len; (void)memcpy((void *)(get_board_desc()->memctrl_membase + offset), src, len); if (NetBootFileXferSize < newsize) NetBootFileXferSize = newsize; }
void TftpStart (void) { struct timestamp now; time_get(&now); #ifdef ET_DEBUG printf ("\nServer ethernet address %02x:%02x:%02x:%02x:%02x:%02x\n", NetServerEther[0], NetServerEther[1], NetServerEther[2], NetServerEther[3], NetServerEther[4], NetServerEther[5] ); #endif /* DEBUG */ printf ("TFTP from server %s", inet_ntoa(NetServerIP)); printf ("; our IP address is %s", inet_ntoa(NetOurIP)); // Check if we need to send across this subnet if (NetOurGatewayIP && NetOurSubnetMask) { IPaddr_t OurNet = NetOurIP & NetOurSubnetMask; IPaddr_t ServerNet = NetServerIP & NetOurSubnetMask; if (OurNet != ServerNet) { printf ("; sending through gateway "); print_IPaddr (NetOurGatewayIP) ; } } printf("\n"); printf ("Filename '%s'.", tftp_filename); if (NetBootFileSize) { printf (" Size is %d%s kB => %x Bytes", NetBootFileSize/2, (NetBootFileSize%2) ? ".5" : "", NetBootFileSize<<9); } printf("\n"); printf ("Load address: 0x%lx\n\n", get_board_desc()->memctrl_membase); printf ("Press Ctrl-C to abort...\n"); printf ("Loading: *\b"); NetSetTimeout (TIMEOUT * 1000, TftpTimeout); NetSetHandler (TftpHandler); TftpServerPort = WELL_KNOWN_PORT; TftpTimeoutCount = 0; TftpState = STATE_RRQ; TftpOurPort = 1024 + (now.usec % 3072); //FIXED TftpSend (); }
void tmu_init() { unsigned int mask; frequency = get_board_desc()->clk_frequency; produce = 0; consume = 0; level = 0; cts = 1; CSR_TMU_CTL = 0; irq_ack(IRQ_TMU); mask = irq_getmask(); mask |= IRQ_TMU; irq_setmask(mask); printf("TMU: texture mapping unit initialized\n"); }
void brd_init() { int rev; char soc_version[13]; brd_desc = get_board_desc(); if(brd_desc == NULL) { printf("BRD: Running on unknown board (ID=0x%08x), startup aborted.\n", CSR_SYSTEM_ID); while(1); } rev = get_pcb_revision(); get_soc_version_formatted(soc_version); printf("BRD: SoC %s on %s (PCB revision %d)\n", soc_version, brd_desc->name, rev); if(strcmp(soc_version, VERSION) != 0) printf("BRD: SoC and HAL versions do not match!\n"); if(rev > 2) printf("BRD: Unsupported PCB revision, please upgrade!\n"); display_capabilities(); }
int main(int i, char **c) { char buffer[64]; brd_desc = get_board_desc(); /* Display a banner as soon as possible to show that the system is alive */ putsnonl(banner); crcbios(); display_board(); boot_sequence(); while(1) { putsnonl("\e[1mBIOS>\e[0m "); readstr(buffer, 64); do_command(buffer); } return 0; }