comparison target-utils/c139explore/main.c @ 503:da53ea0a38ba

c139explore: osmo_delay_ms-ectomy and GPIO init fix
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 27 May 2019 02:19:42 +0000
parents f24b31082605
children fc3592a27317
comparison
equal deleted inserted replaced
502:cb33d81f1386 503:da53ea0a38ba
1 #include "types.h" 1 #include "types.h"
2
3 #define DELAY_1MS 13000
2 4
3 main() 5 main()
4 { 6 {
5 /* delay kludge workaround for defect in fc-compalram */ 7 /* delay kludge workaround for defect in fc-compalram */
6 osmo_delay_ms(30); 8 wait_ARM_cycles(DELAY_1MS * 30);
7 printf("C139 hardware exploration utility running\n"); 9 printf("C139 hardware exploration utility running\n");
8 /* GPIO init */ 10 /* GPIO init, compatible with both C139 and SE J100 */
9 *(volatile u16 *)0xfffe4802 = 0x0002; 11 *(volatile u16 *)0xfffe4802 = 0x0002;
10 *(volatile u16 *)0xfffe4804 = 0xFFF5; 12 *(volatile u16 *)0xfffe4804 = 0x2A59;
11 *(volatile u16 *)0xfffe4806 = 0xFFF3; /* enable ARMIO clock */ 13 *(volatile u16 *)0xfffe4806 = 0xFFF3; /* enable ARMIO clock */
12 /* take peripherals out of reset */ 14 /* take peripherals out of reset */
13 *(volatile u16 *)0xfffffd04 = 0xFFF3; 15 *(volatile u16 *)0xfffffd04 = 0xFFF3;
14 abb_init(); 16 abb_init();
15 uwire_init(); 17 uwire_init();