summaryrefslogtreecommitdiff
path: root/board/microchip/pic32mzda/pic32mzda.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/microchip/pic32mzda/pic32mzda.c')
-rw-r--r--board/microchip/pic32mzda/pic32mzda.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/board/microchip/pic32mzda/pic32mzda.c b/board/microchip/pic32mzda/pic32mzda.c
index afe2ab8..3d31d3d 100644
--- a/board/microchip/pic32mzda/pic32mzda.c
+++ b/board/microchip/pic32mzda/pic32mzda.c
@@ -11,20 +11,31 @@
#include <common.h>
#include <dm.h>
#include <clk.h>
+#include <dt-bindings/clock/microchip,clock.h>
#include <mach/pic32.h>
#ifdef CONFIG_DISPLAY_BOARDINFO
int checkboard(void)
{
- ulong rate = 0;
+ ulong rate;
struct udevice *dev;
+ struct clk clk;
+ int ret;
printf("Core: %s\n", get_core_name());
- if (!uclass_get_device(UCLASS_CLK, 0, &dev)) {
- rate = clk_get_rate(dev);
- printf("CPU Speed: %lu MHz\n", rate / 1000000);
- }
+ if (uclass_get_device(UCLASS_CLK, 0, &dev))
+ return 0;
+
+ clk.id = PB7CLK;
+ ret = clk_request(dev, &clk);
+ if (ret < 0)
+ return 0;
+
+ rate = clk_get_rate(&clk);
+ printf("CPU Speed: %lu MHz\n", rate / 1000000);
+
+ clk_free(&clk);
return 0;
}