#include <stdio.h>
#include <unistd.h>

#include "rr_io.h"

int main(int argc, char *argv[])
{
	if(argc != 2){
		printf( "usage: %s filename \n", argv[0]);
	}
	else{
		rr_init();
		gennum_writel(0xE001F07C, 0x808); // set local bus freq
		//gennum_writel(0x00002000, 0xA04); // GPIO direction
		//gennum_writel(0x0000D000, 0xA08); // GPIO output enable
		//gennum_writel(0x00008000, 0xA0C); // GPIO output value
		printf("Firmware to be loaded : %s \n", argv[1]);
		rr_load_bitstream_from_file(argv[1]);
		printf("Firmware loaded successfully ! \n");
	}
}
