summaryrefslogtreecommitdiff
path: root/board/freescale/mpc8548cds/mpc8548cds.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-11-16 20:06:21 +0100
committerWolfgang Denk <wd@denx.de>2011-11-16 20:06:21 +0100
commitc7801ee43b6263246e782000b71753caac5fe9c6 (patch)
tree1954eb9d5d051934839b70929f04603071335e18 /board/freescale/mpc8548cds/mpc8548cds.c
parent4055a6684781790ca29c8e25b858d55af173e145 (diff)
parent4589728e214958a4e6e011a081a68d360c49d7a5 (diff)
downloadu-boot-imx-c7801ee43b6263246e782000b71753caac5fe9c6.zip
u-boot-imx-c7801ee43b6263246e782000b71753caac5fe9c6.tar.gz
u-boot-imx-c7801ee43b6263246e782000b71753caac5fe9c6.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
* 'master' of git://git.denx.de/u-boot-mpc85xx: powerpc/85xx: Fix builds of P1020/P2020RDB-PC_36BIT_NAND arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc8xxx/ddr/options.c: Fix GCC 4.6 build warning drivers/qe/uec.c: Fix GCC 4.6 build warning drivers/usb/host/ehci-fsl.c: Fix GCC 4.6 build warning drivers/net/fm/fm.c: Fix GCC 4.6 build warning board/sbc8560/sbc8560.c: Fix GCC 4.6 build warning board/sbc8548/sbc8548.c: Fix GCC 4.6 build warning board/freescale/mpc8569mds/mpc8569mds.c: Fix GCC 4.6 build warning board/freescale/mpc8568mds/mpc8568mds.c: Fix GCC 4.6 build warning board/freescale/mpc8548cds/mpc8548cds.c: Fix GCC 4.6 build warning board/freescale/common/pixis.c: Fix GCC 4.6 build warning board/freescale/common/cds_pci_ft.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc8xxx/fsl_lbc.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc85xx/tlb.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc85xx/cpu_init.c: Fix GCC 4.6 build warning phylib: Enable AR8021 phy support powerpc/85xx: Set max alloc length to 10MB on P1022DS powerpc/mpc85xx: Set SYSCLK to the required frequency powerpc/85xx: Fix NAND SPL support powerpc/85xx: Fix MPC8572DS NAND build fsl_ifc: Fixed a bug in the erratum handling code for IFC_A003399 powerpc/85xx: Add support for Book-E MMU Arch v2.0 powerpc/85xx: Make inclusion of USB device fixup conditional powerpc/85xx: Fix warning for USB device-fixup powerpc/85xx: resize the boot page TLB before relocating CCSR powerpc/85xx: verify the current address of CCSR before relocating it powerpc/85xx: add some missing sync instructions in the CCSR relocation code powerpc/85xx: fix some comments in the CCSR relocation code powerpc/85xx: fix definition of MAS register macros powerpc/mpc8548cds: Fix network initialization powerpc/mpc8548: Add workaround for erratum NMG_eTSEC129 powerpc/QorIQ: fix network frame manager TBI PHY address settings
Diffstat (limited to 'board/freescale/mpc8548cds/mpc8548cds.c')
-rw-r--r--board/freescale/mpc8548cds/mpc8548cds.c69
1 files changed, 58 insertions, 11 deletions
diff --git a/board/freescale/mpc8548cds/mpc8548cds.c b/board/freescale/mpc8548cds/mpc8548cds.c
index a8d57cd..e5563f7 100644
--- a/board/freescale/mpc8548cds/mpc8548cds.c
+++ b/board/freescale/mpc8548cds/mpc8548cds.c
@@ -33,6 +33,9 @@
#include <miiphy.h>
#include <libfdt.h>
#include <fdt_support.h>
+#include <tsec.h>
+#include <fsl_mdio.h>
+#include <netdev.h>
#include "../common/cadmus.h"
#include "../common/eeprom.h"
@@ -81,12 +84,10 @@ local_bus_init(void)
volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
uint clkdiv;
- uint lbc_hz;
sys_info_t sysinfo;
get_sys_info(&sysinfo);
clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2;
- lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;
gur->lbiuiplldcr1 = 0x00078080;
if (clkdiv == 16) {
@@ -115,7 +116,6 @@ void lbc_sdram_init(void)
uint idx;
volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE;
- uint cpu_board_rev;
uint lsdmr_common;
puts("LBC SDRAM: ");
@@ -137,7 +137,6 @@ void lbc_sdram_init(void)
/*
* MPC8548 uses "new" 15-16 style addressing.
*/
- cpu_board_rev = get_cpu_board_revision();
lsdmr_common = CONFIG_SYS_LBC_LSDMR_COMMON;
lsdmr_common |= LSDMR_BSMA1516;
@@ -287,7 +286,7 @@ void pci_init_board(void)
fsl_pcie_init_board(first_free_busno);
}
-int last_stage_init(void)
+void configure_rgmii(void)
{
unsigned short temp;
@@ -295,29 +294,77 @@ int last_stage_init(void)
/* This is needed to get the RGMII working for the 1.3+
* CDS cards */
if (get_board_version() == 0x13) {
- miiphy_write(CONFIG_TSEC1_NAME,
+ miiphy_write(DEFAULT_MII_NAME,
TSEC1_PHY_ADDR, 29, 18);
- miiphy_read(CONFIG_TSEC1_NAME,
+ miiphy_read(DEFAULT_MII_NAME,
TSEC1_PHY_ADDR, 30, &temp);
temp = (temp & 0xf03f);
temp |= 2 << 9; /* 36 ohm */
temp |= 2 << 6; /* 39 ohm */
- miiphy_write(CONFIG_TSEC1_NAME,
+ miiphy_write(DEFAULT_MII_NAME,
TSEC1_PHY_ADDR, 30, temp);
- miiphy_write(CONFIG_TSEC1_NAME,
+ miiphy_write(DEFAULT_MII_NAME,
TSEC1_PHY_ADDR, 29, 3);
- miiphy_write(CONFIG_TSEC1_NAME,
+ miiphy_write(DEFAULT_MII_NAME,
TSEC1_PHY_ADDR, 30, 0x8000);
}
- return 0;
+ return;
}
+#ifdef CONFIG_TSEC_ENET
+int board_eth_init(bd_t *bis)
+{
+ struct fsl_pq_mdio_info mdio_info;
+ struct tsec_info_struct tsec_info[4];
+ int num = 0;
+
+#ifdef CONFIG_TSEC1
+ SET_STD_TSEC_INFO(tsec_info[num], 1);
+ num++;
+#endif
+#ifdef CONFIG_TSEC2
+ SET_STD_TSEC_INFO(tsec_info[num], 2);
+ num++;
+#endif
+#ifdef CONFIG_TSEC3
+ /* initialize TSEC3 only if Carrier is 1.3 or above on CDS */
+ if (get_board_version() >= 0x13) {
+ SET_STD_TSEC_INFO(tsec_info[num], 3);
+ tsec_info[num].interface = PHY_INTERFACE_MODE_RGMII_ID;
+ num++;
+ }
+#endif
+#ifdef CONFIG_TSEC4
+ /* initialize TSEC4 only if Carrier is 1.3 or above on CDS */
+ if (get_board_version() >= 0x13) {
+ SET_STD_TSEC_INFO(tsec_info[num], 4);
+ tsec_info[num].interface = PHY_INTERFACE_MODE_RGMII_ID;
+ num++;
+ }
+#endif
+
+ if (!num) {
+ printf("No TSECs initialized\n");
+
+ return 0;
+ }
+
+ mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+ mdio_info.name = DEFAULT_MII_NAME;
+ fsl_pq_mdio_init(bis, &mdio_info);
+
+ tsec_eth_init(bis, tsec_info, num);
+ configure_rgmii();
+
+ return pci_eth_init(bis);
+}
+#endif
#if defined(CONFIG_OF_BOARD_SETUP)
void ft_pci_setup(void *blob, bd_t *bd)