mirror of
https://github.com/drasko/open-ameba.git
synced 2024-11-25 15:34:18 +00:00
delete '!!!'
This commit is contained in:
parent
de57c04fb4
commit
ed4c83a935
44 changed files with 206 additions and 187 deletions
|
@ -314,7 +314,7 @@ static int wps_connect_to_AP_by_certificate(rtw_network_info_t *wifi)
|
||||||
if(retry_count == RETRY_COUNT)
|
if(retry_count == RETRY_COUNT)
|
||||||
rtw_msleep_os(1000); //When start wps with OPEN AP, AP will send a disassociate frame after STA connected, need reconnect here.
|
rtw_msleep_os(1000); //When start wps with OPEN AP, AP will send a disassociate frame after STA connected, need reconnect here.
|
||||||
if(RTW_SUCCESS == wifi_is_connected_to_ap( )){
|
if(RTW_SUCCESS == wifi_is_connected_to_ap( )){
|
||||||
//printf("\r\n[WPS]Ready to tranceive!!\n");
|
//printf("\r\n[WPS]Ready to tranceive!\n");
|
||||||
wps_check_and_show_connection_info();
|
wps_check_and_show_connection_info();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -501,7 +501,7 @@ int wps_start(u16 wps_config, char *pin, u8 channel, char *ssid)
|
||||||
wifi_set_wps_phase(ENABLE);
|
wifi_set_wps_phase(ENABLE);
|
||||||
ret = wps_connect_to_AP_by_open_system(target_ssid);
|
ret = wps_connect_to_AP_by_open_system(target_ssid);
|
||||||
if(ret < 0){
|
if(ret < 0){
|
||||||
printf("WPS: WPS Fail!!\n");
|
printf("WPS: WPS Fail!\n");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
os_xqueue_receive(queue_for_credential, &dev_cred, 120);
|
os_xqueue_receive(queue_for_credential, &dev_cred, 120);
|
||||||
|
@ -511,9 +511,9 @@ int wps_start(u16 wps_config, char *pin, u8 channel, char *ssid)
|
||||||
ret = wps_connect_to_AP_by_certificate(&wifi);
|
ret = wps_connect_to_AP_by_certificate(&wifi);
|
||||||
goto exit1;
|
goto exit1;
|
||||||
} else {
|
} else {
|
||||||
printf("WPS: WPS FAIL!!!\n");
|
printf("WPS: WPS FAIL!\n");
|
||||||
// printf("\n\rWPS: WPS FAIL!!!\n");
|
// printf("\n\rWPS: WPS FAIL!\n");
|
||||||
// printf("\n\rWPS: WPS FAIL!!!\n");
|
// printf("\n\rWPS: WPS FAIL!\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ int wifi_rf_off(void)
|
||||||
int wifi_on(rtw_mode_t mode)
|
int wifi_on(rtw_mode_t mode)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
//pvvx int timeout = 20; // 20 sec ??!!
|
//pvvx int timeout = 20; // 20 sec ?!
|
||||||
int timeout = wifi_test_timeout_ms/wifi_test_timeout_step_ms;
|
int timeout = wifi_test_timeout_ms/wifi_test_timeout_step_ms;
|
||||||
int idx;
|
int idx;
|
||||||
int devnum = 1;
|
int devnum = 1;
|
||||||
|
@ -1063,7 +1063,7 @@ int wifi_on(rtw_mode_t mode)
|
||||||
int wifi_off(void)
|
int wifi_off(void)
|
||||||
{
|
{
|
||||||
// int ret = 0;
|
// int ret = 0;
|
||||||
//pvvx int timeout = 20; // 20 sec ??!!
|
//pvvx int timeout = 20; // 20 sec ?!
|
||||||
int timeout = wifi_test_timeout_ms/10;
|
int timeout = wifi_test_timeout_ms/10;
|
||||||
|
|
||||||
if((rltk_wlan_running(WLAN0_IDX) == 0) &&
|
if((rltk_wlan_running(WLAN0_IDX) == 0) &&
|
||||||
|
|
|
@ -999,7 +999,7 @@ void print_simple_config_result(enum sc_result sc_code)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
switch (sc_code) {
|
switch (sc_code) {
|
||||||
case SC_NO_CONTROLLER_FOUND:
|
case SC_NO_CONTROLLER_FOUND:
|
||||||
printf("Simple Config timeout!! Can't get Ap profile. Please try again\n");
|
printf("Simple Config timeout! Can't get Ap profile. Please try again\n");
|
||||||
break;
|
break;
|
||||||
case SC_CONTROLLER_INFO_PARSE_FAIL:
|
case SC_CONTROLLER_INFO_PARSE_FAIL:
|
||||||
printf("Simple Config fail, cannot parse target ap info from controller\n");
|
printf("Simple Config fail, cannot parse target ap info from controller\n");
|
||||||
|
@ -1014,7 +1014,7 @@ void print_simple_config_result(enum sc_result sc_code)
|
||||||
printf("Simple Config fail, cannot get dhcp ip address\n");
|
printf("Simple Config fail, cannot get dhcp ip address\n");
|
||||||
break;
|
break;
|
||||||
case SC_UDP_SOCKET_CREATE_FAIL:
|
case SC_UDP_SOCKET_CREATE_FAIL:
|
||||||
printf("Simple Config Ack socket create fail!!!\n");
|
printf("Simple Config Ack socket create fail!\n");
|
||||||
break;
|
break;
|
||||||
case SC_TERMINATE:
|
case SC_TERMINATE:
|
||||||
printf("Simple Config terminate\n");
|
printf("Simple Config terminate\n");
|
||||||
|
|
|
@ -153,7 +153,7 @@ int uartadapter_uart_read(ua_socket_t *ua_socket, void *read_buf, size_t size)
|
||||||
if(!ua_socket->uart.overlap){
|
if(!ua_socket->uart.overlap){
|
||||||
memcpy(ptr, (ua_socket->uart.recv_buf+ pread_local), read_bytes );
|
memcpy(ptr, (ua_socket->uart.recv_buf+ pread_local), read_bytes );
|
||||||
}else {
|
}else {
|
||||||
ua_printf(UA_DEBUG, "uart recv buf is write overlap!!");
|
ua_printf(UA_DEBUG, "uart recv buf is write overlap!");
|
||||||
if((pread_local + read_bytes) > UA_UART_RECV_BUFFER_LEN){
|
if((pread_local + read_bytes) > UA_UART_RECV_BUFFER_LEN){
|
||||||
memcpy(ptr,(ua_socket->uart.recv_buf+ pread_local),(UA_UART_RECV_BUFFER_LEN-pread_local));
|
memcpy(ptr,(ua_socket->uart.recv_buf+ pread_local),(UA_UART_RECV_BUFFER_LEN-pread_local));
|
||||||
memcpy(ptr+(UA_UART_RECV_BUFFER_LEN-pread_local), ua_socket->uart.recv_buf,read_bytes-(UA_UART_RECV_BUFFER_LEN- pread_local));
|
memcpy(ptr+(UA_UART_RECV_BUFFER_LEN-pread_local), ua_socket->uart.recv_buf,read_bytes-(UA_UART_RECV_BUFFER_LEN- pread_local));
|
||||||
|
@ -187,7 +187,7 @@ int uartadapter_uart_write(ua_socket_t *ua_socket, char *pbuf, size_t size)
|
||||||
while(RtlDownSema(&ua_socket->uart.dma_tx) == pdTRUE){
|
while(RtlDownSema(&ua_socket->uart.dma_tx) == pdTRUE){
|
||||||
ret = serial_send_stream_dma(&ua_socket->uart.uart_sobj, pbuf, size);
|
ret = serial_send_stream_dma(&ua_socket->uart.uart_sobj, pbuf, size);
|
||||||
if(ret != HAL_OK){
|
if(ret != HAL_OK){
|
||||||
ua_printf(UA_ERROR, "uart dma tx error %d!!", ret);
|
ua_printf(UA_ERROR, "uart dma tx error %d!", ret);
|
||||||
RtlUpSema(&ua_socket->uart.dma_tx);
|
RtlUpSema(&ua_socket->uart.dma_tx);
|
||||||
return -1;
|
return -1;
|
||||||
}else{
|
}else{
|
||||||
|
@ -459,7 +459,7 @@ void uartadapter_systemreload(void)
|
||||||
|
|
||||||
void uartadapter_gpio_irq (uint32_t id, gpio_irq_event event)
|
void uartadapter_gpio_irq (uint32_t id, gpio_irq_event event)
|
||||||
{
|
{
|
||||||
ua_printf(UA_DEBUG, "GPIO push button!!");
|
ua_printf(UA_DEBUG, "GPIO push button!");
|
||||||
|
|
||||||
ua_gpio_irq_happen = 1;
|
ua_gpio_irq_happen = 1;
|
||||||
RtlUpSemaFromISR(&ua_exception_sema);
|
RtlUpSemaFromISR(&ua_exception_sema);
|
||||||
|
@ -510,7 +510,7 @@ void uartadapter_gpio_led_mode(ua_socket_t *ua_socket, ua_led_mode_t mode)
|
||||||
(void*)uartadapter_gtimer_timeout_handler, (uint32_t)&ua_socket->gpio.gpio_led);
|
(void*)uartadapter_gtimer_timeout_handler, (uint32_t)&ua_socket->gpio.gpio_led);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ua_printf(UA_ERROR, "Unknown GPIO LED mode!!");
|
ua_printf(UA_ERROR, "Unknown GPIO LED mode!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ void cloud_link_task(void *param){
|
||||||
sprintf(j, "%.2f", humidity);
|
sprintf(j, "%.2f", humidity);
|
||||||
#endif
|
#endif
|
||||||
if(ret < 0)
|
if(ret < 0)
|
||||||
printf("\n<-----LOCAL LINK FAILED!!(get infor failed)\n");
|
printf("\n<-----LOCAL LINK FAILED!(get infor failed)\n");
|
||||||
else{
|
else{
|
||||||
gen_json_data(i,j, data);
|
gen_json_data(i,j, data);
|
||||||
printf("\nCLOUD-LINK--Sending data : \n%s\n", data);
|
printf("\nCLOUD-LINK--Sending data : \n%s\n", data);
|
||||||
|
@ -60,10 +60,10 @@ void cloud_link_task(void *param){
|
||||||
if(gn_put(&googlenest, URI, data) != 0)
|
if(gn_put(&googlenest, URI, data) != 0)
|
||||||
printf("PUT data failed!\n");
|
printf("PUT data failed!\n");
|
||||||
gn_close(&googlenest);
|
gn_close(&googlenest);
|
||||||
printf("\n<=====CLOUD LINK OK!!\n");
|
printf("\n<=====CLOUD LINK OK!\n");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
printf("\n<=====CLOUD LINK FAILED!!(google nest connecting)\n");
|
printf("\n<=====CLOUD LINK FAILED!(google nest connecting)\n");
|
||||||
}
|
}
|
||||||
free(data);
|
free(data);
|
||||||
vTaskDelay(10000);
|
vTaskDelay(10000);
|
||||||
|
@ -72,7 +72,7 @@ void cloud_link_task(void *param){
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("\n<=====CLOUD LINK FAILED!!(flash reading)\n");
|
printf("\n<=====CLOUD LINK FAILED!(flash reading)\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -318,15 +318,15 @@ static void local_link_task(void *param)
|
||||||
sprintf(j, "%.2f", humidity);
|
sprintf(j, "%.2f", humidity);
|
||||||
#endif
|
#endif
|
||||||
if(ret < 0)
|
if(ret < 0)
|
||||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!!(get infor failed)\r\n\r\n");
|
printf("\r\n\r\n<-----LOCAL LINK FAILED!(get infor failed)\r\n\r\n");
|
||||||
else{
|
else{
|
||||||
printf("\r\n\r\n----->START LOCAL LINKING\r\n\r\n");
|
printf("\r\n\r\n----->START LOCAL LINKING\r\n\r\n");
|
||||||
gen_json_data(i, j, data);
|
gen_json_data(i, j, data);
|
||||||
printf("Sending data : %s\r\n", data);
|
printf("Sending data : %s\r\n", data);
|
||||||
if (local_link(data) < 0)
|
if (local_link(data) < 0)
|
||||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!!\r\n\r\n");
|
printf("\r\n\r\n<-----LOCAL LINK FAILED!\r\n\r\n");
|
||||||
else
|
else
|
||||||
printf("\r\n\r\n<-----LOCAL LINK OK!!\r\n\r\n");
|
printf("\r\n\r\n<-----LOCAL LINK OK!\r\n\r\n");
|
||||||
vTaskDelay(1000);
|
vTaskDelay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -502,10 +502,10 @@ static void pair_device_task(void)
|
||||||
temp = NULL;
|
temp = NULL;
|
||||||
}
|
}
|
||||||
if(pair_device(tx_buffer, rx_buffer, 1) >= 0)
|
if(pair_device(tx_buffer, rx_buffer, 1) >= 0)
|
||||||
printf("\r\n\r\n<===First handshake OK!!\r\n\r\n");
|
printf("\r\n\r\n<===First handshake OK!\r\n\r\n");
|
||||||
else{
|
else{
|
||||||
i--;
|
i--;
|
||||||
printf("\r\n\r\n<===First handshake FAILED!!\r\n\r\n");
|
printf("\r\n\r\n<===First handshake FAILED!\r\n\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Second handshake
|
//Second handshake
|
||||||
|
@ -558,11 +558,11 @@ static void pair_device_task(void)
|
||||||
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 33, (uint8_t *) data);
|
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 33, (uint8_t *) data);
|
||||||
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
||||||
}
|
}
|
||||||
printf("\r\n\r\n<=====Second handshake OK!!\r\n\r\n");
|
printf("\r\n\r\n<=====Second handshake OK!\r\n\r\n");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
i = i - 2;
|
i = i - 2;
|
||||||
printf("\r\n\r\n<=====Second handshake FAILED!!\r\n\r\n");
|
printf("\r\n\r\n<=====Second handshake FAILED!\r\n\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Third handshake
|
//Third handshake
|
||||||
|
@ -586,15 +586,15 @@ static void pair_device_task(void)
|
||||||
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 97, (uint8_t *) data);
|
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 97, (uint8_t *) data);
|
||||||
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
||||||
|
|
||||||
printf("\r\n\r\n<=======Third handshake OK!!\r\n\r\n");
|
printf("\r\n\r\n<=======Third handshake OK!\r\n\r\n");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
i = i - 3;
|
i = i - 3;
|
||||||
printf("\r\n\r\n<=======Third handshake FAILED!!\r\n\r\n");
|
printf("\r\n\r\n<=======Third handshake FAILED!\r\n\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\r\n\r\n<=========Pairing OK!!\r\n\r\n");
|
printf("\r\n\r\n<=========Pairing OK!\r\n\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mdns_task(void *param)
|
static void mdns_task(void *param)
|
||||||
|
@ -657,7 +657,7 @@ static void mdns_task(void *param)
|
||||||
TXTRecordSetValue(&txtRecord, "CONTROL_TYPE", strlen("0"), "0");
|
TXTRecordSetValue(&txtRecord, "CONTROL_TYPE", strlen("0"), "0");
|
||||||
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
||||||
TXTRecordDeallocate(&txtRecord);
|
TXTRecordDeallocate(&txtRecord);
|
||||||
printf("\r\n\r\n<========Registering mDNS service OK!!\r\n\r\n");
|
printf("\r\n\r\n<========Registering mDNS service OK!\r\n\r\n");
|
||||||
pair_device_task();
|
pair_device_task();
|
||||||
}
|
}
|
||||||
//The device was paired
|
//The device was paired
|
||||||
|
@ -676,7 +676,7 @@ static void mdns_task(void *param)
|
||||||
|
|
||||||
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
||||||
TXTRecordDeallocate(&txtRecord);
|
TXTRecordDeallocate(&txtRecord);
|
||||||
printf("\r\n\r\n<========Registering mDNS service OK!! PAIR_STATE = 1\r\n\r\n");
|
printf("\r\n\r\n<========Registering mDNS service OK! PAIR_STATE = 1\r\n\r\n");
|
||||||
}
|
}
|
||||||
#if PSEUDO_DATA
|
#if PSEUDO_DATA
|
||||||
printf("\r\n\r\n========>Using the speudo data\r\n\r\n");
|
printf("\r\n\r\n========>Using the speudo data\r\n\r\n");
|
||||||
|
|
|
@ -103,7 +103,7 @@ void mii_intr_handler(u32 Event, u32 Data)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBG_8195A("Unknown event !!\n");
|
DBG_8195A("Unknown event!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#define MII_TX_DESC_CNT 4
|
#define MII_TX_DESC_CNT 4
|
||||||
#define MII_RX_DESC_CNT 10
|
#define MII_RX_DESC_CNT 10
|
||||||
|
#if CONFIG_ETHERNET
|
||||||
extern s8 rltk_mii_send(struct eth_drv_sg *sg_list, int sg_len, int total_len);
|
extern s8 rltk_mii_send(struct eth_drv_sg *sg_list, int sg_len, int total_len);
|
||||||
extern void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len);
|
extern void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len);
|
||||||
|
#endif
|
||||||
#endif // __MII_ETHERNETIF_H__
|
#endif // __MII_ETHERNETIF_H__
|
||||||
|
|
|
@ -310,9 +310,9 @@ static void dhcps_send_offer(struct pbuf *packet_buffer)
|
||||||
#if 0
|
#if 0
|
||||||
memset(&ip_table, 0, sizeof(struct table));
|
memset(&ip_table, 0, sizeof(struct table));
|
||||||
mark_ip_in_table((uint8_t)ip4_addr4(&dhcps_local_address));
|
mark_ip_in_table((uint8_t)ip4_addr4(&dhcps_local_address));
|
||||||
printf("reset ip table!!");
|
printf("reset ip table!");
|
||||||
#endif
|
#endif
|
||||||
printf("No useable ip!!!!");
|
printf("No useable ip!");
|
||||||
}
|
}
|
||||||
|
|
||||||
IP4_ADDR(&dhcps_allocated_client_address, (ip4_addr1(&dhcps_network_id)),
|
IP4_ADDR(&dhcps_allocated_client_address, (ip4_addr1(&dhcps_network_id)),
|
||||||
|
@ -502,7 +502,7 @@ struct pbuf *udp_packet_buffer, struct ip_addr *sender_addr, uint16_t sender_por
|
||||||
|
|
||||||
dhcp_message_repository = (struct dhcp_msg *)udp_packet_buffer->payload;
|
dhcp_message_repository = (struct dhcp_msg *)udp_packet_buffer->payload;
|
||||||
if (udp_packet_buffer == NULL) {
|
if (udp_packet_buffer == NULL) {
|
||||||
printf("Error!!!! System doesn't allocate any buffer\n");
|
printf("Error! System doesn't allocate any buffer\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sender_port == DHCP_CLIENT_PORT) {
|
if (sender_port == DHCP_CLIENT_PORT) {
|
||||||
|
@ -580,7 +580,7 @@ void dhcps_init(struct netif * pnetif)
|
||||||
|
|
||||||
dhcps_pcb = udp_new();
|
dhcps_pcb = udp_new();
|
||||||
if (dhcps_pcb == NULL) {
|
if (dhcps_pcb == NULL) {
|
||||||
printf("Error!!!upd_new error\n");
|
printf("Error! upd_new error\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IP4_ADDR(&dhcps_send_broadcast_address, 255, 255, 255, 255);
|
IP4_ADDR(&dhcps_send_broadcast_address, 255, 255, 255, 255);
|
||||||
|
|
|
@ -56,13 +56,16 @@
|
||||||
#include "ethernetif.h"
|
#include "ethernetif.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "lwip_netconf.h"
|
#include "lwip_netconf.h"
|
||||||
#include "ethernet_mii/ethernet_mii.h"
|
|
||||||
|
|
||||||
//#include "lwip/ethip6.h" //Add for ipv6
|
//#include "lwip/ethip6.h" //Add for ipv6
|
||||||
|
|
||||||
#include <platform/platform_stdlib.h>
|
#include <platform/platform_stdlib.h>
|
||||||
#include "platform_opts.h"
|
#include "platform_opts.h"
|
||||||
|
|
||||||
|
#if CONFIG_ETHERNET
|
||||||
|
#include "ethernet_mii/ethernet_mii.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_WLAN
|
#if CONFIG_WLAN
|
||||||
#include <lwip_intf.h>
|
#include <lwip_intf.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -159,6 +162,7 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p)
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_ETHERNET
|
||||||
/*for ethernet mii interface*/
|
/*for ethernet mii interface*/
|
||||||
static err_t low_level_output_mii(struct netif *netif, struct pbuf *p)
|
static err_t low_level_output_mii(struct netif *netif, struct pbuf *p)
|
||||||
{
|
{
|
||||||
|
@ -177,7 +181,7 @@ static err_t low_level_output_mii(struct netif *netif, struct pbuf *p)
|
||||||
}
|
}
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should allocate a pbuf and transfer the bytes of the incoming
|
* Should allocate a pbuf and transfer the bytes of the incoming
|
||||||
|
@ -241,7 +245,7 @@ void ethernetif_recv(struct netif *netif, int total_len)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_ETHERNET
|
||||||
void ethernetif_mii_recv(struct netif *netif, int total_len)
|
void ethernetif_mii_recv(struct netif *netif, int total_len)
|
||||||
{
|
{
|
||||||
struct eth_drv_sg sg_list[MAX_ETH_DRV_SG];
|
struct eth_drv_sg sg_list[MAX_ETH_DRV_SG];
|
||||||
|
@ -270,6 +274,7 @@ void ethernetif_mii_recv(struct netif *netif, int total_len)
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Should be called at the beginning of the program to set up the
|
* Should be called at the beginning of the program to set up the
|
||||||
* network interface. It calls the function low_level_init() to do the
|
* network interface. It calls the function low_level_init() to do the
|
||||||
|
@ -307,7 +312,7 @@ err_t ethernetif_init(struct netif *netif)
|
||||||
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
#if CONFIG_ETHERNET
|
||||||
err_t ethernetif_mii_init(struct netif *netif)
|
err_t ethernetif_mii_init(struct netif *netif)
|
||||||
{
|
{
|
||||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||||
|
@ -329,7 +334,7 @@ err_t ethernetif_mii_init(struct netif *netif)
|
||||||
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static void arp_timer(void *arg)
|
static void arp_timer(void *arg)
|
||||||
{
|
{
|
||||||
etharp_tmr();
|
etharp_tmr();
|
||||||
|
|
|
@ -1011,7 +1011,7 @@ lwip_write(int s, const void *data, size_t size)
|
||||||
* set in the sets has events. On return, readset, writeset and exceptset have
|
* set in the sets has events. On return, readset, writeset and exceptset have
|
||||||
* the sockets enabled that had events.
|
* the sockets enabled that had events.
|
||||||
*
|
*
|
||||||
* exceptset is not used for now!!!
|
* exceptset is not used for now!
|
||||||
*
|
*
|
||||||
* @param maxfdp1 the highest socket index in the sets
|
* @param maxfdp1 the highest socket index in the sets
|
||||||
* @param readset_in: set of sockets to check for read events
|
* @param readset_in: set of sockets to check for read events
|
||||||
|
|
|
@ -311,7 +311,7 @@ snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed)
|
||||||
*
|
*
|
||||||
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
||||||
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
||||||
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
|
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed)
|
snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed)
|
||||||
|
@ -337,7 +337,7 @@ snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed)
|
||||||
*
|
*
|
||||||
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
||||||
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
||||||
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
|
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
snmp_asn1_enc_u64t_cnt(const u32_t *value, u16_t *octets_needed)
|
snmp_asn1_enc_u64t_cnt(const u32_t *value, u16_t *octets_needed)
|
||||||
|
@ -479,7 +479,7 @@ snmp_asn1_dec_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tl
|
||||||
*
|
*
|
||||||
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
||||||
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
||||||
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
|
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
snmp_asn1_dec_u32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value)
|
snmp_asn1_dec_u32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value)
|
||||||
|
@ -519,7 +519,7 @@ snmp_asn1_dec_u32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value
|
||||||
*
|
*
|
||||||
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
|
||||||
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
|
||||||
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
|
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
snmp_asn1_dec_u64t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value)
|
snmp_asn1_dec_u64t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value)
|
||||||
|
|
|
@ -876,7 +876,7 @@ dns_enqueue(const char *name, dns_found_callback found, void *callback_arg)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve a hostname (string) into an IP address.
|
* Resolve a hostname (string) into an IP address.
|
||||||
* NON-BLOCKING callback version for use with raw API!!!
|
* NON-BLOCKING callback version for use with raw API!
|
||||||
*
|
*
|
||||||
* Returns immediately with one of err_t return codes:
|
* Returns immediately with one of err_t return codes:
|
||||||
* - ERR_OK if hostname is a valid IP address string or the host
|
* - ERR_OK if hostname is a valid IP address string or the host
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* So, a packet queue consists of one or more pbuf chains, each of
|
* So, a packet queue consists of one or more pbuf chains, each of
|
||||||
* which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE
|
* which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE
|
||||||
* NOT SUPPORTED!!! Use helper structs to queue multiple packets.
|
* NOT SUPPORTED! Use helper structs to queue multiple packets.
|
||||||
*
|
*
|
||||||
* The differences between a pbuf chain and a packet queue are very
|
* The differences between a pbuf chain and a packet queue are very
|
||||||
* precise but subtle.
|
* precise but subtle.
|
||||||
|
@ -359,7 +359,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
||||||
* @param payload_mem pointer to the buffer that is used for payload and headers,
|
* @param payload_mem pointer to the buffer that is used for payload and headers,
|
||||||
* must be at least big enough to hold 'length' plus the header size,
|
* must be at least big enough to hold 'length' plus the header size,
|
||||||
* may be NULL if set later.
|
* may be NULL if set later.
|
||||||
* ATTENTION: The caller is responsible for correct alignment of this buffer!!
|
* ATTENTION: The caller is responsible for correct alignment of this buffer!
|
||||||
* @param payload_mem_len the size of the 'payload_mem' buffer, must be at least
|
* @param payload_mem_len the size of the 'payload_mem' buffer, must be at least
|
||||||
* big enough to hold 'length' plus the header size
|
* big enough to hold 'length' plus the header size
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -261,7 +261,7 @@ int uart_read(uart_socket_t *u, void *read_buf, size_t size)
|
||||||
if(!u->rxoverlap){
|
if(!u->rxoverlap){
|
||||||
memcpy(ptr, (u->recv_buf+ pread_local), read_bytes );
|
memcpy(ptr, (u->recv_buf+ pread_local), read_bytes );
|
||||||
} else {
|
} else {
|
||||||
uart_printf("uart recv buf is write through!!\n");
|
uart_printf("uart recv buf is write through!\n");
|
||||||
if((pread_local + read_bytes) > UART_RECV_BUFFER_LEN){
|
if((pread_local + read_bytes) > UART_RECV_BUFFER_LEN){
|
||||||
memcpy(ptr,(u->recv_buf+ pread_local), (UART_RECV_BUFFER_LEN-pread_local));
|
memcpy(ptr,(u->recv_buf+ pread_local), (UART_RECV_BUFFER_LEN-pread_local));
|
||||||
memcpy(ptr+(UART_RECV_BUFFER_LEN-pread_local), u->recv_buf, read_bytes-(UART_RECV_BUFFER_LEN- pread_local));
|
memcpy(ptr+(UART_RECV_BUFFER_LEN-pread_local), u->recv_buf, read_bytes-(UART_RECV_BUFFER_LEN- pread_local));
|
||||||
|
|
|
@ -612,7 +612,7 @@ exit:
|
||||||
//if anything goes wrong or transfer over,we kill ourself.
|
//if anything goes wrong or transfer over,we kill ourself.
|
||||||
if(error_bit || transfer_over){
|
if(error_bit || transfer_over){
|
||||||
if(error_bit)
|
if(error_bit)
|
||||||
printf("error!!! error bit = %d\r\n",error_bit);
|
printf("error! error bit = %d\r\n",error_bit);
|
||||||
else{
|
else{
|
||||||
printf(" [%s, %d Bytes] transfer_over!\r\n",ymodem_ptr->filename,ymodem_ptr->filelen);
|
printf(" [%s, %d Bytes] transfer_over!\r\n",ymodem_ptr->filename,ymodem_ptr->filelen);
|
||||||
set_signature(ymodem_ptr);
|
set_signature(ymodem_ptr);
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ static u8_t ProcessPostMessage(struct netbuf *pxRxBuffer, portCHAR *LocalBuf)
|
||||||
pcRxString = LocalBuf;
|
pcRxString = LocalBuf;
|
||||||
p = pxRxBuffer->p;
|
p = pxRxBuffer->p;
|
||||||
usLength = p->tot_len;
|
usLength = p->tot_len;
|
||||||
//printf("\r\n !!!!!!!!!POST!p->tot_len =%d p->len=%d\n", p->tot_len, p->len);
|
//printf("\r\n !POST!p->tot_len =%d p->len=%d\n", p->tot_len, p->len);
|
||||||
while(p)
|
while(p)
|
||||||
{
|
{
|
||||||
memcpy(pcRxString, p->payload, p->len);
|
memcpy(pcRxString, p->payload, p->len);
|
||||||
|
@ -1342,7 +1342,7 @@ void stop_web_server()
|
||||||
netconn_delete(pxHTTPListener);
|
netconn_delete(pxHTTPListener);
|
||||||
pxHTTPListener = NULL;
|
pxHTTPListener = NULL;
|
||||||
}
|
}
|
||||||
printf("\r\nWEB: Take webs sema(%p) failed!!!!!!!!!!!\n", webs_sema);
|
printf("\r\nWEB: Take webs sema(%p) failed!\n", webs_sema);
|
||||||
}
|
}
|
||||||
vSemaphoreDelete(webs_sema);
|
vSemaphoreDelete(webs_sema);
|
||||||
webs_sema = NULL;
|
webs_sema = NULL;
|
||||||
|
|
|
@ -56,7 +56,7 @@ static osPriority makeCmsisPriority (unsigned portBASE_TYPE fpriority)
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pvvx!!! */
|
/* pvvx! */
|
||||||
static uint32_t __get_IPSR(void)
|
static uint32_t __get_IPSR(void)
|
||||||
{
|
{
|
||||||
uint32_t result;
|
uint32_t result;
|
||||||
|
|
|
@ -159,7 +159,7 @@ PRTL_MAILBOX RtlMailboxCreate(
|
||||||
// check if this mailbox ID is ocupied ?
|
// check if this mailbox ID is ocupied ?
|
||||||
pMBox = RtlMBoxIdToHdl(MboxID);
|
pMBox = RtlMBoxIdToHdl(MboxID);
|
||||||
if (NULL != pMBox) {
|
if (NULL != pMBox) {
|
||||||
MSG_MBOX_ERR("RtlMailboxCreate: The Mailbox ID %d is used by someone!!\n", MboxID);
|
MSG_MBOX_ERR("RtlMailboxCreate: The Mailbox ID %d is used by someone!\n", MboxID);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1068,7 +1068,7 @@ static void worker_thread_main( void *arg )
|
||||||
{
|
{
|
||||||
message.function(message.buf, message.buf_len, message.flags, message.user_data);
|
message.function(message.buf, message.buf_len, message.flags, message.user_data);
|
||||||
if(message.buf){
|
if(message.buf){
|
||||||
//printf("\n!!!!!Free %p(%d)\n", message.buf, message.buf_len);
|
//printf("\n!Free %p(%d)\n", message.buf, message.buf_len);
|
||||||
_rtw_mfree(message.buf, message.buf_len);
|
_rtw_mfree(message.buf, message.buf_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
//
|
//
|
||||||
#define strlen(str) prvStrLen((const u8*)str)
|
#define strlen(str) prvStrLen((const u8*)str)
|
||||||
#define strcmp(str1, str2) prvStrCmp((const u8*)str1, (const u8*)str2)
|
#define strcmp(str1, str2) prvStrCmp((const u8*)str1, (const u8*)str2)
|
||||||
#define sscanf(src, format...) //TODO
|
#define sscanf(src, format...) //TODO: Strtoul(src,0,16) / Strtoul(src,0,10)
|
||||||
#define strtok(str, delim) prvStrTok(str, delim)
|
#define strtok(str, delim) prvStrTok(str, delim)
|
||||||
#define strcpy(dst, src) prvStrCpy((u8 *)dst, (const u8*)src)
|
#define strcpy(dst, src) prvStrCpy((u8 *)dst, (const u8*)src)
|
||||||
#define atoi(str) prvAtoi(str)
|
#define atoi(str) prvAtoi(str)
|
||||||
|
|
|
@ -87,7 +87,7 @@ typedef enum _IRQn_Type_ {
|
||||||
|
|
||||||
PTA_TRX_IRQ = 95,// 31+64
|
PTA_TRX_IRQ = 95,// 31+64
|
||||||
RXI300_IRQ = 96,// 0+32 + 64
|
RXI300_IRQ = 96,// 0+32 + 64
|
||||||
NFC_IRQ = 97// 1+32+64
|
NFC_IRQ = 97 // 1+32+64
|
||||||
} IRQn_Type, *PIRQn_Type;
|
} IRQn_Type, *PIRQn_Type;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ HAL_GPIO_ADAPTER PINMUX_RAM_DATA_SECTION gBoot_Gpio_Adapter;
|
||||||
#if !USE_SRC_ONLY_BOOT
|
#if !USE_SRC_ONLY_BOOT
|
||||||
//----- HalNMIHandler_Patch
|
//----- HalNMIHandler_Patch
|
||||||
void HalNMIHandler_Patch(void) {
|
void HalNMIHandler_Patch(void) {
|
||||||
DBG_8195A_HAL("RTL8195A[HAL]: %s:NMI Error!\n", "HalNMIHandler_Patch");
|
DBG_8195A_HAL("%s:NMI Error!\n", __func__);
|
||||||
if ( HAL_READ32(VENDOR_REG_BASE, 0) < 0)
|
if ( HAL_READ32(VENDOR_REG_BASE, 0) < 0)
|
||||||
HalWdgIntrHandle(); // ROM: HalWdgIntrHandle = 0x3485;
|
HalWdgIntrHandle(); // ROM: HalWdgIntrHandle = 0x3485;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ HalGdmaChBlockSetingRtl8195a_Patch(
|
||||||
|
|
||||||
//4 Check 4 Bytes Alignment
|
//4 Check 4 Bytes Alignment
|
||||||
if ((u32)(pLliEle) & 0x3) {
|
if ((u32)(pLliEle) & 0x3) {
|
||||||
DBG_GDMA_WARN("LLi Addr: 0x%x not 4 bytes alignment!!!!\n",
|
DBG_GDMA_WARN("LLi Addr: 0x%x not 4 bytes alignment!\n",
|
||||||
pHalGdmaAdapter->pLli);
|
pHalGdmaAdapter->pLli);
|
||||||
return _FALSE;
|
return _FALSE;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ HalGdmaChBlockSetingRtl8195a_Patch(
|
||||||
pLliEle = pGdmaChLli->pLliEle;
|
pLliEle = pGdmaChLli->pLliEle;
|
||||||
|
|
||||||
if (NULL == pLliEle) {
|
if (NULL == pLliEle) {
|
||||||
DBG_GDMA_ERR("pLliEle Null Point!!!!!\n");
|
DBG_GDMA_ERR("pLliEle Null Point!\n");
|
||||||
return _FALSE;
|
return _FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ HalMiiInitIrqRtl8195a(
|
||||||
|
|
||||||
|
|
||||||
if(pEthAdapter == NULL)
|
if(pEthAdapter == NULL)
|
||||||
DBG_MII_ERR("pEthAdapter is NULL !!\n");
|
DBG_MII_ERR("pEthAdapter is NULL!\n");
|
||||||
|
|
||||||
pMiiIrqHandle->Data = (u32) pEthAdapter;
|
pMiiIrqHandle->Data = (u32) pEthAdapter;
|
||||||
pMiiIrqHandle->IrqNum = GMAC_IRQ;
|
pMiiIrqHandle->IrqNum = GMAC_IRQ;
|
||||||
|
@ -169,7 +169,7 @@ HalMiiDeInitIrqRtl8195a(
|
||||||
|
|
||||||
|
|
||||||
if(pEthAdapter == NULL)
|
if(pEthAdapter == NULL)
|
||||||
DBG_8195A("pEthAdapter is NULL !!\n");
|
DBG_8195A("pEthAdapter is NULL!\n");
|
||||||
|
|
||||||
/* Clear all interrupt status */
|
/* Clear all interrupt status */
|
||||||
HAL_MII_WRITE32(REG_MII_ISRIMR, ISR_CLR_ALL);
|
HAL_MII_WRITE32(REG_MII_ISRIMR, ISR_CLR_ALL);
|
||||||
|
@ -203,7 +203,7 @@ HalMiiInitRtl8195a(
|
||||||
|
|
||||||
if((!(pEthAdapter->tx_desc_num)) || (!(pEthAdapter->rx_desc_num)))
|
if((!(pEthAdapter->tx_desc_num)) || (!(pEthAdapter->rx_desc_num)))
|
||||||
{
|
{
|
||||||
DBG_MII_ERR("Invalid Tx/Rx descriptor number !!\n");
|
DBG_MII_ERR("Invalid Tx/Rx descriptor number!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
DBG_MII_INFO("Tx/Rx: %d/%d\n", pEthAdapter->tx_desc_num, pEthAdapter->rx_desc_num);
|
DBG_MII_INFO("Tx/Rx: %d/%d\n", pEthAdapter->tx_desc_num, pEthAdapter->rx_desc_num);
|
||||||
|
@ -286,7 +286,7 @@ HalMiiInitRtl8195a(
|
||||||
RxDesc = (PRX_DESC_FMT)(pEthAdapter->RxDescAddr);
|
RxDesc = (PRX_DESC_FMT)(pEthAdapter->RxDescAddr);
|
||||||
if((TxDesc == NULL) || (RxDesc == NULL))
|
if((TxDesc == NULL) || (RxDesc == NULL))
|
||||||
{
|
{
|
||||||
DBG_MII_ERR("Invalid Tx/Rx descriptor address !!\n");
|
DBG_MII_ERR("Invalid Tx/Rx descriptor address!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ HalMiiInitRtl8195a(
|
||||||
pRxDataBuf = pEthAdapter->pRxPktBuf;
|
pRxDataBuf = pEthAdapter->pRxPktBuf;
|
||||||
if((pTxDataBuf == NULL) || (pRxDataBuf == NULL))
|
if((pTxDataBuf == NULL) || (pRxDataBuf == NULL))
|
||||||
{
|
{
|
||||||
DBG_MII_ERR("Invalid Tx/Rx packet buffer address !!\n");
|
DBG_MII_ERR("Invalid Tx/Rx packet buffer address!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ HalMiiWriteDataRtl8195a(
|
||||||
|
|
||||||
if((Data == NULL) || (Size == 0) || (Size > MAX_FRAME_SIZE))
|
if((Data == NULL) || (Size == 0) || (Size > MAX_FRAME_SIZE))
|
||||||
{
|
{
|
||||||
DBG_MII_ERR("Invalid parameter !!\n");
|
DBG_MII_ERR("Invalid parameter!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1230,7 +1230,7 @@ A2NWriteInQueue(
|
||||||
if ((pNFCAdp->A2NWQWIdx == (pNFCAdp->A2NWQRIdx - 1))||
|
if ((pNFCAdp->A2NWQWIdx == (pNFCAdp->A2NWQRIdx - 1))||
|
||||||
((pNFCAdp->A2NWQRIdx == 0)&&(pNFCAdp->A2NWQWIdx == N2A_Q_LENGTH - 1))){
|
((pNFCAdp->A2NWQRIdx == 0)&&(pNFCAdp->A2NWQWIdx == N2A_Q_LENGTH - 1))){
|
||||||
|
|
||||||
DBG_8195A("A2N write Mailbox Queue full !!\n");
|
DBG_8195A("A2N write Mailbox Queue full!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Idx = 0; Idx < pA2NWData->Length; Idx++) {
|
for (Idx = 0; Idx < pA2NWData->Length; Idx++) {
|
||||||
|
@ -1696,7 +1696,7 @@ HalNFCInit(
|
||||||
NFCTmpSts = xTaskCreate( NFCTaskHandle, (const char *)"NFC_TASK",
|
NFCTmpSts = xTaskCreate( NFCTaskHandle, (const char *)"NFC_TASK",
|
||||||
((1024*4)/sizeof(portBASE_TYPE)), (void *)pNFCAdp, 1, &(pNFCAdp->NFCTask));
|
((1024*4)/sizeof(portBASE_TYPE)), (void *)pNFCAdp, 1, &(pNFCAdp->NFCTask));
|
||||||
if (pdTRUE != NFCTmpSts ) {
|
if (pdTRUE != NFCTmpSts ) {
|
||||||
DBG_NFC_ERR("HalNFCInit: Create Task Err(%d)!!\n", NFCTmpSts);
|
DBG_NFC_ERR("HalNFCInit: Create Task Err(%d)!\n", NFCTmpSts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1760,7 +1760,7 @@ HalNFCRead32(
|
||||||
}
|
}
|
||||||
if (Idxtemp > 0x0fffff) {
|
if (Idxtemp > 0x0fffff) {
|
||||||
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
||||||
DBG_8195A("Read FAIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\r\n");
|
DBG_8195A("Read FAIL!\r\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1799,7 +1799,7 @@ HalNFCWrite32(
|
||||||
}
|
}
|
||||||
if (Idxtemp > 0x0fffff) {
|
if (Idxtemp > 0x0fffff) {
|
||||||
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
||||||
DBG_8195A("write FAIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\r\n");
|
DBG_8195A("write FAIL!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1914,7 +1914,7 @@ HalNFCFwDownload(
|
||||||
// DBG_8195A("NFC FW Download IMEM SUCCESS \n");
|
// DBG_8195A("NFC FW Download IMEM SUCCESS \n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DBG_8195A("NFC FW Download IMEM FAIL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
|
DBG_8195A("NFC FW Download IMEM FAIL!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1934,7 +1934,7 @@ HalNFCFwDownload(
|
||||||
//DBG_8195A("NFC FW Download DMEM SUCCESS \n");
|
//DBG_8195A("NFC FW Download DMEM SUCCESS \n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DBG_8195A("NFC FW Download DMEM FAIL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
|
DBG_8195A("NFC FW Download DMEM FAIL!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1967,7 +1967,7 @@ HalNFCDbgRead32(
|
||||||
}
|
}
|
||||||
if (Idxtemp > 0x0fffff) {
|
if (Idxtemp > 0x0fffff) {
|
||||||
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
||||||
DBG_8195A("Read FAIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\r\n");
|
DBG_8195A("Read FAIL!\r\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2007,7 +2007,7 @@ HalNFCDbgWrite32(
|
||||||
}
|
}
|
||||||
if (Idxtemp > 0x0fffff) {
|
if (Idxtemp > 0x0fffff) {
|
||||||
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
DBG_8195A("A2N_OCP_MISC_R_IN_WHILE: 0x%x\r\n", HAL_READ32(NFC_INTERFACE_BASE, 0x4));
|
||||||
DBG_8195A("write FAIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\r\n");
|
DBG_8195A("write FAIL!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ HAL_Pwm_SetDuty_8195a(
|
||||||
pwm_id = pPwmAdapt->pwm_id;
|
pwm_id = pPwmAdapt->pwm_id;
|
||||||
// Adjust the tick time to a proper value
|
// Adjust the tick time to a proper value
|
||||||
if (period < (MIN_GTIMER_TIMEOUT*2)) {
|
if (period < (MIN_GTIMER_TIMEOUT*2)) {
|
||||||
DBG_PWM_ERR ("HAL_Pwm_SetDuty_8195a: Invalid PWM period(%d), too short!!\n", period);
|
DBG_PWM_ERR ("HAL_Pwm_SetDuty_8195a: Invalid PWM period(%d), too short!\n", period);
|
||||||
tick_time = MIN_GTIMER_TIMEOUT;
|
tick_time = MIN_GTIMER_TIMEOUT;
|
||||||
period = MIN_GTIMER_TIMEOUT*2;
|
period = MIN_GTIMER_TIMEOUT*2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,7 +318,7 @@ BOOL SDIO_Device_Init(
|
||||||
// TODO: initial TX BD
|
// TODO: initial TX BD
|
||||||
pSDIODev->pTXBDAddr = RtlZmalloc((SDIO_TX_BD_NUM * sizeof(SDIO_TX_BD))+3);
|
pSDIODev->pTXBDAddr = RtlZmalloc((SDIO_TX_BD_NUM * sizeof(SDIO_TX_BD))+3);
|
||||||
if (NULL == pSDIODev->pTXBDAddr) {
|
if (NULL == pSDIODev->pTXBDAddr) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX_BD Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX_BD Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
pSDIODev->pTXBDAddrAligned = (PSDIO_TX_BD)(((((u32)pSDIODev->pTXBDAddr - 1) >> 2) + 1) << 2); // Make it 4-bytes aligned
|
pSDIODev->pTXBDAddrAligned = (PSDIO_TX_BD)(((((u32)pSDIODev->pTXBDAddr - 1) >> 2) + 1) << 2); // Make it 4-bytes aligned
|
||||||
|
@ -347,7 +347,7 @@ BOOL SDIO_Device_Init(
|
||||||
|
|
||||||
pSDIODev->pTXBDHdl = (PSDIO_TX_BD_HANDLE)RtlZmalloc(SDIO_TX_BD_NUM * sizeof(SDIO_TX_BD_HANDLE));
|
pSDIODev->pTXBDHdl = (PSDIO_TX_BD_HANDLE)RtlZmalloc(SDIO_TX_BD_NUM * sizeof(SDIO_TX_BD_HANDLE));
|
||||||
if (NULL == pSDIODev->pTXBDHdl) {
|
if (NULL == pSDIODev->pTXBDHdl) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX_BD Handle Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX_BD Handle Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ BOOL SDIO_Device_Init(
|
||||||
if(pTxBdHdl->skb)
|
if(pTxBdHdl->skb)
|
||||||
pTxBdHdl->pTXBD->Address = (u32)pTxBdHdl->skb->tail;
|
pTxBdHdl->pTXBD->Address = (u32)pTxBdHdl->skb->tail;
|
||||||
else
|
else
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: rltk_wlan_alloc_skb (%d) failed!!\n", SDIO_TX_BD_BUF_USIZE*SDIO_TX_BUF_SZ_UNIT);
|
DBG_SDIO_ERR("SDIO_Device_Init: rltk_wlan_alloc_skb (%d) failed!\n", SDIO_TX_BD_BUF_USIZE*SDIO_TX_BUF_SZ_UNIT);
|
||||||
#else
|
#else
|
||||||
pTxBdHdl->pTXBD->Address = (u32)(&inic_TX_Buf[i][0]);
|
pTxBdHdl->pTXBD->Address = (u32)(&inic_TX_Buf[i][0]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -404,7 +404,7 @@ BOOL SDIO_Device_Init(
|
||||||
/* Allocate memory for TX Packets handler */
|
/* Allocate memory for TX Packets handler */
|
||||||
pSDIODev->pTxPktHandler = (SDIO_TX_PACKET *)(RtlZmalloc(sizeof(SDIO_TX_PACKET)*SDIO_TX_PKT_NUM));
|
pSDIODev->pTxPktHandler = (SDIO_TX_PACKET *)(RtlZmalloc(sizeof(SDIO_TX_PACKET)*SDIO_TX_PKT_NUM));
|
||||||
if (NULL == pSDIODev->pTxPktHandler) {
|
if (NULL == pSDIODev->pTxPktHandler) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX PKT Handler Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for TX PKT Handler Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
/* Add all TX packet handler into the Free Queue(list) */
|
/* Add all TX packet handler into the Free Queue(list) */
|
||||||
|
@ -417,7 +417,7 @@ BOOL SDIO_Device_Init(
|
||||||
/* Init RX BD and RX Buffer */
|
/* Init RX BD and RX Buffer */
|
||||||
pSDIODev->pRXBDAddr = RtlZmalloc((SDIO_RX_BD_NUM * sizeof(SDIO_RX_BD))+7);
|
pSDIODev->pRXBDAddr = RtlZmalloc((SDIO_RX_BD_NUM * sizeof(SDIO_RX_BD))+7);
|
||||||
if (NULL == pSDIODev->pRXBDAddr) {
|
if (NULL == pSDIODev->pRXBDAddr) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX_BD Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX_BD Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
pSDIODev->pRXBDAddrAligned = (PSDIO_RX_BD)(((((u32)pSDIODev->pRXBDAddr - 1) >> 3) + 1) << 3); // Make it 8-bytes aligned
|
pSDIODev->pRXBDAddrAligned = (PSDIO_RX_BD)(((((u32)pSDIODev->pRXBDAddr - 1) >> 3) + 1) << 3); // Make it 8-bytes aligned
|
||||||
|
@ -430,7 +430,7 @@ BOOL SDIO_Device_Init(
|
||||||
|
|
||||||
pSDIODev->pRXBDHdl = (PSDIO_RX_BD_HANDLE)RtlZmalloc(SDIO_RX_BD_NUM * sizeof(SDIO_RX_BD_HANDLE));
|
pSDIODev->pRXBDHdl = (PSDIO_RX_BD_HANDLE)RtlZmalloc(SDIO_RX_BD_NUM * sizeof(SDIO_RX_BD_HANDLE));
|
||||||
if (NULL == pSDIODev->pRXBDHdl) {
|
if (NULL == pSDIODev->pRXBDHdl) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX_BD Handle Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX_BD Handle Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ BOOL SDIO_Device_Init(
|
||||||
/* Allocate memory for RX Packets handler */
|
/* Allocate memory for RX Packets handler */
|
||||||
pSDIODev->pRxPktHandler = (SDIO_RX_PACKET *)(RtlZmalloc(sizeof(SDIO_RX_PACKET)*SDIO_RX_PKT_NUM));
|
pSDIODev->pRxPktHandler = (SDIO_RX_PACKET *)(RtlZmalloc(sizeof(SDIO_RX_PACKET)*SDIO_RX_PKT_NUM));
|
||||||
if (NULL == pSDIODev->pRxPktHandler) {
|
if (NULL == pSDIODev->pRxPktHandler) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX PKT Handler Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init: Malloc for RX PKT Handler Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
/* Add all RX packet handler into the Free Queue(list) */
|
/* Add all RX packet handler into the Free Queue(list) */
|
||||||
|
@ -467,20 +467,20 @@ BOOL SDIO_Device_Init(
|
||||||
#if !TASK_SCHEDULER_DISABLED
|
#if !TASK_SCHEDULER_DISABLED
|
||||||
RtlInitSema(&(pSDIODev->TxSema), 0);
|
RtlInitSema(&(pSDIODev->TxSema), 0);
|
||||||
if (NULL == pSDIODev->TxSema){
|
if (NULL == pSDIODev->TxSema){
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init Create Semaphore Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init Create Semaphore Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlInitSema(&(pSDIODev->RxSema), 0);
|
RtlInitSema(&(pSDIODev->RxSema), 0);
|
||||||
if (NULL == pSDIODev->RxSema){
|
if (NULL == pSDIODev->RxSema){
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init Create RX Semaphore Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init Create RX Semaphore Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a Mailbox for other driver module to send message to SDIO driver */
|
/* create a Mailbox for other driver module to send message to SDIO driver */
|
||||||
pSDIODev->pMBox = RtlMailboxCreate(MBOX_ID_SDIO, SDIO_MAILBOX_SIZE, &(pSDIODev->RxSema));
|
pSDIODev->pMBox = RtlMailboxCreate(MBOX_ID_SDIO, SDIO_MAILBOX_SIZE, &(pSDIODev->RxSema));
|
||||||
if (NULL == pSDIODev->pMBox) {
|
if (NULL == pSDIODev->pMBox) {
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init Create Mailbox Err!!\n");
|
DBG_SDIO_ERR("SDIO_Device_Init Create Mailbox Err!\n");
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
#if SDIO_MP_MODE
|
#if SDIO_MP_MODE
|
||||||
|
@ -491,14 +491,14 @@ BOOL SDIO_Device_Init(
|
||||||
ret = xTaskCreate( SDIO_TxTask, "SDIO_TX_TASK", ((1024*2)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_TASK_PRIORITY + PRIORITIE_OFFSET, &pSDIODev->xSDIOTxTaskHandle);
|
ret = xTaskCreate( SDIO_TxTask, "SDIO_TX_TASK", ((1024*2)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_TASK_PRIORITY + PRIORITIE_OFFSET, &pSDIODev->xSDIOTxTaskHandle);
|
||||||
if (pdTRUE != ret )
|
if (pdTRUE != ret )
|
||||||
{
|
{
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Create Task Err(%d)!!\n", ret);
|
DBG_SDIO_ERR("SDIO_Device_Init: Create Task Err(%d)!\n", ret);
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = xTaskCreate( SDIO_RxTask, "SDIO_RX_TASK", ((1024*1)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_TASK_PRIORITY + PRIORITIE_OFFSET, &pSDIODev->xSDIORxTaskHandle);
|
ret = xTaskCreate( SDIO_RxTask, "SDIO_RX_TASK", ((1024*1)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_TASK_PRIORITY + PRIORITIE_OFFSET, &pSDIODev->xSDIORxTaskHandle);
|
||||||
if (pdTRUE != ret )
|
if (pdTRUE != ret )
|
||||||
{
|
{
|
||||||
DBG_SDIO_ERR("SDIO_Device_Init: Create RX Task Err(%d)!!\n", ret);
|
DBG_SDIO_ERR("SDIO_Device_Init: Create RX Task Err(%d)!\n", ret);
|
||||||
goto SDIO_INIT_ERR;
|
goto SDIO_INIT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1355,7 +1355,7 @@ VOID SDIO_TX_FIFO_DataReady(
|
||||||
TxBDWPtr = HAL_SDIO_READ16(REG_SPDIO_TXBD_WPTR);
|
TxBDWPtr = HAL_SDIO_READ16(REG_SPDIO_TXBD_WPTR);
|
||||||
if (TxBDWPtr == pSDIODev->TXBDRPtr) {
|
if (TxBDWPtr == pSDIODev->TXBDRPtr) {
|
||||||
if ((pSDIODev->IntStatus & BIT_TXFIFO_H2C_OVF) == 0) {
|
if ((pSDIODev->IntStatus & BIT_TXFIFO_H2C_OVF) == 0) {
|
||||||
DBG_SDIO_WARN("SDIO TX Data Read False Triggered!!, TXBDWPtr=0x%x\n", TxBDWPtr);
|
DBG_SDIO_WARN("SDIO TX Data Read False Triggered!, TXBDWPtr=0x%x\n", TxBDWPtr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1518,7 +1518,7 @@ PSDIO_RX_PACKET SDIO_Alloc_Rx_Pkt(
|
||||||
RtlMsleepOS(10);
|
RtlMsleepOS(10);
|
||||||
loop_cnt++;
|
loop_cnt++;
|
||||||
if (loop_cnt > 100) {
|
if (loop_cnt > 100) {
|
||||||
DBG_SDIO_ERR("SDIO_Alloc_Rx_Pkt: Err!! Allocate RX PKT Failed!!\n");
|
DBG_SDIO_ERR("SDIO_Alloc_Rx_Pkt: Err! Allocate RX PKT Failed!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1741,14 +1741,14 @@ u8 SDIO_Send_C2H_PktMsg(
|
||||||
|
|
||||||
MsgBuf = RtlZmalloc(MsgLen);
|
MsgBuf = RtlZmalloc(MsgLen);
|
||||||
if (NULL == MsgBuf) {
|
if (NULL == MsgBuf) {
|
||||||
DBG_SDIO_ERR("SDIO_Send_C2H_PktMsg: Malloc Err!!\n");
|
DBG_SDIO_ERR("SDIO_Send_C2H_PktMsg: Malloc Err!\n");
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
_memcpy((void *)(MsgBuf), (void *)C2HMsg, MsgLen);
|
_memcpy((void *)(MsgBuf), (void *)C2HMsg, MsgLen);
|
||||||
|
|
||||||
pPkt = SDIO_Alloc_Rx_Pkt(pSDIODev);
|
pPkt = SDIO_Alloc_Rx_Pkt(pSDIODev);
|
||||||
if (pPkt == NULL) {
|
if (pPkt == NULL) {
|
||||||
DBG_SDIO_ERR("RX Callback Err!! No Free RX PKT!\n");
|
DBG_SDIO_ERR("RX Callback Err! No Free RX PKT!\n");
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
pRxDesc = &pPkt->RxDesc;
|
pRxDesc = &pPkt->RxDesc;
|
||||||
|
@ -2244,7 +2244,7 @@ s8 SDIO_Rx_Callback(
|
||||||
|
|
||||||
pPkt = SDIO_Alloc_Rx_Pkt(pSDIODev);
|
pPkt = SDIO_Alloc_Rx_Pkt(pSDIODev);
|
||||||
if (pPkt == NULL) {
|
if (pPkt == NULL) {
|
||||||
DBG_SDIO_ERR("RX Callback Err!! No Free RX PKT!\n");
|
DBG_SDIO_ERR("RX Callback Err! No Free RX PKT!\n");
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
pRxDesc = &pPkt->RxDesc;
|
pRxDesc = &pPkt->RxDesc;
|
||||||
|
@ -2877,7 +2877,7 @@ VOID SDIO_DeviceMPApp(
|
||||||
case SDIO_MP_LOOPBACK:
|
case SDIO_MP_LOOPBACK:
|
||||||
DBG_SDIO_INFO("MP_App: argv[1]=%s\n", argv[1]);
|
DBG_SDIO_INFO("MP_App: argv[1]=%s\n", argv[1]);
|
||||||
if (pSDIODev->MP_ModeEn == 0) {
|
if (pSDIODev->MP_ModeEn == 0) {
|
||||||
DiagPrintf("Not in MP mode!! Please start MP mode first.\n");
|
DiagPrintf("Not in MP mode! Please start MP mode first.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
arg1 = Strtoul((const u8*)(argv[1]), (u8 **)NULL, 10);
|
arg1 = Strtoul((const u8*)(argv[1]), (u8 **)NULL, 10);
|
||||||
|
@ -2887,14 +2887,14 @@ VOID SDIO_DeviceMPApp(
|
||||||
#if !TASK_SCHEDULER_DISABLED
|
#if !TASK_SCHEDULER_DISABLED
|
||||||
RtlInitSema(&(pSDIODev->MP_EventSema), 0);
|
RtlInitSema(&(pSDIODev->MP_EventSema), 0);
|
||||||
if (NULL == pSDIODev->MP_EventSema){
|
if (NULL == pSDIODev->MP_EventSema){
|
||||||
DBG_SDIO_ERR("SDIO MP_Loopback Create Semaphore Err!!\n");
|
DBG_SDIO_ERR("SDIO MP_Loopback Create Semaphore Err!\n");
|
||||||
break; // break the switch case
|
break; // break the switch case
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a Mailbox for other driver module to send message to SDIO driver */
|
/* create a Mailbox for other driver module to send message to SDIO driver */
|
||||||
pSDIODev->pMP_MBox = RtlMailboxCreate(MBOX_ID_SDIO_MP, SDIO_MAILBOX_SIZE, &(pSDIODev->MP_EventSema));
|
pSDIODev->pMP_MBox = RtlMailboxCreate(MBOX_ID_SDIO_MP, SDIO_MAILBOX_SIZE, &(pSDIODev->MP_EventSema));
|
||||||
if (NULL == pSDIODev->pMBox) {
|
if (NULL == pSDIODev->pMBox) {
|
||||||
DBG_SDIO_ERR("SDIO MP_Loopback Create Mailbox Err!!\n");
|
DBG_SDIO_ERR("SDIO MP_Loopback Create Mailbox Err!\n");
|
||||||
break; // break the switch case
|
break; // break the switch case
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2903,7 +2903,7 @@ VOID SDIO_DeviceMPApp(
|
||||||
ret = xTaskCreate( SDIO_MP_Task, "SDIO_MP_TASK", ((256*4)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_MP_TASK_PRIORITY, &pSDIODev->MP_TaskHandle);
|
ret = xTaskCreate( SDIO_MP_Task, "SDIO_MP_TASK", ((256*4)/sizeof(portBASE_TYPE)), (void *)pSDIODev, SDIO_MP_TASK_PRIORITY, &pSDIODev->MP_TaskHandle);
|
||||||
if (pdTRUE != ret )
|
if (pdTRUE != ret )
|
||||||
{
|
{
|
||||||
DBG_SDIO_ERR("SDIO MP Create Task Err(%d)!!\n", ret);
|
DBG_SDIO_ERR("SDIO MP Create Task Err(%d)!\n", ret);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3101,7 +3101,7 @@ VOID SDIO_DeviceMPApp(
|
||||||
pSDIODev->pMP_CRxBuf = RtlMalloc(pSDIODev->MP_CRxSize+26); // 26: Wlan header
|
pSDIODev->pMP_CRxBuf = RtlMalloc(pSDIODev->MP_CRxSize+26); // 26: Wlan header
|
||||||
DiagPrintf("SDIO RX Test: pBuf @ 0x%x\n", (u32)pSDIODev->pMP_CRxBuf);
|
DiagPrintf("SDIO RX Test: pBuf @ 0x%x\n", (u32)pSDIODev->pMP_CRxBuf);
|
||||||
if (((u32)(pSDIODev->pMP_CRxBuf) & 0x03) != 0) {
|
if (((u32)(pSDIODev->pMP_CRxBuf) & 0x03) != 0) {
|
||||||
DiagPrintf("SDIO RX Test: pBuf Not 4-bytes Aligned!!\n");
|
DiagPrintf("SDIO RX Test: pBuf Not 4-bytes Aligned!\n");
|
||||||
}
|
}
|
||||||
#if SDIO_DEBUG
|
#if SDIO_DEBUG
|
||||||
pSDIODev->MemAllocCnt++;
|
pSDIODev->MemAllocCnt++;
|
||||||
|
|
|
@ -179,7 +179,7 @@ HAL_Status SdioHostSdClkCtrl(void *Data, int En, int Divisor) { // SD_CLK_DIVISO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG_SDIO_ERR("Unsupported SDCLK divisor !!\n");
|
DBG_SDIO_ERR("Unsupported SDCLK divisor!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -365,7 +365,7 @@ HAL_Status HalSdioHostInitHostRtl8195a(IN VOID *Data) {
|
||||||
int x = 1000;
|
int x = 1000;
|
||||||
while (HAL_SDIO_HOST_READ8(REG_SDIO_HOST_SW_RESET) & 1) {
|
while (HAL_SDIO_HOST_READ8(REG_SDIO_HOST_SW_RESET) & 1) {
|
||||||
if (x-- == 0) {
|
if (x-- == 0) {
|
||||||
DBG_SDIO_ERR("SD host initialization FAIL !!\n");
|
DBG_SDIO_ERR("SD host initialization FAIL!\n");
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ HAL_Status HalSdioHostInitHostRtl8195a(IN VOID *Data) {
|
||||||
while (!(HAL_SDIO_HOST_READ16(REG_SDIO_HOST_CLK_CTRL)
|
while (!(HAL_SDIO_HOST_READ16(REG_SDIO_HOST_CLK_CTRL)
|
||||||
& CLK_CTRL_INTERAL_CLK_STABLE)) {
|
& CLK_CTRL_INTERAL_CLK_STABLE)) {
|
||||||
if (x-- == 0) {
|
if (x-- == 0) {
|
||||||
DBG_SDIO_ERR("SD host initialization FAIL !!\n");
|
DBG_SDIO_ERR("SD host initialization FAIL!\n");
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ signed int SdioHostErrIntRecovery(void *Data, int a2, signed int a3) {
|
||||||
goto LABEL_14;
|
goto LABEL_14;
|
||||||
}
|
}
|
||||||
if (v5 == 1000) {
|
if (v5 == 1000) {
|
||||||
DBG_SDIO_ERR("CMD line reset timeout !!\n");
|
DBG_SDIO_ERR("CMD line reset timeout!\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,7 +474,7 @@ signed int SdioHostErrIntRecovery(void *Data, int a2, signed int a3) {
|
||||||
goto LABEL_22;
|
goto LABEL_22;
|
||||||
}
|
}
|
||||||
if (v8 == 1000) {
|
if (v8 == 1000) {
|
||||||
DBG_SDIO_ERR("DAT line reset timeout !!\n");
|
DBG_SDIO_ERR("DAT line reset timeout!\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,13 +494,13 @@ signed int SdioHostErrIntRecovery(void *Data, int a2, signed int a3) {
|
||||||
if (v9 == 1000)
|
if (v9 == 1000)
|
||||||
return 2;
|
return 2;
|
||||||
LABEL_30: if (v40058032 << 28) {
|
LABEL_30: if (v40058032 << 28) {
|
||||||
DBG_SDIO_ERR("Non-recoverable error(1) !!\n");
|
DBG_SDIO_ERR("Non-recoverable error(1)!\n");
|
||||||
LABEL_33: DiagPrintf(v10);
|
LABEL_33: DiagPrintf(v10);
|
||||||
goto LABEL_34;
|
goto LABEL_34;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (v40058032 & 0x10) {
|
if (v40058032 & 0x10) {
|
||||||
DBG_SDIO_ERR("Non-recoverable error(2) !!\n");
|
DBG_SDIO_ERR("Non-recoverable error(2)!\n");
|
||||||
goto LABEL_34;
|
goto LABEL_34;
|
||||||
}
|
}
|
||||||
HalDelayUs(50);
|
HalDelayUs(50);
|
||||||
|
@ -509,7 +509,7 @@ signed int SdioHostErrIntRecovery(void *Data, int a2, signed int a3) {
|
||||||
result = 16;
|
result = 16;
|
||||||
goto LABEL_44;
|
goto LABEL_44;
|
||||||
}
|
}
|
||||||
DBG_SDIO_ERR("Non-recoverable error(3) !!\n");
|
DBG_SDIO_ERR("Non-recoverable error(3)!\n");
|
||||||
goto LABEL_34;
|
goto LABEL_34;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ signed int SdioHostErrIntRecovery(void *Data, int a2, signed int a3) {
|
||||||
LABEL_44: v4005803A = 127;
|
LABEL_44: v4005803A = 127;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
DBG_SDIO_ERR("Stop transmission error !!\n");
|
DBG_SDIO_ERR("Stop transmission error!\n");
|
||||||
return 238;
|
return 238;
|
||||||
}
|
}
|
||||||
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
||||||
|
@ -627,7 +627,7 @@ int SdioHostCardSelection(void *Data, int Select, int a3) {
|
||||||
*(u8 *) &Cmd.CmdFmt & 3), v3[24] == 7)) {
|
*(u8 *) &Cmd.CmdFmt & 3), v3[24] == 7)) {
|
||||||
result = v9;
|
result = v9;
|
||||||
} else {
|
} else {
|
||||||
DBG_SDIO_ERR("Command index error !!\n");
|
DBG_SDIO_ERR("Command index error!\n");
|
||||||
result = 238;
|
result = 238;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,7 @@ IN u32 BlockCnt) {
|
||||||
*(u8 *) &Cmd.CmdFmt & 3);
|
*(u8 *) &Cmd.CmdFmt & 3);
|
||||||
if (*(u32 *) (pSdioHostAdapter + 20) & 0x4000000) {
|
if (*(u32 *) (pSdioHostAdapter + 20) & 0x4000000) {
|
||||||
LABEL_14:
|
LABEL_14:
|
||||||
DBG_SDIO_ERR("Write protect violation !!\n");
|
DBG_SDIO_ERR("Write protect violation!\n");
|
||||||
return HAL_ERR_PARA;
|
return HAL_ERR_PARA;
|
||||||
}
|
}
|
||||||
result = SdioHostChkXferComplete((void *) pSdioHostAdapter, 0x1388u,
|
result = SdioHostChkXferComplete((void *) pSdioHostAdapter, 0x1388u,
|
||||||
|
@ -1073,7 +1073,7 @@ HAL_Status HalSdioHostGetCardStatusRtl8195a(IN VOID *Data) {
|
||||||
*((u8 *) v3 + 131) = (v8 >> 9) & 0xF;
|
*((u8 *) v3 + 131) = (v8 >> 9) & 0xF;
|
||||||
return v7;
|
return v7;
|
||||||
}
|
}
|
||||||
DBG_SDIO_ERR("Command index error !!\n");
|
DBG_SDIO_ERR("Command index error!\n");
|
||||||
return 238;
|
return 238;
|
||||||
}
|
}
|
||||||
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
||||||
|
@ -1152,7 +1152,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
};
|
};
|
||||||
v7 = v4;
|
v7 = v4;
|
||||||
if (v4) {
|
if (v4) {
|
||||||
DBG_SDIO_ERR("Reset sd card fail !!\n");
|
DBG_SDIO_ERR("Reset sd card fail!\n");
|
||||||
goto LABEL_104;
|
goto LABEL_104;
|
||||||
};
|
};
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1171,7 +1171,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
SdioHostGetResponse(v3, (u8) v52 & 3);
|
SdioHostGetResponse(v3, (u8) v52 & 3);
|
||||||
if (v3[24] != 8) {
|
if (v3[24] != 8) {
|
||||||
if (ConfigDebugErr & 0x400) {
|
if (ConfigDebugErr & 0x400) {
|
||||||
v11 = "\r[SDIO Err]Command index error !!\n"
|
v11 = "\r[SDIO Err]Command index error!\n"
|
||||||
); // DBG_SDIO_ERR("
|
); // DBG_SDIO_ERR("
|
||||||
LABEL_18: DiagPrintf(v11);
|
LABEL_18: DiagPrintf(v11);
|
||||||
goto LABEL_21;
|
goto LABEL_21;
|
||||||
|
@ -1191,7 +1191,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
}
|
}
|
||||||
LABEL_21: v7 = 238;
|
LABEL_21: v7 = 238;
|
||||||
LABEL_22: if (ConfigDebugErr & 0x400) {
|
LABEL_22: if (ConfigDebugErr & 0x400) {
|
||||||
v8 = "\r[SDIO Err]Voltage check fail !!\n";
|
v8 = "\r[SDIO Err]Voltage check fail!\n";
|
||||||
goto LABEL_104;
|
goto LABEL_104;
|
||||||
}
|
}
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1213,7 +1213,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
if (v3[24] != 55) {
|
if (v3[24] != 55) {
|
||||||
if (ConfigDebugErr & 0x400) // DBG_SDIO_ERR("
|
if (ConfigDebugErr & 0x400) // DBG_SDIO_ERR("
|
||||||
{
|
{
|
||||||
v17 = "\r[SDIO Err]Command index error !!\n";
|
v17 = "\r[SDIO Err]Command index error!\n";
|
||||||
LABEL_32: DiagPrintf(v17);
|
LABEL_32: DiagPrintf(v17);
|
||||||
goto LABEL_57;
|
goto LABEL_57;
|
||||||
}
|
}
|
||||||
|
@ -1237,7 +1237,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
if (!v13)
|
if (!v13)
|
||||||
goto LABEL_64;
|
goto LABEL_64;
|
||||||
LABEL_60: if (ConfigDebugErr & 0x400) {
|
LABEL_60: if (ConfigDebugErr & 0x400) {
|
||||||
v8 = "\r[SDIO Err]Get OCR fail !!\n";
|
v8 = "\r[SDIO Err]Get OCR fail!\n";
|
||||||
goto LABEL_104;
|
goto LABEL_104;
|
||||||
}
|
}
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1264,7 +1264,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
v25 = SdioHostGetResponse(v3, (u8) v52 & 3);
|
v25 = SdioHostGetResponse(v3, (u8) v52 & 3);
|
||||||
if (v3[24] != 55) {
|
if (v3[24] != 55) {
|
||||||
if (ConfigDebugErr & 0x400) {
|
if (ConfigDebugErr & 0x400) {
|
||||||
v26 = "\r[SDIO Err]Command index error !!\n";
|
v26 = "\r[SDIO Err]Command index error!\n";
|
||||||
LABEL_46: DiagPrintf(v26);
|
LABEL_46: DiagPrintf(v26);
|
||||||
goto LABEL_62;
|
goto LABEL_62;
|
||||||
}
|
}
|
||||||
|
@ -1322,7 +1322,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
if (!v31)
|
if (!v31)
|
||||||
goto LABEL_70;
|
goto LABEL_70;
|
||||||
if (ConfigDebugErr & 0x400) {
|
if (ConfigDebugErr & 0x400) {
|
||||||
v8 = "\r[SDIO Err]Get CID fail !!\n";
|
v8 = "\r[SDIO Err]Get CID fail!\n";
|
||||||
goto LABEL_104;
|
goto LABEL_104;
|
||||||
}
|
}
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1341,10 +1341,10 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
SdioHostGetResponse(v3, (u8) v52 & 3);
|
SdioHostGetResponse(v3, (u8) v52 & 3);
|
||||||
if (v3[24] != 3) {
|
if (v3[24] != 3) {
|
||||||
if (ConfigDebugErr & 0x400)
|
if (ConfigDebugErr & 0x400)
|
||||||
DiagPrintf("\r[SDIO Err]Command index error !!\n");
|
DiagPrintf("\r[SDIO Err]Command index error!\n");
|
||||||
v7 = 238;
|
v7 = 238;
|
||||||
LABEL_79: if (ConfigDebugErr & 0x400) {
|
LABEL_79: if (ConfigDebugErr & 0x400) {
|
||||||
v8 = "\r[SDIO Err]Get RCA fail !!\n";
|
v8 = "\r[SDIO Err]Get RCA fail!\n";
|
||||||
goto LABEL_104;
|
goto LABEL_104;
|
||||||
}
|
}
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1356,7 +1356,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
if (v39) {
|
if (v39) {
|
||||||
v40 = ConfigDebugErr << 21;
|
v40 = ConfigDebugErr << 21;
|
||||||
if (ConfigDebugErr & 0x400) {
|
if (ConfigDebugErr & 0x400) {
|
||||||
v41 = "\r[SDIO Err]Get CSD fail !!\n";
|
v41 = "\r[SDIO Err]Get CSD fail!\n";
|
||||||
goto LABEL_108;
|
goto LABEL_108;
|
||||||
}
|
}
|
||||||
LABEL_113: v7 = v39;
|
LABEL_113: v7 = v39;
|
||||||
|
@ -1366,7 +1366,7 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
if (v39) {
|
if (v39) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
goto LABEL_113;
|
goto LABEL_113;
|
||||||
v41 = "\r[SDIO Err]Select sd card fail !!\n";
|
v41 = "\r[SDIO Err]Select sd card fail!\n";
|
||||||
LABEL_108: DiagPrintf(v41, v40);
|
LABEL_108: DiagPrintf(v41, v40);
|
||||||
goto LABEL_113;
|
goto LABEL_113;
|
||||||
}
|
}
|
||||||
|
@ -1406,12 +1406,12 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
v40 = ConfigDebugErr << 21;
|
v40 = ConfigDebugErr << 21;
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
goto LABEL_113;
|
goto LABEL_113;
|
||||||
v41 = "\r[SDIO Err]Get sd card current state fail !!\n";
|
v41 = "\r[SDIO Err]Get sd card current state fail!\n";
|
||||||
goto LABEL_108;
|
goto LABEL_108;
|
||||||
}
|
}
|
||||||
if (v3[131] != 4) {
|
if (v3[131] != 4) {
|
||||||
DBG_SDIO_ERR(
|
DBG_SDIO_ERR(
|
||||||
"The card isn't in TRANSFER state !! (Current state: %d)\n",
|
"The card isn't in TRANSFER state! (Current state: %d)\n",
|
||||||
v3[131], ConfigDebugErr << 21);
|
v3[131], ConfigDebugErr << 21);
|
||||||
v7 = 238;
|
v7 = 238;
|
||||||
goto LABEL_115;
|
goto LABEL_115;
|
||||||
|
@ -1424,16 +1424,16 @@ HAL_Status HalSdioHostInitCardRtl8195a(IN VOID *Data) {
|
||||||
goto LABEL_105;
|
goto LABEL_105;
|
||||||
}
|
}
|
||||||
LABEL_90: if (ConfigDebugErr & 0x400) {
|
LABEL_90: if (ConfigDebugErr & 0x400) {
|
||||||
v48 = "\r[SDIO Err]Command index error !!\n";
|
v48 = "\r[SDIO Err]Command index error!\n";
|
||||||
goto LABEL_95;
|
goto LABEL_95;
|
||||||
}
|
}
|
||||||
LABEL_96: v7 = 238;
|
LABEL_96: v7 = 238;
|
||||||
LABEL_102: if (ConfigDebugErr & 0x400) {
|
LABEL_102: if (ConfigDebugErr & 0x400) {
|
||||||
v8 = "\r[SDIO Err]Set bus width fail !!\n";
|
v8 = "\r[SDIO Err]Set bus width fail!\n";
|
||||||
LABEL_104: DiagPrintf(v8);
|
LABEL_104: DiagPrintf(v8);
|
||||||
}
|
}
|
||||||
LABEL_115:
|
LABEL_115:
|
||||||
DBG_SDIO_ERR("SD card initialization FAIL !!\n");
|
DBG_SDIO_ERR("SD card initialization FAIL!\n");
|
||||||
}
|
}
|
||||||
return v7;
|
return v7;
|
||||||
}
|
}
|
||||||
|
@ -1490,7 +1490,7 @@ HAL_Status HalSdioHostGetSdStatusRtl8195a(IN VOID *Data) {
|
||||||
SdioHostGetResponse(v4, *(u8 *) &Cmd.CmdFmt & 3);
|
SdioHostGetResponse(v4, *(u8 *) &Cmd.CmdFmt & 3);
|
||||||
if (v4[24] != 55) {
|
if (v4[24] != 55) {
|
||||||
if (ConfigDebugErr & 0x400) {
|
if (ConfigDebugErr & 0x400) {
|
||||||
v10 = "\r[SDIO Err]Command index error !!\n";
|
v10 = "\r[SDIO Err]Command index error!\n";
|
||||||
LABEL_20: DiagPrintf(v10);
|
LABEL_20: DiagPrintf(v10);
|
||||||
return 238;
|
return 238;
|
||||||
}
|
}
|
||||||
|
@ -1585,7 +1585,7 @@ HAL_Status HalSdioHostChangeSdClockRtl8195a(IN VOID *Data, IN u8 Frequency) {
|
||||||
else if (Frequency == SD_CLK_20_8MHZ) // SD_CLK_20_8MHZ
|
else if (Frequency == SD_CLK_20_8MHZ) // SD_CLK_20_8MHZ
|
||||||
v20 = BASE_CLK_DIVIDED_BY_2;
|
v20 = BASE_CLK_DIVIDED_BY_2;
|
||||||
else if (Frequency != SD_CLK_5_2MHZ) { // SD_CLK_5_2MHZ
|
else if (Frequency != SD_CLK_5_2MHZ) { // SD_CLK_5_2MHZ
|
||||||
DBG_SDIO_ERR("Unsupported SDCLK frequency !!\n");
|
DBG_SDIO_ERR("Unsupported SDCLK frequency!\n");
|
||||||
v3 = 3;
|
v3 = 3;
|
||||||
goto LABEL_60;
|
goto LABEL_60;
|
||||||
}
|
}
|
||||||
|
@ -1596,7 +1596,7 @@ HAL_Status HalSdioHostChangeSdClockRtl8195a(IN VOID *Data, IN u8 Frequency) {
|
||||||
return 0;
|
return 0;
|
||||||
LABEL_60: if (!(ConfigDebugErr & 0x400)) {
|
LABEL_60: if (!(ConfigDebugErr & 0x400)) {
|
||||||
return v3;
|
return v3;
|
||||||
v19 = "\r[SDIO Err]Host changes clock fail !!\n"; // DBG_SDIO_ERR("
|
v19 = "\r[SDIO Err]Host changes clock fail!\n"; // DBG_SDIO_ERR("
|
||||||
goto LABEL_62;
|
goto LABEL_62;
|
||||||
}
|
}
|
||||||
v4 = *((u32 *) Data + 4);
|
v4 = *((u32 *) Data + 4);
|
||||||
|
@ -1627,7 +1627,7 @@ HAL_Status HalSdioHostChangeSdClockRtl8195a(IN VOID *Data, IN u8 Frequency) {
|
||||||
if (v2[24] != 55) {
|
if (v2[24] != 55) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return 238;
|
return 238;
|
||||||
v10 = "\r[SDIO Err]Command index error !!\n";
|
v10 = "\r[SDIO Err]Command index error!\n";
|
||||||
LABEL_15: DiagPrintf(v10);
|
LABEL_15: DiagPrintf(v10);
|
||||||
return 238;
|
return 238;
|
||||||
}
|
}
|
||||||
|
@ -1678,7 +1678,7 @@ HAL_Status HalSdioHostChangeSdClockRtl8195a(IN VOID *Data, IN u8 Frequency) {
|
||||||
if ((StatusData[16] & 0xF) != 1) {
|
if ((StatusData[16] & 0xF) != 1) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return 238;
|
return 238;
|
||||||
v10 = "\r[SDIO Err]\"High-Speed\" can't be switched !!\n";
|
v10 = "\r[SDIO Err]\"High-Speed\" can't be switched!\n";
|
||||||
goto LABEL_15;
|
goto LABEL_15;
|
||||||
}
|
}
|
||||||
v18 = SdioHostSwitchFunction(v2, 1, 1, (int) StatusData,
|
v18 = SdioHostSwitchFunction(v2, 1, 1, (int) StatusData,
|
||||||
|
@ -1688,14 +1688,14 @@ HAL_Status HalSdioHostChangeSdClockRtl8195a(IN VOID *Data, IN u8 Frequency) {
|
||||||
if ((StatusData[16] & 0xF) != 1) {
|
if ((StatusData[16] & 0xF) != 1) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return 238;
|
return 238;
|
||||||
v10 = "\r[SDIO Err]Card changes to High-Speed fail !!\n";
|
v10 = "\r[SDIO Err]Card changes to High-Speed fail!\n";
|
||||||
goto LABEL_15;
|
goto LABEL_15;
|
||||||
}
|
}
|
||||||
v3 = SdioHostSdClkCtrl(v2, 1, v18);
|
v3 = SdioHostSdClkCtrl(v2, 1, v18);
|
||||||
if (v3) {
|
if (v3) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return v3;
|
return v3;
|
||||||
v19 = "\r[SDIO Err]Host changes to High-Speed fail !!\n";
|
v19 = "\r[SDIO Err]Host changes to High-Speed fail!\n";
|
||||||
LABEL_62: DiagPrintf(v19);
|
LABEL_62: DiagPrintf(v19);
|
||||||
return v3;
|
return v3;
|
||||||
}
|
}
|
||||||
|
@ -1773,7 +1773,7 @@ IN u64 EndAddr) {
|
||||||
v12 = SdioHostGetResponse((void *) v5, *(u8 *) &v16.CmdFmt & 3);
|
v12 = SdioHostGetResponse((void *) v5, *(u8 *) &v16.CmdFmt & 3);
|
||||||
if (*(u8 *) (v5 + 24) != 33) {
|
if (*(u8 *) (v5 + 24) != 33) {
|
||||||
LABEL_20:
|
LABEL_20:
|
||||||
DBG_SDIO_ERR("Command index error !!\n");
|
DBG_SDIO_ERR("Command index error!\n");
|
||||||
result = 238;
|
result = 238;
|
||||||
} else {
|
} else {
|
||||||
result = SdioHostChkCmdInhibitCMD(v12);
|
result = SdioHostChkCmdInhibitCMD(v12);
|
||||||
|
@ -1818,7 +1818,7 @@ HAL_Status HalSdioHostGetWriteProtectRtl8195a(IN VOID *Data) {
|
||||||
if (v6) {
|
if (v6) {
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return v6;
|
return v6;
|
||||||
v9 = "\r[SDIO Err]Get card status fail !!\n";
|
v9 = "\r[SDIO Err]Get card status fail!\n";
|
||||||
LABEL_16: DiagPrintf(v9);
|
LABEL_16: DiagPrintf(v9);
|
||||||
return v6;
|
return v6;
|
||||||
}
|
}
|
||||||
|
@ -1830,7 +1830,7 @@ HAL_Status HalSdioHostGetWriteProtectRtl8195a(IN VOID *Data) {
|
||||||
}
|
}
|
||||||
if (!(ConfigDebugErr & 0x400))
|
if (!(ConfigDebugErr & 0x400))
|
||||||
return v6;
|
return v6;
|
||||||
v9 = "\r[SDIO Err]Get CSD fail !!\n";
|
v9 = "\r[SDIO Err]Get CSD fail!\n";
|
||||||
goto LABEL_16;
|
goto LABEL_16;
|
||||||
}
|
}
|
||||||
if (*((u8 *) v3 + 131) == 4 || *((u8 *) v3 + 131) == 5) {
|
if (*((u8 *) v3 + 131) == 4 || *((u8 *) v3 + 131) == 5) {
|
||||||
|
@ -1840,7 +1840,7 @@ HAL_Status HalSdioHostGetWriteProtectRtl8195a(IN VOID *Data) {
|
||||||
goto LABEL_10;
|
goto LABEL_10;
|
||||||
}
|
}
|
||||||
if (ConfigDebugErr & 0x400)
|
if (ConfigDebugErr & 0x400)
|
||||||
DiagPrintf("\r[SDIO Err]Wrong card state !!\n", ConfigDebugErr << 21);
|
DiagPrintf("\r[SDIO Err]Wrong card state!\n", ConfigDebugErr << 21);
|
||||||
return 238;
|
return 238;
|
||||||
}
|
}
|
||||||
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
// 23D4: using guessed type int DiagPrintf(const char *, ...);
|
||||||
|
@ -1917,7 +1917,7 @@ HAL_Status HalSdioHostSetWriteProtectRtl8195a(IN VOID *Data, IN u8 Setting) {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
SdioHostGetResponse(v3, v16 & 3);
|
SdioHostGetResponse(v3, v16 & 3);
|
||||||
if (*((u32 *) v3 + 5) & 0x4000000) {
|
if (*((u32 *) v3 + 5) & 0x4000000) {
|
||||||
DBG_SDIO_ERR("Write protect violation !!\n",
|
DBG_SDIO_ERR("Write protect violation!\n",
|
||||||
ConfigDebugErr << 21);
|
ConfigDebugErr << 21);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,9 @@ En32KCalibration(
|
||||||
{
|
{
|
||||||
u32 Rtemp;
|
u32 Rtemp;
|
||||||
u32 Ttemp = 0;
|
u32 Ttemp = 0;
|
||||||
|
#if CONFIG_DEBUG_LOG > 5
|
||||||
//DiagPrintf("32K clock source calibration\n");
|
DiagPrintf("32K clock source calibration\n");
|
||||||
|
#endif
|
||||||
//set parameter
|
//set parameter
|
||||||
HAL_WRITE32(SYSTEM_CTRL_BASE,REG_OSC32K_REG_CTRL0, 0);
|
HAL_WRITE32(SYSTEM_CTRL_BASE,REG_OSC32K_REG_CTRL0, 0);
|
||||||
//offset 1 = 0x1500
|
//offset 1 = 0x1500
|
||||||
|
@ -57,16 +57,20 @@ En32KCalibration(
|
||||||
|
|
||||||
Rtemp = HAL_READ32(SYSTEM_CTRL_BASE,REG_OSC32K_REG_CTRL1);
|
Rtemp = HAL_READ32(SYSTEM_CTRL_BASE,REG_OSC32K_REG_CTRL1);
|
||||||
if ((Rtemp & 0x3000) != 0x0){
|
if ((Rtemp & 0x3000) != 0x0){
|
||||||
//DiagPrintf("32.768 Calibration Success\n", Ttemp);
|
#if CONFIG_DEBUG_LOG > 5
|
||||||
|
DiagPrintf("32.768 Calibration Success\n", Ttemp);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Ttemp++;
|
Ttemp++;
|
||||||
HalDelayUs(30);
|
HalDelayUs(30);
|
||||||
//DiagPrintf("Check lock: %d\n", Ttemp);
|
#if CONFIG_DEBUG_LOG > 5
|
||||||
//DiagPrintf("0x278: %x\n", Rtemp);
|
DiagPrintf("Check lock: %d\n", Ttemp);
|
||||||
|
DiagPrintf("0x278: %x\n", Rtemp);
|
||||||
|
#endif
|
||||||
if (Ttemp > 100000) { /*Delay 100ms*/
|
if (Ttemp > 100000) { /*Delay 100ms*/
|
||||||
DiagPrintf("32K Calibration Fail!!\n", Ttemp);
|
DiagPrintf("32K Calibration Fail!\n", Ttemp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +82,10 @@ WDG_ADAPTER WDGAdapter;
|
||||||
extern HAL_TIMER_OP HalTimerOp;
|
extern HAL_TIMER_OP HalTimerOp;
|
||||||
|
|
||||||
#ifdef CONFIG_WDG_NORMAL
|
#ifdef CONFIG_WDG_NORMAL
|
||||||
|
/*
|
||||||
|
* pvvx: if WDT RESET_MODE:
|
||||||
|
* HAL_PERI_ON_WRITE32(REG_SOC_FUNC_EN, HAL_PERI_ON_READ32(REG_SOC_FUNC_EN) & 0x1FFFFF);
|
||||||
|
*/
|
||||||
VOID
|
VOID
|
||||||
WDGInitial(
|
WDGInitial(
|
||||||
IN u32 Period
|
IN u32 Period
|
||||||
|
@ -93,8 +101,9 @@ WDGInitial(
|
||||||
u32 PeriodTemp = 0;
|
u32 PeriodTemp = 0;
|
||||||
u32 *Reg = (u32*)&(WDGAdapter.Ctrl);
|
u32 *Reg = (u32*)&(WDGAdapter.Ctrl);
|
||||||
|
|
||||||
DBG_8195A(" Period = 0x%08x\n", Period);
|
#if CONFIG_DEBUG_LOG > 1
|
||||||
|
DBG_8195A("WdgPeriod = %d ms\n", Period);
|
||||||
|
#endif
|
||||||
for (CountId = 0; CountId < 12; CountId++) {
|
for (CountId = 0; CountId < 12; CountId++) {
|
||||||
CountTemp = ((0x00000001 << (CountId+1))-1);
|
CountTemp = ((0x00000001 << (CountId+1))-1);
|
||||||
DivFactor = (u16)((PeriodProcess)/(CountTemp*3));
|
DivFactor = (u16)((PeriodProcess)/(CountTemp*3));
|
||||||
|
@ -111,18 +120,20 @@ WDGInitial(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG_8195A("WdgScalar = 0x%08x\n", DivFacProcess);
|
#if CONFIG_DEBUG_LOG > 4
|
||||||
DBG_8195A("WdgCunLimit = 0x%08x\n", CountProcess);
|
DBG_8195A("WdgScalar = %p\n", DivFacProcess);
|
||||||
|
DBG_8195A("WdgCunLimit = %p\n", CountProcess);
|
||||||
|
#endif
|
||||||
WDGAdapter.Ctrl.WdgScalar = DivFacProcess;
|
WDGAdapter.Ctrl.WdgScalar = DivFacProcess;
|
||||||
WDGAdapter.Ctrl.WdgEnByte = 0;
|
WDGAdapter.Ctrl.WdgEnByte = 0;
|
||||||
WDGAdapter.Ctrl.WdgClear = 1;
|
WDGAdapter.Ctrl.WdgClear = 1;
|
||||||
WDGAdapter.Ctrl.WdgCunLimit = CountProcess;
|
WDGAdapter.Ctrl.WdgCunLimit = CountProcess;
|
||||||
WDGAdapter.Ctrl.WdgMode = RESET_MODE;
|
WDGAdapter.Ctrl.WdgMode = RESET_MODE;
|
||||||
WDGAdapter.Ctrl.WdgToISR = 0;
|
WDGAdapter.Ctrl.WdgToISR = 0;
|
||||||
|
#if CONFIG_DEBUG_LOG > 4
|
||||||
|
DBG_8195A("WdgCtrl = %p\n", (u32)(*Reg));
|
||||||
|
#endif
|
||||||
HAL_WRITE32(VENDOR_REG_BASE, 0, (*Reg));
|
HAL_WRITE32(VENDOR_REG_BASE, 0, (*Reg));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -160,6 +171,7 @@ WDGIrqInitial(
|
||||||
InterruptRegister(&(WDGAdapter.IrqHandle));
|
InterruptRegister(&(WDGAdapter.IrqHandle));
|
||||||
InterruptEn(&(WDGAdapter.IrqHandle));
|
InterruptEn(&(WDGAdapter.IrqHandle));
|
||||||
|
|
||||||
|
|
||||||
WDGAdapter.Ctrl.WdgToISR = 1; // clear ISR first
|
WDGAdapter.Ctrl.WdgToISR = 1; // clear ISR first
|
||||||
WDGAdapter.Ctrl.WdgMode = INT_MODE;
|
WDGAdapter.Ctrl.WdgMode = INT_MODE;
|
||||||
HAL_WRITE32(VENDOR_REG_BASE, 0, ((*Temp)));
|
HAL_WRITE32(VENDOR_REG_BASE, 0, ((*Temp)));
|
||||||
|
|
|
@ -358,7 +358,7 @@ I2CISRHandle_Patch(
|
||||||
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
||||||
BIT_CTRL_IC_INTR_STAT_R_TX_ABRT(1)) {
|
BIT_CTRL_IC_INTR_STAT_R_TX_ABRT(1)) {
|
||||||
I2CStsTmp = pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_TX_ABRT_SOURCE);
|
I2CStsTmp = pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_TX_ABRT_SOURCE);
|
||||||
DBG_I2C_ERR("!!!I2C%d INTR_TX_ABRT!!!\n",I2CIrqIdx);
|
DBG_I2C_ERR("!I2C%d INTR_TX_ABRT!\n",I2CIrqIdx);
|
||||||
DBG_I2C_ERR("I2C%d IC_TX_ABRT_SOURCE[%2x]: %x\n", I2CIrqIdx, REG_DW_I2C_IC_TX_ABRT_SOURCE, I2CStsTmp);
|
DBG_I2C_ERR("I2C%d IC_TX_ABRT_SOURCE[%2x]: %x\n", I2CIrqIdx, REG_DW_I2C_IC_TX_ABRT_SOURCE, I2CStsTmp);
|
||||||
DBG_I2C_ERR("Dev Sts:%x\n",pSalI2CHND->DevSts);
|
DBG_I2C_ERR("Dev Sts:%x\n",pSalI2CHND->DevSts);
|
||||||
DBG_I2C_ERR("rx len:%x\n",pSalI2CHND->pRXBuf->DataLen);
|
DBG_I2C_ERR("rx len:%x\n",pSalI2CHND->pRXBuf->DataLen);
|
||||||
|
@ -579,7 +579,7 @@ I2CISRHandle_Patch(
|
||||||
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
||||||
BIT_CTRL_IC_INTR_STAT_R_TX_OVER(1)) {
|
BIT_CTRL_IC_INTR_STAT_R_TX_OVER(1)) {
|
||||||
|
|
||||||
DBG_I2C_ERR("!!!I2C%d INTR_TX_OVER!!!\n",I2CIrqIdx);
|
DBG_I2C_ERR("!I2C%d INTR_TX_OVER!\n",I2CIrqIdx);
|
||||||
|
|
||||||
/* Clear I2C interrupt */
|
/* Clear I2C interrupt */
|
||||||
pHalI2CInitDat->I2CIntrClr = REG_DW_I2C_IC_CLR_TX_OVER;
|
pHalI2CInitDat->I2CIntrClr = REG_DW_I2C_IC_CLR_TX_OVER;
|
||||||
|
@ -778,7 +778,7 @@ I2CISRHandle_Patch(
|
||||||
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
if (pHalI2COP->HalI2CReadReg(pHalI2CInitDat,REG_DW_I2C_IC_INTR_STAT) &
|
||||||
BIT_CTRL_IC_INTR_STAT_R_RX_UNDER(1)) {
|
BIT_CTRL_IC_INTR_STAT_R_RX_UNDER(1)) {
|
||||||
|
|
||||||
DBG_I2C_ERR("!!!I2C%d INTR_RX_UNDER!!!\n",I2CIrqIdx);
|
DBG_I2C_ERR("!I2C%d INTR_RX_UNDER!\n",I2CIrqIdx);
|
||||||
|
|
||||||
pHalI2CInitDat->I2CIntrClr = REG_DW_I2C_IC_CLR_RX_UNDER;
|
pHalI2CInitDat->I2CIntrClr = REG_DW_I2C_IC_CLR_RX_UNDER;
|
||||||
pHalI2COP->HalI2CClrIntr(pHalI2CInitDat);
|
pHalI2COP->HalI2CClrIntr(pHalI2CInitDat);
|
||||||
|
|
|
@ -310,7 +310,7 @@ SdrTestApp(
|
||||||
|
|
||||||
//1 "SdrControllerInit" is located in Image1, so we shouldn't call it in Image2
|
//1 "SdrControllerInit" is located in Image1, so we shouldn't call it in Image2
|
||||||
if (!SdrControllerInit()) {
|
if (!SdrControllerInit()) {
|
||||||
DBG_8195A("SDR Calibartion Fail!!!!\n");
|
DBG_8195A("SDR Calibartion Fail!\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
#include "rtl8195a.h"
|
#include "rtl8195a.h"
|
||||||
#include "hal_soc_ps_monitor.h"
|
#include "hal_soc_ps_monitor.h"
|
||||||
|
#include "rtl_consol.h"
|
||||||
|
|
||||||
#include "PinNames.h"
|
#include "PinNames.h"
|
||||||
#include "gpio_api.h"
|
#include "gpio_api.h"
|
||||||
|
@ -135,6 +136,8 @@ PatchHalLogUartInit(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//_LONG_CALL_ extern VOID UartLogIrqHandle(VOID * Data); // in ROM
|
||||||
|
extern void UartLogIrqHandleRam(void * data);
|
||||||
VOID
|
VOID
|
||||||
PSHalInitPlatformLogUart(
|
PSHalInitPlatformLogUart(
|
||||||
VOID
|
VOID
|
||||||
|
@ -443,7 +446,7 @@ CLKCal(
|
||||||
RRTemp = (((2133/Rtemp) >> x) - 1);
|
RRTemp = (((2133/Rtemp) >> x) - 1);
|
||||||
}
|
}
|
||||||
if ( x == 5 )
|
if ( x == 5 )
|
||||||
DiagPrintf("Using ana to cal is not allowed!!\n");
|
DiagPrintf("Using ana to cal is not allowed!\n");
|
||||||
|
|
||||||
return RRTemp;
|
return RRTemp;
|
||||||
}
|
}
|
||||||
|
@ -1902,7 +1905,6 @@ DeepSleep(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DSleep_GPIO(
|
DSleep_GPIO(
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -369,7 +369,7 @@ SpicFlashInitRtl8195A(
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBG_8195A("No Support SPI Mode!!!!!!!!\n");
|
DBG_8195A("No Support SPI Mode!\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1455,7 +1455,7 @@ SpicNVMCalStore(u8 BitMode, u8 CpuClk)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// There is a parameter on the flash memory already
|
// There is a parameter on the flash memory already
|
||||||
DBG_SPIF_ERR("SpicNVMCalStore: The flash memory(@0x%x = 0x%x) is not able to be write, Erase it first!!\r\n",
|
DBG_SPIF_ERR("SpicNVMCalStore: The flash memory(@0x%x = 0x%x) is not able to be write, Erase it first!\r\n",
|
||||||
(FLASH_SPIC_PARA_BASE+flash_offset), spci_para);
|
(FLASH_SPIC_PARA_BASE+flash_offset), spci_para);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ int main(void)
|
||||||
DiagPrintf("<---- Init %d ---->\n", x);
|
DiagPrintf("<---- Init %d ---->\n", x);
|
||||||
if (!SpicFlashInitRtl8195A(x)) {// SpicOneBitMode)){
|
if (!SpicFlashInitRtl8195A(x)) {// SpicOneBitMode)){
|
||||||
|
|
||||||
DiagPrintf("SPI Init Fail!!!!!!\n"); // DBG_SPIF_ERR?
|
DiagPrintf("SPI Init Fail!\n"); // DBG_SPIF_ERR?
|
||||||
HAL_WRITE32(SYSTEM_CTRL_BASE, REG_SYS_DSTBY_INFO3, HAL_READ32(SYSTEM_CTRL_BASE, REG_SYS_DSTBY_INFO3)|0xf);
|
HAL_WRITE32(SYSTEM_CTRL_BASE, REG_SYS_DSTBY_INFO3, HAL_READ32(SYSTEM_CTRL_BASE, REG_SYS_DSTBY_INFO3)|0xf);
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct BlockInfo{
|
||||||
};
|
};
|
||||||
|
|
||||||
void dma_done_handler(uint32_t id) {
|
void dma_done_handler(uint32_t id) {
|
||||||
DiagPrintf("DMA Copy Done!!\r\n");
|
DiagPrintf("DMA Copy Done!\r\n");
|
||||||
dma_done = 1;
|
dma_done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ int main(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
DiagPrintf("DMA Copy Memory Compare OK!! %x\r\n", TestBuf2[DMA_DST_OFFSET+DMA_CPY_LEN - 1]);
|
DiagPrintf("DMA Copy Memory Compare OK! %x\r\n", TestBuf2[DMA_DST_OFFSET+DMA_CPY_LEN - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
HalGdmaMemCpyDeInit(&(gdma.gdma_obj));
|
HalGdmaMemCpyDeInit(&(gdma.gdma_obj));
|
||||||
|
@ -118,7 +118,7 @@ volatile uint8_t dma_done;
|
||||||
|
|
||||||
|
|
||||||
void dma_done_handler(uint32_t id) {
|
void dma_done_handler(uint32_t id) {
|
||||||
DiagPrintf("DMA Copy Done!!\r\n");
|
DiagPrintf("DMA Copy Done!\r\n");
|
||||||
dma_done = 1;
|
dma_done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ int main(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
DiagPrintf("DMA Copy Memory Compare OK!! %x\r\n", TestBuf2[DMA_DST_OFFSET+DMA_CPY_LEN]);
|
DiagPrintf("DMA Copy Memory Compare OK! %x\r\n", TestBuf2[DMA_DST_OFFSET+DMA_CPY_LEN]);
|
||||||
}
|
}
|
||||||
HalGdmaMemCpyDeInit(&(gdma.gdma_obj));
|
HalGdmaMemCpyDeInit(&(gdma.gdma_obj));
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ void main(void)
|
||||||
log_uart_init(&uobj, 38400, 8, ParityNone, 1);
|
log_uart_init(&uobj, 38400, 8, ParityNone, 1);
|
||||||
|
|
||||||
uart_send_string(&uobj, "UART API Demo...\r\n");
|
uart_send_string(&uobj, "UART API Demo...\r\n");
|
||||||
uart_send_string(&uobj, "Hello World!!\r\n");
|
uart_send_string(&uobj, "Hello World!\r\n");
|
||||||
while(1){
|
while(1){
|
||||||
uart_send_string(&uobj, "\r\n8195a$");
|
uart_send_string(&uobj, "\r\n8195a$");
|
||||||
rc = log_uart_getc(&uobj);
|
rc = log_uart_getc(&uobj);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "log_uart_api.h"
|
#include "log_uart_api.h"
|
||||||
|
|
||||||
char buf[100]="Hello World!!\r\n";;
|
char buf[100]="Hello World!\r\n";;
|
||||||
log_uart_t uobj;
|
log_uart_t uobj;
|
||||||
|
|
||||||
int uart_scan (char *buf)
|
int uart_scan (char *buf)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
extern void wait_ms(int ms);
|
extern void wait_ms(int ms);
|
||||||
|
|
||||||
char buf[BUF_SZ]="Hello World!!\r\n";;
|
char buf[BUF_SZ]="Hello World!\r\n";;
|
||||||
volatile uint32_t tx_busy=0;
|
volatile uint32_t tx_busy=0;
|
||||||
volatile uint32_t rx_busy=0;
|
volatile uint32_t rx_busy=0;
|
||||||
log_uart_t uobj;
|
log_uart_t uobj;
|
||||||
|
|
|
@ -117,7 +117,7 @@ void main(void)
|
||||||
wait_ms(10);
|
wait_ms(10);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
DBG_8195A("SPI Master Write Done!!\r\n");
|
DBG_8195A("SPI Master Write Done!\r\n");
|
||||||
|
|
||||||
DBG_8195A("SPI Master Read Test==>\r\n");
|
DBG_8195A("SPI Master Read Test==>\r\n");
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void main(void)
|
||||||
wait_ms(10);
|
wait_ms(10);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
DBG_8195A("SPI Master Read Done!!\r\n");
|
DBG_8195A("SPI Master Read Done!\r\n");
|
||||||
__rtl_memDump_v1_00(TestBuf, TEST_BUF_SIZE, "SPI Master Read Data:");
|
__rtl_memDump_v1_00(TestBuf, TEST_BUF_SIZE, "SPI Master Read Data:");
|
||||||
Counter++;
|
Counter++;
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ void main(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBG_8195A("SPI Slave Write Done!!\r\n");
|
DBG_8195A("SPI Slave Write Done!\r\n");
|
||||||
Counter++;
|
Counter++;
|
||||||
}
|
}
|
||||||
spi_free(&spi_slave);
|
spi_free(&spi_slave);
|
||||||
|
|
|
@ -36,7 +36,7 @@ void main(void)
|
||||||
serial_format(&sobj, 8, ParityNone, 1);
|
serial_format(&sobj, 8, ParityNone, 1);
|
||||||
|
|
||||||
uart_send_string(&sobj, "UART API Demo...\r\n");
|
uart_send_string(&sobj, "UART API Demo...\r\n");
|
||||||
uart_send_string(&sobj, "Hello World!!\r\n");
|
uart_send_string(&sobj, "Hello World!\r\n");
|
||||||
while(1){
|
while(1){
|
||||||
uart_send_string(&sobj, "\r\n8195a$");
|
uart_send_string(&sobj, "\r\n8195a$");
|
||||||
rc = serial_getc(&sobj);
|
rc = serial_getc(&sobj);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void main(void)
|
||||||
serial_format(&sobj, 8, ParityNone, 1);
|
serial_format(&sobj, 8, ParityNone, 1);
|
||||||
|
|
||||||
uart_send_string(&sobj, "UART IRQ API Demo...\r\n");
|
uart_send_string(&sobj, "UART IRQ API Demo...\r\n");
|
||||||
uart_send_string(&sobj, "Hello World!!\n");
|
uart_send_string(&sobj, "Hello World!\n");
|
||||||
uart_send_string(&sobj, "\r\n8195a$");
|
uart_send_string(&sobj, "\r\n8195a$");
|
||||||
serial_irq_handler(&sobj, uart_irq, (uint32_t)&sobj);
|
serial_irq_handler(&sobj, uart_irq, (uint32_t)&sobj);
|
||||||
serial_irq_set(&sobj, RxIrq, 1);
|
serial_irq_set(&sobj, RxIrq, 1);
|
||||||
|
|
|
@ -70,7 +70,7 @@ void main(void)
|
||||||
while (1) {
|
while (1) {
|
||||||
#if 0
|
#if 0
|
||||||
if (!tx_busy) {
|
if (!tx_busy) {
|
||||||
uart_send_string(&sobj, "Hello! World!! :) \r\n");
|
uart_send_string(&sobj, "Hello World! :) \r\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (rx_done) {
|
if (rx_done) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ void big_task() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void my_watchdog_irq_handler(uint32_t id) {
|
void my_watchdog_irq_handler(uint32_t id) {
|
||||||
printf("watchdog barks!!!\r\n");
|
printf("watchdog barks!\r\n");
|
||||||
watchdog_stop();
|
watchdog_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue