-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: master
Are you sure you want to change the base?
Conversation
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]>
core/drivers/microchip_pit.c
Outdated
#include <drivers/clk_dt.h> | ||
#include <string.h> | ||
|
||
#define MCHP_PIT64B_FREQ 5000000UL /* 5 MHz */ |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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]>
39f47aa
to
2ce7559
Compare
@etienne-lms updated according to the comments, thank you very much. |
No description provided.