summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--board/eco920/Makefile2
-rw-r--r--board/eco920/eco920.c32
-rw-r--r--drivers/net/at91_ether.c22
-rw-r--r--include/configs/eco920.h4
4 files changed, 39 insertions, 21 deletions
diff --git a/board/eco920/Makefile b/board/eco920/Makefile
index 1793714c90..65266285c1 100644
--- a/board/eco920/Makefile
+++ b/board/eco920/Makefile
@@ -1 +1,3 @@
obj-y += eco920.o
+extra-y += u-boot.lds
+
diff --git a/board/eco920/eco920.c b/board/eco920/eco920.c
index fcd7364f1d..91833c8d52 100644
--- a/board/eco920/eco920.c
+++ b/board/eco920/eco920.c
@@ -30,6 +30,7 @@
#include <s1d13706fb.h>
#include <net.h>
#include <cfi_flash.h>
+#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -38,11 +39,12 @@ DECLARE_GLOBAL_DATA_PTR;
* Miscelaneous platform dependent initialisations
*/
-struct cfi_platform_data cfi_info = {
+static struct cfi_platform_data cfi_info = {
};
struct device_d cfi_dev = {
- .name = "nor",
+ .name = "cfi_flash",
+ .id = "nor0",
.map_base = 0x11000000,
.size = 16 * 1024 * 1024,
@@ -52,34 +54,32 @@ struct device_d cfi_dev = {
struct device_d sdram_dev = {
.name = "ram",
+ .id = "ram0",
.map_base = 0x20000000,
.size = 32 * 1024 * 1024,
};
-int board_init (void)
-{
- /* Enable Ctrlc */
- console_init_f ();
-
-
- gd->bd->bi_arch_number = MACH_TYPE_ECO920;
- gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+static struct device_d at91_ath_dev = {
+ .name = "at91_eth",
+ .id = "eth0",
- return 0;
-}
+ .type = DEVICE_TYPE_ETHER,
+};
-int dram_init (void)
+static int devices_init (void)
{
register_device(&cfi_dev);
register_device(&sdram_dev);
+ register_device(&at91_ath_dev);
gd->bd->bi_dram[0].start = PHYS_SDRAM;
gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
return 0;
}
-#ifdef CONFIG_DRIVER_NET_AT91_ETHER
+device_initcall(devices_init);
+
static unsigned int phy_is_connected (AT91PS_EMAC p_mac)
{
return 1;
@@ -163,7 +163,6 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
/* ditto */
p_phyops->AutoNegotiate = NULL;
}
-#endif
#ifdef CONFIG_DRIVER_VIDEO_S1D13706
static int efb_init(struct efb_info *efb)
@@ -211,9 +210,6 @@ int misc_init_r(void)
#ifdef CONFIG_CMD_SPLASH
splash_set_fb_data(&efb.fbd);
#endif
-#ifdef CONFIG_DRIVER_NET_AT91_ETHER
- eth_set_current(&at91rm9200_eth);
-#endif
return 0;
}
diff --git a/drivers/net/at91_ether.c b/drivers/net/at91_ether.c
index d2d3e3ab97..4c1da1178e 100644
--- a/drivers/net/at91_ether.c
+++ b/drivers/net/at91_ether.c
@@ -22,8 +22,10 @@
*/
#include <at91rm9200_net.h>
+#include <init.h>
#include <net.h>
#include <miiphy.h>
+#include <driver.h>
/* ----- Ethernet Buffer definitions ----- */
@@ -147,7 +149,7 @@ UCHAR at91rm9200_EmacWritePhy (AT91PS_EMAC p_mac,
return TRUE;
}
-static int at91rm9200_eth_init (struct eth_device *ndev, bd_t * bd)
+static int at91rm9200_eth_init (struct device_d *dev)
{
int i;
@@ -205,7 +207,7 @@ static int at91rm9200_eth_init (struct eth_device *ndev, bd_t * bd)
return 0;
}
-static int at91rm9200_eth_open (struct eth_device *ndev, bd_t * bd)
+static int at91rm9200_eth_open (struct eth_device *ndev)
{
int ret;
@@ -314,7 +316,6 @@ static int at91rm9200_set_mac_address(struct eth_device *eth, unsigned char *adr
}
struct eth_device at91rm9200_eth = {
- .init = at91rm9200_eth_init,
.open = at91rm9200_eth_open,
.send = at91rm9200_eth_send,
.recv = at91rm9200_eth_rx,
@@ -323,3 +324,18 @@ struct eth_device at91rm9200_eth = {
.set_mac_address = at91rm9200_set_mac_address,
};
+static struct driver_d at91_eth_driver = {
+ .name = "at91_eth",
+ .probe = at91rm9200_eth_init,
+ .type = DEVICE_TYPE_ETHER,
+ .type_data = &at91rm9200_eth,
+};
+
+static int at91_eth_init(void)
+{
+ register_driver(&at91_eth_driver);
+ return 0;
+}
+
+device_initcall(at91_eth_init);
+
diff --git a/include/configs/eco920.h b/include/configs/eco920.h
index 3af4e95b7e..f3b22e5e02 100644
--- a/include/configs/eco920.h
+++ b/include/configs/eco920.h
@@ -151,5 +151,9 @@
#define CONFIG_MISC_INIT_R 1 /* call misc_init_r() on init */
#define CFG_SPLASH 1
#define CFG_S1D13706FB 1
+
+#define CONFIG_ARCH_NUMBER MACH_TYPE_ECO920
+#define CONFIG_BOOT_PARAMS PHYS_SDRAM + 0x100
+
#endif