rename CFG_ macros to CONFIG_SYS
[platform/kernel/u-boot.git] / board / prodrive / alpr / fpga.c
index e94360f..0ecebc9 100644 (file)
@@ -61,10 +61,10 @@ static unsigned long regval;
 #define        SET_GPIO_0(bit)         SET_GPIO_REG_0(GPIO0_OR, bit)
 #define        SET_GPIO_1(bit)         SET_GPIO_REG_1(GPIO0_OR, bit)
 
-#define FPGA_PRG               (0x80000000 >> CFG_GPIO_PROG_EN)
-#define FPGA_CONFIG            (0x80000000 >> CFG_GPIO_CONFIG)
-#define FPGA_DATA              (0x80000000 >> CFG_GPIO_DATA)
-#define FPGA_CLK               (0x80000000 >> CFG_GPIO_CLK)
+#define FPGA_PRG               (0x80000000 >> CONFIG_SYS_GPIO_PROG_EN)
+#define FPGA_CONFIG            (0x80000000 >> CONFIG_SYS_GPIO_CONFIG)
+#define FPGA_DATA              (0x80000000 >> CONFIG_SYS_GPIO_DATA)
+#define FPGA_CLK               (0x80000000 >> CONFIG_SYS_GPIO_CLK)
 #define OLD_VAL                        (FPGA_PRG | FPGA_CONFIG)
 
 #define SET_FPGA(data)         out32(GPIO0_OR, data)
@@ -87,43 +87,43 @@ int fpga_pre_fn (int cookie)
 
        reg = in32(GPIO0_IR);
        /* Enable the FPGA Chain */
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_PROG_EN);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_PROG_EN);
-       SET_GPIO_1(CFG_GPIO_PROG_EN);
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_SEL_DPR);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_SEL_DPR);
-       SET_GPIO_0((CFG_GPIO_SEL_DPR));
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_PROG_EN);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_PROG_EN);
+       SET_GPIO_1(CONFIG_SYS_GPIO_PROG_EN);
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_SEL_DPR);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_SEL_DPR);
+       SET_GPIO_0((CONFIG_SYS_GPIO_SEL_DPR));
 
        /* initialize the GPIO Pins */
        /* output */
-       SET_GPIO_0(CFG_GPIO_CLK);
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_CLK);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_CLK);
+       SET_GPIO_0(CONFIG_SYS_GPIO_CLK);
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_CLK);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_CLK);
 
        /* output */
-       SET_GPIO_0(CFG_GPIO_DATA);
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_DATA);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_DATA);
+       SET_GPIO_0(CONFIG_SYS_GPIO_DATA);
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_DATA);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_DATA);
 
        /* First we set STATUS to 0 then as an input */
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_STATUS);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_STATUS);
-       SET_GPIO_0(CFG_GPIO_STATUS);
-       SET_GPIO_REG_0(GPIO0_TCR, CFG_GPIO_STATUS);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_STATUS);
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_STATUS);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_STATUS);
+       SET_GPIO_0(CONFIG_SYS_GPIO_STATUS);
+       SET_GPIO_REG_0(GPIO0_TCR, CONFIG_SYS_GPIO_STATUS);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_STATUS);
 
        /* output */
-       SET_GPIO_REG_1(GPIO0_TCR, CFG_GPIO_CONFIG);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_CONFIG);
-       SET_GPIO_0(CFG_GPIO_CONFIG);
+       SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_CONFIG);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_CONFIG);
+       SET_GPIO_0(CONFIG_SYS_GPIO_CONFIG);
 
        /* input */
-       SET_GPIO_0(CFG_GPIO_CON_DON);
-       SET_GPIO_REG_0(GPIO0_TCR, CFG_GPIO_CON_DON);
-       SET_GPIO_REG_0(GPIO0_ODR, CFG_GPIO_CON_DON);
+       SET_GPIO_0(CONFIG_SYS_GPIO_CON_DON);
+       SET_GPIO_REG_0(GPIO0_TCR, CONFIG_SYS_GPIO_CON_DON);
+       SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_CON_DON);
 
        /* CONFIG = 0 STATUS = 0 -> FPGA in reset state */
-       SET_GPIO_0(CFG_GPIO_CONFIG);
+       SET_GPIO_0(CONFIG_SYS_GPIO_CONFIG);
        return FPGA_SUCCESS;
 }
 
@@ -131,9 +131,9 @@ int fpga_pre_fn (int cookie)
 int fpga_config_fn (int assert_config, int flush, int cookie)
 {
        if (assert_config) {
-               SET_GPIO_1(CFG_GPIO_CONFIG);
+               SET_GPIO_1(CONFIG_SYS_GPIO_CONFIG);
        } else {
-               SET_GPIO_0(CFG_GPIO_CONFIG);
+               SET_GPIO_0(CONFIG_SYS_GPIO_CONFIG);
        }
        return FPGA_SUCCESS;
 }
@@ -144,7 +144,7 @@ int fpga_status_fn (int cookie)
        unsigned long   reg;
 
        reg = in32(GPIO0_IR);
-       if (reg &= (0x80000000 >> CFG_GPIO_STATUS)) {
+       if (reg &= (0x80000000 >> CONFIG_SYS_GPIO_STATUS)) {
                PRINTF("STATUS = HIGH\n");
                return FPGA_FAIL;
        }
@@ -157,7 +157,7 @@ int fpga_done_fn (int cookie)
 {
        unsigned long   reg;
        reg = in32(GPIO0_IR);
-       if (reg &= (0x80000000 >> CFG_GPIO_CON_DON)) {
+       if (reg &= (0x80000000 >> CONFIG_SYS_GPIO_CON_DON)) {
                PRINTF("CONF_DON = HIGH\n");
                return FPGA_FAIL;
        }
@@ -189,10 +189,10 @@ int fpga_write_fn (void *buf, size_t len, int flush, int cookie)
                        i --;
                } while (i > 0);
 
-#ifdef CFG_FPGA_PROG_FEEDBACK
+#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                if (bytecount % len_40 == 0) {
                        putc ('.');             /* let them know we are alive */
-#ifdef CFG_FPGA_CHECK_CTRLC
+#ifdef CONFIG_SYS_FPGA_CHECK_CTRLC
                        if (ctrlc ())
                                return FPGA_FAIL;
 #endif
@@ -205,7 +205,7 @@ int fpga_write_fn (void *buf, size_t len, int flush, int cookie)
 /* called, when programming is aborted */
 int fpga_abort_fn (int cookie)
 {
-       SET_GPIO_1((CFG_GPIO_SEL_DPR));
+       SET_GPIO_1((CONFIG_SYS_GPIO_SEL_DPR));
        return FPGA_SUCCESS;
 }