powerpc/85xx: Add P5040 processor support
[oweals/u-boot.git] / arch / powerpc / cpu / mpc85xx / fsl_corenet_serdes.h
1 /*
2  * Copyright 2009-2010 Freescale Semiconductor, Inc.
3  *
4  * Author: Roy Zang <tie-fei.zang@freescale.com>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307 USA
20  */
21
22 #ifndef __FSL_CORENET_SERDES_H
23 #define __FSL_CORENET_SERDES_H
24
25 /*
26  * Note: For P5040, the fourth SerDes bank is on SerDes2, but U-boot currently
27  * only supports one SerDes controller.  For now, pretend that we have three
28  * banks and 18 lanes on the P5040.
29  */
30 #define SRDS_MAX_LANES          18
31 #define SRDS_MAX_BANK           3
32
33 enum srds_bank {
34         FSL_SRDS_BANK_1  = 0,
35         FSL_SRDS_BANK_2  = 1,
36         FSL_SRDS_BANK_3  = 2,
37 };
38
39 int is_serdes_prtcl_valid(u32 prtcl);
40 int serdes_get_lane_idx(int lane);
41 int serdes_get_bank_by_lane(int lane);
42 int serdes_lane_enabled(int lane);
43 enum srds_prtcl serdes_get_prtcl(int cfg, int lane);
44
45 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
46 extern uint16_t srds_lpd_b[SRDS_MAX_BANK];
47 #endif
48
49 #endif /* __FSL_CORENET_SERDES_H */