1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <common.h>
24#include <command.h>
25#include <asm/processor.h>
26#include <asm/mmu.h>
27#include <asm/immap_85xx.h>
28#include <asm/immap_fsl_pci.h>
29#include <asm/io.h>
30#include <asm/cache.h>
31#include <libfdt.h>
32#include <fdt_support.h>
33#include <pca953x.h>
34
35DECLARE_GLOBAL_DATA_PTR;
36
37extern void ft_board_pci_setup(void *blob, bd_t *bd);
38
39int checkboard(void)
40{
41 char *s;
42
43 printf("Board: X-ES %s 3U VPX SBC\n", CONFIG_SYS_BOARD_NAME);
44 printf(" ");
45 s = getenv("board_rev");
46 if (s)
47 printf("Rev %s, ", s);
48 s = getenv("serial#");
49 if (s)
50 printf("Serial# %s, ", s);
51 s = getenv("board_cfg");
52 if (s)
53 printf("Cfg %s", s);
54 printf("\n");
55
56 return 0;
57}
58
59static void flash_cs_fixup(void)
60{
61 volatile ccsr_lbc_t *lbc = (void *)(CONFIG_SYS_MPC85xx_LBC_ADDR);
62 int flash_sel;
63
64
65
66
67
68
69 flash_sel = !((pca953x_get_val(CONFIG_SYS_I2C_PCA953X_ADDR0) &
70 CONFIG_SYS_PCA953X_C0_FLASH_PASS_CS));
71 printf("FLASH: Executed from FLASH%d\n", flash_sel ? 2 : 1);
72
73 if (flash_sel) {
74 lbc->br0 = CONFIG_SYS_BR1_PRELIM;
75 lbc->or0 = CONFIG_SYS_OR1_PRELIM;
76
77 lbc->br1 = CONFIG_SYS_BR0_PRELIM;
78 lbc->or1 = CONFIG_SYS_OR0_PRELIM;
79 }
80}
81
82int board_early_init_r(void)
83{
84
85 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR0, 0xff, 0);
86 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR1, 0xff, 0);
87 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR0, 0xff, 0);
88 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR0, 0xff, 0);
89
90
91
92
93
94
95
96 flush_dcache();
97 invalidate_icache();
98
99
100 disable_tlb(0);
101 set_tlb(1, (CONFIG_SYS_FLASH_BASE2 & 0xf0000000),
102 (CONFIG_SYS_FLASH_BASE2 & 0xf0000000),
103 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
104 0, 0, BOOKE_PAGESZ_256M, 1);
105
106 flash_cs_fixup();
107
108 return 0;
109}
110
111#if defined(CONFIG_OF_BOARD_SETUP)
112void ft_board_setup(void *blob, bd_t *bd)
113{
114#ifdef CONFIG_PCI
115 ft_board_pci_setup(blob, bd);
116#endif
117 ft_cpu_setup(blob, bd);
118}
119#endif
120
121#ifdef CONFIG_MP
122extern void cpu_mp_lmb_reserve(struct lmb *lmb);
123
124void board_lmb_reserve(struct lmb *lmb)
125{
126 cpu_mp_lmb_reserve(lmb);
127}
128#endif
129