Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2009 |
| 4 | * Marvell Semiconductor <www.marvell.com> |
| 5 | * Written-by: Prafulla Wadaskar <prafulla@marvell.com> |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <config.h> |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 9 | #include <common.h> |
Lei Wen | 298ae91 | 2011-10-18 20:11:42 +0530 | [diff] [blame] | 10 | #include <asm/io.h> |
| 11 | #include <asm/arch/cpu.h> |
Stefan Roese | c243784 | 2014-10-22 12:13:06 +0200 | [diff] [blame] | 12 | #include <asm/arch/soc.h> |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 13 | |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 14 | #if defined(CONFIG_ARCH_MVEBU) |
| 15 | /* Use common XOR definitions for A3x and AXP */ |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 16 | #include "../../../drivers/ddr/marvell/axp/xor.h" |
| 17 | #include "../../../drivers/ddr/marvell/axp/xor_regs.h" |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 18 | #endif |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 19 | |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 20 | DECLARE_GLOBAL_DATA_PTR; |
| 21 | |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 22 | struct sdram_bank { |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 23 | u32 win_bar; |
| 24 | u32 win_sz; |
| 25 | }; |
| 26 | |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 27 | struct sdram_addr_dec { |
| 28 | struct sdram_bank sdram_bank[4]; |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 31 | #define REG_CPUCS_WIN_ENABLE (1 << 0) |
| 32 | #define REG_CPUCS_WIN_WR_PROTECT (1 << 1) |
| 33 | #define REG_CPUCS_WIN_WIN0_CS(x) (((x) & 0x3) << 2) |
| 34 | #define REG_CPUCS_WIN_SIZE(x) (((x) & 0xff) << 24) |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 35 | |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 36 | #define SDRAM_SIZE_MAX 0xc0000000 |
| 37 | |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 38 | #define SCRUB_MAGIC 0xbeefdead |
| 39 | |
| 40 | #define SCRB_XOR_UNIT 0 |
| 41 | #define SCRB_XOR_CHAN 1 |
| 42 | #define SCRB_XOR_WIN 0 |
| 43 | |
| 44 | #define XEBARX_BASE_OFFS 16 |
| 45 | |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 46 | /* |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 47 | * mvebu_sdram_bar - reads SDRAM Base Address Register |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 48 | */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 49 | u32 mvebu_sdram_bar(enum memory_bank bank) |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 50 | { |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 51 | struct sdram_addr_dec *base = |
| 52 | (struct sdram_addr_dec *)MVEBU_SDRAM_BASE; |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 53 | u32 result = 0; |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 54 | u32 enable = 0x01 & readl(&base->sdram_bank[bank].win_sz); |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 55 | |
| 56 | if ((!enable) || (bank > BANK3)) |
| 57 | return 0; |
| 58 | |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 59 | result = readl(&base->sdram_bank[bank].win_bar); |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 60 | return result; |
| 61 | } |
| 62 | |
| 63 | /* |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 64 | * mvebu_sdram_bs_set - writes SDRAM Bank size |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 65 | */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 66 | static void mvebu_sdram_bs_set(enum memory_bank bank, u32 size) |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 67 | { |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 68 | struct sdram_addr_dec *base = |
| 69 | (struct sdram_addr_dec *)MVEBU_SDRAM_BASE; |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 70 | /* Read current register value */ |
| 71 | u32 reg = readl(&base->sdram_bank[bank].win_sz); |
| 72 | |
| 73 | /* Clear window size */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 74 | reg &= ~REG_CPUCS_WIN_SIZE(0xFF); |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 75 | |
| 76 | /* Set new window size */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 77 | reg |= REG_CPUCS_WIN_SIZE((size - 1) >> 24); |
Gerlando Falauto | ac935e2 | 2012-07-20 02:34:25 +0000 | [diff] [blame] | 78 | |
| 79 | writel(reg, &base->sdram_bank[bank].win_sz); |
| 80 | } |
| 81 | |
| 82 | /* |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 83 | * mvebu_sdram_bs - reads SDRAM Bank size |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 84 | */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 85 | u32 mvebu_sdram_bs(enum memory_bank bank) |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 86 | { |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 87 | struct sdram_addr_dec *base = |
| 88 | (struct sdram_addr_dec *)MVEBU_SDRAM_BASE; |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 89 | u32 result = 0; |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 90 | u32 enable = 0x01 & readl(&base->sdram_bank[bank].win_sz); |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 91 | |
| 92 | if ((!enable) || (bank > BANK3)) |
| 93 | return 0; |
Holger Brunck | 67393fc | 2012-07-20 02:34:24 +0000 | [diff] [blame] | 94 | result = 0xff000000 & readl(&base->sdram_bank[bank].win_sz); |
Prafulla Wadaskar | a09bbe5 | 2009-06-20 11:01:53 +0200 | [diff] [blame] | 95 | result += 0x01000000; |
| 96 | return result; |
| 97 | } |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 98 | |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 99 | void mvebu_sdram_size_adjust(enum memory_bank bank) |
Gerlando Falauto | ea32b7e | 2012-07-25 06:23:48 +0000 | [diff] [blame] | 100 | { |
| 101 | u32 size; |
| 102 | |
| 103 | /* probe currently equipped RAM size */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 104 | size = get_ram_size((void *)mvebu_sdram_bar(bank), |
| 105 | mvebu_sdram_bs(bank)); |
Gerlando Falauto | ea32b7e | 2012-07-25 06:23:48 +0000 | [diff] [blame] | 106 | |
| 107 | /* adjust SDRAM window size accordingly */ |
Stefan Roese | 0b74175 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 108 | mvebu_sdram_bs_set(bank, size); |
Gerlando Falauto | ea32b7e | 2012-07-25 06:23:48 +0000 | [diff] [blame] | 109 | } |
| 110 | |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 111 | #if defined(CONFIG_ARCH_MVEBU) |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 112 | static u32 xor_ctrl_save; |
| 113 | static u32 xor_base_save; |
| 114 | static u32 xor_mask_save; |
| 115 | |
| 116 | static void mv_xor_init2(u32 cs) |
| 117 | { |
| 118 | u32 reg, base, size, base2; |
| 119 | u32 bank_attr[4] = { 0xe00, 0xd00, 0xb00, 0x700 }; |
| 120 | |
| 121 | xor_ctrl_save = reg_read(XOR_WINDOW_CTRL_REG(SCRB_XOR_UNIT, |
| 122 | SCRB_XOR_CHAN)); |
| 123 | xor_base_save = reg_read(XOR_BASE_ADDR_REG(SCRB_XOR_UNIT, |
| 124 | SCRB_XOR_WIN)); |
| 125 | xor_mask_save = reg_read(XOR_SIZE_MASK_REG(SCRB_XOR_UNIT, |
| 126 | SCRB_XOR_WIN)); |
| 127 | |
| 128 | /* Enable Window x for each CS */ |
| 129 | reg = 0x1; |
| 130 | reg |= (0x3 << 16); |
| 131 | reg_write(XOR_WINDOW_CTRL_REG(SCRB_XOR_UNIT, SCRB_XOR_CHAN), reg); |
| 132 | |
| 133 | base = 0; |
| 134 | size = mvebu_sdram_bs(cs) - 1; |
| 135 | if (size) { |
| 136 | base2 = ((base / (64 << 10)) << XEBARX_BASE_OFFS) | |
| 137 | bank_attr[cs]; |
| 138 | reg_write(XOR_BASE_ADDR_REG(SCRB_XOR_UNIT, SCRB_XOR_WIN), |
| 139 | base2); |
| 140 | |
| 141 | base += size + 1; |
| 142 | size = (size / (64 << 10)) << 16; |
| 143 | /* Window x - size - 256 MB */ |
| 144 | reg_write(XOR_SIZE_MASK_REG(SCRB_XOR_UNIT, SCRB_XOR_WIN), size); |
| 145 | } |
| 146 | |
| 147 | mv_xor_hal_init(0); |
| 148 | |
| 149 | return; |
| 150 | } |
| 151 | |
| 152 | static void mv_xor_finish2(void) |
| 153 | { |
| 154 | reg_write(XOR_WINDOW_CTRL_REG(SCRB_XOR_UNIT, SCRB_XOR_CHAN), |
| 155 | xor_ctrl_save); |
| 156 | reg_write(XOR_BASE_ADDR_REG(SCRB_XOR_UNIT, SCRB_XOR_WIN), |
| 157 | xor_base_save); |
| 158 | reg_write(XOR_SIZE_MASK_REG(SCRB_XOR_UNIT, SCRB_XOR_WIN), |
| 159 | xor_mask_save); |
| 160 | } |
| 161 | |
| 162 | static void dram_ecc_scrubbing(void) |
| 163 | { |
| 164 | int cs; |
| 165 | u32 size, temp; |
| 166 | u32 total_mem = 0; |
| 167 | u64 total; |
| 168 | u32 start_addr; |
| 169 | |
| 170 | /* |
| 171 | * The DDR training code from the bin_hdr / SPL already |
| 172 | * scrubbed the DDR till 0x1000000. And the main U-Boot |
| 173 | * is loaded to an address < 0x1000000. So we need to |
| 174 | * skip this range to not re-scrub this area again. |
| 175 | */ |
| 176 | temp = reg_read(REG_SDRAM_CONFIG_ADDR); |
| 177 | temp |= (1 << REG_SDRAM_CONFIG_IERR_OFFS); |
| 178 | reg_write(REG_SDRAM_CONFIG_ADDR, temp); |
| 179 | |
| 180 | for (cs = 0; cs < CONFIG_NR_DRAM_BANKS; cs++) { |
Chris Packham | 50df87f | 2017-09-23 04:50:31 +1200 | [diff] [blame] | 181 | size = mvebu_sdram_bs(cs); |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 182 | if (size == 0) |
| 183 | continue; |
| 184 | |
Chris Packham | 50df87f | 2017-09-23 04:50:31 +1200 | [diff] [blame] | 185 | total = (u64)size; |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 186 | total_mem += (u32)(total / (1 << 30)); |
| 187 | start_addr = 0; |
| 188 | mv_xor_init2(cs); |
| 189 | |
| 190 | /* Skip first 16 MiB */ |
| 191 | if (0 == cs) { |
| 192 | start_addr = 0x1000000; |
| 193 | size -= start_addr; |
| 194 | } |
| 195 | |
Chris Packham | 50df87f | 2017-09-23 04:50:31 +1200 | [diff] [blame] | 196 | mv_xor_mem_init(SCRB_XOR_CHAN, start_addr, size - 1, |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 197 | SCRUB_MAGIC, SCRUB_MAGIC); |
| 198 | |
| 199 | /* Wait for previous transfer completion */ |
| 200 | while (mv_xor_state_get(SCRB_XOR_CHAN) != MV_IDLE) |
| 201 | ; |
| 202 | |
| 203 | mv_xor_finish2(); |
| 204 | } |
| 205 | |
| 206 | temp = reg_read(REG_SDRAM_CONFIG_ADDR); |
| 207 | temp &= ~(1 << REG_SDRAM_CONFIG_IERR_OFFS); |
| 208 | reg_write(REG_SDRAM_CONFIG_ADDR, temp); |
| 209 | } |
| 210 | |
| 211 | static int ecc_enabled(void) |
| 212 | { |
| 213 | if (reg_read(REG_SDRAM_CONFIG_ADDR) & (1 << REG_SDRAM_CONFIG_ECC_OFFS)) |
| 214 | return 1; |
| 215 | |
| 216 | return 0; |
| 217 | } |
Joshua Scott | 2e161b9 | 2017-09-04 17:38:32 +1200 | [diff] [blame] | 218 | |
| 219 | /* Return the width of the DRAM bus, or 0 for unknown. */ |
| 220 | static int bus_width(void) |
| 221 | { |
| 222 | int full_width = 0; |
| 223 | |
| 224 | if (reg_read(REG_SDRAM_CONFIG_ADDR) & (1 << REG_SDRAM_CONFIG_WIDTH_OFFS)) |
| 225 | full_width = 1; |
| 226 | |
| 227 | switch (mvebu_soc_family()) { |
| 228 | case MVEBU_SOC_AXP: |
| 229 | return full_width ? 64 : 32; |
| 230 | break; |
| 231 | case MVEBU_SOC_A375: |
| 232 | case MVEBU_SOC_A38X: |
| 233 | case MVEBU_SOC_MSYS: |
| 234 | return full_width ? 32 : 16; |
| 235 | default: |
| 236 | return 0; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | static int cycle_mode(void) |
| 241 | { |
| 242 | int val = reg_read(REG_DUNIT_CTRL_LOW_ADDR); |
| 243 | |
| 244 | return (val >> REG_DUNIT_CTRL_LOW_2T_OFFS) & REG_DUNIT_CTRL_LOW_2T_MASK; |
| 245 | } |
| 246 | |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 247 | #else |
| 248 | static void dram_ecc_scrubbing(void) |
| 249 | { |
| 250 | } |
| 251 | |
| 252 | static int ecc_enabled(void) |
| 253 | { |
| 254 | return 0; |
| 255 | } |
| 256 | #endif |
| 257 | |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 258 | int dram_init(void) |
| 259 | { |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 260 | u64 size = 0; |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 261 | int i; |
| 262 | |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 263 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 264 | /* |
| 265 | * It is assumed that all memory banks are consecutive |
| 266 | * and without gaps. |
| 267 | * If the gap is found, ram_size will be reported for |
| 268 | * consecutive memory only |
| 269 | */ |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 270 | if (mvebu_sdram_bar(i) != size) |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 271 | break; |
| 272 | |
Stefan Roese | 2cc5fad | 2014-10-22 12:13:05 +0200 | [diff] [blame] | 273 | /* |
| 274 | * Don't report more than 3GiB of SDRAM, otherwise there is no |
| 275 | * address space left for the internal registers etc. |
| 276 | */ |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 277 | size += mvebu_sdram_bs(i); |
| 278 | if (size > SDRAM_SIZE_MAX) |
| 279 | size = SDRAM_SIZE_MAX; |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 280 | } |
Tanmay Upadhyay | 9a5ff78 | 2010-10-28 20:06:22 +0530 | [diff] [blame] | 281 | |
| 282 | for (; i < CONFIG_NR_DRAM_BANKS; i++) { |
| 283 | /* If above loop terminated prematurely, we need to set |
| 284 | * remaining banks' start address & size as 0. Otherwise other |
| 285 | * u-boot functions and Linux kernel gets wrong values which |
| 286 | * could result in crash */ |
| 287 | gd->bd->bi_dram[i].start = 0; |
| 288 | gd->bd->bi_dram[i].size = 0; |
| 289 | } |
| 290 | |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 291 | |
| 292 | if (ecc_enabled()) |
| 293 | dram_ecc_scrubbing(); |
| 294 | |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 295 | gd->ram_size = size; |
| 296 | |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 297 | return 0; |
| 298 | } |
| 299 | |
| 300 | /* |
| 301 | * If this function is not defined here, |
| 302 | * board.c alters dram bank zero configuration defined above. |
| 303 | */ |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 304 | int dram_init_banksize(void) |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 305 | { |
Stefan Roese | 420abea | 2015-08-10 15:11:27 +0200 | [diff] [blame] | 306 | u64 size = 0; |
| 307 | int i; |
| 308 | |
| 309 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { |
| 310 | gd->bd->bi_dram[i].start = mvebu_sdram_bar(i); |
| 311 | gd->bd->bi_dram[i].size = mvebu_sdram_bs(i); |
| 312 | |
| 313 | /* Clip the banksize to 1GiB if it exceeds the max size */ |
| 314 | size += gd->bd->bi_dram[i].size; |
| 315 | if (size > SDRAM_SIZE_MAX) |
| 316 | mvebu_sdram_bs_set(i, 0x40000000); |
| 317 | } |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 318 | |
| 319 | return 0; |
Prafulla Wadaskar | f8e4262 | 2010-09-30 19:33:19 +0530 | [diff] [blame] | 320 | } |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 321 | |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 322 | #if defined(CONFIG_ARCH_MVEBU) |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 323 | void board_add_ram_info(int use_default) |
| 324 | { |
Stefan Roese | 2a539c8 | 2015-12-21 12:36:40 +0100 | [diff] [blame] | 325 | struct sar_freq_modes sar_freq; |
Joshua Scott | 2e161b9 | 2017-09-04 17:38:32 +1200 | [diff] [blame] | 326 | int mode; |
| 327 | int width; |
Stefan Roese | 2a539c8 | 2015-12-21 12:36:40 +0100 | [diff] [blame] | 328 | |
| 329 | get_sar_freq(&sar_freq); |
| 330 | printf(" (%d MHz, ", sar_freq.d_clk); |
| 331 | |
Joshua Scott | 2e161b9 | 2017-09-04 17:38:32 +1200 | [diff] [blame] | 332 | width = bus_width(); |
| 333 | if (width) |
| 334 | printf("%d-bit, ", width); |
| 335 | |
| 336 | mode = cycle_mode(); |
| 337 | /* Mode 0 = Single cycle |
| 338 | * Mode 1 = Two cycles (2T) |
| 339 | * Mode 2 = Three cycles (3T) |
| 340 | */ |
| 341 | if (mode == 1) |
| 342 | printf("2T, "); |
| 343 | if (mode == 2) |
| 344 | printf("3T, "); |
| 345 | |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 346 | if (ecc_enabled()) |
Stefan Roese | 2a539c8 | 2015-12-21 12:36:40 +0100 | [diff] [blame] | 347 | printf("ECC"); |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 348 | else |
Stefan Roese | 2a539c8 | 2015-12-21 12:36:40 +0100 | [diff] [blame] | 349 | printf("ECC not"); |
Stefan Roese | 7a96ee9 | 2015-08-03 13:15:31 +0200 | [diff] [blame] | 350 | printf(" enabled)"); |
| 351 | } |
Stefan Roese | 2a539c8 | 2015-12-21 12:36:40 +0100 | [diff] [blame] | 352 | #endif |