summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2012-04-01 17:14:55 +0800
committerJosh Wu <josh.wu@atmel.com>2012-09-25 16:18:13 +0800
commit739b3885c18acc1ac121db0f57d9a1c55c7662b4 (patch)
treeebdaf51436bc5c5459b53423d10a4261edf15b3a /board
parent299c204712a83fff2837d964a3c38b1e4946af2e (diff)
SAMA5: Add function to distinguish CPU type
LCDC: using has_lcdc() function to avoid error register NET: using has_emac() and has_gmac to avoid error register
Diffstat (limited to 'board')
-rw-r--r--board/atmel/at91sama5ek/at91sama5ek.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/board/atmel/at91sama5ek/at91sama5ek.c b/board/atmel/at91sama5ek/at91sama5ek.c
index f95c10e8cc0..9c7ca3ffea0 100644
--- a/board/atmel/at91sama5ek/at91sama5ek.c
+++ b/board/atmel/at91sama5ek/at91sama5ek.c
@@ -195,7 +195,7 @@ void lcd_show_board_info(void)
lcd_printf ("(C) 2008 ATMEL Corp\n");
lcd_printf ("at91support@atmel.com\n");
lcd_printf ("%s CPU at %s MHz\n",
- ATMEL_CPU_NAME,
+ get_cpu_name(),
strmhz(temp, get_cpu_clk_rate()));
dram_size = 0;
@@ -247,10 +247,12 @@ int board_init(void)
at91_spi0_hw_init(1 << 4);
#endif
#ifdef CONFIG_MACB
- at91sama5ek_macb_hw_init();
+ if(has_emac())
+ at91sama5ek_macb_hw_init();
#endif
#ifdef CONFIG_GMACB
- at91sama5ek_gmacb_hw_init();
+ if (has_gmac())
+ at91sama5ek_gmacb_hw_init();
#endif
#ifdef CONFIG_LCD
at91sama5ek_lcd_hw_init();
@@ -275,10 +277,12 @@ int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_MACB
- rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
+ if (has_emac())
+ rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
#endif
#ifdef CONFIG_GMACB
- rc = gmacb_eth_initialize(0, (void *)ATMEL_BASE_GMAC, 0x00);
+ if (has_gmac())
+ rc = gmacb_eth_initialize(0, (void *)ATMEL_BASE_GMAC, 0x00);
#endif
return rc;
}