obj-$(CONFIG_MMC_DW_PLTFM) += dw_mmc-pltfm.o
# To Specific Extensions for Synopsys DW Multimedia Card Interface in Rockchip Soc. Added by XBW.
-obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_of.o rk_sdmmc_ops.o
+obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_dbg.o rk_sdmmc_ops.o
obj-$(CONFIG_MMC_DW_EXYNOS) += dw_mmc-exynos.o
obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o
#include "dw_mmc-pltfm.h"
#include "../../clk/rockchip/clk-ops.h"
-#include "rk_sdmmc_of.h"
+#include "rk_sdmmc_dbg.h"
/*CRU SDMMC TUNING*/
/*
};
MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match);
-#if DW_MMC_OF_PROBE
-extern void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *mmc_property);
-#endif
-
static int dw_mci_rockchip_probe(struct platform_device *pdev)
{
const struct dw_mci_drv_data *drv_data;
const struct of_device_id *match;
- #if DW_MMC_OF_PROBE
- struct device_node *np = pdev->dev.of_node;
- struct rk_sdmmc_of *rk_mmc_property = NULL;
-
- rk_mmc_property = (struct rk_sdmmc_of *)kmalloc(sizeof(struct rk_sdmmc_of),GFP_KERNEL);
- if(NULL == rk_mmc_property)
- {
- kfree(rk_mmc_property);
- rk_mmc_property = NULL;
- printk("rk_mmc_property malloc space failed!\n");
- return 0;
- }
-
- rockchip_mmc_of_probe(np,rk_mmc_property);
- #endif /*DW_MMC_OF_PROBE*/
-
-
match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node);
drv_data = match->data;
return dw_mci_pltfm_register(pdev, drv_data);
#include <linux/rockchip/cpu.h>
#include "rk_sdmmc.h"
-#include "rk_sdmmc_of.h"
+#include "rk_sdmmc_dbg.h"
#include <linux/regulator/rockchip_io_vol_domain.h>
#include "../../clk/rockchip/clk-ops.h"
#ifndef _DW_MMC_H_
#define _DW_MMC_H_
-#include "rk_sdmmc_of.h"
+#include "rk_sdmmc_dbg.h"
#define DW_MMC_240A 0x240a
--- /dev/null
+/*
+ * Synopsys DesignWare Multimedia Card Interface driver
+ *
+ * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "rk_sdmmc_dbg.h"
+
+u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR;
+char dbg_flag[]="mmc0mmc1mmc2";
+
--- /dev/null
+/*
+ * Synopsys DesignWare Multimedia Card Interface driver
+ *
+ * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __RK_SDMMC_DBG_H
+#define __RK_SDMMC_DBG_H
+
+#include <linux/of_gpio.h>
+#include <linux/of_i2c.h>
+#include <linux/types.h>
+#include <linux/bitops.h>
+
+
+#define DRIVER_NAME "rk_sdmmc"
+#define DRIVER_PREFIX DRIVER_NAME ": "
+#define DRIVER_VER "Dw-mci-rockchip"
+
+enum MMC_DBG_MASK{
+ MMC_DBG_NONE = 0,
+ MMC_DBG_BOOT = BIT(0),
+ MMC_DBG_ERROR= BIT(1),
+ MMC_DBG_WARN = BIT(2),
+ MMC_DBG_INFO = BIT(3),
+ MMC_DBG_CMD = BIT(4),
+ MMC_DBG_DBG = BIT(5),
+ MMC_DBG_SW_VOL = BIT(6),
+ MMC_DBG_ALL = 0xFF,
+
+};
+
+extern u32 mmc_debug_level;
+extern char dbg_flag[];
+
+#define MMC_DBG_FUNC_CONFIG 1
+#if MMC_DBG_FUNC_CONFIG
+#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) \
+ do { \
+ if(mmc_debug_level & MMC_DBG_BOOT) { \
+ if(NULL != strpbrk(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) \
+ do{ \
+ if(mmc_debug_level & MMC_DBG_ERROR) { \
+ if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "ERROR " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) \
+ do { \
+ if(mmc_debug_level & MMC_DBG_WARN) { \
+ if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "WARN " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) \
+ do { \
+ if(mmc_debug_level & MMC_DBG_INFO) { \
+ if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "INFO " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) \
+ do { \
+ if(mmc_debug_level & MMC_DBG_CMD) { \
+ if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "CMD " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) \
+ do { \
+ if(mmc_debug_level & MMC_DBG_SW_VOL) { \
+ if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
+ printk(DRIVER_PREFIX "SW-VOL " fmt "\n", ##arg);\
+ } \
+ } \
+ }while(0)
+#else
+#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) {printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);}
+#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...)
+#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...)
+#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...)
+#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...)
+#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...)
+#endif
+
+#if defined(CONFIG_DYNAMIC_DEBUG)
+ #define mmc_debug(level, fmt, arg...) \
+ do { \
+ if (unlikely(level & mmc_debug_level)) \
+ dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \
+ } while (0)
+#else
+ #define mmc_debug(level, fmt, arg...) \
+ do { \
+ if (unlikely(level & mmc_debug_level)) \
+ printk(KERN_DEBUG pr_fmt(DRIVER_PREFIX fmt "\n"), \
+ ##arg); \
+ } while (0)
+#endif
+
+#endif
+++ /dev/null
-/*
- * Synopsys DesignWare Multimedia Card Interface driver
- *
- * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#include "rk_sdmmc_of.h"
-
-u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR;//MMC_DBG_SW_VOL|MMC_DBG_CMD;//set the value refer to file rk_sdmmc_of.h
-char dbg_flag[]="mmc0mmc1mmc2";
-
-#if DW_MMC_OF_PROBE
-static void rockchip_mmc_of_dump(struct rk_sdmmc_of *rk_mmc_property)
-{
- printk("=========rockchip mmc dts dump info start== 2014-03-14 20:39 ======");
- mmc_debug(MMC_DBG_BOOT,"mmc,caps: 0x%x\n",rk_mmc_property->mmc_caps);
- mmc_debug(MMC_DBG_BOOT,"mmc,ocr: 0x%x\n",rk_mmc_property->mmc_ocr);
- mmc_debug(MMC_DBG_BOOT,"mmc,int: 0x%x\n",rk_mmc_property->mmc_int_type);
- mmc_debug(MMC_DBG_BOOT,"mmc,emmc_is_selected: 0x%x\n",rk_mmc_property->emmc_is_selected);
- mmc_debug(MMC_DBG_BOOT,"mmc,use_dma: %d %d\n",rk_mmc_property->mmc_dma_is_used[0],
- rk_mmc_property->mmc_dma_is_used[1]);
- mmc_debug(MMC_DBG_BOOT,"mmc,dma_ch: %d\n",rk_mmc_property->mmc_dma_chn);
- mmc_debug(MMC_DBG_BOOT,"=========rockchip mmc dts dump info end================\n");
-}
-
-
-void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *rk_mmc_property)
-{
- of_property_read_u32(np, "mmc,caps", &rk_mmc_property->mmc_caps);
- of_property_read_u32(np, "mmc,ocr", &rk_mmc_property->mmc_ocr);
- of_property_read_u32(np, "mmc,int", &rk_mmc_property->mmc_int_type);
- of_property_read_u32(np, "mmc,emmc_is_selected", &rk_mmc_property->emmc_is_selected);
- of_property_read_u32_array(np, "mmc,use_dma", rk_mmc_property->mmc_dma_is_used,2);
-/*
- if((&rk_mmc_property->mmc_dma_is_used[0] == MMC_USE_DMA))
- {
- if(rk_mmc_property->mmc_dma_is_used[1] == 0)
- rk_mmc_property->mmc_dma_name = "dma_mmc0";
- else if(rk_mmc_property->mmc_dma_is_used[1] == 1)
- rk_mmc_property->mmc_dma_name = "dma_mmc1";
- else
- rk_mmc_property->mmc_dma_name = "dma_mmc2";
-
- //of_property_read_string(np, "mmc,dma_name", &(rk_mmc_property->mmc_dma_name));
- of_property_read_u32(np, "mmc,dma_ch", &rk_mmc_property->mmc_dma_chn);
-
- }else{
- mmc_debug(MMC_DBG_WARN,"Device Tree configure mmc drivers to use pio!\n");
- }
- */
- rockchip_mmc_of_dump(rk_mmc_property);
- return ;
-
-}
-EXPORT_SYSMBOL(rockchip_mmc_of_probe);
-#endif /*DW_MMC_OF_PROBE*/
-
-
+++ /dev/null
-/*
- * Synopsys DesignWare Multimedia Card Interface driver
- *
- * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __RK_SDMMC_OF_H
-#define __RK_SDMMC_OF_H
-
-#include <linux/of_gpio.h>
-#include <linux/of_i2c.h>
-#include <linux/types.h>
-#include <linux/bitops.h>
-
-
-#define DRIVER_NAME "rk_sdmmc"
-#define DRIVER_PREFIX DRIVER_NAME ": "
-#define DRIVER_VER "Dw-mci-rockchip"
-#define DW_MMC_OF_PROBE 0
-
-enum MMC_DBG_MASK{
- MMC_DBG_NONE = 0,
- MMC_DBG_BOOT = BIT(0),
- MMC_DBG_ERROR= BIT(1),
- MMC_DBG_WARN = BIT(2),
- MMC_DBG_INFO = BIT(3),
- MMC_DBG_CMD = BIT(4),
- MMC_DBG_DBG = BIT(5),
- MMC_DBG_SW_VOL = BIT(6),
- MMC_DBG_ALL = 0xFF,
-
-};
-
-extern u32 mmc_debug_level;
-extern char dbg_flag[];
-
-#define MMC_DBG_FUNC_CONFIG 1
-#if MMC_DBG_FUNC_CONFIG
-#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) \
- do { \
- if(mmc_debug_level & MMC_DBG_BOOT) { \
- if(NULL != strpbrk(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) \
- do{ \
- if(mmc_debug_level & MMC_DBG_ERROR) { \
- if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "ERROR " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) \
- do { \
- if(mmc_debug_level & MMC_DBG_WARN) { \
- if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "WARN " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) \
- do { \
- if(mmc_debug_level & MMC_DBG_INFO) { \
- if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "INFO " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) \
- do { \
- if(mmc_debug_level & MMC_DBG_CMD) { \
- if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "CMD " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) \
- do { \
- if(mmc_debug_level & MMC_DBG_SW_VOL) { \
- if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \
- printk(DRIVER_PREFIX "SW-VOL " fmt "\n", ##arg);\
- } \
- } \
- }while(0)
-#else
-#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) {printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);}
-#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...)
-#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...)
-#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...)
-#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...)
-#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...)
-#endif
-
-#if defined(CONFIG_DYNAMIC_DEBUG)
- #define mmc_debug(level, fmt, arg...) \
- do { \
- if (unlikely(level & mmc_debug_level)) \
- dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \
- } while (0)
-#else
- #define mmc_debug(level, fmt, arg...) \
- do { \
- if (unlikely(level & mmc_debug_level)) \
- printk(KERN_DEBUG pr_fmt(DRIVER_PREFIX fmt "\n"), \
- ##arg); \
- } while (0)
-#endif
-
-#if DW_MMC_OF_PROBE
-struct rk_sdmmc_of
-{
- u32 mmc_caps;
- u32 mmc_int_type;
- u32 mmc_ocr;
- u32 mmc_dma_is_used[2]; /*Bit 1: use dma or not ; Bit 2:general dma or idma*/
- u32 emmc_is_selected;
- u32 mmc_dma_chn;
- const char *mmc_dma_name;
-
-};
-#endif /*DW_MMC_OF_PROBE*/
-
-#endif