From 0867cb95115a179051c2937d10daa16ff154baec Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Mon, 8 Nov 2010 21:22:55 +0000 Subject: [PATCH] o) Recognize the Lanner MR-730. o) Fix enumeration of PHY addresses on the MR-955. o) Parse link state for the MR-730 using the Broadcom PHY support in the SDK. It's not clear that this is entirely-correct, but it seems to work. Since this board uses a BCM5482S, this may mean that we work correctly for copper but not SFI, which is untested. --- sys/contrib/octeon-sdk/cvmx-app-init.h | 6 ++++++ sys/contrib/octeon-sdk/cvmx-helper-board.c | 16 +++++++++++++--- sys/contrib/octeon-sdk/cvmx-helper.c | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/contrib/octeon-sdk/cvmx-app-init.h b/sys/contrib/octeon-sdk/cvmx-app-init.h index 8f768ed7834..8b43bcf9d25 100644 --- a/sys/contrib/octeon-sdk/cvmx-app-init.h +++ b/sys/contrib/octeon-sdk/cvmx-app-init.h @@ -193,6 +193,9 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_GCT108 = 10012, CVMX_BOARD_TYPE_CUST_AGS109 = 10013, CVMX_BOARD_TYPE_CUST_GCT110 = 10014, +#if defined(OCTEON_VENDOR_LANNER) + CVMX_BOARD_TYPE_CUST_LANNER_MR730= 10021, +#endif CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, /* Set aside a range for customer private use. The SDK won't @@ -272,6 +275,9 @@ static inline const char *cvmx_board_type_to_string(enum cvmx_board_types_enum t ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110) +#if defined(OCTEON_VENDOR_LANNER) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR730) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) /* Customer private range */ diff --git a/sys/contrib/octeon-sdk/cvmx-helper-board.c b/sys/contrib/octeon-sdk/cvmx-helper-board.c index cca2b22bd76..4efc825a027 100644 --- a/sys/contrib/octeon-sdk/cvmx-helper-board.c +++ b/sys/contrib/octeon-sdk/cvmx-helper-board.c @@ -114,9 +114,6 @@ int cvmx_helper_board_get_mii_address(int ipd_port) case CVMX_BOARD_TYPE_EBT5800: case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR955: -#endif /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -180,6 +177,15 @@ int cvmx_helper_board_get_mii_address(int ipd_port) /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + /* Interface 1 is 12 BCM5482S PHYs. */ + if ((ipd_port >= 16) && (ipd_port < 28)) + return ipd_port - 16; + return -1; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + if ((ipd_port >= 0) && (ipd_port < 4)) + return ipd_port; + return -1; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell 88E1111 interfaces. */ @@ -291,6 +297,10 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port) break; /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + /* Ports are BCM5482S */ + is_broadcom_phy = 1; + break; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 connects to the switch */ if (ipd_port == 0) diff --git a/sys/contrib/octeon-sdk/cvmx-helper.c b/sys/contrib/octeon-sdk/cvmx-helper.c index cd155bb9ff6..fbb1316792d 100644 --- a/sys/contrib/octeon-sdk/cvmx-helper.c +++ b/sys/contrib/octeon-sdk/cvmx-helper.c @@ -105,6 +105,8 @@ int cvmx_helper_get_number_of_interfaces(void) #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR955: return 2; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + return 1; #endif default: break;