From 6d0f6bcf337c5261c08fabe12982178c2c489d76 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 16 Oct 2008 15:01:15 +0200 Subject: rename CFG_ macros to CONFIG_SYS Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/mpc8xx/cpu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'cpu/mpc8xx/cpu.c') diff --git a/cpu/mpc8xx/cpu.c b/cpu/mpc8xx/cpu.c index ec6a3fd5d..420eaedf5 100644 --- a/cpu/mpc8xx/cpu.c +++ b/cpu/mpc8xx/cpu.c @@ -137,13 +137,13 @@ static int check_CPU (long clock, uint pvr, uint immr) printf ("unknown M%s (0x%08x)", id_str, k); -#if defined(CFG_8xx_CPUCLK_MIN) && defined(CFG_8xx_CPUCLK_MAX) +#if defined(CONFIG_SYS_8xx_CPUCLK_MIN) && defined(CONFIG_SYS_8xx_CPUCLK_MAX) printf (" at %s MHz [%d.%d...%d.%d MHz]\n ", strmhz (buf, clock), - CFG_8xx_CPUCLK_MIN / 1000000, - ((CFG_8xx_CPUCLK_MIN % 1000000) + 50000) / 100000, - CFG_8xx_CPUCLK_MAX / 1000000, - ((CFG_8xx_CPUCLK_MAX % 1000000) + 50000) / 100000 + CONFIG_SYS_8xx_CPUCLK_MIN / 1000000, + ((CONFIG_SYS_8xx_CPUCLK_MIN % 1000000) + 50000) / 100000, + CONFIG_SYS_8xx_CPUCLK_MAX / 1000000, + ((CONFIG_SYS_8xx_CPUCLK_MAX % 1000000) + 50000) / 100000 ); #else printf (" at %s MHz: ", strmhz (buf, clock)); @@ -375,7 +375,7 @@ int checkcpu (void) int checkicache (void) { - volatile immap_t *immap = (immap_t *) CFG_IMMR; + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; u32 cacheon = rd_ic_cst () & IDC_ENABLED; @@ -422,7 +422,7 @@ int checkicache (void) int checkdcache (void) { - volatile immap_t *immap = (immap_t *) CFG_IMMR; + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; u32 cacheon = rd_dc_cst () & IDC_ENABLED; @@ -462,7 +462,7 @@ void upmconfig (uint upm, uint * table, uint size) { uint i; uint addr = 0; - volatile immap_t *immap = (immap_t *) CFG_IMMR; + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; for (i = 0; i < size; i++) { @@ -480,7 +480,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { ulong msr, addr; - volatile immap_t *immap = (immap_t *) CFG_IMMR; + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; immap->im_clkrst.car_plprcr |= PLPRCR_CSR; /* Checkstop Reset enable */ @@ -495,16 +495,16 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Trying to execute the next instruction at a non-existing address * should cause a machine check, resulting in reset */ -#ifdef CFG_RESET_ADDRESS - addr = CFG_RESET_ADDRESS; +#ifdef CONFIG_SYS_RESET_ADDRESS + addr = CONFIG_SYS_RESET_ADDRESS; #else /* - * note: when CFG_MONITOR_BASE points to a RAM address, CFG_MONITOR_BASE + * note: when CONFIG_SYS_MONITOR_BASE points to a RAM address, CONFIG_SYS_MONITOR_BASE * - sizeof (ulong) is usually a valid address. Better pick an address - * known to be invalid on your system and assign it to CFG_RESET_ADDRESS. + * known to be invalid on your system and assign it to CONFIG_SYS_RESET_ADDRESS. * "(ulong)-1" used to be a good choice for many systems... */ - addr = CFG_MONITOR_BASE - sizeof (ulong); + addr = CONFIG_SYS_MONITOR_BASE - sizeof (ulong); #endif ((void (*)(void)) addr) (); return 1; @@ -525,7 +525,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) disable_interrupts (); /* make sure the watchdog is running */ - reset_8xx_watchdog ((immap_t *) CFG_IMMR); + reset_8xx_watchdog ((immap_t *) CONFIG_SYS_IMMR); /* wait for watchdog reset */ while (1) {}; @@ -591,7 +591,7 @@ void watchdog_reset (void) { int re_enable = disable_interrupts (); - reset_8xx_watchdog ((immap_t *) CFG_IMMR); + reset_8xx_watchdog ((immap_t *) CONFIG_SYS_IMMR); if (re_enable) enable_interrupts (); } -- cgit v1.2.3-70-g09d2 From 3456a148276d5494b53ee40242efb6462d163504 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Wed, 22 Oct 2008 23:20:29 -0700 Subject: Moved initialization of FCC Ethernet controller to cpu_eth_init Affected boards: Several MPC8xx boards Several MPC8260/MPC8272 boards Several MPC85xx boards Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- cpu/mpc8260/cpu.c | 13 +++++++++++++ cpu/mpc85xx/cpu.c | 5 ++++- cpu/mpc8xx/cpu.c | 13 +++++++++++++ include/netdev.h | 1 + net/eth.c | 5 ----- 5 files changed, 31 insertions(+), 6 deletions(-) (limited to 'cpu/mpc8xx/cpu.c') diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c index 9f834d3e5..b9e748ab8 100644 --- a/cpu/mpc8260/cpu.c +++ b/cpu/mpc8260/cpu.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -315,3 +316,15 @@ void ft_cpu_setup (void *blob, bd_t *bd) do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1); } #endif /* CONFIG_OF_LIBFDT */ + +/* + * Initializes on-chip ethernet controllers. + * to override, implement board_eth_init() + */ +int cpu_eth_init(bd_t *bis) +{ +#if defined(CONFIG_ETHER_ON_FCC) + fec_initialize(bis); +#endif + return 0; +} diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c index b90871d22..fc6bd2d21 100644 --- a/cpu/mpc85xx/cpu.c +++ b/cpu/mpc85xx/cpu.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -383,9 +384,11 @@ void upmconfig (uint upm, uint * table, uint size) */ int cpu_eth_init(bd_t *bis) { +#if defined(CONFIG_ETHER_ON_FCC) + fec_initialize(bis); +#endif #if defined(CONFIG_TSEC_ENET) || defined(CONFIG_MPC85XX_FEC) tsec_standard_init(bis); #endif - return 0; } diff --git a/cpu/mpc8xx/cpu.c b/cpu/mpc8xx/cpu.c index 420eaedf5..de3d67960 100644 --- a/cpu/mpc8xx/cpu.c +++ b/cpu/mpc8xx/cpu.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #if defined(CONFIG_OF_LIBFDT) @@ -635,3 +636,15 @@ void reset_8xx_watchdog (volatile immap_t * immr) # endif /* CONFIG_LWMON */ } #endif /* CONFIG_WATCHDOG */ + +/* + * Initializes on-chip ethernet controllers. + * to override, implement board_eth_init() + */ +int cpu_eth_init(bd_t *bis) +{ +#if defined(FEC_ENET) + fec_initialize(bis); +#endif + return 0; +} diff --git a/include/netdev.h b/include/netdev.h index 31115e2b2..0d1b0d517 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -47,6 +47,7 @@ int dc21x4x_initialize(bd_t *bis); int e1000_initialize(bd_t *bis); int eepro100_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); +int fec_initialize (bd_t *bis); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); int inca_switch_initialize(bd_t *bis); diff --git a/net/eth.c b/net/eth.c index 72fed6989..6cf53f4a4 100644 --- a/net/eth.c +++ b/net/eth.c @@ -39,7 +39,6 @@ static int __def_eth_init(bd_t *bis) int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); -extern int fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); @@ -184,10 +183,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_UEC_ETH6) uec_initialize(5); #endif - -#if defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FCC) - fec_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64); -- cgit v1.2.3-70-g09d2 From 9eb79bd8856bcab896ed5e1f1bca159807a124dd Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Thu, 23 Oct 2008 22:02:49 -0700 Subject: Moved initialization of MPC8XX SCC to cpu_eth_init() Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- cpu/mpc8xx/cpu.c | 4 ++++ include/netdev.h | 1 + net/eth.c | 4 ---- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'cpu/mpc8xx/cpu.c') diff --git a/cpu/mpc8xx/cpu.c b/cpu/mpc8xx/cpu.c index de3d67960..40f81efc3 100644 --- a/cpu/mpc8xx/cpu.c +++ b/cpu/mpc8xx/cpu.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -643,6 +644,9 @@ void reset_8xx_watchdog (volatile immap_t * immr) */ int cpu_eth_init(bd_t *bis) { +#if defined(SCC_ENET) + scc_initialize(bis); +#endif #if defined(FEC_ENET) fec_initialize(bis); #endif diff --git a/include/netdev.h b/include/netdev.h index 55183e87a..45e59b6f6 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -64,6 +64,7 @@ int pcnet_initialize(bd_t *bis); int plb2800_eth_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); +int scc_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int tsi108_eth_initialize(bd_t *bis); int uec_initialize(int index); diff --git a/net/eth.c b/net/eth.c index d5431639a..0b954edb7 100644 --- a/net/eth.c +++ b/net/eth.c @@ -42,7 +42,6 @@ int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); extern int ppc_4xx_eth_initialize(bd_t *); -extern int scc_initialize(bd_t*); #ifdef CONFIG_API extern void (*push_packet)(volatile void *, int); @@ -156,9 +155,6 @@ int eth_initialize(bd_t *bis) #endif #if defined(CONFIG_4xx) && !defined(CONFIG_IOP480) && !defined(CONFIG_AP1000) ppc_4xx_eth_initialize(bis); -#endif -#ifdef SCC_ENET - scc_initialize(bis); #endif if (!eth_devices) { puts ("No ethernet found.\n"); -- cgit v1.2.3-70-g09d2 From 2145188bea2df8f2b47a87ec3071b55027e8d0ae Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Tue, 9 Dec 2008 23:34:15 -0800 Subject: Fix compile error in building MBX860T. Signed-off-by: Ben Warren --- cpu/mpc8xx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu/mpc8xx/cpu.c') diff --git a/cpu/mpc8xx/cpu.c b/cpu/mpc8xx/cpu.c index 40f81efc3..2eb848bd0 100644 --- a/cpu/mpc8xx/cpu.c +++ b/cpu/mpc8xx/cpu.c @@ -644,7 +644,7 @@ void reset_8xx_watchdog (volatile immap_t * immr) */ int cpu_eth_init(bd_t *bis) { -#if defined(SCC_ENET) +#if defined(SCC_ENET) && defined(CONFIG_CMD_NET) scc_initialize(bis); #endif #if defined(FEC_ENET) -- cgit v1.2.3-70-g09d2