1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2014 Freescale Semiconductor, Inc.
9 #include <fdt_support.h>
14 #include <linux/compiler.h>
16 #include <asm/processor.h>
17 #include <asm/cache.h>
18 #include <asm/immap_85xx.h>
19 #include <asm/fsl_law.h>
20 #include <asm/fsl_serdes.h>
21 #include <asm/fsl_liodn.h>
26 #include "../common/vid.h"
28 DECLARE_GLOBAL_DATA_PTR;
32 struct cpu_type *cpu = gd->arch.cpu;
35 printf("Board: %sRDB, ", cpu->name);
36 printf("Board rev: 0x%02x CPLD ver: 0x%02x%02x, ",
37 CPLD_READ(hw_ver), CPLD_READ(sw_maj_ver), CPLD_READ(sw_min_ver));
39 sw = CPLD_READ(vbank);
40 sw = sw & CPLD_BANK_SEL_MASK;
43 printf("vBank: %d\n", sw);
45 printf("Unsupported Bank=%x\n", sw);
47 puts("SERDES Reference Clocks:\n");
48 printf(" SERDES1=100MHz SERDES2=156.25MHz\n"
49 " SERDES3=100MHz SERDES4=100MHz\n");
54 int board_early_init_r(void)
56 const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
57 int flash_esel = find_tlb_idx((void *)flashbase, 1);
60 * Remap Boot flash + PROMJET region to caching-inhibited
61 * so that flash can be erased properly.
64 /* Flush d-cache and invalidate i-cache of any FLASH data */
68 if (flash_esel == -1) {
69 /* very unlikely unless something is messed up */
70 puts("Error: Could not find TLB for FLASH BASE\n");
71 flash_esel = 2; /* give our best effort to continue */
73 /* invalidate existing TLB entry for flash + promjet */
74 disable_tlb(flash_esel);
77 set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
78 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
79 0, flash_esel, BOOKE_PAGESZ_256M, 1);
82 * Adjust core voltage according to voltage ID
83 * This function changes I2C mux to channel 2.
86 printf("Warning: Adjusting core voltage failed.\n");
96 int ft_board_setup(void *blob, bd_t *bd)
101 ft_cpu_setup(blob, bd);
103 base = env_get_bootm_low();
104 size = env_get_bootm_size();
106 fdt_fixup_memory(blob, (u64)base, (u64)size);
109 pci_of_setup(blob, bd);
112 fdt_fixup_liodn(blob);
113 fsl_fdt_fixup_dr_usb(blob, bd);
115 #ifdef CONFIG_SYS_DPAA_FMAN
116 fdt_fixup_fman_ethernet(blob);
117 fdt_fixup_board_enet(blob);
124 * This function is called by bdinfo to print detail board information.
125 * As an exmaple for future board, we organize the messages into
126 * several sections. If applicable, the message is in the format of
128 * It should aligned with normal output of bdinfo command.
130 * Voltage: Core, DDR and another configurable voltages
131 * Clock : Critical clocks which are not printed already
132 * RCW : RCW source if not printed already
133 * Misc : Other important information not in above catagories
135 void board_detail(void)
139 /* RCW section SW3[4] */
141 puts("RCW source = ");
142 switch (rcwsrc & 0x1) {
147 puts("I2C normal addressing\n");