#include <asm/fsl_serdes.h>
#include <linux/errno.h>
+#include "../common/qrio.h"
#include "kmp204x.h"
#define PROM_SEL_L 11
/* control the PROM_SEL_L signal*/
static void toggle_fpga_eeprom_bus(bool cpu_own)
{
- qrio_gpio_direction_output(GPIO_A, PROM_SEL_L, !cpu_own);
+ qrio_gpio_direction_output(QRIO_GPIO_A, PROM_SEL_L, !cpu_own);
}
#define CONF_SEL_L 10
toggle_fpga_eeprom_bus(false);
/* assert CONF_SEL_L to be able to drive FPGA_PROG_L */
- qrio_gpio_direction_output(GPIO_A, CONF_SEL_L, 0);
+ qrio_gpio_direction_output(QRIO_GPIO_A, CONF_SEL_L, 0);
/* trigger the config start */
- qrio_gpio_direction_output(GPIO_A, FPGA_PROG_L, 0);
+ qrio_gpio_direction_output(QRIO_GPIO_A, FPGA_PROG_L, 0);
/* small delay for INIT_L line */
udelay(10);
/* wait for FPGA_INIT to be asserted */
do {
- init_l = qrio_get_gpio(GPIO_A, FPGA_INIT_L);
+ init_l = qrio_get_gpio(QRIO_GPIO_A, FPGA_INIT_L);
if (timeout-- == 0) {
printf("FPGA_INIT timeout\n");
ret = -EFAULT;
} while (init_l);
/* deassert FPGA_PROG, config should start */
- qrio_set_gpio(GPIO_A, FPGA_PROG_L, 1);
+ qrio_set_gpio(QRIO_GPIO_A, FPGA_PROG_L, 1);
return ret;
}
printf("PCIe FPGA config:");
do {
- done = qrio_get_gpio(GPIO_A, FPGA_DONE);
+ done = qrio_get_gpio(QRIO_GPIO_A, FPGA_DONE);
if (timeout-- == 0) {
printf(" FPGA_DONE timeout\n");
ret = -EFAULT;
err_out:
/* deactive CONF_SEL and give the CPU conf EEPROM access */
- qrio_set_gpio(GPIO_A, CONF_SEL_L, 1);
+ qrio_set_gpio(QRIO_GPIO_A, CONF_SEL_L, 1);
toggle_fpga_eeprom_bus(true);
return ret;