]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/renesas/ecovec/ecovec.c
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 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <asm/processor.h>
29 /* USB power management register */
30 #define UPONCR0 0xA40501D4
34 puts("BOARD: ecovec\n");
40 DECLARE_GLOBAL_DATA_PTR
;
42 gd
->bd
->bi_memstart
= CONFIG_SYS_SDRAM_BASE
;
43 gd
->bd
->bi_memsize
= CONFIG_SYS_SDRAM_SIZE
;
44 printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE
/ (1024 * 1024));
48 static void debug_led(u8 led
)
50 /* PDGR[0-4] is debug LED */
51 outb((inb(PGDR
) & ~0x0F) | (led
& 0x0F), PGDR
);
54 int board_late_init(void)
62 /* SH-Eth (PLCR, PNCR, PXCR, PSELx )*/
63 outw(inw(PLCR
) & ~0xFFF0, PLCR
);
64 outw(inw(PNCR
) & ~0x000F, PNCR
);
65 outw(inw(PXCR
) & ~0x0FC0, PXCR
);
66 outw((inw(PSELB
) & ~0x030F) | 0x020A, PSELB
);
67 outw((inw(PSELC
) & ~0x0307) | 0x0207, PSELC
);
68 outw((inw(PSELE
) & ~0x00c0) | 0x0080, PSELE
);
72 outl(inl(MSTPCR2
) & ~0x10000000, MSTPCR2
);
74 i2c_init(CONFIG_SYS_I2C_SPEED
, CONFIG_SYS_I2C_SLAVE
);
75 i2c_set_bus_num(CONFIG_SYS_I2C_MODULE
); /* Use I2C 1 */
77 /* Read MAC address */
78 i2c_read(0x50, 0x10, 0, mac
, 6);
81 sprintf(env_mac
, "%02X:%02X:%02X:%02X:%02X:%02X",
82 mac
[0], mac
[1], mac
[2], mac
[3], mac
[4], mac
[5]);
83 setenv("ethaddr", env_mac
);
94 outw((inw(PGCR
) & ~0xFF) | 0x66, PGCR
);
95 outw((inw(HIZCRA
) & ~0x02), HIZCRA
);
99 /* SCIF0 (PTF, PTM) */
100 outw(inw(PFCR
) & ~0x30, PFCR
);
101 outw(inw(PMCR
) & ~0x0C, PMCR
);
102 outw((inw(PSELA
) & ~0x40) | 0x40, PSELA
);
107 outw((inw(PACR
) & ~0x0C) | 0x04, PACR
);
108 outb((inb(PADR
) & ~0x02) | 0x02, PADR
);
113 outw((inw(PBCR
) & ~0x300) | 0x100, PBCR
);
114 outb((inb(PBDR
) & ~0x10) | 0x10, PBDR
);
115 outl(inl(MSTPCR2
) & 0x100000, MSTPCR2
);
116 outw(0x0600, UPONCR0
);
121 outw((inw(PVCR
) & ~0x03) | 0x02 , PVCR
);