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