if_dwc: Honor snps,pbl property
DTS node can have this property which configure the burst length for both TX and RX if it's the same. This unbreak if_dwc on Allwinner A20 and possibly other boards that uses this prop. Reported by: qroxana <qroxana@mail.ru>
This commit is contained in:
parent
8eba75ed68
commit
3e5cd548af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368299
@ -1496,7 +1496,7 @@ dwc_attach(device_t dev)
|
|||||||
uint32_t reg;
|
uint32_t reg;
|
||||||
char *phy_mode;
|
char *phy_mode;
|
||||||
phandle_t node;
|
phandle_t node;
|
||||||
uint32_t txpbl, rxpbl;
|
uint32_t txpbl, rxpbl, pbl;
|
||||||
bool nopblx8 = false;
|
bool nopblx8 = false;
|
||||||
bool fixed_burst = false;
|
bool fixed_burst = false;
|
||||||
|
|
||||||
@ -1516,10 +1516,12 @@ dwc_attach(device_t dev)
|
|||||||
OF_prop_free(phy_mode);
|
OF_prop_free(phy_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OF_getencprop(node, "snps,pbl", &pbl, sizeof(uint32_t)) <= 0)
|
||||||
|
pbl = BUS_MODE_DEFAULT_PBL;
|
||||||
if (OF_getencprop(node, "snps,txpbl", &txpbl, sizeof(uint32_t)) <= 0)
|
if (OF_getencprop(node, "snps,txpbl", &txpbl, sizeof(uint32_t)) <= 0)
|
||||||
txpbl = 8;
|
txpbl = pbl;
|
||||||
if (OF_getencprop(node, "snps,rxpbl", &rxpbl, sizeof(uint32_t)) <= 0)
|
if (OF_getencprop(node, "snps,rxpbl", &rxpbl, sizeof(uint32_t)) <= 0)
|
||||||
rxpbl = 8;
|
rxpbl = pbl;
|
||||||
if (OF_hasprop(node, "snps,no-pbl-x8") == 1)
|
if (OF_hasprop(node, "snps,no-pbl-x8") == 1)
|
||||||
nopblx8 = true;
|
nopblx8 = true;
|
||||||
if (OF_hasprop(node, "snps,fixed-burst") == 1)
|
if (OF_hasprop(node, "snps,fixed-burst") == 1)
|
||||||
@ -1569,6 +1571,7 @@ dwc_attach(device_t dev)
|
|||||||
reg |= (rxpbl << BUS_MODE_RPBL_SHIFT);
|
reg |= (rxpbl << BUS_MODE_RPBL_SHIFT);
|
||||||
if (fixed_burst)
|
if (fixed_burst)
|
||||||
reg |= BUS_MODE_FIXEDBURST;
|
reg |= BUS_MODE_FIXEDBURST;
|
||||||
|
|
||||||
WRITE4(sc, BUS_MODE, reg);
|
WRITE4(sc, BUS_MODE, reg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -229,8 +229,8 @@
|
|||||||
#define BUS_MODE_PRIORXTX_21 1
|
#define BUS_MODE_PRIORXTX_21 1
|
||||||
#define BUS_MODE_PRIORXTX_11 0
|
#define BUS_MODE_PRIORXTX_11 0
|
||||||
#define BUS_MODE_PBL_SHIFT 8 /* Single block transfer size */
|
#define BUS_MODE_PBL_SHIFT 8 /* Single block transfer size */
|
||||||
#define BUS_MODE_PBL_BEATS_8 8
|
|
||||||
#define BUS_MODE_SWR (1 << 0) /* Reset */
|
#define BUS_MODE_SWR (1 << 0) /* Reset */
|
||||||
|
#define BUS_MODE_DEFAULT_PBL 8
|
||||||
#define TRANSMIT_POLL_DEMAND 0x1004
|
#define TRANSMIT_POLL_DEMAND 0x1004
|
||||||
#define RECEIVE_POLL_DEMAND 0x1008
|
#define RECEIVE_POLL_DEMAND 0x1008
|
||||||
#define RX_DESCR_LIST_ADDR 0x100C
|
#define RX_DESCR_LIST_ADDR 0x100C
|
||||||
|
Loading…
Reference in New Issue
Block a user