Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: sam: update PLL ready time, add driver for pit64b #7103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TonyHan11
Copy link
Contributor

No description provided.

The start-up time (simulation data) of sama7g5 PLL is 50us in condition
reaching 95% of target frequency. The PLL lock status bit is not set a few
times with current timeout setting. Extend the time to make sure the check
is successful for any cases.

Signed-off-by: Tony Han <[email protected]>
#include <drivers/clk_dt.h>
#include <string.h>

#define MCHP_PIT64B_FREQ 5000000UL /* 5 MHz */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer UM(5000000)

break;
}

if (!parent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no clock was found at line 38, parent is the last tested parent clock, not NULL.


res = clk_dt_get_by_name(fdt, node, "gclk", &gclk);
if (res)
return res;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, I suggest to get the clock first, then to act on clocks:

	res = clk_dt_get_by_name(fdt, node, "pclk", &pclk);
	if (res)
		return res;

-	res = clk_enable(pclk);
-	if (res)
-		panic();
-
	res = clk_dt_get_by_name(fdt, node, "gclk", &gclk);
	if (res)
		return res;

+	res = clk_enable(pclk);
+	if (res)
+		panic();
+

#include <assert.h>
#include <drivers/clk.h>
#include <drivers/clk_dt.h>
#include <string.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include also dt_driver.h

Add support for the peripheral PIT64B in sama7g54. In the driver the clocks
are initialized for PIT64B.

Signed-off-by: Tony Han <[email protected]>
@TonyHan11
Copy link
Contributor Author

@etienne-lms updated according to the comments, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants