view target-utils/c139explore/main.c @ 565:4a199ff4b23f

loadtools/scripts/gta02.config: use WS=4 for consistency with generic configs which also work on GTA02 and GTA01 targets
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 31 Jan 2020 06:18:10 +0000
parents fc3592a27317
children
line wrap: on
line source

#include "types.h"

#define	DELAY_1MS	6500	/* ARM7 core runs at 26 MHz here, not 52 MHz */

main()
{
	/* delay kludge workaround for defect in fc-compalram */
	wait_ARM_cycles(DELAY_1MS * 30);
	printf("C139 hardware exploration utility running\n");
	/* GPIO init, compatible with both C139 and SE J100 */
	*(volatile u16 *)0xfffe4802 = 0x0002;
	*(volatile u16 *)0xfffe4804 = 0x2A59;
	*(volatile u16 *)0xfffe4806 = 0xFFF3;	/* enable ARMIO clock */
	/* take peripherals out of reset */
	*(volatile u16 *)0xfffffd04 = 0xFFF3;
	abb_init();
	uwire_init();
	for (;;) {
		putchar('=');
		if (command_entry())
			command_dispatch();
	}
}