3 * Michael Schwingen, michael@schwingen.org
5 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/ixp425.h>
17 #include <asm/arch/ixp425pci.h>
20 #include "dvlhost_hw.h"
22 DECLARE_GLOBAL_DATA_PTR;
24 int board_early_init_f(void)
27 writel(0xBFFF0002, IXP425_EXP_CS1);
33 /* adress of boot parameters */
34 gd->bd->bi_boot_params = 0x00000100;
36 /* Setup GPIOs used as output */
37 GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_WDGTRIGGER);
38 GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_DLAN_PAIRING);
39 GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_PCIRST);
42 * LED latch enable and watchdog enable are tied to the same GPIO,
43 * so we need to trigger the watchdog if we want to enable the LEDs.
45 #ifdef CONFIG_HW_WATCHDOG
46 GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_WDG_LED_EN);
48 GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_WDG_LED_EN);
51 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_WDGTRIGGER);
52 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_DLAN_PAIRING);
53 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_WDG_LED_EN);
54 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCIRST);
56 /* Setup GPIOs for Interrupt inputs */
57 GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_BTN_WLAN);
58 GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_BTN_PAIRING);
59 GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_BTN_RESET);
60 GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_IRQA);
61 GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_IRQB);
63 /* Setup GPIO's for 33MHz clock output */
64 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCI_CLK);
65 GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_EXTBUS_CLK);
66 writel(0x01FF01FF, IXP425_GPIO_GPCLKR);
68 /* turn off all LEDs */
69 writew(0x0000, DVLHOST_LED_LATCH);
72 GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_PCIRST);
77 /* Check Board Identity */
80 char *s = getenv("serial#");
82 puts("Board: dLAN 200AV (dvlhost)");
95 gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, 128<<20);
100 struct pci_controller hose;
102 void pci_init_board(void)
110 /* init IcPlus IP175C ethernet switch to native IP175C mode */
111 miiphy_write("NPE1", 29, 31, 0x175C);