Browse Source

Forward-port start-of-day fixes from 5.4 tree

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
a20c565ef3
1 changed files with 31 additions and 3 deletions
  1. 31
    3
      src/drivers/net/etherfabric.c

+ 31
- 3
src/drivers/net/etherfabric.c View File

@@ -771,16 +771,28 @@ static int mentormac_mdio_read ( struct efab_nic *efab, int phy_id,
771 771
 #define EF1_EVT3_REG 0x38
772 772
 
773 773
 /** EEPROM access */
774
-#define EF1_EEPROM_REG 0x0040
774
+#define EF1_EEPROM_REG 0x40
775
+#define EF1_EEPROM_SDA_LBN 31
776
+#define EF1_EEPROM_SDA_WIDTH 1
777
+#define EF1_EEPROM_SCL_LBN 30
778
+#define EF1_EEPROM_SCL_WIDTH 1
779
+#define EF1_JTAG_DISCONNECT_LBN 17
780
+#define EF1_JTAG_DISCONNECT_WIDTH 1
775 781
 #define EF1_EEPROM_LBN 0
776 782
 #define EF1_EEPROM_WIDTH 32
777 783
 
778 784
 /** Control register 2 */
779 785
 #define EF1_CTL2_REG 0x4c
786
+#define EF1_PLL_TRAP_LBN 31
787
+#define EF1_PLL_TRAP_WIDTH 1
780 788
 #define EF1_MEM_MAP_4MB_LBN 11
781 789
 #define EF1_MEM_MAP_4MB_WIDTH 1
782 790
 #define EF1_EV_INTR_CLR_WRITE_LBN 6
783 791
 #define EF1_EV_INTR_CLR_WRITE_WIDTH 1
792
+#define EF1_BURST_MERGE_LBN 5
793
+#define EF1_BURST_MERGE_WIDTH 1
794
+#define EF1_CLEAR_NULL_PAD_LBN 4
795
+#define EF1_CLEAR_NULL_PAD_WIDTH 1
784 796
 #define EF1_SW_RESET_LBN 2
785 797
 #define EF1_SW_RESET_WIDTH 1
786 798
 #define EF1_INTR_AFTER_EVENT_LBN 1
@@ -1083,15 +1095,20 @@ static int ef1002_init_nic ( struct efab_nic *efab ) {
1083 1095
 	/* General control register 0 */
1084 1096
 	ef1002_readl ( efab, &reg, EF1_CTR_GEN_STATUS0_REG );
1085 1097
 	EFAB_SET_DWORD_FIELD ( reg, EF1_MASTER_EVENTS, 0 );
1098
+	EFAB_SET_DWORD_FIELD ( reg, EF1_TX_ENGINE_EN, 0 );
1099
+	EFAB_SET_DWORD_FIELD ( reg, EF1_RX_ENGINE_EN, 0 );
1086 1100
 	EFAB_SET_DWORD_FIELD ( reg, EF1_CAM_ENABLE, 1 );
1087 1101
 	ef1002_writel ( efab, &reg, EF1_CTR_GEN_STATUS0_REG );
1088 1102
 	udelay ( 1000 );
1089 1103
 
1090 1104
 	/* General control register 2 */
1091 1105
 	ef1002_readl ( efab, &reg, EF1_CTL2_REG );
1092
-	EFAB_SET_DWORD_FIELD ( reg, EF1_INTR_AFTER_EVENT, 1 );
1093
-	EFAB_SET_DWORD_FIELD ( reg, EF1_EV_INTR_CLR_WRITE, 0 );
1106
+	EFAB_SET_DWORD_FIELD ( reg, EF1_PLL_TRAP, 1 );
1094 1107
 	EFAB_SET_DWORD_FIELD ( reg, EF1_MEM_MAP_4MB, 0 );
1108
+	EFAB_SET_DWORD_FIELD ( reg, EF1_EV_INTR_CLR_WRITE, 0 );
1109
+	EFAB_SET_DWORD_FIELD ( reg, EF1_BURST_MERGE, 0 );
1110
+	EFAB_SET_DWORD_FIELD ( reg, EF1_CLEAR_NULL_PAD, 1 );
1111
+	EFAB_SET_DWORD_FIELD ( reg, EF1_INTR_AFTER_EVENT, 1 );
1095 1112
 	ef1002_writel ( efab, &reg, EF1_CTL2_REG );
1096 1113
 	udelay ( 1000 );
1097 1114
 
@@ -1111,6 +1128,17 @@ static int ef1002_init_nic ( struct efab_nic *efab ) {
1111 1128
 	ef1002_writel ( efab, &reg, EF1_DMA_TX_CSR_REG );
1112 1129
 	udelay ( 1000 );
1113 1130
 
1131
+	/* Disconnect the JTAG chain.  Read-modify-write is impossible
1132
+	 * on the I2C control bits, since reading gives the state of
1133
+	 * the line inputs rather than the last written state.
1134
+	 */
1135
+	ef1002_readl ( efab, &reg, EF1_EEPROM_REG );
1136
+	EFAB_SET_DWORD_FIELD ( reg, EF1_EEPROM_SDA, 1 );
1137
+	EFAB_SET_DWORD_FIELD ( reg, EF1_EEPROM_SCL, 1 );
1138
+	EFAB_SET_DWORD_FIELD ( reg, EF1_JTAG_DISCONNECT, 1 );
1139
+	ef1002_writel ( efab, &reg, EF1_EEPROM_REG );
1140
+	udelay ( 10 );
1141
+
1114 1142
 	/* Flush descriptor queues */
1115 1143
 	EFAB_ZERO_DWORD ( reg );
1116 1144
 	ef1002_writel ( efab, &reg, EF1_RX_DESC_FIFO_FLUSH );

Loading…
Cancel
Save