blob: 57cea0af689f4a0a6cde78cc26e005723ca6f2bd [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Haiying Wang765547d2009-03-27 17:02:45 -04002/*
Kumar Gala4c2e3da2009-07-28 21:49:52 -05003 * Copyright (C) 2009 Freescale Semiconductor, Inc.
Haiying Wang765547d2009-03-27 17:02:45 -04004 */
5
6#include <common.h>
7#include <asm/io.h>
8
9#include "bcsr.h"
10
Kim Phillipse56143e2012-10-29 13:34:38 +000011void enable_8569mds_flash_write(void)
Haiying Wang765547d2009-03-27 17:02:45 -040012{
Dave Liu16e75592009-05-15 10:27:44 +080013 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP);
Haiying Wang765547d2009-03-27 17:02:45 -040014}
15
Kim Phillipse56143e2012-10-29 13:34:38 +000016void disable_8569mds_flash_write(void)
Haiying Wang765547d2009-03-27 17:02:45 -040017{
18 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP);
19}
20
Kim Phillipse56143e2012-10-29 13:34:38 +000021void enable_8569mds_qe_uec(void)
Haiying Wang765547d2009-03-27 17:02:45 -040022{
Haiying Wangf82107f2009-05-20 12:30:37 -040023#if defined(CONFIG_SYS_UCC_RGMII_MODE)
Haiying Wang765547d2009-03-27 17:02:45 -040024 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7),
25 BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN);
26 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8),
27 BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN);
Haiying Wang750098d2009-05-20 12:30:36 -040028 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9),
29 BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN);
30 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10),
31 BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN);
Haiying Wangf82107f2009-05-20 12:30:37 -040032#elif defined(CONFIG_SYS_UCC_RMII_MODE)
33 /* Set UCC1-4 working at RMII mode */
34 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7),
35 BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN);
36 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8),
37 BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN);
38 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9),
39 BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN);
40 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10),
41 BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN);
42 setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9), BCSR9_UCC3_RMII_EN);
43#endif
Haiying Wang765547d2009-03-27 17:02:45 -040044}
45
Kim Phillipse56143e2012-10-29 13:34:38 +000046void disable_8569mds_brd_eeprom_write_protect(void)
Haiying Wang765547d2009-03-27 17:02:45 -040047{
48 clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), BCSR7_BRD_WRT_PROTECT);
49}