浏览代码

[intel] Explicitly enable descriptor queues

On i350 the datasheet contradicts itself in stating that the default
value of RXDCTL.ENABLE for queue zero is both set (according to the
"Receive Initialization" section) and unset (according to the "Receive
Descriptor Control - RXDCTL" section).  Empirical evidence suggests
that the default value is unset.

Explicitly enable both transmit and receive queues to avoid any
ambiguity.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 年前
父节点
当前提交
9f0b2d25a8
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 6
    0
      src/drivers/net/intel.c
  2. 4
    0
      src/drivers/net/intel.h

+ 6
- 0
src/drivers/net/intel.c 查看文件

363
 static int intel_create_ring ( struct intel_nic *intel,
363
 static int intel_create_ring ( struct intel_nic *intel,
364
 			       struct intel_ring *ring ) {
364
 			       struct intel_ring *ring ) {
365
 	physaddr_t address;
365
 	physaddr_t address;
366
+	uint32_t dctl;
366
 
367
 
367
 	/* Allocate descriptor ring.  Align ring on its own size to
368
 	/* Allocate descriptor ring.  Align ring on its own size to
368
 	 * prevent any possible page-crossing errors due to hardware
369
 	 * prevent any possible page-crossing errors due to hardware
393
 	writel ( 0, ( intel->regs + ring->reg + INTEL_xDH ) );
394
 	writel ( 0, ( intel->regs + ring->reg + INTEL_xDH ) );
394
 	writel ( 0, ( intel->regs + ring->reg + INTEL_xDT ) );
395
 	writel ( 0, ( intel->regs + ring->reg + INTEL_xDT ) );
395
 
396
 
397
+	/* Enable ring */
398
+	dctl = readl ( intel->regs + ring->reg + INTEL_xDCTL );
399
+	dctl |= INTEL_xDCTL_ENABLE;
400
+	writel ( dctl, intel->regs + ring->reg + INTEL_xDCTL );
401
+
396
 	DBGC ( intel, "INTEL %p ring %05x is at [%08llx,%08llx)\n",
402
 	DBGC ( intel, "INTEL %p ring %05x is at [%08llx,%08llx)\n",
397
 	       intel, ring->reg, ( ( unsigned long long ) address ),
403
 	       intel, ring->reg, ( ( unsigned long long ) address ),
398
 	       ( ( unsigned long long ) address + ring->len ) );
404
 	       ( ( unsigned long long ) address + ring->len ) );

+ 4
- 0
src/drivers/net/intel.h 查看文件

170
 /** Receive/Transmit Descriptor Tail (offset) */
170
 /** Receive/Transmit Descriptor Tail (offset) */
171
 #define INTEL_xDT 0x18
171
 #define INTEL_xDT 0x18
172
 
172
 
173
+/** Receive/Transmit Descriptor Control (offset) */
174
+#define INTEL_xDCTL 0x28
175
+#define INTEL_xDCTL_ENABLE	0x02000000UL	/**< Queue enable */
176
+
173
 /** Receive Descriptor Head */
177
 /** Receive Descriptor Head */
174
 #define INTEL_RDH ( INTEL_RD + INTEL_xDH )
178
 #define INTEL_RDH ( INTEL_RD + INTEL_xDH )
175
 
179
 

正在加载...
取消
保存