2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
11 #include <linux/compiler.h>
13 #include <asm/processor.h>
14 #include <asm/cache.h>
15 #include <asm/immap_85xx.h>
16 #include <asm/fsl_law.h>
17 #include <asm/fsl_serdes.h>
18 #include <asm/fsl_portals.h>
19 #include <asm/fsl_liodn.h>
25 DECLARE_GLOBAL_DATA_PTR;
29 struct cpu_type *cpu = gd->arch.cpu;
32 printf("Board: %sRDB, ", cpu->name);
33 printf("Board rev: 0x%02x CPLD ver: 0x%02x%02x, ",
34 CPLD_READ(hw_ver), CPLD_READ(sw_maj_ver), CPLD_READ(sw_min_ver));
36 sw = CPLD_READ(vbank);
37 sw = sw & CPLD_BANK_SEL_MASK;
40 printf("vBank: %d\n", sw);
42 printf("Unsupported Bank=%x\n", sw);
44 puts("SERDES Reference Clocks:\n");
45 printf(" SERDES1=100MHz SERDES2=156.25MHz\n"
46 " SERDES3=100MHz SERDES4=100MHz\n");
51 int board_early_init_r(void)
53 const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
54 int flash_esel = find_tlb_idx((void *)flashbase, 1);
57 * Remap Boot flash + PROMJET region to caching-inhibited
58 * so that flash can be erased properly.
61 /* Flush d-cache and invalidate i-cache of any FLASH data */
65 if (flash_esel == -1) {
66 /* very unlikely unless something is messed up */
67 puts("Error: Could not find TLB for FLASH BASE\n");
68 flash_esel = 2; /* give our best effort to continue */
70 /* invalidate existing TLB entry for flash + promjet */
71 disable_tlb(flash_esel);
74 set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
75 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
76 0, flash_esel, BOOKE_PAGESZ_256M, 1);
79 #ifdef CONFIG_SYS_DPAA_QBMAN
91 int ft_board_setup(void *blob, bd_t *bd)
96 ft_cpu_setup(blob, bd);
98 base = getenv_bootm_low();
99 size = getenv_bootm_size();
101 fdt_fixup_memory(blob, (u64)base, (u64)size);
104 pci_of_setup(blob, bd);
107 fdt_fixup_liodn(blob);
108 fdt_fixup_dr_usb(blob, bd);
110 #ifdef CONFIG_SYS_DPAA_FMAN
111 fdt_fixup_fman_ethernet(blob);
112 fdt_fixup_board_enet(blob);
119 * This function is called by bdinfo to print detail board information.
120 * As an exmaple for future board, we organize the messages into
121 * several sections. If applicable, the message is in the format of
123 * It should aligned with normal output of bdinfo command.
125 * Voltage: Core, DDR and another configurable voltages
126 * Clock : Critical clocks which are not printed already
127 * RCW : RCW source if not printed already
128 * Misc : Other important information not in above catagories
130 void board_detail(void)
134 /* RCW section SW3[4] */
136 puts("RCW source = ");
137 switch (rcwsrc & 0x1) {
142 puts("I2C normal addressing\n");