2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2006-11-03 18:11:15 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Freescale Semiconductor, Inc.
|
|
|
|
*
|
|
|
|
* Dave Liu <daveliu@freescale.com>
|
|
|
|
* based on source code of Shlomi Gridish
|
|
|
|
*/
|
|
|
|
|
2016-09-21 02:28:53 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <malloc.h>
|
2016-09-21 02:28:55 +00:00
|
|
|
#include <linux/errno.h>
|
2016-09-21 02:28:53 +00:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <linux/immap_qe.h>
|
2006-11-03 18:11:15 +00:00
|
|
|
#include "uccf.h"
|
2016-02-18 05:01:59 +00:00
|
|
|
#include <fsl_qe.h>
|
2006-11-03 18:11:15 +00:00
|
|
|
|
2020-02-06 08:48:16 +00:00
|
|
|
#if !defined(CONFIG_DM_ETH)
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
void ucc_fast_transmit_on_demand(struct ucc_fast_priv *uccf)
|
2006-11-03 18:11:15 +00:00
|
|
|
{
|
|
|
|
out_be16(&uccf->uf_regs->utodr, UCC_FAST_TOD);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 ucc_fast_get_qe_cr_subblock(int ucc_num)
|
|
|
|
{
|
|
|
|
switch (ucc_num) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
case 0:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST1;
|
|
|
|
case 1:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST2;
|
|
|
|
case 2:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST3;
|
|
|
|
case 3:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST4;
|
|
|
|
case 4:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST5;
|
|
|
|
case 5:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST6;
|
|
|
|
case 6:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST7;
|
|
|
|
case 7:
|
|
|
|
return QE_CR_SUBBLOCK_UCCFAST8;
|
|
|
|
default:
|
|
|
|
return QE_CR_SUBBLOCK_INVALID;
|
2006-11-30 17:02:20 +00:00
|
|
|
}
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
static void ucc_get_cmxucr_reg(int ucc_num, u32 **p_cmxucr,
|
|
|
|
u8 *reg_num, u8 *shift)
|
2006-11-03 18:11:15 +00:00
|
|
|
{
|
|
|
|
switch (ucc_num) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
case 0: /* UCC1 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr1;
|
|
|
|
*reg_num = 1;
|
|
|
|
*shift = 16;
|
|
|
|
break;
|
|
|
|
case 2: /* UCC3 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr1;
|
|
|
|
*reg_num = 1;
|
|
|
|
*shift = 0;
|
|
|
|
break;
|
|
|
|
case 4: /* UCC5 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr2;
|
|
|
|
*reg_num = 2;
|
|
|
|
*shift = 16;
|
|
|
|
break;
|
|
|
|
case 6: /* UCC7 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr2;
|
|
|
|
*reg_num = 2;
|
|
|
|
*shift = 0;
|
|
|
|
break;
|
|
|
|
case 1: /* UCC2 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr3;
|
|
|
|
*reg_num = 3;
|
|
|
|
*shift = 16;
|
|
|
|
break;
|
|
|
|
case 3: /* UCC4 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr3;
|
|
|
|
*reg_num = 3;
|
|
|
|
*shift = 0;
|
|
|
|
break;
|
|
|
|
case 5: /* UCC6 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr4;
|
|
|
|
*reg_num = 4;
|
|
|
|
*shift = 16;
|
|
|
|
break;
|
|
|
|
case 7: /* UCC8 */
|
|
|
|
*p_cmxucr = &qe_immr->qmx.cmxucr4;
|
|
|
|
*reg_num = 4;
|
|
|
|
*shift = 0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ucc_set_clk_src(int ucc_num, qe_clock_e clock, comm_dir_e mode)
|
|
|
|
{
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
u32 *p_cmxucr = NULL;
|
|
|
|
u8 reg_num = 0;
|
|
|
|
u8 shift = 0;
|
|
|
|
u32 clk_bits;
|
|
|
|
u32 clk_mask;
|
|
|
|
int source = -1;
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* check if the UCC number is in range. */
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
if ((ucc_num > UCC_MAX_NUM - 1) || ucc_num < 0)
|
2006-11-03 18:11:15 +00:00
|
|
|
return -EINVAL;
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
if (!(mode == COMM_DIR_RX || mode == COMM_DIR_TX)) {
|
|
|
|
printf("%s: bad comm mode type passed\n", __func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ucc_get_cmxucr_reg(ucc_num, &p_cmxucr, ®_num, &shift);
|
|
|
|
|
|
|
|
switch (reg_num) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
case 1:
|
|
|
|
switch (clock) {
|
|
|
|
case QE_BRG1:
|
|
|
|
source = 1;
|
|
|
|
break;
|
|
|
|
case QE_BRG2:
|
|
|
|
source = 2;
|
|
|
|
break;
|
|
|
|
case QE_BRG7:
|
|
|
|
source = 3;
|
|
|
|
break;
|
|
|
|
case QE_BRG8:
|
|
|
|
source = 4;
|
|
|
|
break;
|
|
|
|
case QE_CLK9:
|
|
|
|
source = 5;
|
|
|
|
break;
|
|
|
|
case QE_CLK10:
|
|
|
|
source = 6;
|
|
|
|
break;
|
|
|
|
case QE_CLK11:
|
|
|
|
source = 7;
|
|
|
|
break;
|
|
|
|
case QE_CLK12:
|
|
|
|
source = 8;
|
|
|
|
break;
|
|
|
|
case QE_CLK15:
|
|
|
|
source = 9;
|
|
|
|
break;
|
|
|
|
case QE_CLK16:
|
|
|
|
source = 10;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
source = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
switch (clock) {
|
|
|
|
case QE_BRG5:
|
|
|
|
source = 1;
|
|
|
|
break;
|
|
|
|
case QE_BRG6:
|
|
|
|
source = 2;
|
|
|
|
break;
|
|
|
|
case QE_BRG7:
|
|
|
|
source = 3;
|
|
|
|
break;
|
|
|
|
case QE_BRG8:
|
|
|
|
source = 4;
|
|
|
|
break;
|
|
|
|
case QE_CLK13:
|
|
|
|
source = 5;
|
|
|
|
break;
|
|
|
|
case QE_CLK14:
|
|
|
|
source = 6;
|
|
|
|
break;
|
|
|
|
case QE_CLK19:
|
|
|
|
source = 7;
|
|
|
|
break;
|
|
|
|
case QE_CLK20:
|
|
|
|
source = 8;
|
|
|
|
break;
|
|
|
|
case QE_CLK15:
|
|
|
|
source = 9;
|
|
|
|
break;
|
|
|
|
case QE_CLK16:
|
|
|
|
source = 10;
|
2006-11-03 18:11:15 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
source = -1;
|
|
|
|
break;
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
switch (clock) {
|
|
|
|
case QE_BRG9:
|
|
|
|
source = 1;
|
|
|
|
break;
|
|
|
|
case QE_BRG10:
|
|
|
|
source = 2;
|
|
|
|
break;
|
|
|
|
case QE_BRG15:
|
|
|
|
source = 3;
|
|
|
|
break;
|
|
|
|
case QE_BRG16:
|
|
|
|
source = 4;
|
|
|
|
break;
|
|
|
|
case QE_CLK3:
|
|
|
|
source = 5;
|
|
|
|
break;
|
|
|
|
case QE_CLK4:
|
|
|
|
source = 6;
|
|
|
|
break;
|
|
|
|
case QE_CLK17:
|
|
|
|
source = 7;
|
|
|
|
break;
|
|
|
|
case QE_CLK18:
|
|
|
|
source = 8;
|
|
|
|
break;
|
|
|
|
case QE_CLK7:
|
|
|
|
source = 9;
|
|
|
|
break;
|
|
|
|
case QE_CLK8:
|
|
|
|
source = 10;
|
|
|
|
break;
|
|
|
|
case QE_CLK16:
|
|
|
|
source = 11;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
source = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
switch (clock) {
|
|
|
|
case QE_BRG13:
|
|
|
|
source = 1;
|
|
|
|
break;
|
|
|
|
case QE_BRG14:
|
|
|
|
source = 2;
|
|
|
|
break;
|
|
|
|
case QE_BRG15:
|
|
|
|
source = 3;
|
|
|
|
break;
|
|
|
|
case QE_BRG16:
|
|
|
|
source = 4;
|
|
|
|
break;
|
|
|
|
case QE_CLK5:
|
|
|
|
source = 5;
|
|
|
|
break;
|
|
|
|
case QE_CLK6:
|
|
|
|
source = 6;
|
|
|
|
break;
|
|
|
|
case QE_CLK21:
|
|
|
|
source = 7;
|
|
|
|
break;
|
|
|
|
case QE_CLK22:
|
|
|
|
source = 8;
|
|
|
|
break;
|
|
|
|
case QE_CLK7:
|
|
|
|
source = 9;
|
|
|
|
break;
|
|
|
|
case QE_CLK8:
|
|
|
|
source = 10;
|
|
|
|
break;
|
|
|
|
case QE_CLK16:
|
|
|
|
source = 11;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
source = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
source = -1;
|
|
|
|
break;
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (source == -1) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
printf("%s: Bad combination of clock and UCC\n", __func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -ENOENT;
|
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
clk_bits = (u32)source;
|
|
|
|
clk_mask = QE_CMXUCR_TX_CLK_SRC_MASK;
|
2006-11-03 18:11:15 +00:00
|
|
|
if (mode == COMM_DIR_RX) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
clk_bits <<= 4; /* Rx field is 4 bits to left of Tx field */
|
|
|
|
clk_mask <<= 4; /* Rx field is 4 bits to left of Tx field */
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
clk_bits <<= shift;
|
|
|
|
clk_mask <<= shift;
|
2006-11-03 18:11:15 +00:00
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
out_be32(p_cmxucr, (in_be32(p_cmxucr) & ~clk_mask) | clk_bits);
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint ucc_get_reg_baseaddr(int ucc_num)
|
|
|
|
{
|
|
|
|
uint base = 0;
|
|
|
|
|
|
|
|
/* check if the UCC number is in range */
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
if ((ucc_num > UCC_MAX_NUM - 1) || ucc_num < 0) {
|
|
|
|
printf("%s: the UCC num not in ranges\n", __func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (ucc_num) {
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
case 0:
|
|
|
|
base = 0x00002000;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
base = 0x00003000;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
base = 0x00002200;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
base = 0x00003200;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
base = 0x00002400;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
base = 0x00003400;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
base = 0x00002600;
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
base = 0x00003600;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
base = (uint)qe_immr + base;
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
void ucc_fast_enable(struct ucc_fast_priv *uccf, comm_dir_e mode)
|
2006-11-03 18:11:15 +00:00
|
|
|
{
|
|
|
|
ucc_fast_t *uf_regs;
|
|
|
|
u32 gumr;
|
|
|
|
|
|
|
|
uf_regs = uccf->uf_regs;
|
|
|
|
|
|
|
|
/* Enable reception and/or transmission on this UCC. */
|
|
|
|
gumr = in_be32(&uf_regs->gumr);
|
|
|
|
if (mode & COMM_DIR_TX) {
|
|
|
|
gumr |= UCC_FAST_GUMR_ENT;
|
|
|
|
uccf->enabled_tx = 1;
|
|
|
|
}
|
|
|
|
if (mode & COMM_DIR_RX) {
|
|
|
|
gumr |= UCC_FAST_GUMR_ENR;
|
|
|
|
uccf->enabled_rx = 1;
|
|
|
|
}
|
|
|
|
out_be32(&uf_regs->gumr, gumr);
|
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
void ucc_fast_disable(struct ucc_fast_priv *uccf, comm_dir_e mode)
|
2006-11-03 18:11:15 +00:00
|
|
|
{
|
|
|
|
ucc_fast_t *uf_regs;
|
|
|
|
u32 gumr;
|
|
|
|
|
|
|
|
uf_regs = uccf->uf_regs;
|
|
|
|
|
|
|
|
/* Disable reception and/or transmission on this UCC. */
|
|
|
|
gumr = in_be32(&uf_regs->gumr);
|
|
|
|
if (mode & COMM_DIR_TX) {
|
|
|
|
gumr &= ~UCC_FAST_GUMR_ENT;
|
|
|
|
uccf->enabled_tx = 0;
|
|
|
|
}
|
|
|
|
if (mode & COMM_DIR_RX) {
|
|
|
|
gumr &= ~UCC_FAST_GUMR_ENR;
|
|
|
|
uccf->enabled_rx = 0;
|
|
|
|
}
|
|
|
|
out_be32(&uf_regs->gumr, gumr);
|
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
int ucc_fast_init(struct ucc_fast_inf *uf_info,
|
|
|
|
struct ucc_fast_priv **uccf_ret)
|
2006-11-03 18:11:15 +00:00
|
|
|
{
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
struct ucc_fast_priv *uccf;
|
2006-11-03 18:11:15 +00:00
|
|
|
ucc_fast_t *uf_regs;
|
|
|
|
|
|
|
|
if (!uf_info)
|
|
|
|
return -EINVAL;
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
if (uf_info->ucc_num < 0 || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
|
|
|
|
printf("%s: Illagal UCC number!\n", __func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
uccf = (struct ucc_fast_priv *)malloc(sizeof(struct ucc_fast_priv));
|
2006-11-03 18:11:15 +00:00
|
|
|
if (!uccf) {
|
|
|
|
printf("%s: No memory for UCC fast data structure!\n",
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
__func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
memset(uccf, 0, sizeof(struct ucc_fast_priv));
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* Save fast UCC structure */
|
|
|
|
uccf->uf_info = uf_info;
|
|
|
|
uccf->uf_regs = (ucc_fast_t *)ucc_get_reg_baseaddr(uf_info->ucc_num);
|
|
|
|
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
if (!uccf->uf_regs) {
|
2006-11-03 18:11:15 +00:00
|
|
|
printf("%s: No memory map for UCC fast controller!\n",
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
__func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
uccf->enabled_tx = 0;
|
|
|
|
uccf->enabled_rx = 0;
|
|
|
|
|
|
|
|
uf_regs = uccf->uf_regs;
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
uccf->p_ucce = (u32 *)&uf_regs->ucce;
|
|
|
|
uccf->p_uccm = (u32 *)&uf_regs->uccm;
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* Init GUEMR register, UCC both Rx and Tx is Fast protocol */
|
|
|
|
out_8(&uf_regs->guemr, UCC_GUEMR_SET_RESERVED3 | UCC_GUEMR_MODE_FAST_RX
|
|
|
|
| UCC_GUEMR_MODE_FAST_TX);
|
|
|
|
|
|
|
|
/* Set GUMR, disable UCC both Rx and Tx, Ethernet protocol */
|
|
|
|
out_be32(&uf_regs->gumr, UCC_FAST_GUMR_ETH);
|
|
|
|
|
|
|
|
/* Set the Giga ethernet VFIFO stuff */
|
|
|
|
if (uf_info->eth_type == GIGA_ETH) {
|
|
|
|
/* Allocate memory for Tx Virtual Fifo */
|
|
|
|
uccf->ucc_fast_tx_virtual_fifo_base_offset =
|
|
|
|
qe_muram_alloc(UCC_GETH_UTFS_GIGA_INIT,
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* Allocate memory for Rx Virtual Fifo */
|
|
|
|
uccf->ucc_fast_rx_virtual_fifo_base_offset =
|
|
|
|
qe_muram_alloc(UCC_GETH_URFS_GIGA_INIT +
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
UCC_FAST_RX_VIRTUAL_FIFO_SIZE_PAD,
|
|
|
|
UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* utfb, urfb are offsets from MURAM base */
|
|
|
|
out_be32(&uf_regs->utfb,
|
|
|
|
uccf->ucc_fast_tx_virtual_fifo_base_offset);
|
|
|
|
out_be32(&uf_regs->urfb,
|
|
|
|
uccf->ucc_fast_rx_virtual_fifo_base_offset);
|
|
|
|
|
|
|
|
/* Set Virtual Fifo registers */
|
|
|
|
out_be16(&uf_regs->urfs, UCC_GETH_URFS_GIGA_INIT);
|
|
|
|
out_be16(&uf_regs->urfet, UCC_GETH_URFET_GIGA_INIT);
|
|
|
|
out_be16(&uf_regs->urfset, UCC_GETH_URFSET_GIGA_INIT);
|
|
|
|
out_be16(&uf_regs->utfs, UCC_GETH_UTFS_GIGA_INIT);
|
|
|
|
out_be16(&uf_regs->utfet, UCC_GETH_UTFET_GIGA_INIT);
|
|
|
|
out_be16(&uf_regs->utftt, UCC_GETH_UTFTT_GIGA_INIT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the Fast ethernet VFIFO stuff */
|
|
|
|
if (uf_info->eth_type == FAST_ETH) {
|
|
|
|
/* Allocate memory for Tx Virtual Fifo */
|
|
|
|
uccf->ucc_fast_tx_virtual_fifo_base_offset =
|
|
|
|
qe_muram_alloc(UCC_GETH_UTFS_INIT,
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
|
2006-11-03 18:11:15 +00:00
|
|
|
|
|
|
|
/* Allocate memory for Rx Virtual Fifo */
|
|
|
|
uccf->ucc_fast_rx_virtual_fifo_base_offset =
|
|
|
|
qe_muram_alloc(UCC_GETH_URFS_INIT +
|
|
|
|
UCC_FAST_RX_VIRTUAL_FIFO_SIZE_PAD,
|
|
|
|
UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
|
|
|
|
|
|
|
|
/* utfb, urfb are offsets from MURAM base */
|
|
|
|
out_be32(&uf_regs->utfb,
|
|
|
|
uccf->ucc_fast_tx_virtual_fifo_base_offset);
|
|
|
|
out_be32(&uf_regs->urfb,
|
|
|
|
uccf->ucc_fast_rx_virtual_fifo_base_offset);
|
|
|
|
|
|
|
|
/* Set Virtual Fifo registers */
|
|
|
|
out_be16(&uf_regs->urfs, UCC_GETH_URFS_INIT);
|
|
|
|
out_be16(&uf_regs->urfet, UCC_GETH_URFET_INIT);
|
|
|
|
out_be16(&uf_regs->urfset, UCC_GETH_URFSET_INIT);
|
|
|
|
out_be16(&uf_regs->utfs, UCC_GETH_UTFS_INIT);
|
|
|
|
out_be16(&uf_regs->utfet, UCC_GETH_UTFET_INIT);
|
2008-05-20 14:00:29 +00:00
|
|
|
out_be16(&uf_regs->utftt, UCC_GETH_UTFTT_INIT);
|
2006-11-03 18:11:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Rx clock routing */
|
|
|
|
if (uf_info->rx_clock != QE_CLK_NONE) {
|
|
|
|
if (ucc_set_clk_src(uf_info->ucc_num,
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
uf_info->rx_clock, COMM_DIR_RX)) {
|
2006-11-03 18:11:15 +00:00
|
|
|
printf("%s: Illegal value for parameter 'RxClock'.\n",
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
__func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Tx clock routing */
|
|
|
|
if (uf_info->tx_clock != QE_CLK_NONE) {
|
|
|
|
if (ucc_set_clk_src(uf_info->ucc_num,
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
uf_info->tx_clock, COMM_DIR_TX)) {
|
2006-11-03 18:11:15 +00:00
|
|
|
printf("%s: Illegal value for parameter 'TxClock'.\n",
|
powerpc, qe: fix codingstyle issues for drivers/qe
fix Codingstyle for files in drivers/qe, remaining following
check warnings:
$ ./scripts/checkpatch.pl -f drivers/qe/uec.h
CHECK: Macro argument reuse '_bd' - possible side-effects?
+#define BD_ADVANCE(_bd, _status, _base) \
+ (((_status) & BD_WRAP) ? (_bd) = \
+ ((struct buffer_descriptor *)(_base)) : ++(_bd))
total: 0 errors, 0 warnings, 1 checks, 692 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.h
total: 0 errors, 0 warnings, 0 checks, 214 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uccf.c
total: 0 errors, 0 warnings, 0 checks, 507 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec.c
total: 0 errors, 0 warnings, 0 checks, 1434 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/uec_phy.c
total: 0 errors, 0 warnings, 0 checks, 927 lines checked
$ ./scripts/checkpatch.pl -f drivers/qe/qe.c
CHECK: Lines should not end with a '('
+U_BOOT_CMD(
total: 0 errors, 0 warnings, 1 checks, 830 lines checked
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-05-25 05:27:26 +00:00
|
|
|
__func__);
|
2006-11-03 18:11:15 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear interrupt mask register to disable all of interrupts */
|
|
|
|
out_be32(&uf_regs->uccm, 0x0);
|
|
|
|
|
|
|
|
/* Writing '1' to clear all of envents */
|
|
|
|
out_be32(&uf_regs->ucce, 0xffffffff);
|
|
|
|
|
|
|
|
*uccf_ret = uccf;
|
|
|
|
return 0;
|
|
|
|
}
|
2020-02-06 08:48:16 +00:00
|
|
|
#endif
|