xref: /rk3399_rockchip-uboot/board/freescale/mpc8568mds/bcsr.c (revision acbca876fb3fec25cd9c55b0efc81ff618ff5262)
1*acbca876SKumar Gala /*
2*acbca876SKumar Gala  * Copyright 2007 Freescale Semiconductor.
3*acbca876SKumar Gala  *
4*acbca876SKumar Gala  * See file CREDITS for list of people who contributed to this
5*acbca876SKumar Gala  * project.
6*acbca876SKumar Gala  *
7*acbca876SKumar Gala  * This program is free software; you can redistribute it and/or
8*acbca876SKumar Gala  * modify it under the terms of the GNU General Public License as
9*acbca876SKumar Gala  * published by the Free Software Foundation; either version 2 of
10*acbca876SKumar Gala  * the License, or (at your option) any later version.
11*acbca876SKumar Gala  *
12*acbca876SKumar Gala  * This program is distributed in the hope that it will be useful,
13*acbca876SKumar Gala  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14*acbca876SKumar Gala  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
15*acbca876SKumar Gala  * GNU General Public License for more details.
16*acbca876SKumar Gala  *
17*acbca876SKumar Gala  * You should have received a copy of the GNU General Public License
18*acbca876SKumar Gala  * along with this program; if not, write to the Free Software
19*acbca876SKumar Gala  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20*acbca876SKumar Gala  * MA 02111-1307 USA
21*acbca876SKumar Gala  */
22*acbca876SKumar Gala 
23*acbca876SKumar Gala #include <common.h>
24*acbca876SKumar Gala #include "bcsr.h"
25*acbca876SKumar Gala 
26*acbca876SKumar Gala void enable_8568mds_duart()
27*acbca876SKumar Gala {
28*acbca876SKumar Gala 	volatile uint* duart_mux	= (uint *)(CFG_CCSRBAR + 0xe0060);
29*acbca876SKumar Gala 	volatile uint* devices		= (uint *)(CFG_CCSRBAR + 0xe0070);
30*acbca876SKumar Gala 	volatile u8 *bcsr		= (u8 *)(CFG_BCSR);
31*acbca876SKumar Gala 
32*acbca876SKumar Gala 	*duart_mux = 0x80000000;	/* Set the mux to Duart on PMUXCR */
33*acbca876SKumar Gala 	*devices  = 0;			/* Enable all peripheral devices */
34*acbca876SKumar Gala 	bcsr[5] |= 0x01;		/* Enable Duart in BCSR*/
35*acbca876SKumar Gala }
36*acbca876SKumar Gala 
37*acbca876SKumar Gala void enable_8568mds_flash_write()
38*acbca876SKumar Gala {
39*acbca876SKumar Gala 	volatile u8 *bcsr = (u8 *)(CFG_BCSR);
40*acbca876SKumar Gala 
41*acbca876SKumar Gala 	bcsr[9] |= 0x01;
42*acbca876SKumar Gala }
43*acbca876SKumar Gala 
44*acbca876SKumar Gala void disable_8568mds_flash_write()
45*acbca876SKumar Gala {
46*acbca876SKumar Gala 	volatile u8 *bcsr = (u8 *)(CFG_BCSR);
47*acbca876SKumar Gala 
48*acbca876SKumar Gala 	bcsr[9] &= ~(0x01);
49*acbca876SKumar Gala }
50*acbca876SKumar Gala 
51*acbca876SKumar Gala void enable_8568mds_qe_mdio()
52*acbca876SKumar Gala {
53*acbca876SKumar Gala 	u8 *bcsr = (u8 *)(CFG_BCSR);
54*acbca876SKumar Gala 
55*acbca876SKumar Gala 	bcsr[7] |= 0x01;
56*acbca876SKumar Gala }
57