Commit 3ae071e44256144d6c1e3febb65f6c56bd433769

Authored by Ben Warren
1 parent 89973f8a82
Exists in master and in 57 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf-6.6.52-2.2.0, emb_lf_v2022.04, emb_lf_v2023.04, emb_lf_v2024.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Moved initialization of Ethernet controllers on Atmel AT91 to board_eth_init()

Removed at91sam9_eth_initialize() from net/eth.c

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>

Showing 6 changed files with 33 additions and 41 deletions Side-by-side Diff

board/atmel/at91cap9adk/at91cap9adk.c
... ... @@ -30,11 +30,13 @@
30 30 #include <asm/arch/at91_rstc.h>
31 31 #include <asm/arch/gpio.h>
32 32 #include <asm/arch/io.h>
  33 +#include <asm/arch/hardware.h>
33 34 #include <lcd.h>
34 35 #include <atmel_lcdc.h>
35 36 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
36 37 #include <net.h>
37 38 #endif
  39 +#include <netdev.h>
38 40  
39 41 #define MP_BLOCK_3_BASE 0xFDF00000
40 42  
... ... @@ -376,4 +378,13 @@
376 378 #endif
377 379 }
378 380 #endif
  381 +
  382 +int board_eth_init(bd_t *bis)
  383 +{
  384 + int rc = 0;
  385 +#ifdef CONFIG_MACB
  386 + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
  387 +#endif
  388 + return rc;
  389 +}
board/atmel/at91sam9260ek/at91sam9260ek.c
... ... @@ -30,9 +30,11 @@
30 30 #include <asm/arch/at91_rstc.h>
31 31 #include <asm/arch/gpio.h>
32 32 #include <asm/arch/io.h>
  33 +#include <asm/arch/hardware.h>
33 34 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
34 35 #include <net.h>
35 36 #endif
  37 +#include <netdev.h>
36 38  
37 39 DECLARE_GLOBAL_DATA_PTR;
38 40  
... ... @@ -248,4 +250,13 @@
248 250 #endif
249 251 }
250 252 #endif
  253 +
  254 +int board_eth_init(bd_t *bis)
  255 +{
  256 + int rc = 0;
  257 +#ifdef CONFIG_MACB
  258 + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
  259 +#endif
  260 + return rc;
  261 +}
board/atmel/at91sam9263ek/at91sam9263ek.c
... ... @@ -31,11 +31,13 @@
31 31 #include <asm/arch/at91_rstc.h>
32 32 #include <asm/arch/gpio.h>
33 33 #include <asm/arch/io.h>
  34 +#include <asm/arch/hardware.h>
34 35 #include <lcd.h>
35 36 #include <atmel_lcdc.h>
36 37 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
37 38 #include <net.h>
38 39 #endif
  40 +#include <netdev.h>
39 41  
40 42 DECLARE_GLOBAL_DATA_PTR;
41 43  
... ... @@ -308,4 +310,13 @@
308 310 #endif
309 311 }
310 312 #endif
  313 +
  314 +int board_eth_init(bd_t *bis)
  315 +{
  316 + int rc = 0;
  317 +#ifdef CONFIG_MACB
  318 + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
  319 +#endif
  320 + return rc;
  321 +}
cpu/arm926ejs/at91/Makefile
... ... @@ -25,7 +25,6 @@
25 25  
26 26 LIB = $(obj)lib$(SOC).a
27 27  
28   -COBJS-y += ether.o
29 28 COBJS-y += timer.o
30 29 COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o
31 30 COBJS-y += usb.o
cpu/arm926ejs/at91/ether.c
1   -/*
2   - * (C) Copyright 2007-2008
3   - * Stelian Pop <stelian.pop@leadtechdesign.com>
4   - * Lead Tech Design <www.leadtechdesign.com>
5   - *
6   - * See file CREDITS for list of people who contributed to this
7   - * project.
8   - *
9   - * This program is free software; you can redistribute it and/or
10   - * modify it under the terms of the GNU General Public License as
11   - * published by the Free Software Foundation; either version 2 of
12   - * the License, or (at your option) any later version.
13   - *
14   - * This program is distributed in the hope that it will be useful,
15   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   - * GNU General Public License for more details.
18   - *
19   - * You should have received a copy of the GNU General Public License
20   - * along with this program; if not, write to the Free Software
21   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22   - * MA 02111-1307 USA
23   - */
24   -
25   -#include <common.h>
26   -#include <asm/arch/hardware.h>
27   -
28   -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
29   -
30   -#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
31   -void at91sam9_eth_initialize(bd_t *bi)
32   -{
33   - macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
34   -}
35   -#endif
... ... @@ -66,7 +66,6 @@
66 66 extern int tsi108_eth_initialize(bd_t*);
67 67 extern int npe_initialize(bd_t *);
68 68 extern int uec_initialize(int);
69   -extern int at91sam9_eth_initialize(bd_t *);
70 69  
71 70 #ifdef CONFIG_API
72 71 extern void (*push_packet)(volatile void *, int);
... ... @@ -253,10 +252,6 @@
253 252 #endif
254 253 #if defined(CONFIG_RTL8169)
255 254 rtl8169_initialize(bis);
256   -#endif
257   -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
258   - defined(CONFIG_AT91SAM9263)
259   - at91sam9_eth_initialize(bis);
260 255 #endif
261 256  
262 257 if (!eth_devices) {