[PATCH 4/7] mmc: zynq_sdhci: Move setting tapdelay code to driver
Ashok Reddy Soma
ashok.reddy.soma at xilinx.com
Sat Jul 24 10:10:06 CEST 2021
tap_delays.c just has calls to xilinx_pm_request() for setting tapdelays.
Simply move these calls to zynq_sdhci.c and make them static inline.
Similarly zynqmp_tap_delay.h also has call to xilinx_pm_request() for
dll reset. Do the same for this file as well.
Remove tap_delays.c and zynqmp_tap_delay.h files.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma at xilinx.com>
---
board/xilinx/zynqmp/Makefile | 2 --
board/xilinx/zynqmp/tap_delays.c | 26 ------------------------
drivers/mmc/zynq_sdhci.c | 21 +++++++++++++++++++-
include/zynqmp_tap_delay.h | 34 --------------------------------
4 files changed, 20 insertions(+), 63 deletions(-)
delete mode 100644 board/xilinx/zynqmp/tap_delays.c
delete mode 100644 include/zynqmp_tap_delay.h
diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile
index 7d8277ca40..a914028753 100644
--- a/board/xilinx/zynqmp/Makefile
+++ b/board/xilinx/zynqmp/Makefile
@@ -44,8 +44,6 @@ $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_C
endif
endif
-obj-$(CONFIG_MMC_SDHCI_ZYNQ) += tap_delays.o
-
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_CMD_ZYNQMP) += cmds.o
endif
diff --git a/board/xilinx/zynqmp/tap_delays.c b/board/xilinx/zynqmp/tap_delays.c
deleted file mode 100644
index 4ce2244060..0000000000
--- a/board/xilinx/zynqmp/tap_delays.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Xilinx ZynqMP SoC Tap Delay Programming
- *
- * Copyright (C) 2018 Xilinx, Inc.
- */
-
-#include <common.h>
-#include <zynqmp_tap_delay.h>
-#include <asm/arch/sys_proto.h>
-#include <linux/delay.h>
-#include <mmc.h>
-#include <zynqmp_firmware.h>
-
-int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type, u32 itap_delay)
-{
-
- return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY,
- type, itap_delay, NULL);
-}
-
-int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type, u32 otap_delay)
-{
- return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY,
- type, otap_delay, NULL);
-}
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index 4dafd47b57..97caca51e2 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -17,7 +17,6 @@
#include <linux/libfdt.h>
#include <malloc.h>
#include <sdhci.h>
-#include <zynqmp_tap_delay.h>
#include <zynqmp_firmware.h>
#define SDHCI_ARASAN_ITAPDLY_REGISTER 0xF0F8
@@ -76,6 +75,26 @@ static const u8 mode2timing[] = {
[MMC_HS_200] = MMC_TIMING_MMC_HS200,
};
+static inline int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type,
+ u32 itap_delay)
+{
+ return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY,
+ type, itap_delay, NULL);
+}
+
+static inline int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type,
+ u32 otap_delay)
+{
+ return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY,
+ type, otap_delay, NULL);
+}
+
+static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type)
+{
+ return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SD_DLL_RESET,
+ type, 0, NULL);
+}
+
static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid)
{
struct mmc *mmc = (struct mmc *)host->mmc;
diff --git a/include/zynqmp_tap_delay.h b/include/zynqmp_tap_delay.h
deleted file mode 100644
index 7e4d4e4a9a..0000000000
--- a/include/zynqmp_tap_delay.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Xilinx ZynqMP SoC Tap Delay Programming
- *
- * Copyright (C) 2018 Xilinx, Inc.
- */
-
-#ifndef __ZYNQMP_TAP_DELAY_H__
-#define __ZYNQMP_TAP_DELAY_H__
-
-#include <zynqmp_firmware.h>
-
-#ifdef CONFIG_ARCH_ZYNQMP
-int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay);
-int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay);
-#else
-inline int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay)
-{
- return 0;
-}
-
-int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay)
-{
- return 0;
-}
-#endif
-
-static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type)
-{
- return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SD_DLL_RESET,
- type, 0, NULL);
-}
-
-#endif
--
2.17.1
More information about the U-Boot
mailing list