setup.c (05668381140309088443bf5dc53add4104610fbb) setup.c (36a885306fdf7bb557c773309c993bfb2d0d693c)
1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *

--- 53 unchanged lines hidden (view full) ---

62 soc_str = "BCM1125";
63 ret = setup_bcm112x();
64 break;
65 case K_SYS_SOC_TYPE_BCM1125H:
66 soc_str = "BCM1125H";
67 ret = setup_bcm112x();
68 break;
69 default:
1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *

--- 53 unchanged lines hidden (view full) ---

62 soc_str = "BCM1125";
63 ret = setup_bcm112x();
64 break;
65 case K_SYS_SOC_TYPE_BCM1125H:
66 soc_str = "BCM1125H";
67 ret = setup_bcm112x();
68 break;
69 default:
70 prom_printf("Unknown SOC type %x\n", soc_type);
70 printk("Unknown SOC type %x\n", soc_type);
71 ret = 1;
72 break;
73 }
74 return ret;
75}
76
77static int __init setup_bcm1250(void)
78{

--- 28 unchanged lines hidden (view full) ---

107 pass_str = "C1";
108 break;
109 default:
110 if (soc_pass < K_SYS_REVISION_BCM1250_PASS2_2) {
111 periph_rev = 2;
112 pass_str = "A0-A6";
113 war_pass = K_SYS_REVISION_BCM1250_PASS2;
114 } else {
71 ret = 1;
72 break;
73 }
74 return ret;
75}
76
77static int __init setup_bcm1250(void)
78{

--- 28 unchanged lines hidden (view full) ---

107 pass_str = "C1";
108 break;
109 default:
110 if (soc_pass < K_SYS_REVISION_BCM1250_PASS2_2) {
111 periph_rev = 2;
112 pass_str = "A0-A6";
113 war_pass = K_SYS_REVISION_BCM1250_PASS2;
114 } else {
115 prom_printf("Unknown BCM1250 rev %x\n", soc_pass);
115 printk("Unknown BCM1250 rev %x\n", soc_pass);
116 ret = 1;
117 }
118 break;
119 }
120 return ret;
121}
122
123static int __init setup_bcm112x(void)

--- 11 unchanged lines hidden (view full) ---

135 periph_rev = 3;
136 pass_str = "A1";
137 break;
138 case K_SYS_REVISION_BCM112x_A2:
139 periph_rev = 3;
140 pass_str = "A2";
141 break;
142 default:
116 ret = 1;
117 }
118 break;
119 }
120 return ret;
121}
122
123static int __init setup_bcm112x(void)

--- 11 unchanged lines hidden (view full) ---

135 periph_rev = 3;
136 pass_str = "A1";
137 break;
138 case K_SYS_REVISION_BCM112x_A2:
139 periph_rev = 3;
140 pass_str = "A2";
141 break;
142 default:
143 prom_printf("Unknown %s rev %x\n", soc_str, soc_pass);
143 printk("Unknown %s rev %x\n", soc_str, soc_pass);
144 ret = 1;
145 }
146 return ret;
147}
148
149void __init sb1250_setup(void)
150{
151 uint64_t sys_rev;
152 int plldiv;
153 int bad_config = 0;
154
155 sb1_pass = read_c0_prid() & 0xff;
156 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
157 soc_type = SYS_SOC_TYPE(sys_rev);
158 soc_pass = G_SYS_REVISION(sys_rev);
159
160 if (sys_rev_decode()) {
144 ret = 1;
145 }
146 return ret;
147}
148
149void __init sb1250_setup(void)
150{
151 uint64_t sys_rev;
152 int plldiv;
153 int bad_config = 0;
154
155 sb1_pass = read_c0_prid() & 0xff;
156 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
157 soc_type = SYS_SOC_TYPE(sys_rev);
158 soc_pass = G_SYS_REVISION(sys_rev);
159
160 if (sys_rev_decode()) {
161 prom_printf("Restart after failure to identify SiByte chip\n");
161 printk("Restart after failure to identify SiByte chip\n");
162 machine_restart(NULL);
163 }
164
165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
167
162 machine_restart(NULL);
163 }
164
165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
167
168 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",
168 printk("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",
169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
170 prom_printf("Board type: %s\n", get_system_type());
170 printk("Board type: %s\n", get_system_type());
171
172 switch (war_pass) {
173 case K_SYS_REVISION_BCM1250_PASS1:
174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
171
172 switch (war_pass) {
173 case K_SYS_REVISION_BCM1250_PASS1:
174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
175 prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "
175 printk("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "
176 "and the kernel doesn't have the proper "
177 "workarounds compiled in. @@@@\n");
178 bad_config = 1;
179#endif
180 break;
181 case K_SYS_REVISION_BCM1250_PASS2:
182 /* Pass 2 - easiest as default for now - so many numbers */
183#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \
184 !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)
176 "and the kernel doesn't have the proper "
177 "workarounds compiled in. @@@@\n");
178 bad_config = 1;
179#endif
180 break;
181 case K_SYS_REVISION_BCM1250_PASS2:
182 /* Pass 2 - easiest as default for now - so many numbers */
183#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \
184 !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)
185 prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the "
185 printk("@@@@ This is a BCM1250 A3-A10 board, and the "
186 "kernel doesn't have the proper workarounds "
187 "compiled in. @@@@\n");
188 bad_config = 1;
189#endif
190#ifdef CONFIG_CPU_HAS_PREFETCH
186 "kernel doesn't have the proper workarounds "
187 "compiled in. @@@@\n");
188 bad_config = 1;
189#endif
190#ifdef CONFIG_CPU_HAS_PREFETCH
191 prom_printf("@@@@ Prefetches may be enabled in this kernel, "
191 printk("@@@@ Prefetches may be enabled in this kernel, "
192 "but are buggy on this board. @@@@\n");
193 bad_config = 1;
194#endif
195 break;
196 case K_SYS_REVISION_BCM1250_PASS2_2:
197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS
192 "but are buggy on this board. @@@@\n");
193 bad_config = 1;
194#endif
195 break;
196 case K_SYS_REVISION_BCM1250_PASS2_2:
197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS
198 prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the "
198 printk("@@@@ This is a BCM1250 B1/B2. board, and the "
199 "kernel doesn't have the proper workarounds "
200 "compiled in. @@@@\n");
201 bad_config = 1;
202#endif
203#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \
204 !defined(CONFIG_CPU_HAS_PREFETCH)
199 "kernel doesn't have the proper workarounds "
200 "compiled in. @@@@\n");
201 bad_config = 1;
202#endif
203#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \
204 !defined(CONFIG_CPU_HAS_PREFETCH)
205 prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is "
205 printk("@@@@ This is a BCM1250 B1/B2, but the kernel is "
206 "conservatively configured for an 'A' stepping. "
207 "@@@@\n");
208#endif
209 break;
210 default:
211 break;
212 }
213 if (bad_config) {
206 "conservatively configured for an 'A' stepping. "
207 "@@@@\n");
208#endif
209 break;
210 default:
211 break;
212 }
213 if (bad_config) {
214 prom_printf("Invalid configuration for this chip.\n");
214 printk("Invalid configuration for this chip.\n");
215 machine_restart(NULL);
216 }
217}
215 machine_restart(NULL);
216 }
217}