From 82ec1ba7a7adb9125ae21fdae1a778e5a98f2f1b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 13 Jun 2020 16:31:25 +0800 Subject: [PATCH] sdio: better logging --- libboard_zynq/src/sdio/mod.rs | 6 +++--- libboard_zynq/src/sdio/sd_card.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libboard_zynq/src/sdio/mod.rs b/libboard_zynq/src/sdio/mod.rs index 9ed9d6e..8feb00a 100644 --- a/libboard_zynq/src/sdio/mod.rs +++ b/libboard_zynq/src/sdio/mod.rs @@ -8,7 +8,7 @@ use super::slcr; use super::time::Milliseconds; use embedded_hal::timer::CountDown; use libregister::{RegisterR, RegisterRW, RegisterW}; -use log::debug; +use log::{trace, debug}; use nb; /// Basic SDIO Struct with common low-level functions. @@ -123,7 +123,7 @@ impl SDIO { /// From XSdPs_Change_ClkFreq in xsdps_options.c. SPEC_V3 related code is removed as /// our board would only be V1 or V2. fn change_clk_freq(&mut self, freq: u32) { - debug!("Change clock frequency to {}", freq); + debug!("Changing clock frequency to {}", freq); self.regs .clock_control .modify(|_, w| w.sd_clk_en(false).internal_clk_en(false)); @@ -244,7 +244,7 @@ impl SDIO { block_cnt: u16, transfer_mode: regs::transfer_mode_command::Write, ) -> Result<(), CmdTransferError> { - debug!("Send Cmd {:?}", cmd); + trace!("Send Cmd {:?}", cmd); let state = self.regs.present_state.read(); if state.command_inhibit_cmd() { return Err(CmdTransferError::CmdInhibited); diff --git a/libboard_zynq/src/sdio/sd_card.rs b/libboard_zynq/src/sdio/sd_card.rs index b49ce42..d09c96e 100644 --- a/libboard_zynq/src/sdio/sd_card.rs +++ b/libboard_zynq/src/sdio/sd_card.rs @@ -1,7 +1,7 @@ use super::{adma::Adma2DescTable, cmd, CardType, CmdTransferError, SDIO}; use libcortex_a9::cache; use libregister::{RegisterR, RegisterRW, RegisterW}; -use log::debug; +use log::{trace, debug}; #[derive(Debug)] pub enum CardInitializationError { @@ -146,7 +146,7 @@ impl SdCard { let mut scr: [u8; 32] = [0; 32]; self.get_bus_width(&mut scr)?; - debug!("{:?}", scr); + trace!("SCR={:?}", scr); if scr[1] & 0x4 != 0 { // 4bit support debug!("4 bit support"); @@ -337,7 +337,7 @@ impl SdCard { fn change_bus_width(&mut self) -> Result<(), CmdTransferError> { use cmd::SdCmd::*; - debug!("Changing bus speed"); + debug!("Changing bus width"); self.sdio.cmd_transfer(CMD55, self.rel_card_addr, 0)?; self.width_4_bit = true; self.sdio.cmd_transfer(ACMD6, 0x2, 0)?;