Skip to content

Commit

Permalink
os/arch/arm/src/amebasmart: Revise logging usage
Browse files Browse the repository at this point in the history
- Optimize some logging to reduce flash memory usage
  • Loading branch information
edwakuwaku committed Jul 11, 2024
1 parent 184763a commit 0f37078
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
6 changes: 3 additions & 3 deletions os/arch/arm/src/amebasmart/amebasmart_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ FAR struct mtd_dev_s *up_flashinitialize(void)
#ifdef CONFIG_MTD_REGISTRATION
priv->mtd.name = "ameba_flash";
#endif
u8 chip_id[4];
flash_read_id(NULL, chip_id, 4);

lldbg("Manufacturer : %u memory type : %u capacity : %u\n", chip_id[0], chip_id[1], chip_id[2]);
/* For flash information, it will be printed during KM4 booting phase
For example: [FLASHCLK-I] Flash ID: ef-40-18
*/
return (FAR struct mtd_dev_s *)priv;
}
#ifdef CONFIG_PM
Expand Down
4 changes: 2 additions & 2 deletions os/arch/arm/src/amebasmart/amebasmart_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,14 +1181,14 @@ static void amebasmart_spi_exchange(FAR struct spi_dev_s *dev,
uint8_t *txbuff_aligned = NULL;
rxbuff_aligned = (uint8_t *)rtw_zmalloc(SPI_DMA_MAX_BUFFER_SIZE);
if(rxbuff_aligned == NULL) {
lldbg("rxbuff_aligned malloc failed\n");
dbg_noarg("SPI RX malloc failed\n");
return;
}
if (txbuffer) {
txbuff_aligned = (uint8_t *)rtw_zmalloc(SPI_DMA_MAX_BUFFER_SIZE);
if(txbuff_aligned == NULL) {
rtw_mfree(rxbuff_aligned, 0);
lldbg("txbuff_aligned malloc failed\n");
dbg_noarg("SPI TX malloc failed\n");
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion os/arch/arm/src/common/up_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void up_initialize(void)

#ifdef CONFIG_SYSTEM_REBOOT_REASON
up_reboot_reason_init();
lldbg("[Reboot Reason] : %d\n", up_reboot_reason_read());
lldbg_noarg("[Reboot Reason]: %d\n", up_reboot_reason_read());
#endif

/* Calibrate the timing loop */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ static uint8_t* hci_platform_get_btfw_patch(uint32_t *rtlbt_fw_size)
/* Below condition is minimal requirement to meet */
/* Address must be starting of the external flash, size shouldn't be larger than 128KB */
if(!((*rtlbt_fw_size > 0 && *rtlbt_fw_size < 0x20000) && (rtlbt_fw_addr == EXT_FLASH_BASE_ADDRESS))) {
dbg("Please check whether RTK data binary is flashed correctly!");
ASSERT(0);
}
if (rtlbt_fw_hdr_ptr) {
Expand Down
23 changes: 14 additions & 9 deletions os/board/rtl8730e/src/rtl8730e_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ void amebasmart_mount_partitions(void)
/* Configure mtd partitions */
ret = configure_mtd_partitions(mtd, 0, &partinfo);
if (ret != OK) {
lldbg("ERROR: configure_mtd_partitions for primary flash failed\n");
return;
ret = __LINE__;
goto errout;
}

#ifdef CONFIG_AUTOMOUNT
Expand All @@ -336,26 +336,31 @@ void amebasmart_mount_partitions(void)
#ifdef CONFIG_MTD_JEDEC
mtd = jedec_initialize(spi);
if (mtd == NULL) {
lldbg("Jedec Init failed\n");
return;
ret = __LINE__;
goto errout;
}

#elif defined(CONFIG_MTD_W25)
mtd = w25_initialize(spi);
if (mtd == NULL) {
lldbg("w25 Init failed\n");
return;
ret = __LINE__;
goto errout;
}
#endif
ret = configure_mtd_partitions(mtd, 1, &partinfo);
if (ret != OK) {
lldbg("ERROR: configure_mtd_partitions for secondary flash failed\n");
return;
ret = __LINE__;
goto errout;
}
#ifdef CONFIG_AUTOMOUNT
automount_fs_partition(&partinfo);
#endif
#endif /* end of CONFIG_SECOND_FLASH_PARTITION */
#endif /* CONFIG_SECOND_FLASH_PARTITION */
errout:
if (ret != OK) {
lldbg("Mounting failed, check line: %d\n", ret);
return;
}
}

#ifdef CONFIG_FTL_ENABLED
Expand Down

0 comments on commit 0f37078

Please sign in to comment.