2 * (C) Copyright 2005, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 * (C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
6 * SPDX-License-Identifier: GPL-2.0+
11 #if defined(CONFIG_CFI_FLASH_MTD)
12 #include <mtd/cfi_flash.h>
17 void text_base_hook(void); /* nop hook for text_base.S */
19 #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \
20 defined(CONFIG_CFI_FLASH_MTD)
21 static void __early_flash_cmd_reset(void)
23 /* reset flash before we read env */
24 writeb(AMD_CMD_RESET, CONFIG_ENV_ADDR);
25 writeb(FLASH_CMD_RESET, CONFIG_ENV_ADDR);
27 void early_flash_cmd_reset(void)
28 __attribute__((weak,alias("__early_flash_cmd_reset")));
31 int board_early_init_f(void)
34 #ifdef CONFIG_ALTERA_PIO
36 altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o',
37 LED_PIO_RSTVAL, (1 << LED_PIO_WIDTH) - 1,
41 #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \
42 defined(CONFIG_CFI_FLASH_MTD)
43 early_flash_cmd_reset();
50 printf("BOARD : %s\n", CONFIG_BOARD_NAME);
54 phys_size_t initdram(int board_type)
60 int board_eth_init(bd_t *bis)
63 #ifdef CONFIG_SMC91111
64 rc += smc91111_initialize(0, CONFIG_SMC91111_BASE);
66 #ifdef CONFIG_DRIVER_DM9000
67 rc += dm9000_initialize(bis);
69 #ifdef CONFIG_ALTERA_TSE
70 rc += altera_tse_initialize(0,
71 CONFIG_SYS_ALTERA_TSE_MAC_BASE,
72 CONFIG_SYS_ALTERA_TSE_SGDMA_RX_BASE,
73 CONFIG_SYS_ALTERA_TSE_SGDMA_TX_BASE,
74 #if defined(CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_BASE) && \
75 (CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_SIZE > 0)
76 CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_BASE,
77 CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_SIZE);
84 rc += ethoc_initialize(0, CONFIG_SYS_ETHOC_BASE);