3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/processor.h>
12 #include <asm/ppc4xx-gpio.h>
15 #include <gdsys_fpga.h>
17 #define LATCH0_BASE (CONFIG_SYS_LATCH_BASE)
18 #define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100)
19 #define LATCH2_BASE (CONFIG_SYS_LATCH_BASE + 0x200)
30 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
35 * Note: DTT has been removed. Please use UCLASS_THERMAL.
47 char *s = getenv("serial#");
49 puts("Board: CATCenter Neo");
61 static void print_fpga_info(void)
66 int fpga_state = get_fpga_state(0);
68 unsigned hardware_version;
69 unsigned feature_channels;
72 if (fpga_state & FPGA_STATE_DONE_FAILED) {
73 printf(" done timed out\n");
77 if (fpga_state & FPGA_STATE_REFLECTION_FAILED) {
78 printf(" refelectione test failed\n");
82 FPGA_GET_REG(0, versions, &versions);
83 FPGA_GET_REG(0, fpga_version, &fpga_version);
84 FPGA_GET_REG(0, fpga_features, &fpga_features);
86 unit_type = (versions & 0xf000) >> 12;
87 hardware_version = versions & 0x000f;
88 feature_channels = fpga_features & 0x007f;
96 printf("UnitType %d(not supported)", unit_type);
100 switch (hardware_version) {
102 printf(" HW-Ver 3.00-3.12\n");
106 printf(" HW-Ver %d(not supported)\n",
111 printf(" FPGA V %d.%02d, features:",
112 fpga_version / 100, fpga_version % 100);
114 printf(" %d channel(s)\n", feature_channels);
117 int last_stage_init(void)
124 void gd405ep_init(void)
128 void gd405ep_set_fpga_reset(unsigned state)
131 out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_RESET);
132 out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_RESET);
134 out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_BOOT);
135 out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_BOOT);
139 void gd405ep_setup_hw(void)
142 * set "startup-finished"-gpios
144 gpio_write_bit(21, 0);
145 gpio_write_bit(22, 1);
148 int gd405ep_get_fpga_done(unsigned fpga)
151 * Neo hardware has no FPGA-DONE GPIO