Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Renesas Solutions Corp. |
| 3 | * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> |
| 4 | * Copyright (C) 2007 Kenati Technologies, Inc. |
| 5 | * |
| 6 | * board/sh7763rdp/sh7763rdp.c |
| 7 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 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, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <asm/io.h> |
| 26 | #include <asm/processor.h> |
| 27 | |
John Rigby | 0d21ed0 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 28 | DECLARE_GLOBAL_DATA_PTR; |
| 29 | |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 30 | #define CPU_CMDREG 0xB1000006 |
| 31 | #define PDCR 0xffef0006 |
| 32 | #define PECR 0xffef0008 |
| 33 | #define PFCR 0xffef000a |
| 34 | #define PGCR 0xffef000c |
| 35 | #define PHCR 0xffef000e |
| 36 | #define PJCR 0xffef0012 |
| 37 | #define PKCR 0xffef0014 |
| 38 | #define PLCR 0xffef0016 |
| 39 | #define PMCR 0xffef0018 |
| 40 | #define PSEL1 0xffef0072 |
| 41 | #define PSEL2 0xffef0074 |
| 42 | #define PSEL3 0xffef0076 |
| 43 | |
| 44 | int checkboard(void) |
| 45 | { |
| 46 | puts("BOARD: Renesas SH7763 RDP\n"); |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | int board_init(void) |
| 51 | { |
| 52 | vu_short dat; |
| 53 | |
Nobuhiro Iwamatsu | 73c4019 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 54 | /* Enable mode */ |
| 55 | writew(inw(CPU_CMDREG)|0x0001, CPU_CMDREG); |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 56 | |
| 57 | /* GPIO Setting (eth1) */ |
Nobuhiro Iwamatsu | 73c4019 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 58 | dat = inw(PSEL1); |
| 59 | writew(((dat & ~0xff00) | 0x2400), PSEL1); |
| 60 | writew(0, PFCR); |
| 61 | writew(0, PGCR); |
| 62 | writew(0, PHCR); |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 63 | |
| 64 | return 0; |
| 65 | } |
| 66 | |
Nobuhiro Iwamatsu | 73c4019 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 67 | int dram_init(void) |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 68 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 69 | gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; |
| 70 | gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; |
| 71 | printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024)); |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 72 | return 0; |
| 73 | } |
| 74 | |
Nobuhiro Iwamatsu | 73c4019 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 75 | void led_set_state(unsigned short value) |
Nobuhiro Iwamatsu | 113a37e | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 76 | { |
| 77 | } |