2 * Copyright 2009 Extreme Engineering Solutions, Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #include <asm/processor.h>
27 #include <fdt_support.h>
30 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_PCI)
31 extern void ft_board_pci_setup(void *blob
, bd_t
*bd
);
38 printf("Board: X-ES %s 3U VPX SBC\n", CONFIG_SYS_BOARD_NAME
);
40 s
= getenv("board_rev");
42 printf("Rev %s, ", s
);
43 s
= getenv("serial#");
45 printf("Serial# %s, ", s
);
46 s
= getenv("board_cfg");
54 * Print out which flash was booted from and if booting from the 2nd flash,
55 * swap flash chip selects to maintain consistent flash numbering/addresses.
57 static void flash_cs_fixup(void)
59 immap_t
*immap
= (immap_t
*)CONFIG_SYS_IMMR
;
60 ccsr_lbc_t
*lbc
= &immap
->im_lbc
;
64 * Print boot dev and swap flash flash chip selects if booted from 2nd
65 * flash. Swapping chip selects presents user with a common memory
66 * map regardless of which flash was booted from.
68 flash_sel
= !((pca953x_get_val(CONFIG_SYS_I2C_PCA953X_ADDR0
) &
69 CONFIG_SYS_PCA953X_C0_FLASH_PASS_CS
));
70 printf("FLASH: Executed from FLASH%d\n", flash_sel
? 2 : 1);
73 out_be32(&lbc
->br0
, CONFIG_SYS_BR1_PRELIM
);
74 out_be32(&lbc
->or0
, CONFIG_SYS_OR1_PRELIM
);
76 out_be32(&lbc
->br1
, CONFIG_SYS_BR0_PRELIM
);
77 out_be32(&lbc
->or1
, CONFIG_SYS_OR0_PRELIM
);
81 int board_early_init_r(void)
83 /* Initialize PCA9557 devices */
84 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR0
, 0xff, 0);
85 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR1
, 0xff, 0);
86 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR2
, 0xff, 0);
87 pca953x_set_pol(CONFIG_SYS_I2C_PCA953X_ADDR3
, 0xff, 0);
94 #if defined(CONFIG_OF_BOARD_SETUP)
95 void ft_board_setup(void *blob
, bd_t
*bd
)
98 ft_board_pci_setup(blob
, bd
);
100 ft_cpu_setup(blob
, bd
);
105 extern void cpu_mp_lmb_reserve(struct lmb
*lmb
);
107 void board_lmb_reserve(struct lmb
*lmb
)
109 cpu_mp_lmb_reserve(lmb
);