int exynos_init(void) { gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE; gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE; gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210; switch (get_hwrev()) { case 0: /* * Set the low to enable LDO_EN * But when you use the test board for eMMC booting * you should set it HIGH since it removes the inverter */ /* MASSMEMORY_EN: XMDMDATA_6: GPE3[6] */ s5p_gpio_direction_output(&gpio1->e3, 6, 0); break; default: /* * Default reset state is High and there's no inverter * But set it as HIGH to ensure */ /* MASSMEMORY_EN: XMDMADDR_3: GPE1[3] */ s5p_gpio_direction_output(&gpio1->e1, 3, 1); break; } #ifdef CONFIG_SOFT_SPI soft_spi_init(); #endif check_hw_revision(); printf("HW Revision:\t0x%x\n", board_rev); return 0; }
int board_init(void) { gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE; gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE; gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210; gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; #ifdef CONFIG_SOFT_SPI soft_spi_init(); #endif check_hw_revision(); printf("HW Revision:\t0x%x\n", board_rev); return 0; }
int main(void) { DDRB |= 0xFF; DDRD |= (1<<5) | (1<<6); PORTD = (1<<6); uint16_t tmp = 512; while(tmp--) { lcd_content[tmp] = 0x00; } spi_init(); soft_spi_init(); enc28j60_init(); nic_init(enc28j60_send_packet, enc28j60_receive_packet, enc28j60_set_mac); dhcp_init(dhcpname); timer_init(); sei(); //char nic_buffer[600]; while(1) { nic_doEvents(nic_buffer); dhcp_doEvents(nic_buffer); } }