tidy up unused printf

Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
pull/12106/head
PARKJIHOON 2020-01-11 01:58:54 +09:00 committed by Andrew Chong
parent c8e776929a
commit ccb85e00f1
9 changed files with 8 additions and 89 deletions

View File

@ -17,11 +17,10 @@
*
****************************************************************************/
#include "mbed.h"
#include "modem_io_device.h"
#include "s5js100_dcxo.h"
#include "mbed_trace.h"
#include "mbed_error.h"
#define TRACE_GROUP "DCXO"
#ifndef DCXO_UPDATE_DBG_ON

View File

@ -35,7 +35,6 @@ int flash_idx = 0;
#define CACHE_LINE_MASK 0xffffffe0
#define CACHE_LINE_SIZE 32
Semaphore *g_sem = new Semaphore(1);
//int sflash_init=0;
/****************************************************************************
* Public Function Prototypes
@ -181,8 +180,6 @@ static void local_memcpy(void *dst, void *src, size_t n)
unsigned char *pin = (unsigned char *)src;
while (n-- > 0) {
*pout++ = *pin++;
//hw_delay_us(100 * S5JS100_FLASH_DELAYTIME);
//printf(".");
}
}
@ -416,51 +413,40 @@ char *get_env(const char *name)
/* hal/flash_api.h */
int32_t flash_init(flash_t *obj)
{
printf("%s\n\r", __func__);
SFlash_DriverInitialize();
return 0;
}
int32_t flash_free(flash_t *obj)
{
printf("%s\n\r", __func__);
return 0;
}
uint32_t flash_get_page_size(const flash_t *info)
{
// printf("%s, PAGE[1B]\n\r", __func__);
return 4; /*S5JS100_FLASH_PAGE_SIZE*/ //byte program
return 4; /*S5JS100_FLASH_PAGE_SIZE*/
}
uint32_t flash_get_sector_size(const flash_t *info, uint32_t addr)
{
// printf("%s addr[0x%x], size[0x%x]\n\r", __func__, addr, S5JS100_FLASH_BLOCK_SIZE);
return up_progmem_blocksize(); //4KB
return up_progmem_blocksize();
}
uint32_t flash_get_start_address(const flash_t *info)
{
// printf("%s addr[0x%x]\n\r", __func__, S5JS100_FLASH_FS_PADDR);
return S5JS100_FLASH_FS_PADDR;
}
uint32_t flash_get_size(const flash_t *info)
{
// printf("%s size[0x%x]\n\r", __func__, S5JS100_FLASH_FS_SIZE);
return S5JS100_FLASH_FS_SIZE;
}
int32_t flash_program_page(flash_t *obj, uint32_t addr, const uint8_t *data, uint32_t size)
{
// printf("\n\rW\r\n");
if (addr > S5JS100_FLASH_PADDR) {
printf("%s FLASH, addr[0x%x], size[%d]\n\r", __func__, addr, size);
return sflash_write(addr, (unsigned char *)data, size);
} else {
// printf("%s, addr[0x%x], size[%d]\n\r", __func__, addr, size);
// sflash_write(0x4086A000+flash_idx, (unsigned char *)data, size); //Write Test
// printf("\n\rWRITE[0x%x], [0x%x]", addr, 0x4086A000+flash_idx);
local_memcpy((void *)addr, (void *)data, size);
return 0;
}
@ -468,20 +454,14 @@ int32_t flash_program_page(flash_t *obj, uint32_t addr, const uint8_t *data, uin
uint8_t flash_get_erase_value(const flash_t *obj)
{
(void)obj;
// printf("%s\n\r", __func__);
return 0xFF;
}
int32_t flash_erase_sector(flash_t *obj, uint32_t addr)
{
// printf("\n\rE\n\r");
if (addr > S5JS100_FLASH_PADDR) {
printf("%s FLASH addr[0x%x]\n\r", __func__, addr);
return sflash_erase(addr);
} else {
// printf("%s addr[0x%x]\n\r", __func__, addr);
// printf("\n\r[[ERASE]]\n\r"); //Erase Test
// sflash_erase(0x4086A000);
memset((void *)addr, 0xFFFFFFFF, 4096);
return 0;
}

View File

@ -175,7 +175,7 @@ int ShmemIpcDevice::xmit_ipc_msg(mio_buf *msg)
if (chk_nospc) {
/* TO DO - implement this back pressure to operate properly. */
printf("ERROR Not implement %s:%d\n", __func__, __LINE__);
mbed_error_printf("ERROR Not implement %s:%d\n", __func__, __LINE__);
while (1);
/* Set res_required flag for the "dev" */
res_required = 1;
@ -317,7 +317,7 @@ ShmemLinkDevice::ShmemLinkDevice()
ShmemLinkDevice::~ShmemLinkDevice()
{
printf("need to add code here ,%s\n\r", __func__);
mbed_error_printf("need to add code here ,%s\n\r", __func__);
}
/* To avoid race conditions start of RX/TX threads should be done
@ -386,7 +386,7 @@ void rx_cmd_phone_start(void)
void rx_cmd_cp_crash(void)
{
printf("\n!!!!!CP Crash!!!!!\n");
mbed_error_printf("\n!!!!!CP Crash!!!!!\n");
if (!strcmp(get_env("CRASHDUMP"), "ON")) {
mcpu_reset();
mcpu_init(MCPU_CP);

View File

@ -140,7 +140,7 @@ void shmem_get_data(unsigned int *cs, unsigned int *nv, unsigned int *cal)
g_flash_nv_base = FLASH_NV_BASE;
g_flash_cal_base = FLASH_CAL_BASE;
} else {
printf("no support FLASH size..\n");
mbed_error_printf("no support FLASH size..\n");
}
section[0].start = g_flash_cs_base;
@ -220,7 +220,6 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
while (1) {
wsize = (real_len - wlen + cached_size > psize) ? psize - cached_size : real_len - wlen;
//printf("shmem_data_save:%d wsize : 0x%x cached_size : 0x%x real_len : 0x%x wlen : 0x%x psize : 0x%x buffer : 0x%x\n", __LINE__, wsize, cached_size, real_len, wlen, psize, buffer);
if (wsize != psize) {
memcpy(save_cached + cached_size, buffer + wlen, wsize);
@ -233,13 +232,10 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
poffset = (offset / psize) * psize;
offset += wsize;
//printf("shmem_data_save:%d wsize : 0x%x cached_size : 0x%x real_len : 0x%x wlen : 0x%x psize : 0x%x buf : 0x%x\n", __LINE__, wsize, cached_size, real_len, wlen, psize, buf);
if (cached_size != psize) {
break;
}
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset, psize, buf);
cached_size = 0;
sflash_erase(flash_start_addr + poffset);
sflash_write(flash_start_addr + poffset, buf, psize);
@ -247,7 +243,6 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
if (real_len + s_size >= t_size) {
poffset = (offset / psize) * psize;
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset, cached_size, save_cached);
if (cached_size + sizeof(shmem_section_data) <= psize) {
memcpy(save_cached + 0xFF0, (unsigned char *)(&(next_shmem_section[section_idx])), 0x10);
sflash_erase(flash_start_addr + poffset);
@ -255,7 +250,6 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
} else {
sflash_erase(flash_start_addr + poffset);
sflash_write(flash_start_addr + poffset, save_cached, cached_size);
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset + psize, cached_size, save_cached);
memcpy(save_cached + 0xFF0, (unsigned char *)(&(next_shmem_section[section_idx])), 0x10);
sflash_erase(flash_start_addr + poffset + psize);
sflash_write(flash_start_addr + poffset, save_cached, psize);
@ -271,14 +265,12 @@ void shmem_factory_reset(void)
unsigned int poffset = 0;
/* erase NV */
flash_start_addr = g_flash_nv_base;
printf("erase NV [0x%x]\n", flash_start_addr);
for (poffset = 0; poffset < 64; poffset++) {
sflash_erase(flash_start_addr + poffset * 4096);
}
/* erase CS */
flash_start_addr = g_flash_cs_base;
printf("erase CS [0x%x]\n", flash_start_addr);
for (poffset = 0; poffset < 75; poffset++) {
sflash_erase(flash_start_addr + poffset * 4096);
}
@ -310,12 +302,8 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
sent_size = *(uint32_t *)(buffer + 8);
remain_len = *(uint32_t *)(buffer + 4) - *(uint32_t *)(buffer + 8);
//printf("%s:%d cur_save_target(0x%08X) len(%x)\n", __func__, __LINE__, cur_save_target, buf->len);
//printf("msg_len : 0x%x t_size : 0x%x, s_size : 0x%x, real_len : 0x%x, remain_len : 0x%x\n", msg_len, total_size, sent_size, real_len, remain_len);
shmem_data_save(cur_save_target, buffer + 12, real_len, total_size, sent_size);
} else {
//printf("%s:%d cur_save_target(0x%08X) len(%x)\n", __func__, __LINE__, cur_save_target, buf->len);
remain_len = 0;
real_len = 0;
}
@ -329,8 +317,6 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
shmem_mio->register_ReadCb(shmem_initiate_cb, NULL);
nbsleep_req = 1;
nbsleep_sec = ((((unsigned long long)(getreg32(0x81000000 + 0xE4))) << 32) + getreg32(0x81000000 + 0xE8)) / 32768;
printf("\nEnter NB sleep!! %lld seconds\n", nbsleep_sec);
printf("\nOK\n");
}
cur_save_target += 0x10;
@ -340,7 +326,6 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
}
}
//printf("%s:%d cur_save_target(0x%08X)\n", __func__, __LINE__, cur_save_target);
shmem_mio->write((char *)(&cur_save_target), 4);
}

