static int update_boot_eeprom(void) { u32 len = 0x20; u8 chip = CONFIG_SYS_I2C_EEPROM_ADDR; u8 *pbuf; u8 base; int i; if (in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_ZEUS_PE)) { pbuf = buf_zeus_pe; base = 0x40; } else { pbuf = buf_zeus_ce; base = 0x00; } for (i = 0; i < len; i++, base++) { if (i2c_write(chip, base, 1, &pbuf[i], 1) != 0) { printf("i2c_write fail\n"); return 1; } udelay(11000); } return 0; }
static int katmai_pcie_card_present(int port) { u32 val; val = in32(GPIO0_IR); switch (port) { case 0: return !(val & GPIO_VAL(CONFIG_SYS_GPIO_PCIE_PRESENT0)); case 1: return !(val & GPIO_VAL(CONFIG_SYS_GPIO_PCIE_PRESENT1)); case 2: return !(val & GPIO_VAL(CONFIG_SYS_GPIO_PCIE_PRESENT2)); default: return 0; } }
/* * Check Board Identity: */ int checkboard(void) { char *s = getenv("serial#"); puts("Board: Zeus-"); if (in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_ZEUS_PE)) puts("PE"); else puts("CE"); puts(" of BulletEndPoint"); if (s != NULL) { puts(", serial# "); puts(s); } putc('\n'); /* both LED's off */ gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 0); gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 0); udelay(10000); /* and on again */ gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 1); gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 1); return (0); }
GPA4_ADDR19, GPA5_ADDR20, GPA6_ADDR21, GPA7_ADDR22, GPA8_ADDR23_GPIO | GPIO_IN, GPA9_ADDR24, /* BA0 */ GPA10_ADDR25, /* BA1 */ GPA11_ADDR26_GPIO | GPIO_IN, /* not connected */ /* DM9000 requirements */ GPA15_NGCS4, GPF7_EINT7, /* de-activate the speaker */ GPB0_GPIO | GPIO_OUT | GPIO_VAL(0), /* SD socket */ GPE5_SDCLK, GPE6_SDCMD, GPE7_SDDAT0, GPE8_SDDAT1, GPE9_SDDAT2, GPE10_SDDAT3, GPG8_GPIO | GPIO_IN, /* change detection */ GPH8_GPIO | GPIO_IN, /* write protection sense */ /* NAND requirements */ GPA17_CLE, GPA18_ALE, GPA19_NFWE,
static inline int sw_reset_pressed(void) { return !(in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_SW_RESET)); }
GPC1_SPI0_CLK, GPC2_SPI0_MOSI, GPC3_SPI0_NCS, GPC4_SPI1_MISO | ENABLE_PU, GPC5_SPI1_CLK, GPC6_SPI1_MOSI, GPC7_SPI1_NCS, GPD0_AC97_BITCLK, GPD1_AC97_NRST, GPD2_AC97_SYNC, GPD3_AC97_SDI | ENABLE_PU, GPD4_AC97_SDO, GPE0_GPIO | GPIO_OUT | GPIO_VAL(0), /* LCD backlight off */ GPE1_GPIO | GPIO_IN | ENABLE_PU, GPE2_GPIO | GPIO_IN | ENABLE_PU, GPE3_GPIO | GPIO_IN | ENABLE_PU, GPE4_GPIO | GPIO_IN | ENABLE_PU, /* keep all camera signals at reasonable values */ GPF0_GPIO | GPIO_IN | ENABLE_PU, GPF1_GPIO | GPIO_IN | ENABLE_PU, GPF2_GPIO | GPIO_IN | ENABLE_PU, GPF3_GPIO | GPIO_IN | ENABLE_PU, GPF4_GPIO | GPIO_IN | ENABLE_PU, GPF5_GPIO | GPIO_IN | ENABLE_PU, GPF6_GPIO | GPIO_IN | ENABLE_PU, GPF7_GPIO | GPIO_IN | ENABLE_PU, GPF8_GPIO | GPIO_IN | ENABLE_PU,