3 * Stefano Babic, DENX Software Engineering, sbabic@denx.de
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/clock.h>
10 #include <asm/arch/imx-regs.h>
14 #include "qong_fpga.h"
16 DECLARE_GLOBAL_DATA_PTR;
18 #if defined(CONFIG_FPGA)
20 static void qong_jtag_init(void)
25 static void qong_fpga_jtag_set_tdi(int value)
27 gpio_set_value(QONG_FPGA_TDI_PIN, value);
30 static void qong_fpga_jtag_set_tms(int value)
32 gpio_set_value(QONG_FPGA_TMS_PIN, value);
35 static void qong_fpga_jtag_set_tck(int value)
37 gpio_set_value(QONG_FPGA_TCK_PIN, value);
40 static int qong_fpga_jtag_get_tdo(void)
42 return gpio_get_value(QONG_FPGA_TDO_PIN);
45 lattice_board_specific_func qong_fpga_fns = {
47 qong_fpga_jtag_set_tdi,
48 qong_fpga_jtag_set_tms,
49 qong_fpga_jtag_set_tck,
50 qong_fpga_jtag_get_tdo
53 Lattice_desc qong_fpga[CONFIG_FPGA_COUNT] = {
58 (void *) &qong_fpga_fns,
65 int qong_fpga_init(void)
71 for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
72 fpga_add(fpga_lattice, &qong_fpga[i]);