aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/usrp2p/bootloader/icap_test.c
blob: 5feb9d014c26264087ee453ee1426a4f028ade8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* -*- c++ -*- */
/*
 * Copyright 2010 Ettus Research LLC
 *
 */

#include <memory_map.h>
#include <hal_io.h>
#include <xilinx_s3_icap.h>
#include <nonstdio.h>

void delay(uint32_t t) {
	while(t-- != 0) asm("NOP");
}


int main(int argc, char *argv[]) {
	pic_init();
	hal_uart_init();
	puts("\nStarting delay...\n");

	output_regs->leds = 0xFF;
	delay(4000000);
	output_regs->leds = 0x00;
	delay(4000000);

	puts("Rebooting FPGA to 0x00000000\n");
	icap_reload_fpga((uint32_t)0x00000000);

	return 0;
}