View File

@ -50,7 +50,6 @@ time_t rtc_read(void)
void rtc_write(time_t t)
{
g_base_timeval = t;
// printf("base time will be %d\n", g_base_timeval);
}
static uint8_t rtc_hex8_to_dec(uint8_t hex_val)

View File

@ -20,7 +20,6 @@
#include "mbed.h"
#include "s5js100_dcxo.h"
#include "s5js100_type.h"
#include "mbed_trace.h"
#define TRACE_GROUP "DCXO"
@ -112,9 +111,6 @@ static unsigned int tsu_code_to_temperature(unsigned int tsu_code)
ratio = ((int)(g_dcxo_tsu_table[index - 1] - tsu_code) * DCXO_TSU_TABLE_UNIT)
/ (int)(g_dcxo_tsu_table[index - 1] - g_dcxo_tsu_table[index]);
temp_code = base + ratio;
//dbg("\ng_dcxo_tsu_table[index]:%d, g_dcxo_tsu_table[index-1]:%d\n", g_dcxo_tsu_table[index], g_dcxo_tsu_table[index-1]);
//dbg("\nbase:%d, ratio:%d\n", base, ratio);
return temp_code;
}
@ -150,11 +146,8 @@ static unsigned int tsu_temperature_to_code(unsigned int temp_celcius)
****************************************************************************/
int dcxo_tsu_isr(int irq, void *context, void *arg)
{
//dbg("%d, %d, %d\n", irq, context, arg);
NVIC_DisableIRQ((IRQn_Type)irq);
//dbg("tsu_code : 0x%x, 0x%x, 0x%x, 0x%x\n", (getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA1) & 0xFFFF0000) >> 16, getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA1) & 0xFFFF, (getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA0) & 0xFFFF0000) >> 16, getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA0) & 0xFFFF);
tsu_interrupt_flag = 1;
if (irq == S5JS100_IRQ_TSU0) {
@ -257,23 +250,12 @@ void s5js100_dcxo_ctb_loop(void)
ctb_prev--;
}
s5js100_dcxo_set_tune_value(ctb_prev, 4096);
//dcxollvdbg("[ctb_cal:%d, ctb_set:%d]\n", ctb, ctb_prev);
}
if (ctb == 0) {
S5JS100_DCXO_DBG("[ERROR]CTB was 0x0[temp:%d]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", tsu);
//asm("b .");
}
#if 0
if ((tsu - 50000) > 0) {
//printf("TSU : %d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (tsu) % 1000, ctb, tsu);
} else if ((tsu - 50000) > -1000) {
//printf("TSU : -%d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (1000 - (tsu) % 1000) % 1000, ctb, tsu);
} else {
//printf("TSU : %d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (1000 - (tsu) % 1000) % 1000, ctb, tsu);
}
#endif
loop_started = 1;
dcxo_ctb_sem_release();
osDelay(50);
@ -434,17 +416,6 @@ int s5js100_dcxo_start_ctb_loop(Full_set_table_t tbl[])
return 0;
}
int s5js100_dcxo_stop_ctb_loop(void)
{
// if(!task_delete(g_dcxo_tid)){
// lldbg("fail to delete ctb_loop task ..\n");
// }
// else
// lldbg("ctb_loop stopped..\n");
return 0;
}
/****************************************************************************
* Name: s5js100_tsu_get_temperature
*
@ -591,8 +562,6 @@ int s5js100_dcxo_get_coarse_tune_value(void)
int s5js100_dcxo_set_tune_value(unsigned int coarse_value, unsigned int fine_value)
{
// printf("%s, coarse_value : 0x%x, fine_value : 0x%x\n", __func__, coarse_value, fine_value);
#if defined(DCXO_FINE_PMU_COARSE_DCXO)
// Fine=DcxoFTune, Coarse=FTUNE2
coarse_value <<= 6;
@ -641,15 +610,11 @@ int s5js100_dcxo_set_tune_value(unsigned int coarse_value, unsigned int fine_val
}
#endif
//printf("dotsu : %d\n", s5js100_tsu_get_code());
return 1;
}
int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fine_value)
{
//printf("%s, coarse_value : 0x%x, fine_value : 0x%x\n", __func__, coarse_value, fine_value);
#if defined(DCXO_FINE_PMU_COARSE_DCXO)
// Coarse=DcxoFTune, Fine=FTUNE2
@ -671,7 +636,6 @@ int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fi
// Fine=FTUNE2, Coarse=FTUNE
coarse_value >>= 6;
//printf("coarse_value changed to 14 bit (0x%x)\n", coarse_value);
// Fine = FTUNE2 13bit
// EVT0 : 0x81000528[31:17], EVT1 : 0x8100000C[28:14]
@ -693,7 +657,6 @@ int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fi
// Fine=DcxoFTune, Coarse=FTUNE2
coarse_value >>= 6;
//printf("coarse_value changed to 14 bit (0x%x)\n", coarse_value);
// Fine = DcxoFTune 20bit
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_DSM_CFG0, 0xFFFFF << 1, fine_value << 1);
@ -738,7 +701,6 @@ int s5js100_dcxo_set_dsmdither(unsigned int dither_bit_sel)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("To enable dsm dither, DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}
@ -751,7 +713,6 @@ int s5js100_dcxo_set_dither_bit_sel(unsigned int dither_bit_sel)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}
@ -764,7 +725,6 @@ int s5js100_dcxo_set_dsm_type(unsigned int dsm_type)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}
@ -777,7 +737,6 @@ int s5js100_dcxo_set_en_dsm_dither(unsigned int en_dsm_dither)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}
@ -790,7 +749,6 @@ int s5js100_dcxo_set_prbs_sel(unsigned int prbs_sel)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}
@ -803,7 +761,6 @@ int s5js100_dcxo_en_dsm(unsigned int en_dsm)
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
#else
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
#endif
return 1;
}

View File

@ -338,7 +338,6 @@ void mcpu_init(MCPU_MODE device)
S5JS100_PWR_DBG("\nMCPU BOOT\n");
if (device == MCPU_GNSS) {
//printf("\nSetting FOR GNSS\n");
putreg32(0x7004, 0x8202114C);
putreg32(0x7004, 0x82021150);
putreg32(0x7004, 0x82021154);

View File

@ -117,7 +117,6 @@ void hal_watchdog_kick(void)
watchdog_status_t hal_watchdog_stop(void)
{
// printf("%s\r\n", __func__);
s5js100_watchdog_disable();
return WATCHDOG_STATUS_OK;
}

View File

@ -22,6 +22,7 @@
****************************************************************************/
#include "hal/trng_api.h"
#include "sss_driver_rng.h"
#include "mbed_error.h"
void trng_init(trng_t *obj)
{