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