Nobuhiro Iwamatsu | 0d53a47 | 2008-08-31 22:45:08 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 0d53a47 | 2008-08-31 22:45:08 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/io.h> |
| 9 | #include <asm/processor.h> |
| 10 | #include <asm/pci.h> |
Yoshihiro Shimoda | 1d9b67b | 2008-09-09 17:52:47 +0900 | [diff] [blame] | 11 | #include <netdev.h> |
Nobuhiro Iwamatsu | 0d53a47 | 2008-08-31 22:45:08 +0900 | [diff] [blame] | 12 | |
John Rigby | 2956532 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
Nobuhiro Iwamatsu | 0d53a47 | 2008-08-31 22:45:08 +0900 | [diff] [blame] | 15 | int checkboard(void) |
| 16 | { |
| 17 | puts("BOARD: Renesas Technology Corp. R0P7785LC0011RL\n"); |
| 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | int board_init(void) |
| 22 | { |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | int dram_init(void) |
| 27 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 28 | gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; |
| 29 | gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; |
| 30 | printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024)); |
Nobuhiro Iwamatsu | 0d53a47 | 2008-08-31 22:45:08 +0900 | [diff] [blame] | 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | static struct pci_controller hose; |
| 35 | void pci_init_board(void) |
| 36 | { |
| 37 | pci_sh7780_init(&hose); |
| 38 | } |
| 39 | |
Yoshihiro Shimoda | 1d9b67b | 2008-09-09 17:52:47 +0900 | [diff] [blame] | 40 | int board_eth_init(bd_t *bis) |
| 41 | { |
| 42 | return pci_eth_init(bis); |
| 43 | } |
Yoshihiro Shimoda | ada9318 | 2009-03-03 15:11:17 +0900 | [diff] [blame] | 44 | |
| 45 | #if defined(CONFIG_SH_32BIT) |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 46 | int do_pmb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Yoshihiro Shimoda | ada9318 | 2009-03-03 15:11:17 +0900 | [diff] [blame] | 47 | { |
| 48 | /* clear ITLB */ |
| 49 | writel(0x00000004, 0xff000010); |
| 50 | |
| 51 | /* delete PMB for peripheral */ |
| 52 | writel(0, PMB_ADDR_BASE(0)); |
| 53 | writel(0, PMB_DATA_BASE(0)); |
| 54 | writel(0, PMB_ADDR_BASE(1)); |
| 55 | writel(0, PMB_DATA_BASE(1)); |
| 56 | writel(0, PMB_ADDR_BASE(2)); |
| 57 | writel(0, PMB_DATA_BASE(2)); |
| 58 | |
| 59 | /* add PMB for SDRAM(0x40000000 - 0x47ffffff) */ |
| 60 | writel(mk_pmb_addr_val(0x80), PMB_ADDR_BASE(8)); |
| 61 | writel(mk_pmb_data_val(0x40, 0, 1, 1, 0, 1, 1), PMB_DATA_BASE(8)); |
| 62 | writel(mk_pmb_addr_val(0xa0), PMB_ADDR_BASE(12)); |
| 63 | writel(mk_pmb_data_val(0x40, 1, 1, 1, 0, 0, 1), PMB_DATA_BASE(12)); |
| 64 | |
| 65 | return 0; |
| 66 | } |
| 67 | |
| 68 | U_BOOT_CMD( |
| 69 | pmb, 1, 1, do_pmb, |
| 70 | "pmb - PMB setting\n", |
| 71 | "\n" |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 72 | " - PMB setting for all SDRAM mapping" |
Yoshihiro Shimoda | ada9318 | 2009-03-03 15:11:17 +0900 | [diff] [blame] | 73 | ); |
| 74 | #endif |