Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 2 | /* |
| 3 | * board/renesas/blanche/blanche.c |
| 4 | * This file is blanche board support. |
| 5 | * |
| 6 | * Copyright (C) 2016 Renesas Electronics Corporation |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 10 | #include <asm/arch/mmc.h> |
| 11 | #include <asm/arch/rcar-mstp.h> |
| 12 | #include <asm/arch/rmobile.h> |
| 13 | #include <asm/arch/sh_sdhi.h> |
| 14 | #include <asm/arch/sys_proto.h> |
| 15 | #include <asm/gpio.h> |
| 16 | #include <asm/io.h> |
| 17 | #include <asm/mach-types.h> |
| 18 | #include <asm/processor.h> |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 19 | #include <dm.h> |
| 20 | #include <dm/platform_data/serial_sh.h> |
Alex Kiernan | 9c21549 | 2018-04-01 09:22:38 +0000 | [diff] [blame] | 21 | #include <environment.h> |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 22 | #include <i2c.h> |
Masahiro Yamada | 56a931c | 2016-09-21 11:28:55 +0900 | [diff] [blame] | 23 | #include <linux/errno.h> |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 24 | #include <malloc.h> |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 25 | #include <miiphy.h> |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 26 | #include <mmc.h> |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 27 | #include <netdev.h> |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 28 | #include "qos.h" |
| 29 | |
| 30 | DECLARE_GLOBAL_DATA_PTR; |
| 31 | |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 32 | #define CPG_PLL1CR 0xE6150028 |
| 33 | #define CPG_PLL3CR 0xE61500DC |
| 34 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 35 | #define TMU0_MSTP125 BIT(25) |
| 36 | #define QSPI_MSTP917 BIT(17) |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 37 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 38 | struct reg_config { |
| 39 | u16 off; |
| 40 | u32 val; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 41 | }; |
| 42 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 43 | static void blanche_init_sys(void) |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 44 | { |
| 45 | struct rcar_rwdt *rwdt = (struct rcar_rwdt *)RWDT_BASE; |
| 46 | struct rcar_swdt *swdt = (struct rcar_swdt *)SWDT_BASE; |
| 47 | u32 cpu_type; |
| 48 | |
| 49 | cpu_type = rmobile_get_cpu_type(); |
| 50 | if (cpu_type == 0x4A) { |
| 51 | writel(0x4D000000, CPG_PLL1CR); |
| 52 | writel(0x4F000000, CPG_PLL3CR); |
| 53 | } |
| 54 | |
| 55 | /* Watchdog init */ |
| 56 | writel(0xA5A5A500, &rwdt->rwtcsra); |
| 57 | writel(0xA5A5A500, &swdt->swtcsra); |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 58 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 59 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 60 | static void blanche_init_pfc(void) |
| 61 | { |
| 62 | static const struct reg_config pfc_with_unlock[] = { |
| 63 | { 0x0004, 0x0bffffff }, |
| 64 | { 0x0008, 0x002fffff }, |
| 65 | { 0x0014, 0x00000fff }, |
| 66 | { 0x0018, 0x00010fff }, |
| 67 | { 0x001c, 0x00010fff }, |
| 68 | { 0x0020, 0x00010fff }, |
| 69 | { 0x0024, 0x00010fff }, |
| 70 | { 0x0028, 0x00010fff }, |
| 71 | { 0x002c, 0x04006000 }, |
| 72 | { 0x0030, 0x303fefe0 }, |
| 73 | { 0x0058, 0x0002000e }, |
| 74 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 75 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 76 | static const struct reg_config pfc_without_unlock[] = { |
| 77 | { 0x0108, 0x00000000 }, |
| 78 | { 0x010c, 0x0803FF40 }, |
| 79 | { 0x0110, 0x0000FFFF }, |
| 80 | { 0x0114, 0x00010FFF }, |
| 81 | { 0x011c, 0x0001AFFF }, |
| 82 | { 0x0124, 0x0001CFFF }, |
| 83 | { 0x0128, 0xC0438001 }, |
| 84 | { 0x012c, 0x0FC00007 }, |
| 85 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 86 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 87 | static const u32 pfc_base = 0xe6060000; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 88 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 89 | unsigned int i; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 90 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 91 | for (i = 0; i < ARRAY_SIZE(pfc_with_unlock); i++) { |
| 92 | writel(~pfc_with_unlock[i].val, pfc_base); |
| 93 | writel(pfc_with_unlock[i].val, |
| 94 | pfc_base | pfc_with_unlock[i].off); |
| 95 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 96 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 97 | for (i = 0; i < ARRAY_SIZE(pfc_without_unlock); i++) |
| 98 | writel(pfc_without_unlock[i].val, |
| 99 | pfc_base | pfc_without_unlock[i].off); |
| 100 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 101 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 102 | static void blanche_init_lbsc(void) |
| 103 | { |
| 104 | static const struct reg_config lbsc_config[] = { |
| 105 | { 0x00, 0x00000020 }, |
| 106 | { 0x08, 0x00002020 }, |
| 107 | { 0x30, 0x2a103320 }, |
| 108 | { 0x38, 0x19102110 }, |
| 109 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 110 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 111 | static const u32 lbsc_base = 0xfec00200; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 112 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 113 | unsigned int i; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 114 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 115 | for (i = 0; i < ARRAY_SIZE(lbsc_config); i++) { |
| 116 | writel(lbsc_config[i].val, |
| 117 | lbsc_base | lbsc_config[i].off); |
| 118 | writel(lbsc_config[i].val, |
| 119 | lbsc_base | (lbsc_config[i].off + 4)); |
| 120 | } |
| 121 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 122 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 123 | #if defined(CONFIG_MTD_NOR_FLASH) |
| 124 | static void dbsc_wait(u16 reg) |
| 125 | { |
| 126 | static const u32 dbsc3_0_base = DBSC3_0_BASE; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 127 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 128 | while (!(readl(dbsc3_0_base + reg) & BIT(0))) |
| 129 | ; |
| 130 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 131 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 132 | static void blanche_init_dbsc(void) |
| 133 | { |
| 134 | static const struct reg_config dbsc_config1[] = { |
| 135 | { 0x0280, 0x0000a55a }, |
| 136 | { 0x0018, 0x21000000 }, |
| 137 | { 0x0018, 0x11000000 }, |
| 138 | { 0x0018, 0x10000000 }, |
| 139 | { 0x0290, 0x00000001 }, |
| 140 | { 0x02a0, 0x80000000 }, |
| 141 | { 0x0290, 0x00000004 }, |
| 142 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 143 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 144 | static const struct reg_config dbsc_config2[] = { |
| 145 | { 0x0290, 0x00000006 }, |
| 146 | { 0x02a0, 0x0001c000 }, |
| 147 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 148 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 149 | static const struct reg_config dbsc_config4[] = { |
| 150 | { 0x0290, 0x0000000f }, |
| 151 | { 0x02a0, 0x00181ee4 }, |
| 152 | { 0x0290, 0x00000010 }, |
| 153 | { 0x02a0, 0xf00464db }, |
| 154 | { 0x0290, 0x00000061 }, |
| 155 | { 0x02a0, 0x0000008d }, |
| 156 | { 0x0290, 0x00000001 }, |
| 157 | { 0x02a0, 0x00000073 }, |
| 158 | { 0x0020, 0x00000007 }, |
| 159 | { 0x0024, 0x0f030a02 }, |
| 160 | { 0x0030, 0x00000001 }, |
| 161 | { 0x00b0, 0x00000000 }, |
| 162 | { 0x0040, 0x0000000b }, |
| 163 | { 0x0044, 0x00000008 }, |
| 164 | { 0x0048, 0x00000000 }, |
| 165 | { 0x0050, 0x0000000b }, |
| 166 | { 0x0054, 0x000c000b }, |
| 167 | { 0x0058, 0x00000027 }, |
| 168 | { 0x005c, 0x0000001c }, |
| 169 | { 0x0060, 0x00000006 }, |
| 170 | { 0x0064, 0x00000020 }, |
| 171 | { 0x0068, 0x00000008 }, |
| 172 | { 0x006c, 0x0000000c }, |
| 173 | { 0x0070, 0x00000009 }, |
| 174 | { 0x0074, 0x00000012 }, |
| 175 | { 0x0078, 0x000000d0 }, |
| 176 | { 0x007c, 0x00140005 }, |
| 177 | { 0x0080, 0x00050004 }, |
| 178 | { 0x0084, 0x70233005 }, |
| 179 | { 0x0088, 0x000c0000 }, |
| 180 | { 0x008c, 0x00000300 }, |
| 181 | { 0x0090, 0x00000040 }, |
| 182 | { 0x0100, 0x00000001 }, |
| 183 | { 0x00c0, 0x00020001 }, |
| 184 | { 0x00c8, 0x20082004 }, |
| 185 | { 0x0380, 0x00020002 }, |
| 186 | { 0x0390, 0x0000001f }, |
| 187 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 188 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 189 | static const struct reg_config dbsc_config5[] = { |
| 190 | { 0x0244, 0x00000011 }, |
| 191 | { 0x0290, 0x00000003 }, |
| 192 | { 0x02a0, 0x0300c4e1 }, |
| 193 | { 0x0290, 0x00000023 }, |
| 194 | { 0x02a0, 0x00fcdb60 }, |
| 195 | { 0x0290, 0x00000011 }, |
| 196 | { 0x02a0, 0x1000040b }, |
| 197 | { 0x0290, 0x00000012 }, |
| 198 | { 0x02a0, 0x9d9cbb66 }, |
| 199 | { 0x0290, 0x00000013 }, |
| 200 | { 0x02a0, 0x1a868400 }, |
| 201 | { 0x0290, 0x00000014 }, |
| 202 | { 0x02a0, 0x300214d8 }, |
| 203 | { 0x0290, 0x00000015 }, |
| 204 | { 0x02a0, 0x00000d70 }, |
| 205 | { 0x0290, 0x00000016 }, |
| 206 | { 0x02a0, 0x00000004 }, |
| 207 | { 0x0290, 0x00000017 }, |
| 208 | { 0x02a0, 0x00000018 }, |
| 209 | { 0x0290, 0x0000001a }, |
| 210 | { 0x02a0, 0x910035c7 }, |
| 211 | { 0x0290, 0x00000004 }, |
| 212 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 213 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 214 | static const struct reg_config dbsc_config6[] = { |
| 215 | { 0x0290, 0x00000001 }, |
| 216 | { 0x02a0, 0x00000181 }, |
| 217 | { 0x0018, 0x11000000 }, |
| 218 | { 0x0290, 0x00000004 }, |
| 219 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 220 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 221 | static const struct reg_config dbsc_config7[] = { |
| 222 | { 0x0290, 0x00000001 }, |
| 223 | { 0x02a0, 0x0000fe01 }, |
| 224 | { 0x0304, 0x00000000 }, |
| 225 | { 0x00f4, 0x01004c20 }, |
| 226 | { 0x00f8, 0x014000aa }, |
| 227 | { 0x00e0, 0x00000140 }, |
| 228 | { 0x00e4, 0x00081860 }, |
| 229 | { 0x00e8, 0x00010000 }, |
| 230 | { 0x0290, 0x00000004 }, |
| 231 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 232 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 233 | static const struct reg_config dbsc_config8[] = { |
| 234 | { 0x0014, 0x00000001 }, |
| 235 | { 0x0010, 0x00000001 }, |
| 236 | { 0x0280, 0x00000000 }, |
| 237 | }; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 238 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 239 | static const u32 dbsc3_0_base = DBSC3_0_BASE; |
| 240 | unsigned int i; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 241 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 242 | for (i = 0; i < ARRAY_SIZE(dbsc_config1); i++) |
| 243 | writel(dbsc_config1[i].val, dbsc3_0_base | dbsc_config1[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 244 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 245 | dbsc_wait(0x2a0); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 246 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 247 | for (i = 0; i < ARRAY_SIZE(dbsc_config2); i++) |
| 248 | writel(dbsc_config2[i].val, dbsc3_0_base | dbsc_config2[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 249 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 250 | for (i = 0; i < ARRAY_SIZE(dbsc_config4); i++) |
| 251 | writel(dbsc_config4[i].val, dbsc3_0_base | dbsc_config4[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 252 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 253 | dbsc_wait(0x240); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 254 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 255 | for (i = 0; i < ARRAY_SIZE(dbsc_config5); i++) |
| 256 | writel(dbsc_config5[i].val, dbsc3_0_base | dbsc_config5[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 257 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 258 | dbsc_wait(0x2a0); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 259 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 260 | for (i = 0; i < ARRAY_SIZE(dbsc_config6); i++) |
| 261 | writel(dbsc_config6[i].val, dbsc3_0_base | dbsc_config6[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 262 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 263 | dbsc_wait(0x2a0); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 264 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 265 | for (i = 0; i < ARRAY_SIZE(dbsc_config7); i++) |
| 266 | writel(dbsc_config7[i].val, dbsc3_0_base | dbsc_config7[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 267 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 268 | dbsc_wait(0x2a0); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 269 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 270 | for (i = 0; i < ARRAY_SIZE(dbsc_config8); i++) |
| 271 | writel(dbsc_config8[i].val, dbsc3_0_base | dbsc_config8[i].off); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 272 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 273 | } |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 274 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 275 | static void s_init_wait(volatile unsigned int cnt) |
| 276 | { |
| 277 | volatile u32 i = cnt * 0x10000; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 278 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 279 | while (i-- > 0) |
| 280 | ; |
| 281 | } |
| 282 | #endif |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 283 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 284 | void s_init(void) |
| 285 | { |
| 286 | blanche_init_sys(); |
| 287 | qos_init(); |
| 288 | blanche_init_pfc(); |
| 289 | blanche_init_lbsc(); |
| 290 | #if defined(CONFIG_MTD_NOR_FLASH) |
| 291 | s_init_wait(10); |
| 292 | blanche_init_dbsc(); |
Masahiro Yamada | 8cea9b5 | 2017-02-11 22:43:54 +0900 | [diff] [blame] | 293 | #endif /* CONFIG_MTD_NOR_FLASH */ |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 294 | } |
| 295 | |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 296 | int board_early_init_f(void) |
| 297 | { |
| 298 | /* TMU0 */ |
| 299 | mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 300 | /* QSPI */ |
| 301 | mstp_clrbits_le32(MSTPSR9, SMSTPCR9, QSPI_MSTP917); |
| 302 | |
| 303 | return 0; |
| 304 | } |
| 305 | |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 306 | int board_init(void) |
| 307 | { |
| 308 | /* adress of boot parameters */ |
| 309 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
| 310 | |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 311 | return 0; |
| 312 | } |
| 313 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 314 | /* Added for BLANCHE(R-CarV2H board) */ |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 315 | int board_eth_init(bd_t *bis) |
| 316 | { |
| 317 | int rc = 0; |
| 318 | |
| 319 | #ifdef CONFIG_SMC911X |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 320 | struct eth_device *dev; |
| 321 | uchar eth_addr[6]; |
| 322 | |
| 323 | rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); |
| 324 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 325 | if (!eth_env_get_enetaddr("ethaddr", eth_addr)) { |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 326 | dev = eth_get_dev_by_index(0); |
| 327 | if (dev) { |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 328 | eth_env_set_enetaddr("ethaddr", dev->enetaddr); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 329 | } else { |
| 330 | printf("blanche: Couldn't get eth device\n"); |
| 331 | rc = -1; |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | #endif |
| 336 | |
| 337 | return rc; |
| 338 | } |
| 339 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 340 | int dram_init(void) |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 341 | { |
Siva Durga Prasad Paladugu | b3d55ea | 2018-07-16 15:56:11 +0530 | [diff] [blame] | 342 | if (fdtdec_setup_mem_size_base() != 0) |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 343 | return -EINVAL; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 344 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 345 | return 0; |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 346 | } |
| 347 | |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 348 | int dram_init_banksize(void) |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 349 | { |
Marek Vasut | 927b1e3 | 2018-04-30 14:10:36 +0200 | [diff] [blame] | 350 | fdtdec_setup_memory_banksize(); |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 351 | |
| 352 | return 0; |
| 353 | } |
| 354 | |
masakazu.mochizuki.wd@hitachi.com | 9d0e937 | 2016-04-12 17:11:41 +0900 | [diff] [blame] | 355 | void reset_cpu(ulong addr) |
| 356 | { |
| 357 | } |