diff options
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index fd6140bd9aae..e2f2e91cfdd2 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -273,7 +273,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth, | |||
273 | u8 num_entries, | 273 | u8 num_entries, |
274 | u32 thread_size, | 274 | u32 thread_size, |
275 | u32 thread_alignment, | 275 | u32 thread_alignment, |
276 | enum qe_risc_allocation risc, | 276 | unsigned int risc, |
277 | int skip_page_for_first_entry) | 277 | int skip_page_for_first_entry) |
278 | { | 278 | { |
279 | u32 init_enet_offset; | 279 | u32 init_enet_offset; |
@@ -310,7 +310,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth, | |||
310 | static int return_init_enet_entries(struct ucc_geth_private *ugeth, | 310 | static int return_init_enet_entries(struct ucc_geth_private *ugeth, |
311 | u32 *p_start, | 311 | u32 *p_start, |
312 | u8 num_entries, | 312 | u8 num_entries, |
313 | enum qe_risc_allocation risc, | 313 | unsigned int risc, |
314 | int skip_page_for_first_entry) | 314 | int skip_page_for_first_entry) |
315 | { | 315 | { |
316 | u32 init_enet_offset; | 316 | u32 init_enet_offset; |
@@ -345,7 +345,7 @@ static int dump_init_enet_entries(struct ucc_geth_private *ugeth, | |||
345 | u32 __iomem *p_start, | 345 | u32 __iomem *p_start, |
346 | u8 num_entries, | 346 | u8 num_entries, |
347 | u32 thread_size, | 347 | u32 thread_size, |
348 | enum qe_risc_allocation risc, | 348 | unsigned int risc, |
349 | int skip_page_for_first_entry) | 349 | int skip_page_for_first_entry) |
350 | { | 350 | { |
351 | u32 init_enet_offset; | 351 | u32 init_enet_offset; |
@@ -2180,6 +2180,14 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) | |||
2180 | return -ENOMEM; | 2180 | return -ENOMEM; |
2181 | } | 2181 | } |
2182 | 2182 | ||
2183 | /* read the number of risc engines, update the riscTx and riscRx | ||
2184 | * if there are 4 riscs in QE | ||
2185 | */ | ||
2186 | if (qe_get_num_of_risc() == 4) { | ||
2187 | ug_info->riscTx = QE_RISC_ALLOCATION_FOUR_RISCS; | ||
2188 | ug_info->riscRx = QE_RISC_ALLOCATION_FOUR_RISCS; | ||
2189 | } | ||
2190 | |||
2183 | ugeth->ug_regs = ioremap(uf_info->regs, sizeof(*ugeth->ug_regs)); | 2191 | ugeth->ug_regs = ioremap(uf_info->regs, sizeof(*ugeth->ug_regs)); |
2184 | if (!ugeth->ug_regs) { | 2192 | if (!ugeth->ug_regs) { |
2185 | if (netif_msg_probe(ugeth)) | 2193 | if (netif_msg_probe(ugeth)) |
@@ -3744,7 +3752,15 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3744 | ug_info->uf_info.utfet = UCC_GETH_UTFET_GIGA_INIT; | 3752 | ug_info->uf_info.utfet = UCC_GETH_UTFET_GIGA_INIT; |
3745 | ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT; | 3753 | ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT; |
3746 | ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4; | 3754 | ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4; |
3747 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; | 3755 | |
3756 | /* If QE's snum number is 46 which means we need to support | ||
3757 | * 4 UECs at 1000Base-T simultaneously, we need to allocate | ||
3758 | * more Threads to Rx. | ||
3759 | */ | ||
3760 | if (qe_get_num_of_snums() == 46) | ||
3761 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_6; | ||
3762 | else | ||
3763 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; | ||
3748 | } | 3764 | } |
3749 | 3765 | ||
3750 | if (netif_msg_probe(&debug)) | 3766 | if (netif_msg_probe(&debug)) |