3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/processor.h>
28 #include <asm/ppc4xx-gpio.h>
32 #include <gdsys_fpga.h>
34 #define LATCH0_BASE (CONFIG_SYS_LATCH_BASE)
35 #define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100)
36 #define LATCH2_BASE (CONFIG_SYS_LATCH_BASE + 0x200)
57 char *s = getenv("serial#");
59 puts("Board: CATCenter Neo");
71 static void print_fpga_info(void)
73 struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(0);
74 u16 versions = in_le16(&fpga->versions);
75 u16 fpga_version = in_le16(&fpga->fpga_version);
76 u16 fpga_features = in_le16(&fpga->fpga_features);
77 int fpga_state = get_fpga_state(0);
79 unsigned hardware_version;
80 unsigned feature_channels;
83 if (fpga_state & FPGA_STATE_DONE_FAILED) {
84 printf(" done timed out\n");
88 if (fpga_state & FPGA_STATE_REFLECTION_FAILED) {
89 printf(" refelectione test failed\n");
93 unit_type = (versions & 0xf000) >> 12;
94 hardware_version = versions & 0x000f;
95 feature_channels = fpga_features & 0x007f;
103 printf("UnitType %d(not supported)", unit_type);
107 switch (hardware_version) {
109 printf(" HW-Ver 3.00-3.12\n");
113 printf(" HW-Ver %d(not supported)\n",
118 printf(" FPGA V %d.%02d, features:",
119 fpga_version / 100, fpga_version % 100);
121 printf(" %d channel(s)\n", feature_channels);
124 int last_stage_init(void)
131 void gd405ep_init(void)
135 void gd405ep_set_fpga_reset(unsigned state)
138 out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_RESET);
139 out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_RESET);
141 out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_BOOT);
142 out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_BOOT);
146 void gd405ep_setup_hw(void)
149 * set "startup-finished"-gpios
151 gpio_write_bit(21, 0);
152 gpio_write_bit(22, 1);
155 int gd405ep_get_fpga_done(unsigned fpga)
158 * Neo hardware has no FPGA-DONE GPIO