[HUST CSE][bsp] fix printf parameter in loongson (#7321)

This commit is contained in:
Chef003 2023-04-20 11:08:58 +08:00 committed by GitHub
parent 0ace6078e7
commit 9490f8818d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ void *ls1c_spi_get_base(unsigned char SPIx)
void ls1c_spi_print_all_regs_info(void *spi_base) void ls1c_spi_print_all_regs_info(void *spi_base)
{ {
printf("[%s] SPCR=0x%x, SPSR=0x%x, SPER=0x%x, SFC_PARAM=0x%x, SFC_SOFTCS=0x%x, SFC_TIMING=0x%x\r\n", printf("[%s] SPCR=0x%x, SPSR=0x%x, SPER=0x%x, SFC_PARAM=0x%x, SFC_SOFTCS=0x%x, SFC_TIMING=0x%x\r\n",
__FUNCTION__, __FUNCTION__,
reg_read_8(spi_base + LS1C_SPI_SPCR_OFFSET), reg_read_8(spi_base + LS1C_SPI_SPCR_OFFSET),
reg_read_8(spi_base + LS1C_SPI_SPSR_OFFSET), reg_read_8(spi_base + LS1C_SPI_SPSR_OFFSET),
reg_read_8(spi_base + LS1C_SPI_SPER_OFFSET), reg_read_8(spi_base + LS1C_SPI_SPER_OFFSET),
@ -245,7 +245,7 @@ void ls1c_spi_clear(void *spi_base)
val = reg_read_8(spi_base + LS1C_SPI_SPSR_OFFSET); val = reg_read_8(spi_base + LS1C_SPI_SPSR_OFFSET);
if (LS1C_SPI_SPSR_WCOL_MASK & val) if (LS1C_SPI_SPSR_WCOL_MASK & val)
{ {
printf("[%s] clear register SPSR's wcol!\r\n"); // 手册和linux源码中不一样加个打印看看 printf("[%s] clear register SPSR's wcol!\r\n", __FUNCTION__); // 手册和linux源码中不一样加个打印看看
reg_write_8(val & ~LS1C_SPI_SPSR_WCOL_MASK, spi_base + LS1C_SPI_SPSR_OFFSET); // 写0linux源码中是写0 reg_write_8(val & ~LS1C_SPI_SPSR_WCOL_MASK, spi_base + LS1C_SPI_SPSR_OFFSET); // 写0linux源码中是写0
// reg_write_8(val | LS1C_SPI_SPSR_WCOL_MASK, spi_base + LS1C_SPI_SPSR_OFFSET); // 写1按照1c手册应该写1 // reg_write_8(val | LS1C_SPI_SPSR_WCOL_MASK, spi_base + LS1C_SPI_SPSR_OFFSET); // 写1按照1c手册应该写1
} }