Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2015 Freescale Semiconductor |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 4 | */ |
| 5 | #include <common.h> |
Simon Glass | 7b51b57 | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 6 | #include <env.h> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 7 | #include <init.h> |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 8 | #include <malloc.h> |
| 9 | #include <errno.h> |
| 10 | #include <netdev.h> |
| 11 | #include <fsl_ifc.h> |
| 12 | #include <fsl_ddr.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 13 | #include <asm/global_data.h> |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 14 | #include <asm/io.h> |
| 15 | #include <fdt_support.h> |
Masahiro Yamada | b08c8c4 | 2018-03-05 01:20:11 +0900 | [diff] [blame] | 16 | #include <linux/libfdt.h> |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 17 | #include <fsl-mc/fsl_mc.h> |
Simon Glass | f3998fd | 2019-08-02 09:44:25 -0600 | [diff] [blame] | 18 | #include <env_internal.h> |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 19 | #include <i2c.h> |
Priyanka Jain | 7fb79e6 | 2015-06-29 15:39:40 +0530 | [diff] [blame] | 20 | #include <rtc.h> |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 21 | #include <asm/arch/soc.h> |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 22 | #include <hwconfig.h> |
Saksham Jain | fcfdb6d | 2016-03-23 16:24:35 +0530 | [diff] [blame] | 23 | #include <fsl_sec.h> |
Santan Kumar | 54ad7b5 | 2017-03-07 11:21:03 +0530 | [diff] [blame] | 24 | #include <asm/arch/ppa.h> |
Laurentiu Tudor | e33938a | 2019-10-18 09:01:54 +0000 | [diff] [blame] | 25 | #include <asm/arch-fsl-layerscape/fsl_icid.h> |
Stephen Carlson | 17c2a30 | 2021-06-22 16:42:02 -0700 | [diff] [blame] | 26 | #include "../common/i2c_mux.h" |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 27 | |
| 28 | #include "../common/qixis.h" |
Prabhakar Kushwaha | 4493721 | 2015-11-09 16:42:07 +0530 | [diff] [blame] | 29 | #include "ls2080aqds_qixis.h" |
Priyanka Jain | 35cc100 | 2017-01-19 11:12:28 +0530 | [diff] [blame] | 30 | #include "../common/vid.h" |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 31 | |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 32 | #define PIN_MUX_SEL_SDHC 0x00 |
| 33 | #define PIN_MUX_SEL_DSPI 0x0a |
Yuan Yao | 916d9f0 | 2016-06-08 18:24:52 +0800 | [diff] [blame] | 34 | #define SCFG_QSPICLKCTRL_DIV_20 (5 << 27) |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 35 | |
| 36 | #define SET_SDHC_MUX_SEL(reg, value) ((reg & 0xf0) | value) |
| 37 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 38 | DECLARE_GLOBAL_DATA_PTR; |
| 39 | |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 40 | enum { |
| 41 | MUX_TYPE_SDHC, |
| 42 | MUX_TYPE_DSPI, |
| 43 | }; |
| 44 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 45 | unsigned long long get_qixis_addr(void) |
| 46 | { |
| 47 | unsigned long long addr; |
| 48 | |
| 49 | if (gd->flags & GD_FLG_RELOC) |
| 50 | addr = QIXIS_BASE_PHYS; |
| 51 | else |
| 52 | addr = QIXIS_BASE_PHYS_EARLY; |
| 53 | |
| 54 | /* |
| 55 | * IFC address under 256MB is mapped to 0x30000000, any address above |
| 56 | * is mapped to 0x5_10000000 up to 4GB. |
| 57 | */ |
| 58 | addr = addr > 0x10000000 ? addr + 0x500000000ULL : addr + 0x30000000; |
| 59 | |
| 60 | return addr; |
| 61 | } |
| 62 | |
| 63 | int checkboard(void) |
| 64 | { |
| 65 | char buf[64]; |
| 66 | u8 sw; |
| 67 | static const char *const freq[] = {"100", "125", "156.25", |
| 68 | "100 separate SSCG"}; |
| 69 | int clock; |
| 70 | |
Prabhakar Kushwaha | ff1b8e3 | 2015-05-28 14:54:07 +0530 | [diff] [blame] | 71 | cpu_name(buf); |
| 72 | printf("Board: %s-QDS, ", buf); |
| 73 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 74 | sw = QIXIS_READ(arch); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 75 | printf("Board Arch: V%d, ", sw >> 4); |
| 76 | printf("Board version: %c, boot from ", (sw & 0xf) + 'A' - 1); |
| 77 | |
Prabhakar Kushwaha | ff1b8e3 | 2015-05-28 14:54:07 +0530 | [diff] [blame] | 78 | memset((u8 *)buf, 0x00, ARRAY_SIZE(buf)); |
| 79 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 80 | sw = QIXIS_READ(brdcfg[0]); |
| 81 | sw = (sw & QIXIS_LBMAP_MASK) >> QIXIS_LBMAP_SHIFT; |
| 82 | |
| 83 | if (sw < 0x8) |
| 84 | printf("vBank: %d\n", sw); |
| 85 | else if (sw == 0x8) |
| 86 | puts("PromJet\n"); |
| 87 | else if (sw == 0x9) |
| 88 | puts("NAND\n"); |
Yuan Yao | a646f66 | 2016-06-08 18:25:00 +0800 | [diff] [blame] | 89 | else if (sw == 0xf) |
| 90 | puts("QSPI\n"); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 91 | else if (sw == 0x15) |
| 92 | printf("IFCCard\n"); |
| 93 | else |
| 94 | printf("invalid setting of SW%u\n", QIXIS_LBMAP_SWITCH); |
| 95 | |
| 96 | printf("FPGA: v%d (%s), build %d", |
| 97 | (int)QIXIS_READ(scver), qixis_read_tag(buf), |
| 98 | (int)qixis_read_minor()); |
| 99 | /* the timestamp string contains "\n" at the end */ |
| 100 | printf(" on %s", qixis_read_time(buf)); |
| 101 | |
| 102 | /* |
| 103 | * Display the actual SERDES reference clocks as configured by the |
| 104 | * dip switches on the board. Note that the SWx registers could |
| 105 | * technically be set to force the reference clocks to match the |
| 106 | * values that the SERDES expects (or vice versa). For now, however, |
| 107 | * we just display both values and hope the user notices when they |
| 108 | * don't match. |
| 109 | */ |
| 110 | puts("SERDES1 Reference : "); |
| 111 | sw = QIXIS_READ(brdcfg[2]); |
| 112 | clock = (sw >> 6) & 3; |
| 113 | printf("Clock1 = %sMHz ", freq[clock]); |
| 114 | clock = (sw >> 4) & 3; |
| 115 | printf("Clock2 = %sMHz", freq[clock]); |
| 116 | |
| 117 | puts("\nSERDES2 Reference : "); |
| 118 | clock = (sw >> 2) & 3; |
| 119 | printf("Clock1 = %sMHz ", freq[clock]); |
| 120 | clock = (sw >> 0) & 3; |
| 121 | printf("Clock2 = %sMHz\n", freq[clock]); |
| 122 | |
| 123 | return 0; |
| 124 | } |
| 125 | |
| 126 | unsigned long get_board_sys_clk(void) |
| 127 | { |
| 128 | u8 sysclk_conf = QIXIS_READ(brdcfg[1]); |
| 129 | |
| 130 | switch (sysclk_conf & 0x0F) { |
| 131 | case QIXIS_SYSCLK_83: |
| 132 | return 83333333; |
| 133 | case QIXIS_SYSCLK_100: |
| 134 | return 100000000; |
| 135 | case QIXIS_SYSCLK_125: |
| 136 | return 125000000; |
| 137 | case QIXIS_SYSCLK_133: |
| 138 | return 133333333; |
| 139 | case QIXIS_SYSCLK_150: |
| 140 | return 150000000; |
| 141 | case QIXIS_SYSCLK_160: |
| 142 | return 160000000; |
| 143 | case QIXIS_SYSCLK_166: |
| 144 | return 166666666; |
| 145 | } |
| 146 | return 66666666; |
| 147 | } |
| 148 | |
| 149 | unsigned long get_board_ddr_clk(void) |
| 150 | { |
| 151 | u8 ddrclk_conf = QIXIS_READ(brdcfg[1]); |
| 152 | |
| 153 | switch ((ddrclk_conf & 0x30) >> 4) { |
| 154 | case QIXIS_DDRCLK_100: |
| 155 | return 100000000; |
| 156 | case QIXIS_DDRCLK_125: |
| 157 | return 125000000; |
| 158 | case QIXIS_DDRCLK_133: |
| 159 | return 133333333; |
| 160 | } |
| 161 | return 66666666; |
| 162 | } |
| 163 | |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 164 | int config_board_mux(int ctrl_type) |
| 165 | { |
| 166 | u8 reg5; |
| 167 | |
| 168 | reg5 = QIXIS_READ(brdcfg[5]); |
| 169 | |
| 170 | switch (ctrl_type) { |
| 171 | case MUX_TYPE_SDHC: |
| 172 | reg5 = SET_SDHC_MUX_SEL(reg5, PIN_MUX_SEL_SDHC); |
| 173 | break; |
| 174 | case MUX_TYPE_DSPI: |
| 175 | reg5 = SET_SDHC_MUX_SEL(reg5, PIN_MUX_SEL_DSPI); |
| 176 | break; |
| 177 | default: |
| 178 | printf("Wrong mux interface type\n"); |
| 179 | return -1; |
| 180 | } |
| 181 | |
| 182 | QIXIS_WRITE(brdcfg[5], reg5); |
| 183 | |
| 184 | return 0; |
| 185 | } |
| 186 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 187 | int board_init(void) |
| 188 | { |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 189 | char *env_hwconfig; |
| 190 | u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE; |
| 191 | u32 val; |
| 192 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 193 | init_final_memctl_regs(); |
| 194 | |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 195 | val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); |
| 196 | |
Simon Glass | 00caae6 | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 197 | env_hwconfig = env_get("hwconfig"); |
Haikun Wang | e71a980 | 2015-06-26 19:58:12 +0800 | [diff] [blame] | 198 | |
| 199 | if (hwconfig_f("dspi", env_hwconfig) && |
| 200 | DCFG_RCWSR13_DSPI == (val & (u32)(0xf << 8))) |
| 201 | config_board_mux(MUX_TYPE_DSPI); |
| 202 | else |
| 203 | config_board_mux(MUX_TYPE_SDHC); |
| 204 | |
Miquel Raynal | 88718be | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 205 | #if defined(CONFIG_MTD_RAW_NAND) && defined(CONFIG_FSL_QSPI) |
Yuan Yao | 453418f | 2016-06-08 18:24:57 +0800 | [diff] [blame] | 206 | val = in_le32(dcfg_ccsr + DCFG_RCWSR15 / 4); |
| 207 | |
| 208 | if (DCFG_RCWSR15_IFCGRPABASE_QSPI == (val & (u32)0x3)) |
| 209 | QIXIS_WRITE(brdcfg[9], |
| 210 | (QIXIS_READ(brdcfg[9]) & 0xf8) | |
| 211 | FSL_QIXIS_BRDCFG9_QSPI); |
| 212 | #endif |
| 213 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 214 | #ifdef CONFIG_ENV_IS_NOWHERE |
| 215 | gd->env_addr = (ulong)&default_environment[0]; |
| 216 | #endif |
Stephen Carlson | 17c2a30 | 2021-06-22 16:42:02 -0700 | [diff] [blame] | 217 | select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0); |
Chuanhua Han | 885ae05 | 2019-07-26 19:24:01 +0800 | [diff] [blame] | 218 | |
Chuanhua Han | db07c44 | 2019-07-26 19:24:00 +0800 | [diff] [blame] | 219 | #ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT |
Igor Opaniuk | 2147a16 | 2021-02-09 13:52:45 +0200 | [diff] [blame] | 220 | #if CONFIG_IS_ENABLED(DM_I2C) |
Chuanhua Han | 885ae05 | 2019-07-26 19:24:01 +0800 | [diff] [blame] | 221 | rtc_enable_32khz_output(0, CONFIG_SYS_I2C_RTC_ADDR); |
| 222 | #else |
Priyanka Jain | 7fb79e6 | 2015-06-29 15:39:40 +0530 | [diff] [blame] | 223 | rtc_enable_32khz_output(); |
Chuanhua Han | db07c44 | 2019-07-26 19:24:00 +0800 | [diff] [blame] | 224 | #endif |
Chuanhua Han | 885ae05 | 2019-07-26 19:24:01 +0800 | [diff] [blame] | 225 | #endif |
| 226 | |
Udit Agarwal | 15e7c68 | 2017-08-16 07:13:29 -0400 | [diff] [blame] | 227 | #ifdef CONFIG_FSL_CAAM |
| 228 | sec_init(); |
| 229 | #endif |
Santan Kumar | 54ad7b5 | 2017-03-07 11:21:03 +0530 | [diff] [blame] | 230 | |
| 231 | #ifdef CONFIG_FSL_LS_PPA |
| 232 | ppa_init(); |
| 233 | #endif |
| 234 | |
Ioana Ciornei | 8cbef91 | 2020-05-18 14:48:35 +0300 | [diff] [blame] | 235 | #if !defined(CONFIG_SYS_EARLY_PCI_INIT) && defined(CONFIG_DM_ETH) |
| 236 | pci_init(); |
| 237 | #endif |
| 238 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 239 | return 0; |
| 240 | } |
| 241 | |
| 242 | int board_early_init_f(void) |
| 243 | { |
Tom Rini | 52c7e37 | 2021-08-18 23:12:25 -0400 | [diff] [blame^] | 244 | #if defined(CONFIG_SYS_I2C_EARLY_INIT) |
Yuan Yao | 8c77ef8 | 2016-06-08 18:24:54 +0800 | [diff] [blame] | 245 | i2c_early_init_f(); |
| 246 | #endif |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 247 | fsl_lsch3_early_init_f(); |
Yuan Yao | 916d9f0 | 2016-06-08 18:24:52 +0800 | [diff] [blame] | 248 | #ifdef CONFIG_FSL_QSPI |
| 249 | /* input clk: 1/2 platform clk, output: input/20 */ |
| 250 | out_le32(SCFG_BASE + SCFG_QSPICLKCTLR, SCFG_QSPICLKCTRL_DIV_20); |
| 251 | #endif |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 252 | return 0; |
| 253 | } |
| 254 | |
Priyanka Jain | 35cc100 | 2017-01-19 11:12:28 +0530 | [diff] [blame] | 255 | int misc_init_r(void) |
| 256 | { |
| 257 | if (adjust_vdd(0)) |
| 258 | printf("Warning: Adjusting core voltage failed.\n"); |
| 259 | |
| 260 | return 0; |
| 261 | } |
| 262 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 263 | void detail_board_ddr_info(void) |
| 264 | { |
| 265 | puts("\nDDR "); |
| 266 | print_size(gd->bd->bi_dram[0].size + gd->bd->bi_dram[1].size, ""); |
| 267 | print_ddr_info(0); |
Prabhakar Kushwaha | 4493721 | 2015-11-09 16:42:07 +0530 | [diff] [blame] | 268 | #ifdef CONFIG_SYS_FSL_HAS_DP_DDR |
York Sun | 3c1d218 | 2016-04-04 11:41:26 -0700 | [diff] [blame] | 269 | if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) { |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 270 | puts("\nDP-DDR "); |
| 271 | print_size(gd->bd->bi_dram[2].size, ""); |
| 272 | print_ddr_info(CONFIG_DP_DDR_CTRL); |
| 273 | } |
Prabhakar Kushwaha | 4493721 | 2015-11-09 16:42:07 +0530 | [diff] [blame] | 274 | #endif |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Santan Kumar | 1f55a93 | 2017-05-05 15:42:29 +0530 | [diff] [blame] | 277 | #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 278 | void fdt_fixup_board_enet(void *fdt) |
| 279 | { |
| 280 | int offset; |
| 281 | |
Stuart Yoder | e91f1de | 2016-03-02 16:37:13 -0600 | [diff] [blame] | 282 | offset = fdt_path_offset(fdt, "/soc/fsl-mc"); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 283 | |
| 284 | if (offset < 0) |
Stuart Yoder | e91f1de | 2016-03-02 16:37:13 -0600 | [diff] [blame] | 285 | offset = fdt_path_offset(fdt, "/fsl-mc"); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 286 | |
| 287 | if (offset < 0) { |
| 288 | printf("%s: ERROR: fsl-mc node not found in device tree (error %d)\n", |
| 289 | __func__, offset); |
| 290 | return; |
| 291 | } |
| 292 | |
Mian Yousaf Kaukab | 7e96804 | 2018-12-18 14:01:17 +0100 | [diff] [blame] | 293 | if (get_mc_boot_status() == 0 && |
| 294 | (is_lazy_dpl_addr_valid() || get_dpl_apply_status() == 0)) |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 295 | fdt_status_okay(fdt, offset); |
| 296 | else |
| 297 | fdt_status_fail(fdt, offset); |
| 298 | } |
Alexander Graf | b7b8410 | 2016-11-17 01:02:57 +0100 | [diff] [blame] | 299 | |
| 300 | void board_quiesce_devices(void) |
| 301 | { |
| 302 | fsl_mc_ldpaa_exit(gd->bd); |
| 303 | } |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 304 | #endif |
| 305 | |
| 306 | #ifdef CONFIG_OF_BOARD_SETUP |
Masahiro Yamada | b75d8dc | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 307 | int ft_board_setup(void *blob, struct bd_info *bd) |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 308 | { |
Bhupesh Sharma | a2dc818 | 2015-05-28 14:54:10 +0530 | [diff] [blame] | 309 | u64 base[CONFIG_NR_DRAM_BANKS]; |
| 310 | u64 size[CONFIG_NR_DRAM_BANKS]; |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 311 | |
| 312 | ft_cpu_setup(blob, bd); |
| 313 | |
Bhupesh Sharma | a2dc818 | 2015-05-28 14:54:10 +0530 | [diff] [blame] | 314 | /* fixup DT for the two GPP DDR banks */ |
| 315 | base[0] = gd->bd->bi_dram[0].start; |
| 316 | size[0] = gd->bd->bi_dram[0].size; |
| 317 | base[1] = gd->bd->bi_dram[1].start; |
| 318 | size[1] = gd->bd->bi_dram[1].size; |
| 319 | |
York Sun | 36cc0de | 2017-03-06 09:02:28 -0800 | [diff] [blame] | 320 | #ifdef CONFIG_RESV_RAM |
| 321 | /* reduce size if reserved memory is within this bank */ |
| 322 | if (gd->arch.resv_ram >= base[0] && |
| 323 | gd->arch.resv_ram < base[0] + size[0]) |
| 324 | size[0] = gd->arch.resv_ram - base[0]; |
| 325 | else if (gd->arch.resv_ram >= base[1] && |
| 326 | gd->arch.resv_ram < base[1] + size[1]) |
| 327 | size[1] = gd->arch.resv_ram - base[1]; |
| 328 | #endif |
| 329 | |
Bhupesh Sharma | a2dc818 | 2015-05-28 14:54:10 +0530 | [diff] [blame] | 330 | fdt_fixup_memory_banks(blob, base, size, 2); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 331 | |
Nipun Gupta | a78df40 | 2018-08-20 16:01:14 +0530 | [diff] [blame] | 332 | fdt_fsl_mc_fixup_iommu_map_entry(blob); |
| 333 | |
Sriram Dash | a5c289b | 2016-09-16 17:12:15 +0530 | [diff] [blame] | 334 | fsl_fdt_fixup_dr_usb(blob, bd); |
Sriram Dash | ef53b8c | 2016-06-13 09:58:36 +0530 | [diff] [blame] | 335 | |
Santan Kumar | 1f55a93 | 2017-05-05 15:42:29 +0530 | [diff] [blame] | 336 | #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 337 | fdt_fixup_board_enet(blob); |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 338 | #endif |
| 339 | |
Laurentiu Tudor | e33938a | 2019-10-18 09:01:54 +0000 | [diff] [blame] | 340 | fdt_fixup_icid(blob); |
| 341 | |
York Sun | 7288c2c | 2015-03-20 19:28:23 -0700 | [diff] [blame] | 342 | return 0; |
| 343 | } |
| 344 | #endif |
| 345 | |
| 346 | void qixis_dump_switch(void) |
| 347 | { |
| 348 | int i, nr_of_cfgsw; |
| 349 | |
| 350 | QIXIS_WRITE(cms[0], 0x00); |
| 351 | nr_of_cfgsw = QIXIS_READ(cms[1]); |
| 352 | |
| 353 | puts("DIP switch settings dump:\n"); |
| 354 | for (i = 1; i <= nr_of_cfgsw; i++) { |
| 355 | QIXIS_WRITE(cms[0], i); |
| 356 | printf("SW%d = (0x%02x)\n", i, QIXIS_READ(cms[1])); |
| 357 | } |
| 358 | } |