}
 #endif
 
+#ifdef CONFIG_SPI_BOOTING
 static void spi_rx_tx(struct exynos_spi *regs, int todo,
                        void *dinp, void const *doutp, int i)
 {
        clrbits_le32(®s->ch_cfg, SPI_CH_RST);
        clrbits_le32(®s->ch_cfg, SPI_TX_CH_ON | SPI_RX_CH_ON);
 }
+#endif
 
 /*
 * Copy U-boot from mmc to RAM:
 
        u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
        u32 offset = 0, size = 0;
+#ifdef CONFIG_SPI_BOOTING
        struct spl_machine_param *param = spl_get_machine_params();
+#endif
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
        u32 (*copy_bl2_from_emmc)(u32 nblock, u32 dst);
        void (*end_bootop_from_emmc)(void);