Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 1 | /* |
Kumar Gala | 6a6d948 | 2009-07-28 21:49:52 -0500 | [diff] [blame] | 2 | * Copyright (C) 2009 Freescale Semiconductor, Inc. |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 3 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/io.h> |
| 9 | |
| 10 | #include "bcsr.h" |
| 11 | |
Kim Phillips | 402673f | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 12 | void enable_8569mds_flash_write(void) |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 13 | { |
Dave Liu | 82d713c | 2009-05-15 10:27:44 +0800 | [diff] [blame] | 14 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP); |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 15 | } |
| 16 | |
Kim Phillips | 402673f | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 17 | void disable_8569mds_flash_write(void) |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 18 | { |
| 19 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP); |
| 20 | } |
| 21 | |
Kim Phillips | 402673f | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 22 | void enable_8569mds_qe_uec(void) |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 23 | { |
Haiying Wang | bc759ee | 2009-05-20 12:30:37 -0400 | [diff] [blame] | 24 | #if defined(CONFIG_SYS_UCC_RGMII_MODE) |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 25 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), |
| 26 | BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN); |
| 27 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8), |
| 28 | BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN); |
Haiying Wang | df1bbbd | 2009-05-20 12:30:36 -0400 | [diff] [blame] | 29 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9), |
| 30 | BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN); |
| 31 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10), |
| 32 | BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN); |
Haiying Wang | bc759ee | 2009-05-20 12:30:37 -0400 | [diff] [blame] | 33 | #elif defined(CONFIG_SYS_UCC_RMII_MODE) |
| 34 | /* Set UCC1-4 working at RMII mode */ |
| 35 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), |
| 36 | BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN); |
| 37 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8), |
| 38 | BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN); |
| 39 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9), |
| 40 | BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN); |
| 41 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10), |
| 42 | BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN); |
| 43 | setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9), BCSR9_UCC3_RMII_EN); |
| 44 | #endif |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 45 | } |
| 46 | |
Kim Phillips | 402673f | 2012-10-29 13:34:38 +0000 | [diff] [blame] | 47 | void disable_8569mds_brd_eeprom_write_protect(void) |
Haiying Wang | bd25537 | 2009-03-27 17:02:45 -0400 | [diff] [blame] | 48 | { |
| 49 | clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), BCSR7_BRD_WRT_PROTECT); |
| 50 | } |