3 * Stefano Babic, DENX Software Engineering, sbabic@denx.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/arch/clock.h>
27 #include <asm/arch/imx-regs.h>
31 #include "qong_fpga.h"
33 DECLARE_GLOBAL_DATA_PTR;
35 #if defined(CONFIG_FPGA)
37 static void qong_jtag_init(void)
42 static void qong_fpga_jtag_set_tdi(int value)
44 gpio_set_value(QONG_FPGA_TDI_PIN, value);
47 static void qong_fpga_jtag_set_tms(int value)
49 gpio_set_value(QONG_FPGA_TMS_PIN, value);
52 static void qong_fpga_jtag_set_tck(int value)
54 gpio_set_value(QONG_FPGA_TCK_PIN, value);
57 static int qong_fpga_jtag_get_tdo(void)
59 return gpio_get_value(QONG_FPGA_TDO_PIN);
62 lattice_board_specific_func qong_fpga_fns = {
64 qong_fpga_jtag_set_tdi,
65 qong_fpga_jtag_set_tms,
66 qong_fpga_jtag_set_tck,
67 qong_fpga_jtag_get_tdo
70 Lattice_desc qong_fpga[CONFIG_FPGA_COUNT] = {
75 (void *) &qong_fpga_fns,
82 int qong_fpga_init(void)
88 for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
89 fpga_add(fpga_lattice, &qong_fpga[i]);