diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/drivers/clk/intel | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/drivers/clk/intel')
-rw-r--r-- | roms/u-boot/drivers/clk/intel/Makefile | 6 | ||||
-rw-r--r-- | roms/u-boot/drivers/clk/intel/clk_intel.c | 37 |
2 files changed, 43 insertions, 0 deletions
diff --git a/roms/u-boot/drivers/clk/intel/Makefile b/roms/u-boot/drivers/clk/intel/Makefile new file mode 100644 index 000000000..45e93d702 --- /dev/null +++ b/roms/u-boot/drivers/clk/intel/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2010 Google LLC +# + +obj-y += clk_intel.o diff --git a/roms/u-boot/drivers/clk/intel/clk_intel.c b/roms/u-boot/drivers/clk/intel/clk_intel.c new file mode 100644 index 000000000..46ccbb1d8 --- /dev/null +++ b/roms/u-boot/drivers/clk/intel/clk_intel.c @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 Google LLC + * Written by Simon Glass <sjg@chromium.org> + */ + +#include <common.h> +#include <dm.h> +#include <clk-uclass.h> +#include <dt-bindings/clock/intel-clock.h> + +static ulong intel_clk_get_rate(struct clk *clk) +{ + switch (clk->id) { + case CLK_I2C: + /* Hard-coded to 133MHz on current platforms */ + return 133333333; + default: + return -ENODEV; + } +} + +static struct clk_ops intel_clk_ops = { + .get_rate = intel_clk_get_rate, +}; + +static const struct udevice_id intel_clk_ids[] = { + { .compatible = "intel,apl-clk" }, + { } +}; + +U_BOOT_DRIVER(intel_apl_clk) = { + .name = "intel_apl_clk", + .id = UCLASS_CLK, + .of_match = intel_clk_ids, + .ops = &intel_clk_ops, +}; |