Commit 02ab0970b3ae7b2d535a1231ad259e3114d09772
Committed by
Wolfgang Denk
1 parent
b2eb7d9bc6
Exists in
master
and in
54 other branches
mpc5200: digsy_mtc: Fix extension board detection
Switch to extension board detection using pci_find_device() instead of detecting by i2c access to EEPROM device on extension board. This is a cleaner detection method since EEPROM addresses can be different on different board revisions. This also avoids "i2c_read: failed to address chip" error messages in the boot log on boards without extension board which may confuse users. Signed-off-by: Anatolij Gustschin <agust@denx.de>
Showing 2 changed files with 8 additions and 14 deletions Side-by-side Diff
board/intercontrol/digsy_mtc/digsy_mtc.c
... | ... | @@ -49,6 +49,7 @@ |
49 | 49 | #include <libfdt.h> |
50 | 50 | #include <fdt_support.h> |
51 | 51 | #include <i2c.h> |
52 | +#include <mb862xx.h> | |
52 | 53 | |
53 | 54 | DECLARE_GLOBAL_DATA_PTR; |
54 | 55 | |
55 | 56 | |
... | ... | @@ -226,12 +227,7 @@ |
226 | 227 | struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO; |
227 | 228 | struct mpc5xxx_wu_gpio *wu_gpio = |
228 | 229 | (struct mpc5xxx_wu_gpio *)MPC5XXX_WU_GPIO; |
229 | - unsigned char val; | |
230 | 230 | |
231 | - /* 1st, check if extension board is present */ | |
232 | - if (i2c_read(CONFIG_SYS_EXBO_EE_I2C_ADDRESS, 0, 1, &val, 1)) | |
233 | - return; | |
234 | - | |
235 | 231 | /* configure IrDA pins (PSC6 port) as gpios */ |
236 | 232 | gpio->port_config &= 0xFF8FFFFF; |
237 | 233 | |
... | ... | @@ -285,8 +281,6 @@ |
285 | 281 | /* enable CS0 */ |
286 | 282 | setbits_be32((void *)MPC5XXX_ADDECR, (1 << 16)); |
287 | 283 | |
288 | - exbo_hw_init(); | |
289 | - | |
290 | 284 | #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) |
291 | 285 | /* Low level USB init, required for proper kernel operation */ |
292 | 286 | usb_cpu_init(); |
293 | 287 | |
... | ... | @@ -326,7 +320,14 @@ |
326 | 320 | |
327 | 321 | int misc_init_r(void) |
328 | 322 | { |
323 | + pci_dev_t devbusfn; | |
329 | 324 | uchar enetaddr[6]; |
325 | + | |
326 | + /* check if graphic extension board is present */ | |
327 | + devbusfn = pci_find_device(PCI_VENDOR_ID_FUJITSU, | |
328 | + PCI_DEVICE_ID_CORAL_PA, 0); | |
329 | + if (devbusfn != -1) | |
330 | + exbo_hw_init(); | |
330 | 331 | |
331 | 332 | if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { |
332 | 333 | board_get_enetaddr(enetaddr); |
include/configs/digsy_mtc.h
... | ... | @@ -289,13 +289,6 @@ |
289 | 289 | #define CONFIG_SYS_DS1339_TCR_VAL 0xAB /* diode + 4k resistor */ |
290 | 290 | #endif |
291 | 291 | |
292 | -/* ExBo I2C Addresses */ | |
293 | -#if defined(CONFIG_DIGSY_REV5) | |
294 | -#define CONFIG_SYS_EXBO_EE_I2C_ADDRESS 0x54 | |
295 | -#else | |
296 | -#define CONFIG_SYS_EXBO_EE_I2C_ADDRESS 0x56 | |
297 | -#endif | |
298 | - | |
299 | 292 | /* |
300 | 293 | * Flash configuration |
301 | 294 | */ |