mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
mmc: host: rockchip: disable DW_MMC_OF_PROBE and excv fromdos src-files
This commit is contained in:
@@ -185,17 +185,19 @@ static const struct of_device_id dw_mci_rockchip_match[] = {
|
||||
};
|
||||
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
|
||||
|
||||
#define DW_MMC_OF_PROBE 0
|
||||
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;
|
||||
|
||||
#if DW_MMC_OF_PROBE
|
||||
rk_mmc_property = (struct rk_sdmmc_of *)kmalloc(sizeof(struct rk_sdmmc_of),GFP_KERNEL);
|
||||
if(NULL == rk_mmc_property)
|
||||
{
|
||||
|
||||
@@ -420,9 +420,12 @@ static void dw_mci_idmac_complete_dma(struct dw_mci *host)
|
||||
struct mmc_data *data = host->data;
|
||||
|
||||
dev_vdbg(host->dev, "DMA complete\n");
|
||||
// MMC_DBG_CMD_FUNC(host->mmc," DMA complete cmd=%d(arg=0x%x), blocks=%d,blksz=%d[%s]", \
|
||||
// host->mrq->cmd->opcode,host->mrq->cmd->arg,data->blocks,data->blksz,mmc_hostname(host->mmc));
|
||||
|
||||
/*
|
||||
MMC_DBG_CMD_FUNC(host->mmc," DMA complete cmd=%d(arg=0x%x), blocks=%d,blksz=%d[%s]", \
|
||||
host->mrq->cmd->opcode,host->mrq->cmd->arg,data->blocks,data->blksz,mmc_hostname(host->mmc));
|
||||
*/
|
||||
|
||||
host->dma_ops->cleanup(host);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,60 +1,62 @@
|
||||
/*
|
||||
* 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_ERROR;//MMC_DBG_CMD//set the value refer to file rk_sdmmc_of.h
|
||||
char dbg_flag[]="mmc0mmc1mmc2";
|
||||
|
||||
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);
|
||||
|
||||
|
||||
/*
|
||||
* 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_ERROR;//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*/
|
||||
|
||||
|
||||
|
||||
@@ -1,115 +1,120 @@
|
||||
/*
|
||||
* 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 ": "
|
||||
|
||||
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_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)
|
||||
#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...)
|
||||
#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
|
||||
|
||||
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
|
||||
/*
|
||||
* 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_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)
|
||||
#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...)
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user