2 * Copyright 2011 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 #include <asm/fsl_law.h>
23 #include <asm/fsl_serdes.h>
25 #if defined(CONFIG_FSL_CORENET)
26 #define _DEVDISR_SRIO1 FSL_CORENET_DEVDISR_SRIO1
27 #define _DEVDISR_SRIO2 FSL_CORENET_DEVDISR_SRIO2
28 #define _DEVDISR_RMU FSL_CORENET_DEVDISR_RMU
29 #define CONFIG_SYS_MPC8xxx_GUTS_ADDR CONFIG_SYS_MPC85xx_GUTS_ADDR
30 #elif defined(CONFIG_MPC85xx)
31 #define _DEVDISR_SRIO1 MPC85xx_DEVDISR_SRIO
32 #define _DEVDISR_SRIO2 MPC85xx_DEVDISR_SRIO
33 #define _DEVDISR_RMU MPC85xx_DEVDISR_RMSG
34 #define CONFIG_SYS_MPC8xxx_GUTS_ADDR CONFIG_SYS_MPC85xx_GUTS_ADDR
35 #elif defined(CONFIG_MPC86xx)
36 #define _DEVDISR_SRIO1 MPC86xx_DEVDISR_SRIO
37 #define _DEVDISR_SRIO2 MPC86xx_DEVDISR_SRIO
38 #define _DEVDISR_RMU MPC86xx_DEVDISR_RMSG
39 #define CONFIG_SYS_MPC8xxx_GUTS_ADDR \
40 (&((immap_t *)CONFIG_SYS_IMMR)->im_gur)
42 #error "No defines for DEVDISR_SRIO"
47 ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC8xxx_GUTS_ADDR;
48 int srio1_used = 0, srio2_used = 0;
50 if (is_serdes_configured(SRIO1)) {
51 set_next_law(CONFIG_SYS_SRIO1_MEM_PHYS,
52 law_size_bits(CONFIG_SYS_SRIO1_MEM_SIZE),
55 printf("SRIO1: enabled\n");
57 printf("SRIO1: disabled\n");
61 if (is_serdes_configured(SRIO2)) {
62 set_next_law(CONFIG_SYS_SRIO2_MEM_PHYS,
63 law_size_bits(CONFIG_SYS_SRIO2_MEM_SIZE),
66 printf("SRIO2: enabled\n");
68 printf("SRIO2: disabled\n");
72 #ifdef CONFIG_FSL_CORENET
73 /* On FSL_CORENET devices we can disable individual ports */
75 setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO1);
77 setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO2);
80 /* neither port is used - disable everything */
81 if (!srio1_used && !srio2_used) {
82 setbits_be32(&gur->devdisr, _DEVDISR_SRIO1);
83 setbits_be32(&gur->devdisr, _DEVDISR_SRIO2);
84 setbits_be32(&gur->devdisr, _DEVDISR_RMU);