2016-01-28 10:00:17 +00:00
|
|
|
/*
|
|
|
|
* Microchip PIC32MZ[DA] Starter Kit board
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015, Microchip Technology Inc.
|
|
|
|
* Purna Chandra Mandal <purna.mandal@microchip.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
|
|
|
#include <clk.h>
|
2016-06-17 15:44:00 +00:00
|
|
|
#include <dt-bindings/clock/microchip,clock.h>
|
2016-01-28 10:00:17 +00:00
|
|
|
#include <mach/pic32.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_DISPLAY_BOARDINFO
|
|
|
|
int checkboard(void)
|
|
|
|
{
|
2016-06-17 15:44:00 +00:00
|
|
|
ulong rate;
|
2016-01-28 10:00:17 +00:00
|
|
|
struct udevice *dev;
|
2016-06-17 15:44:00 +00:00
|
|
|
struct clk clk;
|
|
|
|
int ret;
|
2016-01-28 10:00:17 +00:00
|
|
|
|
|
|
|
printf("Core: %s\n", get_core_name());
|
|
|
|
|
2016-06-17 15:44:00 +00:00
|
|
|
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);
|
2016-01-28 10:00:17 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|