3 * Michael Kurz <michi.kurz@googlemail.com>.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/mipsregs.h>
27 #include <asm/addrspace.h>
28 #include <asm/reboot.h>
29 #include <asm/ar71xx.h>
30 #include <asm/ar71xx_gpio.h>
32 #define NBG460N_WAN_LED 19
34 phys_size_t
initdram(int board_type
)
36 return (32*1024*1024);
41 // Set pin 19 to 1, to stop WAN LED blinking
42 ar71xx_setpindir(NBG460N_WAN_LED
, 1);
43 ar71xx_setpin(NBG460N_WAN_LED
, 1);
45 printf("U-boot on Zyxel NBG460N\n");
49 void _machine_restart(void)
52 writel((RESET_MODULE_FULL_CHIP
| RESET_MODULE_DDR
),
53 KSEG1ADDR(AR71XX_RESET_BASE
+ AR91XX_RESET_REG_RESET_MODULE
));
54 readl(KSEG1ADDR(AR71XX_RESET_BASE
+ AR91XX_RESET_REG_RESET_MODULE
));
58 int board_eth_init(bd_t
*bis
)
60 char *phynames
[] = {RTL8366_DEVNAME
, RTL8366_DEVNAME
};
61 u16 phyids
[] = {RTL8366_LANPHY_ID
, RTL8366_WANPHY_ID
};
62 u16 phyfixed
[] = {1, 0};
64 if (ag71xx_register(bis
, phynames
, phyids
, phyfixed
) <= 0)
67 if (rtl8366s_initialize())
70 if (rtl8366_mii_register(bis
))
76 int misc_init_r(void) {
80 debug("Testing mac addresses\n");
82 memcpy(macaddr
, (uint8_t *) CONFIG_ETHADDR_ADDR
, 6);
84 if (!eth_getenv_enetaddr("ethaddr", enetaddr
)) {
85 debug("Setting eth0 mac addr to %pM\n", macaddr
);
86 eth_setenv_enetaddr("ethaddr", macaddr
);
89 if (!eth_getenv_enetaddr("eth1addr", enetaddr
)) {
91 debug("Setting eth1 mac addr to %pM\n", macaddr
);
92 eth_setenv_enetaddr("eth1addr", macaddr
);