From patchwork Tue Feb 18 16:13:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 236512 List-Id: U-Boot discussion From: sagar.kadam at sifive.com (Sagar Shrikant Kadam) Date: Tue, 18 Feb 2020 08:13:22 -0800 Subject: [PATCH v1 0/2] display proper CPU frequency on hifive-unleashed Message-ID: <1582042404-27356-1-git-send-email-sagar.kadam@sifive.com> U-Boot cmd "cpu detail" shows wrong values, as the current cpu driver is fetching cpu_freq by reading the dt node property "clock-frequency". There should be a fallback mechanism to handle a case where this property if not present in DT it should be read from the prci driver. This patch series uses the clk_get_rate method to fetch proper core clock frequency. The series is based on U-Boot commit f2a73d6867ef ("Merge tag 'u-boot-stm32-20200214' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm") Thanks to Vincent Chen for testing this patch. =>-----------------------Log for reference------------------------ => cpu detail 0: cpu at 1 rv64imafdc ID = 1, freq = 4.30 GHz <= Before patch 1: cpu at 2 rv64imafdc ID = 2, freq = 4.30 GHz 2: cpu at 3 rv64imafdc ID = 3, freq = 4.30 GHz 3: cpu at 4 rv64imafdc ID = 4, freq = 4.30 GHz ................................................................. => cpu detail 0: cpu at 1 rv64imafdc ID = 1, freq = 999.100 MHz <= After patch 1: cpu at 2 rv64imafdc ID = 2, freq = 999.100 MHz 2: cpu at 3 rv64imafdc ID = 3, freq = 999.100 MHz 3: cpu at 4 rv64imafdc ID = 4, freq = 999.100 MHz Sagar Shrikant Kadam (2): fu540: prci: add request and free clock handlers cpu: clk: riscv: populate proper CPU core clk frequency drivers/clk/sifive/fu540-prci.c | 24 ++++++++++++++++++++++++ drivers/cpu/riscv_cpu.c | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-)