/*
* $QNXLicenseC:
* Copyright 2014, QNX Software Systems.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You
* may not reproduce, modify or distribute this software except in
* compliance with the License. You may obtain a copy of the License
* at: http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OF ANY KIND, either express or implied.
*
* This file may contain contributions from others, either as
* contributors under the License or as licensors under other terms.
* Please review this entire file for other proprietary rights or license
* notices, as well as the QNX Development Suite License Guide at
* http://licensing.qnx.com/license-guide/ for other information.
* $
*/
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <malloc.h>
#include <unistd.h>
#include <hw/inout.h>
#include <sys/mman.h>
#include <sys/rsrcdbmgr.h>
#include <internal.h>
#ifdef SDIO_HC_OMAP
#ifdef SDIO_OMAP_BUS_SYNC
#include <arm/mmu.h>
#include <fcntl.h>
#endif
//#define OMAP_DEBUG
#include <omap.h>
static int omap_pwr( sdio_hc_t *hc, int vdd );
static int omap_drv_type( sdio_hc_t *hc, int type );
static int omap_bus_mode( sdio_hc_t *hc, int bus_mode );
static int omap_bus_width( sdio_hc_t *hc, int width );
static int omap_clk( sdio_hc_t *hc, int clk );
static int omap_timing( sdio_hc_t *hc, int timing );
static int omap_signal_voltage( sdio_hc_t *hc, int signal_voltage );
static int omap_cd( sdio_hc_t *hc );
static int omap_pm( sdio_hc_t *hc, int op );
static int omap_cmd( sdio_hc_t *hc, sdio_cmd_t *cmd );
static int omap_abort( sdio_hc_t *hc, sdio_cmd_t *cmd );
static int omap_event( sdio_hc_t *hc, sdio_event_t *ev );
static int omap_tune( sdio_hc_t *hc, int op );
static int omap_preset( sdio_hc_t *hc, int enable );
static int omap_set_dll( sdio_hc_t *hc, int delay );
static sdio_hc_entry_t omap_hc_entry = { 16,
omap_dinit, omap_pm,
omap_cmd, omap_abort,
omap_event, omap_cd, omap_pwr,
omap_clk, omap_bus_mode,
omap_bus_width, omap_timing,
omap_signal_voltage, omap_drv_type,
NULL, omap_tune, omap_preset,
};
// EDMA is "Enhanced Direct Memory Access"
// EDMA initialization
static int edma3_init(const sdio_hc_t *hc);
// EDMA termination
static int edma3_dinit(edma3_data_t* edma);
// Setup a scatter receive (transfer from a device I/O port to memory buffers),
// or a gather transmit (transfer from memory buffers to a device I/O port).
// Works fine also with just one buffer, so there's no need to have
// separate code for single buffer I/O.
//
// Returns 0 if no errors were detected, nonzero otherwise.
//
// Currently the only possible error is EINVAL - Invalid argument.
//
static int edma3_setup_transfer(
edma3_data_t* edma,
unsigned port, // The data I/O port
int receiving, // Nonzero if receiving, zero if transmitting
unsigned block_size, // Block size to be used
const sdio_sge_t* sgp, // Pointer to the scatter gather fragment descriptors
unsigned fragment_count // Number of scatter gather fragments
);
// Verify that a transfer has really completed.
static void edma3_verify_completion(edma3_data_t* edma);
// Cleanup at the end of a completed transfer
static void edma3_transfer_done(edma3_data_t* edma);
// Cleanup at the end of a failed or aborted transfer
static void edma3_transfer_failed(edma3_data_t* edma);
// this is the registers database, per device and per block
typedef struct {
uint32_t physbase; // MC module physical base address
uint32_t clkctrl_phys; // PRCM clkctrl physical address
uint32_t context_phys; // PRCM context register physical address
} pm_info_t;
// Definition of OMAP4 PM info
pm_info_t omap4_info[] = {
{ .physbase = MMCHS1_BASE, .clkctrl_phys = OMAP4_MMC1_CLKCTRL, .context_phys = OMAP4_MMC1_CONTEXT },
{ .physbase = MMCHS2_BASE, .clkctrl_phys = OMAP4_MMC2_CLKCTRL, .context_phys = OMAP4_MMC2_CONTEXT },
{ .physbase = -1, .clkctrl_phys = -1, .context_phys = -1 },
};
// Definition of OMAP5 ES1 PM info
pm_info_t omap5_es1_info[] = {
{ .physbase = MMCHS1_BASE, .clkctrl_phys = OMAP5_ES1_MMC1_CLKCTRL, .context_phys = OMAP5_ES1_MMC1_CONTEXT },
{ .physbase = MMCHS2_BASE, .clkctrl_phys = OMAP5_ES1_MMC2_CLKCTRL, .context_phys = OMAP5_ES1_MMC2_CONTEXT },
{ .physbase = MMCHS3_BASE, .clkctrl_phys = OMAP5_ES1_MMC3_CLKCTRL, .context_phys = OMAP5_ES1_MMC3_CONTEXT },
{ .physbase = MMCHS4_BASE, .clkctrl_phys = OMAP5_ES1_MMC4_CLKCTRL, .context_phys = OMAP5_ES1_MMC4_CONTEXT },
{ .physbase = MMCHS5_BASE, .clkctrl_phys = OMAP5_ES1_MMC5_CLKCTRL, .context_phys = OMAP5_ES1_MMC5_CONTEXT },
{ .physbase = -1, .clkctrl_phys = -1, .context_phys = -1 },
};
// Definition of OMAP5 ES2 PM info
pm_info_t omap5_es2_info[] = {
{ .physbase = MMCHS1_BASE, .clkctrl_phys = OMAP5_ES2_MMC1_CLKCTRL, .context_phys = OMAP5_ES2_MMC1_CONTEXT },
{ .physbase = MMCHS2_BASE, .clkctrl_phys = OMAP5_ES2_MMC2_CLKCTRL, .context_phys = OMAP5_ES2_MMC2_CONTEXT },
{ .physbase = MMCHS3_BASE, .clkctrl_phys = OMAP5_ES2_MMC3_CLKCTRL, .context_phys = OMAP5_ES2_MMC3_CONTEXT },
{ .physbase = MMCHS4_BASE, .clkctrl_phys = OMAP5_ES2_MMC4_CLKCTRL, .context_phys = OMAP5_ES2_MMC4_CONTEXT },
{ .physbase = MMCHS5_BASE, .clkctrl_phys = OMAP5_ES2_MMC5_CLKCTRL, .context_phys = OMAP5_ES2_MMC5_CONTEXT },
{ .physbase = -1, .clkctrl_phys = -1, .context_phys = -1 },
};
pm_info_t dra7xx_info[] = {
{ .physbase = MMCHS1_BASE, .clkctrl_phys = DRA7XX_MMC1_CLKCTRL, .context_phys = DRA7XX_MMC1_CONTEXT },
{ .physbase = MMCHS2_BASE, .clkctrl_phys = DRA7XX_MMC2_CLKCTRL, .context_phys = DRA7XX_MMC2_CONTEXT },
{ .physbase = MMCHS3_BASE, .clkctrl_phys = DRA7XX_MMC3_CLKCTRL, .context_phys = DRA7XX_MMC3_CONTEXT },
{ .physbase = MMCHS4_BASE, .clkctrl_phys = DRA7XX_MMC4_CLKCTRL, .context_phys = DRA7XX_MMC4_CONTEXT },
{ .physbase = -1, .clkctrl_phys = -1, .context_phys = -1 },
};
#ifdef OMAP_DEBUG
static int omap_reg_dump( sdio_hc_t *hc, const char *func, int line )
{
omap_hc_mmchs_t *mmchs;
uintptr_t base;
mmchs = (omap_hc_mmchs_t *)hc->cs_hdl;
base = mmchs->mmc_base;
sdio_slogf( _SLOGC_SDIODI, _SLOG_ERROR, 1, 1, "%s: line %d", func, line );
if( hc->cfg.did == OMAP_DID_34XX ) {
sdio_slogf( _SLOGC_SDIODI, _SLOG_ERROR, 1, 1, "%s: SYSSTATUS %x, REV %x, CAPA %x, CAPA2 %x, MCCAP %x, SYSTEST %x, FE %x",
__FUNCTION__,
in32( base + MMCHS_SYSSTATUS ),
in32( base + MMCHS_REV ),
in32( base + MMCHS_CAPA ),
in32( base + MMCHS_CAPA2 ),
in32( base + MMCHS_MCCAP ),
in32( base + MMCHS_SYSTEST ),
in32( base + MMCHS_FE ) );
}
else {
sdio_slogf( _SLOGC_SDIODI, _SLOG_ERROR, 1, 1, "%s: HL_REV %x, HL_HWINFO %x, HL_SYSCONFIG %x, SYSSTATUS %x, REV %x, CAPA %x, CAPA2 %x, MCCAP %x, SYSTEST %x, FE %x",
__FUNCTION__,
in32( base + MMCHS_HL_REV ),
in32( base + MMCHS_HL_HWINFO ),
in32( base + MMCHS_HL_SYSCONFIG ),
in32( base + MMCHS_SYSSTATUS ),
in32( base + MMCHS_REV ),
in32( base + MMCHS_CAPA ),
in32( base + MMCHS_CAPA2 ),
in32( base + MMCHS_MCCAP ),
in32( base + MMCHS_SYSTEST ),
in32( base + MMCHS_FE ) );
}
sdio_slogf( _SLOGC_SDIODI, _SLOG_ERROR, 1, 1, "%s: CSRE %x, CON %x, PWCNT %x, BLK %x, ARG %x, CMD %x, RSP10 %x, RSP32 %x, RSP54 %x, RSP76 %x",
__FUNCTION__,
in32( base + MMCHS_CSRE ),
in32( base + MMCHS_CON ),
in32( base + MMCHS_PWCNT ),
in32( base + MMCHS_BLK ),
in32( base + MMCHS_ARG ),
in32( base + MMCHS_CMD ),
in32( base + MMCHS_RSP10 ),
in32( base + MMCHS_RSP32 ),
in32( base + MMCHS_RSP54 ),
in32( base + MMCHS_RSP76 ) );
sdio_slogf( _SLOGC_SDIODI, _SLOG_ERROR, 1, 1, "%s: PSTATE %x, HCTL %x, SYSCTL %x, STAT %x, IE %x, ISE %x, AC12 %x, ADMAES %x ADMASAL %x",
__FUNCTION__,
in32( base + MMCHS_PSTATE ),
in32( base + MMCHS_HCTL ),
in32( base + MMCHS_SYSCTL ),
in32( base + MMCHS_STAT ),
in32(
没有合适的资源?快使用搜索试试~ 我知道了~
QNX SDP 6.6 BSP for the Freescale i.XM6 Solo X Sabre SDB
共942个文件
c:436个
h:178个
s:163个
5星 · 超过95%的资源 需积分: 24 25 下载量 174 浏览量
2018-09-20
11:35:47
上传
评论 3
收藏 5.73MB ZIP 举报
温馨提示
1、QNX BSP开发包,提供了IMX6处理器 QNX SDP 6.6 BSP for the Freescale i.XM6 Solo X Sabre SDB BSP包;2、提供了相关的串口、以太网、USB等等驱动
资源推荐
资源详情
资源评论
收起资源包目录
QNX SDP 6.6 BSP for the Freescale i.XM6 Solo X Sabre SDB (942个子文件)
libdma-sdma-imx6x.so.1 31KB
libgpio.so.1 19KB
libstartup.a 784KB
libipl.a 77KB
libdma-sdma-imx6xS.a 23KB
libdma-sdma-imx6x.a 21KB
libi2c-master.a 21KB
callout.ah 2KB
ipl-mx6sx-sabre-sdb.bin 13KB
sabreSDB.build 10KB
build 10KB
omap.c 80KB
sim_sdmmc.c 75KB
mxssi_dll.c 68KB
base.c 52KB
detect.c 40KB
wm8962.c 37KB
mii.c 36KB
imx6.c 33KB
mmc.c 33KB
sdhci.c 32KB
pxiv.c 29KB
rcar_sdhi.c 28KB
sd.c 27KB
api.c 25KB
tto.c 25KB
sdmmc.c 24KB
sim_bs.c 23KB
omap_sdmmc.c 22KB
atmel-hsmci.c 21KB
mx6sx_board_init.c 21KB
main.c 20KB
arm_map_lpae.c 19KB
ptp.c 18KB
pic_ep9301.c 18KB
ep93xx_pll_clk.c 17KB
rcar_mmcif.c 17KB
mx_sdmmc.c 17KB
transmit.c 17KB
restore_ifs.c 16KB
sim_assd.c 16KB
print_sysp.c 15KB
card.c 15KB
omap_uhs.c 14KB
hwi_ep9301.c 14KB
fat-fs.c 13KB
mem_tests.c 13KB
asmoff.c 12KB
cmd.c 12KB
mx6sx_get_clocks.c 12KB
ram.c 12KB
bs.c 12KB
md5c.c 11KB
intr.c 11KB
init_system_private.c 10KB
bsd_media.c 10KB
ep93xx_syscfg.c 10KB
sdma_copy.c 10KB
init_intrinfo.c 9KB
omap_i2c.c 9KB
init.c 9KB
options.c 9KB
receive.c 8KB
omap_i2c.c 8KB
hwi_imx6sx_sabre_sdb.c 8KB
event.c 8KB
arm_map.c 7KB
mx6x_i2c.c 7KB
omap5_dpll_init.c 7KB
devctl.c 7KB
main.c 6KB
omap4_dpll_init.c 6KB
mx6sx_init_usb.c 6KB
mx6sx_i2c.c 6KB
callouts.c 6KB
arm_cache.c 6KB
syspage_memory.c 6KB
main.c 6KB
hwi_imx51.c 6KB
init_qtime_ep93xx.c 6KB
init_audio.c 6KB
wait.c 6KB
armv_setup_a9mp.c 6KB
common_options.c 5KB
pci.c 5KB
init.c 5KB
arm_lpae_debug.c 5KB
cpu_syspage_memory.c 5KB
init_cpuinfo.c 5KB
init.c 5KB
armv_setup_v7.c 5KB
omap4_init_gpio.c 5KB
omap4_padconf.c 5KB
elf.c 5KB
init_cacheattr.c 5KB
hw_ser_ep93xx.c 5KB
image_download_primecell.c 5KB
init_smp.c 5KB
stats.c 5KB
init_mmu_lpae.c 5KB
共 942 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
- cuilinguo2021-03-25谢谢分享,可以参考
janet2013t
- 粉丝: 199
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功