]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/at91rm9200dk/at91rm9200dk.c
GCC-4.x fixes: clean up global data pointer initialization for all boards.
[people/ms/u-boot.git] / board / at91rm9200dk / at91rm9200dk.c
index 2cb60b0fa38bd42b62d26564db1d20228e3a6dbe..002981a762481e01cd3ce1816946d13c9bebdd13 100644 (file)
 
 #include <common.h>
 #include <asm/arch/AT91RM9200.h>
+#include <at91rm9200_net.h>
+#include <dm9161.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 /* ------------------------------------------------------------------------- */
 /*
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Enable Ctrlc */
        console_init_f ();
 
        /* Correct IRDA resistor problem */
        /* Set PA23_TXD in Output */
-       (AT91PS_PIO) AT91C_BASE_PIOA->PIO_OER = AT91C_PA23_TXD2;
+       ((AT91PS_PIO) AT91C_BASE_PIOA)->PIO_OER = AT91C_PA23_TXD2;
 
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
@@ -54,13 +56,35 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
 }
 
+#ifdef CONFIG_DRIVER_ETHER
+#if (CONFIG_COMMANDS & CFG_CMD_NET)
+
+/*
+ * Name:
+ *     at91rm9200_GetPhyInterface
+ * Description:
+ *     Initialise the interface functions to the PHY
+ * Arguments:
+ *     None
+ * Return value:
+ *     None
+ */
+void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
+{
+       p_phyops->Init = dm9161_InitPhy;
+       p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
+       p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
+       p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
+}
+
+#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif /* CONFIG_DRIVER_ETHER */
+
 /*
  * Disk On Chip (NAND) Millenium initialization.
  * The NAND lives in the CS2* space