Commit b19bf8344f2098bcc7746ef641c4c69f5aa7eb65

Authored by Dirk Eibach
Committed by Stefan Roese
1 parent 6e9e6c36a6

powerpc/ppc4xx: Adapt gdsys 405ep boards to platform changes

Print fpga info at last_stage_init on gdsys 405ep boards.
Use dtt_init() to startup fans.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>

Showing 5 changed files with 70 additions and 37 deletions Side-by-side Diff

board/gdsys/405ep/dlvision-10g.c
... ... @@ -26,6 +26,7 @@
26 26 #include <asm/processor.h>
27 27 #include <asm/io.h>
28 28 #include <asm/ppc4xx-gpio.h>
  29 +#include <dtt.h>
29 30  
30 31 #include "405ep.h"
31 32 #include <gdsys_fpga.h>
... ... @@ -68,6 +69,14 @@
68 69 RAM_DDR2_64 = 2,
69 70 };
70 71  
  72 +int misc_init_r(void)
  73 +{
  74 + /* startup fans */
  75 + dtt_init();
  76 +
  77 + return 0;
  78 +}
  79 +
71 80 static unsigned int get_hwver(void)
72 81 {
73 82 u16 latch3 = in_le16((void *)LATCH3_BASE);
74 83  
75 84  
76 85  
77 86  
78 87  
... ... @@ -226,24 +235,19 @@
226 235 */
227 236 int checkboard(void)
228 237 {
229   - char buf[64];
230   - int i = getenv_f("serial#", buf, sizeof(buf));
  238 + char *s = getenv("serial#");
231 239  
232   - printf("Board: ");
  240 + puts("Board: ");
233 241  
234   - printf("DLVision 10G");
  242 + puts("DLVision 10G");
235 243  
236   - if (i > 0) {
  244 + if (s != NULL) {
237 245 puts(", serial# ");
238   - puts(buf);
  246 + puts(s);
239 247 }
240 248  
241 249 puts("\n");
242 250  
243   - print_fpga_info(0);
244   - if (get_mc2_present())
245   - print_fpga_info(1);
246   -
247 251 return 0;
248 252 }
249 253  
... ... @@ -251,6 +255,10 @@
251 255 {
252 256 ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
253 257 u16 versions = in_le16(&fpga->versions);
  258 +
  259 + print_fpga_info(0);
  260 + if (get_mc2_present())
  261 + print_fpga_info(1);
254 262  
255 263 if (((versions >> 4) & 0x000f) != UNITTYPE_MAIN_USER)
256 264 return 0;
board/gdsys/405ep/io.c
... ... @@ -27,6 +27,7 @@
27 27 #include <asm/io.h>
28 28 #include <asm/ppc4xx-gpio.h>
29 29  
  30 +#include <dtt.h>
30 31 #include <miiphy.h>
31 32  
32 33 #include "405ep.h"
... ... @@ -52,6 +53,14 @@
52 53 HWVER_122 = 3,
53 54 };
54 55  
  56 +int misc_init_r(void)
  57 +{
  58 + /* startup fans */
  59 + dtt_init();
  60 +
  61 + return 0;
  62 +}
  63 +
55 64 int configure_gbit_phy(unsigned char addr)
56 65 {
57 66 unsigned short value;
... ... @@ -92,8 +101,22 @@
92 101 */
93 102 int checkboard(void)
94 103 {
95   - char buf[64];
96   - int i = getenv_f("serial#", buf, sizeof(buf));
  104 + char *s = getenv("serial#");
  105 +
  106 + puts("Board: CATCenter Io");
  107 +
  108 + if (s != NULL) {
  109 + puts(", serial# ");
  110 + puts(s);
  111 + }
  112 +
  113 + puts("\n");
  114 +
  115 + return 0;
  116 +}
  117 +
  118 +static void print_fpga_info(void)
  119 +{
97 120 ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
98 121 u16 versions = in_le16(&fpga->versions);
99 122 u16 fpga_version = in_le16(&fpga->fpga_version);
100 123  
... ... @@ -108,16 +131,8 @@
108 131 feature_channels = fpga_features & 0x007f;
109 132 feature_expansion = fpga_features & (1<<15);
110 133  
111   - printf("Board: ");
  134 + puts("FPGA: ");
112 135  
113   - printf("CATCenter Io");
114   -
115   - if (i > 0) {
116   - puts(", serial# ");
117   - puts(buf);
118   - }
119   - puts("\n ");
120   -
121 136 switch (unit_type) {
122 137 case UNITTYPE_CCD_SWITCH:
123 138 printf("CCD-Switch");
... ... @@ -157,8 +172,6 @@
157 172 printf(" %d channel(s)", feature_channels);
158 173  
159 174 printf(", expansion %ssupported\n", feature_expansion ? "" : "un");
160   -
161   - return 0;
162 175 }
163 176  
164 177 /*
... ... @@ -168,6 +181,8 @@
168 181 {
169 182 ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
170 183 unsigned int k;
  184 +
  185 + print_fpga_info();
171 186  
172 187 miiphy_register(CONFIG_SYS_GBIT_MII_BUSNAME,
173 188 bb_miiphy_read, bb_miiphy_write);
board/gdsys/405ep/iocon.c
... ... @@ -74,8 +74,24 @@
74 74 */
75 75 int checkboard(void)
76 76 {
77   - char buf[64];
78   - int i = getenv_f("serial#", buf, sizeof(buf));
  77 + char *s = getenv("serial#");
  78 +
  79 + puts("Board: ");
  80 +
  81 + puts("IoCon");
  82 +
  83 + if (s != NULL) {
  84 + puts(", serial# ");
  85 + puts(s);
  86 + }
  87 +
  88 + puts("\n");
  89 +
  90 + return 0;
  91 +}
  92 +
  93 +static void print_fpga_info(void)
  94 +{
79 95 ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
80 96 u16 versions = in_le16(&fpga->versions);
81 97 u16 fpga_version = in_le16(&fpga->fpga_version);
... ... @@ -100,16 +116,6 @@
100 116 feature_carriers = (fpga_features & 0x000c) >> 2;
101 117 feature_video_channels = fpga_features & 0x0003;
102 118  
103   - printf("Board: ");
104   -
105   - printf("IoCon");
106   -
107   - if (i > 0) {
108   - puts(", serial# ");
109   - puts(buf);
110   - }
111   - puts("\n ");
112   -
113 119 switch (unit_type) {
114 120 case UNITTYPE_MAIN_USER:
115 121 printf("Mainchannel");
116 122  
... ... @@ -210,12 +216,12 @@
210 216 printf(", %d carrier(s)", feature_carriers);
211 217  
212 218 printf(", %d video channel(s)\n", feature_video_channels);
213   -
214   - return 0;
215 219 }
216 220  
217 221 int last_stage_init(void)
218 222 {
  223 + print_fpga_info();
  224 +
219 225 return osd_probe(0);
220 226 }
221 227  
include/configs/dlvision-10g.h
... ... @@ -39,6 +39,7 @@
39 39  
40 40 #define CONFIG_BOARD_EARLY_INIT_F
41 41 #define CONFIG_BOARD_EARLY_INIT_R
  42 +#define CONFIG_MISC_INIT_R
42 43 #define CONFIG_LAST_STAGE_INIT
43 44  
44 45 #define CONFIG_SYS_CLK_FREQ 33333333 /* external frequency to pll */
... ... @@ -81,6 +82,7 @@
81 82 * Commands additional to the ones defined in amcc-common.h
82 83 */
83 84 #define CONFIG_CMD_CACHE
  85 +#define CONFIG_CMD_DTT
84 86 #undef CONFIG_CMD_EEPROM
85 87  
86 88 /*
include/configs/io.h
... ... @@ -39,6 +39,7 @@
39 39  
40 40 #define CONFIG_BOARD_EARLY_INIT_F
41 41 #define CONFIG_BOARD_EARLY_INIT_R
  42 +#define CONFIG_MISC_INIT_R
42 43 #define CONFIG_LAST_STAGE_INIT
43 44  
44 45 #define CONFIG_SYS_CLK_FREQ 33333333 /* external frequency to pll */
... ... @@ -77,6 +78,7 @@
77 78 * Commands additional to the ones defined in amcc-common.h
78 79 */
79 80 #define CONFIG_CMD_CACHE
  81 +#define CONFIG_CMD_DTT
80 82 #undef CONFIG_CMD_EEPROM
81 83  
82 84 /*