Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
15
sdk/include/dev/spi/hgic_sdspi.h
Normal file
15
sdk/include/dev/spi/hgic_sdspi.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef _HGIC_SDSPI_H_
|
||||
#define _HGIC_SDSPI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int32 hgic_sdspi_attach(uint32 dev_id, uint32 spi_dev);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
57
sdk/include/dev/spi/hgspi_v1.h
Normal file
57
sdk/include/dev/spi/hgspi_v1.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _HGSPI_V1_H_
|
||||
#define _HGSPI_V1_H_
|
||||
#include "hal/spi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct hgspi_v1 {
|
||||
struct spi_device dev;
|
||||
uint32 hw;
|
||||
uint32 irq_num;
|
||||
spi_irq_hdl irq_hdl;
|
||||
uint32 irq_data;
|
||||
//os_mutex_t os_spi_tx_lock;
|
||||
//os_mutex_t os_spi_rx_lock;
|
||||
os_mutex_t os_spi_lock;
|
||||
os_semaphore_t os_spi_tx_done;
|
||||
os_semaphore_t os_spi_rx_done;
|
||||
uint32 timeout;
|
||||
uint16 len_threshold;
|
||||
uint16 spi_tx_done :1,
|
||||
spi_rx_done :1,
|
||||
spi_irq_flag_tx_done :1,
|
||||
spi_irq_flag_rx_done :1,
|
||||
spi_tx_async :1,
|
||||
spi_rx_async :1,
|
||||
opened :1,
|
||||
dsleep :1;
|
||||
#ifdef CONFIG_SLEEP
|
||||
struct {
|
||||
uint32 con0;
|
||||
uint32 con1;
|
||||
uint32 baud;
|
||||
uint32 tdmalen;
|
||||
uint32 rdmalen;
|
||||
uint32 tstadr;
|
||||
uint32 rstadr;
|
||||
uint32 slavesta;
|
||||
uint32 ssp_dly;
|
||||
}bp_regs;
|
||||
uint32 bp_irq_flags;
|
||||
spi_irq_hdl bp_irq_hdl;
|
||||
uint32 bp_irq_data;
|
||||
os_mutex_t bp_suspend_lock;
|
||||
os_mutex_t bp_resume_lock;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
int32 hgspi_v1_attach(uint32 dev_id, struct hgspi_v1 *p_spi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HGSPI_V1_H_ */
|
||||
28
sdk/include/dev/spi/hgspi_v2.h
Normal file
28
sdk/include/dev/spi/hgspi_v2.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef _HGSPI_V2_H
|
||||
#define _HGSPI_V2_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct hgspi_v2 {
|
||||
struct spi_device dev;
|
||||
uint32 hw ;
|
||||
spi_irq_hdl irq_hdl ;
|
||||
uint32 irq_data;
|
||||
uint32 irq_num ;
|
||||
uint16 opened ;
|
||||
uint16 spi_irq_flag_tx_done: 1,
|
||||
spi_irq_flag_rx_done: 1;
|
||||
};
|
||||
|
||||
|
||||
int32 hgspi_v2_attach(uint32 dev_id, struct hgspi_v2 *spi);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
69
sdk/include/dev/spi/hgspi_v3.h
Normal file
69
sdk/include/dev/spi/hgspi_v3.h
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _HGSPI_V3_H_
|
||||
#define _HGSPI_V3_H_
|
||||
#include "hal/spi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct hgspi_v3 {
|
||||
struct spi_device dev;
|
||||
uint32 hw;
|
||||
uint32 irq_num;
|
||||
spi_irq_hdl irq_hdl;
|
||||
uint32 irq_data;
|
||||
//os_mutex_t os_spi_tx_lock;
|
||||
//os_mutex_t os_spi_rx_lock;
|
||||
os_mutex_t os_spi_lock;
|
||||
os_semaphore_t os_spi_tx_done;
|
||||
os_semaphore_t os_spi_rx_done;
|
||||
uint32 timeout;
|
||||
uint16 len_threshold;
|
||||
uint16 spi_tx_done :1,
|
||||
spi_rx_done :1,
|
||||
spi_irq_flag_tx_done :1,
|
||||
spi_irq_flag_rx_done :1,
|
||||
spi_tx_async :1,
|
||||
spi_rx_async :1,
|
||||
opened :1,
|
||||
dsleep :1;
|
||||
#ifdef CONFIG_SLEEP
|
||||
struct {
|
||||
uint32 con0;
|
||||
uint32 con1;
|
||||
uint32 cmd_data;
|
||||
uint32 timecon;
|
||||
uint32 tdmalen;
|
||||
uint32 rdmalen;
|
||||
uint32 tdmacnt;
|
||||
uint32 rdmacnt;
|
||||
uint32 tstadr;
|
||||
uint32 rstadr;
|
||||
uint32 sta1;
|
||||
uint32 sta2;
|
||||
uint32 slavesta;
|
||||
uint32 ownadrcon;
|
||||
uint32 rbuf;
|
||||
uint32 timeoutcon;
|
||||
uint32 rxtimeoutcon;
|
||||
uint32 rstadr1;
|
||||
uint32 vsync_tcon;
|
||||
uint32 hsync_tcon;
|
||||
}bp_regs;
|
||||
|
||||
uint32 bp_irq_flags;
|
||||
spi_irq_hdl bp_irq_hdl;
|
||||
uint32 bp_irq_data;
|
||||
os_mutex_t bp_suspend_lock;
|
||||
os_mutex_t bp_resume_lock;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
int32 hgspi_v3_attach(uint32 dev_id, struct hgspi_v3 *p_spi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HGSPI_V3_H_ */
|
||||
147
sdk/include/dev/spi/hgspi_xip.h
Normal file
147
sdk/include/dev/spi/hgspi_xip.h
Normal file
@@ -0,0 +1,147 @@
|
||||
#ifndef _HGSPI_XIP_H_
|
||||
#define _HGSPI_XIP_H_
|
||||
#include "hal/spi.h"
|
||||
#include "osal/task.h"
|
||||
#include "list.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum hgspi_xip_flags {
|
||||
hgspi_xip_flags_ready,
|
||||
hgspi_xip_flags_suspend,
|
||||
hgspi_xip_flags_suspend_pasr,
|
||||
hgspi_xip_flags_suspend_ulp,
|
||||
hgspi_xip_flags_suspend_pd,
|
||||
hgspi_xip_flags_wip,
|
||||
hgspi_xip_flags_xip,
|
||||
};
|
||||
|
||||
struct xip_wip {
|
||||
uint32 addrl;
|
||||
uint32 addru;
|
||||
uint32 addr;
|
||||
uint32 tsr :16,
|
||||
trs :16;
|
||||
uint32 tsus :16,
|
||||
trus :16;
|
||||
struct os_semaphore rc;
|
||||
struct os_task task;
|
||||
};
|
||||
|
||||
struct rdcfg_bk {
|
||||
uint32_t rdinstr;
|
||||
uint32_t rd_capt;
|
||||
};
|
||||
|
||||
|
||||
struct hgspi_xip {
|
||||
struct spi_device dev;
|
||||
uint32_t hw;
|
||||
uint32_t ddr : 1,
|
||||
nbp : 1,
|
||||
xip : 1,
|
||||
flags : 29;
|
||||
uint32_t tms; //io timeout ms
|
||||
uint16_t tdp : 8,
|
||||
trst : 8;
|
||||
struct xip_wip wip;
|
||||
struct rdcfg_bk def_cfg;
|
||||
struct rdcfg_bk dtr_cfg;
|
||||
#ifdef CONFIG_SLEEP
|
||||
uint32 regs[30];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct hgcqspi {
|
||||
//struct qspi_device dev;
|
||||
void *hw;
|
||||
uint32 irq_num;
|
||||
//qspi_irq_hdl irq_hdl;
|
||||
uint32 irq_data;
|
||||
uint32 opened;
|
||||
uint32 flags;
|
||||
};
|
||||
|
||||
struct hgxip_flash_custom_opa {
|
||||
uint8_t dummys; //最大31,内部默认有24个dummys
|
||||
uint8_t cmd;
|
||||
uint16_t size;
|
||||
uint32_t addr;
|
||||
uint8_t *buf;
|
||||
};
|
||||
|
||||
struct hgxip_flash_custom_read {
|
||||
uint8_t dummys; //最大31,内部默认有24个dummys
|
||||
uint8_t cmd;
|
||||
uint16_t size;
|
||||
uint32_t addr;
|
||||
uint8_t *buf;
|
||||
};
|
||||
|
||||
struct hgxip_flash_custom_write {
|
||||
struct hgxip_flash_custom_opa opa;
|
||||
};
|
||||
|
||||
struct hgxip_flash_reg_opt_param
|
||||
{
|
||||
uint8_t cmd;
|
||||
/* write opt when pre_cmd is valid(0xFF != pre_cmd); e.g.: 0x06/0x50 */
|
||||
uint8_t pre_cmd;
|
||||
uint8_t len;
|
||||
uint8_t *buf;
|
||||
};
|
||||
|
||||
|
||||
enum MSROM_FUNC
|
||||
{
|
||||
#ifdef TXW82X
|
||||
MSROM_MEMSET,
|
||||
MSROM_MEMCPY,
|
||||
MSROM_MEMCMP,
|
||||
MSROM_QSPI_CMD_BUSY_WAIT,
|
||||
MSROM_HIGHPASS_FILTER_100HZ_ASM,
|
||||
MSROM_QSPI_XIP_ERASE,
|
||||
MSROM_QSPI_XIP_READ,
|
||||
MSROM_QSPI_XIP_WRITE,
|
||||
MSROM_QSPI_XIP_OPT_ENTER,
|
||||
MSROM_QSPI_XIP_OPT_EXIT,
|
||||
MSROM_QSPI_ENTER_XIP_MODE,
|
||||
MSROM_QSPI_EXIT_XIP_MODE, // NULL?
|
||||
MSROM_QSPI_STIG,
|
||||
MSROM_QSPI_ENTER_4B,
|
||||
MSROM_QSPI_EXIT_4B,
|
||||
MSROM_OSPI_SEND_SEQ,
|
||||
MSROM_SYSCLK_SET_BUT_QSPI_CHAOS_DO,
|
||||
#else
|
||||
MSROM_MEMSET,
|
||||
MSROM_MEMCPY,
|
||||
MSROM_MEMCMP,
|
||||
MSROM_STRCASECMP,
|
||||
MSROM_QSPI_CMD_BUSY_WAIT = MSROM_STRCASECMP,
|
||||
MSROM_STRNCASECMP,
|
||||
MSROM_HIGHPASS_FILTER_100HZ_ASM = MSROM_STRNCASECMP,
|
||||
MSROM_QSPI_XIP_ERASE,
|
||||
MSROM_QSPI_XIP_READ,
|
||||
MSROM_QSPI_XIP_WRITE,
|
||||
MSROM_QSPI_XIP_OPT_ENTER,
|
||||
MSROM_QSPI_XIP_OPT_EXIT,
|
||||
MSROM_QSPI_ENTER_XIP_MODE,
|
||||
MSROM_QSPI_EXIT_XIP_MODE,
|
||||
MSROM_QSPI_STIG,
|
||||
MSROM_OSPI_PSRAM_MRR,
|
||||
MSROM_OSPI_PSRAM_MRW,
|
||||
MSROM_OSPI_STIG,
|
||||
#endif
|
||||
};
|
||||
|
||||
int32 hgspi_xip_attach(uint32 dev_id, struct hgspi_xip *p_spi);
|
||||
uint32_t get_msrom_func(uint32_t func_code);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HGSPI_V1_H_ */
|
||||
|
||||
Reference in New Issue
Block a user