Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 2 | /* |
Kumar Gala | 4c2e3da | 2009-07-28 21:49:52 -0500 | [diff] [blame] | 3 | * Copyright (C) 2009 Freescale Semiconductor, Inc. |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <asm/io.h> |
| 8 | |
| 9 | #include "bcsr.h" |
| 10 | |
Kim Phillips | e56143e | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 11 | void enable_8569mds_flash_write(void) |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 12 | { |
Dave Liu | 16e7559 | 2009-05-15 10:27:44 +0800 | [diff] [blame] | 13 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP); |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 14 | } |
| 15 | |
Kim Phillips | e56143e | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 16 | void disable_8569mds_flash_write(void) |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 17 | { |
| 18 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP); |
| 19 | } |
| 20 | |
Kim Phillips | e56143e | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 21 | void enable_8569mds_qe_uec(void) |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 22 | { |
Haiying Wang | f82107f | 2009-05-20 12:30:37 -0400 | [diff] [blame] | 23 | #if defined(CONFIG_SYS_UCC_RGMII_MODE) |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 24 | 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 Wang | 750098d | 2009-05-20 12:30:36 -0400 | [diff] [blame] | 28 | 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 Wang | f82107f | 2009-05-20 12:30:37 -0400 | [diff] [blame] | 32 | #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 Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 44 | } |
| 45 | |
Kim Phillips | e56143e | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 46 | void disable_8569mds_brd_eeprom_write_protect(void) |
Haiying Wang | 765547d | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 47 | { |
| 48 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), BCSR7_BRD_WRT_PROTECT); |
| 49 | } |