Nobuhiro Iwamatsu | 7faddae | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <asm/io.h> |
| 13 | #include <asm/processor.h> |
| 14 | |
John Rigby | 2956532 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 15 | DECLARE_GLOBAL_DATA_PTR; |
| 16 | |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 17 | #define CPU_CMDREG 0xB1000006 |
| 18 | #define PDCR 0xffef0006 |
| 19 | #define PECR 0xffef0008 |
| 20 | #define PFCR 0xffef000a |
| 21 | #define PGCR 0xffef000c |
| 22 | #define PHCR 0xffef000e |
| 23 | #define PJCR 0xffef0012 |
| 24 | #define PKCR 0xffef0014 |
| 25 | #define PLCR 0xffef0016 |
| 26 | #define PMCR 0xffef0018 |
| 27 | #define PSEL1 0xffef0072 |
| 28 | #define PSEL2 0xffef0074 |
| 29 | #define PSEL3 0xffef0076 |
| 30 | |
| 31 | int checkboard(void) |
| 32 | { |
| 33 | puts("BOARD: Renesas SH7763 RDP\n"); |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | int board_init(void) |
| 38 | { |
| 39 | vu_short dat; |
| 40 | |
Nobuhiro Iwamatsu | 26209e4 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 41 | /* Enable mode */ |
| 42 | writew(inw(CPU_CMDREG)|0x0001, CPU_CMDREG); |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 43 | |
| 44 | /* GPIO Setting (eth1) */ |
Nobuhiro Iwamatsu | 26209e4 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 45 | dat = inw(PSEL1); |
| 46 | writew(((dat & ~0xff00) | 0x2400), PSEL1); |
| 47 | writew(0, PFCR); |
| 48 | writew(0, PGCR); |
| 49 | writew(0, PHCR); |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 50 | |
| 51 | return 0; |
| 52 | } |
| 53 | |
Nobuhiro Iwamatsu | 26209e4 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 54 | int dram_init(void) |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 55 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 56 | gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; |
| 57 | gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; |
| 58 | printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024)); |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 59 | return 0; |
| 60 | } |
| 61 | |
Nobuhiro Iwamatsu | 26209e4 | 2008-06-17 16:27:48 +0900 | [diff] [blame] | 62 | void led_set_state(unsigned short value) |
Nobuhiro Iwamatsu | 7faddae | 2008-06-09 13:39:57 +0900 | [diff] [blame] | 63 | { |
| 64 | } |