2 * Copyright (C) 2009, 2011 Renesas Solutions Corp.
3 * Copyright (C) 2009 Kuninori Morimoto <morimoto.kuninori@renesas.com>
4 * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
6 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/processor.h>
16 /* USB power management register */
17 #define UPONCR0 0xA40501D4
21 puts("BOARD: ecovec\n");
25 static void debug_led(u8 led)
27 /* PDGR[0-4] is debug LED */
28 outb((inb(PGDR) & ~0x0F) | (led & 0x0F), PGDR);
31 int board_late_init(void)
38 /* SH-Eth (PLCR, PNCR, PXCR, PSELx )*/
39 outw(inw(PLCR) & ~0xFFF0, PLCR);
40 outw(inw(PNCR) & ~0x000F, PNCR);
41 outw(inw(PXCR) & ~0x0FC0, PXCR);
42 outw((inw(PSELB) & ~0x030F) | 0x020A, PSELB);
43 outw((inw(PSELC) & ~0x0307) | 0x0207, PSELC);
44 outw((inw(PSELE) & ~0x00c0) | 0x0080, PSELE);
48 outl(inl(MSTPCR2) & ~0x10000000, MSTPCR2);
50 i2c_set_bus_num(1); /* Use I2C 1 */
52 /* Read MAC address */
53 i2c_read(0x50, 0x10, 0, mac, 6);
56 sprintf(env_mac, "%02X:%02X:%02X:%02X:%02X:%02X",
57 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
58 env_set("ethaddr", env_mac);
69 outw((inw(PGCR) & ~0xFF) | 0x55, PGCR);
70 outw((inw(HIZCRA) & ~0x02), HIZCRA);
74 /* SCIF0 (PTF, PTM) */
75 outw(inw(PFCR) & ~0x30, PFCR);
76 outw(inw(PMCR) & ~0x0C, PMCR);
77 outw((inw(PSELA) & ~0x40) | 0x40, PSELA);
82 outw((inw(PACR) & ~0x0C) | 0x04, PACR);
83 outb((inb(PADR) & ~0x02) | 0x02, PADR);
88 outw((inw(PBCR) & ~0x300) | 0x100, PBCR);
89 outb((inb(PBDR) & ~0x10) | 0x10, PBDR);
90 outl(inl(MSTPCR2) & ~0x100000, MSTPCR2);
91 outw(0x0600, UPONCR0);
96 outw((inw(PVCR) & ~0x03) | 0x02 , PVCR);