=================================================================== RCS file: /cvs/funnyos/arch/sam7s64/config.c,v retrieving revision 1.11 retrieving revision 1.15 diff -u -r1.11 -r1.15 --- funnyos/arch/sam7s64/config.c 2007/11/24 17:10:07 1.11 +++ funnyos/arch/sam7s64/config.c 2007/12/20 15:38:46 1.15 @@ -1,5 +1,5 @@ /* - * $Id: config.c,v 1.11 2007/11/24 17:10:07 nbrk Exp $ + * $Id: config.c,v 1.15 2007/12/20 15:38:46 nbrk Exp $ */ #include #include @@ -17,6 +17,10 @@ extern struct driver saapbus_dr; extern struct driver sapio_dr; extern struct driver gpioled_dr; +extern struct driver saaic_dr; +extern struct driver sartt_dr; +extern struct driver gpiobtn_dr; +extern struct driver saspi_dr; extern void (*putchar)(char); @@ -30,12 +34,17 @@ */ struct attachinfo config_attachinfo[] = { /* child, parent, pminor, loc, intrno, flags */ - { "cpu" , "root", 0, 0, 0, 0 }, - { "saapbus","root", 0, 0, 0, 0 }, - { "sapio", "saapbus", 0, 0, 0, 0 }, - { "gpioled","sapio", 0, 17, 0, 0 }, - { "gpioled","sapio", 0, 18, 0, 0 }, - { NULL, NULL, 0, 0, 0, 0 } + { "cpu" , "root", 0, 0, -1, 0 }, + { "saapbus","root", 0, 0, -1, 0 }, + { "sapio", "saapbus", 0, 0, -1, 0 }, + { "gpioled","sapio", 0, 17, -1, 0 }, + { "gpioled","sapio", 0, 18, -1, 0 }, + { "gpiobtn","sapio", 0, 19, 0, 0 /*controls gpioled/0*/}, + { "gpiobtn","sapio", 0, 20, 30, 0 /*controls gpioled/1*/}, +// { "sartt", "saapbus", 0, 0, 1, 0 }, + { "saspi", "saapbus", 0, 0, 0, 0 }, +// { "saaic", "saapbus", 0, 0, -1, 0 }, + { NULL, NULL, 0, 0, -1, 0 } }; @@ -49,6 +58,10 @@ { "saapbus" , &saapbus_dr, -1 }, { "sapio", &sapio_dr, -1 }, { "gpioled", &gpioled_dr, -1 }, + { "saaic", &saaic_dr, -1 }, + { "sartt", &sartt_dr, -1 }, + { "gpiobtn", &gpiobtn_dr, -1 }, + { "saspi", &saspi_dr, -1 }, { NULL, NULL, 0 } }; @@ -121,14 +134,9 @@ while(!(*AT91C_PMC_SR & AT91C_PMC_MCKRDY)) ; - /* enable clock to PIO and USART0 */ - //*AT91C_PMC_PCER = AT91C_ID_PIOA | AT91C_ID_US0; + /* enable clock to all modules */ *AT91C_PMC_PCER = AT91C_ALL_INT; - *AT91C_PIOA_PER = (1 << 17 | 1 << 18); - *AT91C_PIOA_OER = (1 << 17 | 1 << 18); - *AT91C_PIOA_CODR= (1 << 17 | 1 << 18); - /* initialize USART0 (we clock it in PMC above) */ *AT91C_PIOA_PDR = AT91C_PA5_RXD0 | /* Enable RxD0 Pin */