diff options
author | Svyatoslav Ryhel <clamor95@gmail.com> | 2023-02-14 19:35:26 +0200 |
---|---|---|
committer | Tom <twarren@nvidia.com> | 2023-02-23 12:55:36 -0700 |
commit | a81d792479340bf03131111b285c0f70d27622b6 (patch) | |
tree | e0aa21f9c53c44079b0e7dbf7981ec9227d6d646 /arch/arm/include | |
parent | 65e02744ec1517eefb20354db61ddbd9560aba2c (diff) | |
download | u-boot-a81d792479340bf03131111b285c0f70d27622b6.zip u-boot-a81d792479340bf03131111b285c0f70d27622b6.tar.gz u-boot-a81d792479340bf03131111b285c0f70d27622b6.tar.bz2 |
ARM: tegra: clock: add clock_decode_pair helper
Get periph clock id and its parent from device tree.
This works by looking up the peripheral's 'clocks' node and
reading out the second and fourth cells, which are the
peripheral and PLL clock numbers.
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS TF T30
Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # HTC One X
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Tom <twarren@nvidia.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/arch-tegra/clock.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-tegra/clock.h b/arch/arm/include/asm/arch-tegra/clock.h index 2270501..61ef81e 100644 --- a/arch/arm/include/asm/arch-tegra/clock.h +++ b/arch/arm/include/asm/arch-tegra/clock.h @@ -271,6 +271,19 @@ void clock_ll_start_uart(enum periph_id periph_id); int clock_decode_periph_id(struct udevice *dev); /** + * Get periph clock id and its parent from device tree. + * + * This works by looking up the peripheral's 'clocks' node and reading out + * the second and fourth cells, which are the peripheral and PLL clock numbers. + * + * @param dev udevice associated with FDT node + * @param clk_id pointer to int array of 2 values + * first is periph clock, second is + * its PLL parent according to FDT. + */ +int clock_decode_pair(struct udevice *dev, int *clk_id); + +/** * Checks if the oscillator bypass is enabled (XOBP bit) * * Return: 1 if bypass is enabled, 0 if not |