int board_early_init_f(void) { /* Port H: PH8 - PH13 == A4 - A9 * address lines of the parallel asynchronous memory interface */ /************************************************ * configure GPIO * * set port H function enable register * * configure PH8-PH13 as peripheral (not GPIO) * *************************************************/ bfin_write_PORTH_FER(0x3F03); /************************************************ * set port H MUX to configure PH8-PH13 * * 1st Function (MUX = 00) (bits 16-27 == 0) * * Set to address signals A4-A9 * *************************************************/ bfin_write_PORTH_MUX(0); /************************************************ * set port H direction register * * enable PH8-PH13 as outputs * *************************************************/ bfin_write_PORTH_DIR_SET(0x3F00); /* Port I: PI0 - PH14 == A10 - A24 * address lines of the parallel asynchronous memory interface */ /************************************************ * set port I function enable register * * configure PI0-PI14 as peripheral (not GPIO) * *************************************************/ bfin_write_PORTI_FER(0x7fff); /************************************************** * set PORT I MUX to configure PI14-PI0 as * * 1st Function (MUX=00) - address signals A10-A24 * ***************************************************/ bfin_write_PORTI_MUX(0); /**************************************** * set PORT I direction register * * enable PI0 - PI14 as outputs * *****************************************/ bfin_write_PORTI_DIR_SET(0x7fff); return 0; }
/** * * Function: bfin_config_atapi_gpio * * Description: Configures the ATAPI pins for use * */ static int bfin_config_atapi_gpio(struct ata_port *ap) { bfin_write_PORTH_FER(bfin_read_PORTH_FER() | 0x4); bfin_write_PORTH_MUX(bfin_read_PORTH_MUX() & ~0x30); bfin_write_PORTH_DIR_SET(0x4); bfin_write_PORTJ_FER(0x7f8); bfin_write_PORTJ_MUX(bfin_read_PORTI_MUX() & ~0x3fffc0); bfin_write_PORTJ_DIR_SET(0x5f8); bfin_write_PORTJ_DIR_CLEAR(0x200); bfin_write_PORTJ_INEN(0x200); bfin_write_PINT2_ASSIGN(0x0707); bfin_write_PINT2_MASK_SET(0x200); SSYNC(); return 0; }