aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_link.c
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-08-12 04:23:01 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-13 02:02:23 -0400
commitbc7f0a053021491e292fc00810c4f2a8524453dd (patch)
tree8646255294fd28eeaa4d55c2b65737d73bd630ab /drivers/net/bnx2x_link.c
parent97b41dad385bce97d60b8cdd56342f07f93fc5d2 (diff)
bnx2x: BCM8727 FW load
The BCM8727 is a dual port PHY. The FW must be loaded in a given order on all designs - including those which swapped the ports (calling port number zero the second port) Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_link.c')
-rw-r--r--drivers/net/bnx2x_link.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c
index aee9fff9619a..db4f3c057a19 100644
--- a/drivers/net/bnx2x_link.c
+++ b/drivers/net/bnx2x_link.c
@@ -6430,7 +6430,7 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, u32 shmem_base)
6430static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base) 6430static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base)
6431{ 6431{
6432 u8 ext_phy_addr[PORT_MAX]; 6432 u8 ext_phy_addr[PORT_MAX];
6433 s8 port; 6433 s8 port, first_port, i;
6434 u32 swap_val, swap_override; 6434 u32 swap_val, swap_override;
6435 DP(NETIF_MSG_LINK, "Executing BCM8727 common init\n"); 6435 DP(NETIF_MSG_LINK, "Executing BCM8727 common init\n");
6436 swap_val = REG_RD(bp, NIG_REG_PORT_SWAP); 6436 swap_val = REG_RD(bp, NIG_REG_PORT_SWAP);
@@ -6439,8 +6439,13 @@ static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base)
6439 bnx2x_hw_reset(bp, 1 ^ (swap_val && swap_override)); 6439 bnx2x_hw_reset(bp, 1 ^ (swap_val && swap_override));
6440 msleep(5); 6440 msleep(5);
6441 6441
6442 if (swap_val && swap_override)
6443 first_port = PORT_0;
6444 else
6445 first_port = PORT_1;
6446
6442 /* PART1 - Reset both phys */ 6447 /* PART1 - Reset both phys */
6443 for (port = PORT_MAX - 1; port >= PORT_0; port--) { 6448 for (i = 0, port = first_port; i < PORT_MAX; i++, port = !port) {
6444 /* Extract the ext phy address for the port */ 6449 /* Extract the ext phy address for the port */
6445 u32 ext_phy_config = REG_RD(bp, shmem_base + 6450 u32 ext_phy_config = REG_RD(bp, shmem_base +
6446 offsetof(struct shmem_region, 6451 offsetof(struct shmem_region,
@@ -6470,7 +6475,7 @@ static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base)
6470 msleep(150); 6475 msleep(150);
6471 6476
6472 /* PART2 - Download firmware to both phys */ 6477 /* PART2 - Download firmware to both phys */
6473 for (port = PORT_MAX - 1; port >= PORT_0; port--) { 6478 for (i = 0, port = first_port; i < PORT_MAX; i++, port = !port) {
6474 u16 fw_ver1; 6479 u16 fw_ver1;
6475 6480
6476 bnx2x_bcm8727_external_rom_boot(bp, port, 6481 bnx2x_bcm8727_external_rom_boot(bp, port,
@@ -6482,16 +6487,13 @@ static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base)
6482 MDIO_PMA_REG_ROM_VER1, &fw_ver1); 6487 MDIO_PMA_REG_ROM_VER1, &fw_ver1);
6483 if (fw_ver1 == 0 || fw_ver1 == 0x4321) { 6488 if (fw_ver1 == 0 || fw_ver1 == 0x4321) {
6484 DP(NETIF_MSG_LINK, 6489 DP(NETIF_MSG_LINK,
6485 "bnx2x_8073_common_init_phy port %x:" 6490 "bnx2x_8727_common_init_phy port %x:"
6486 "Download failed. fw version = 0x%x\n", 6491 "Download failed. fw version = 0x%x\n",
6487 port, fw_ver1); 6492 port, fw_ver1);
6488 return -EINVAL; 6493 return -EINVAL;
6489 } 6494 }
6490
6491 } 6495 }
6492 6496
6493
6494
6495 return 0; 6497 return 0;
6496} 6498}
6497 6499