diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 21:32:19 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | 4916f4586eab7941f38a89e4dacd103af1c4105f (patch) | |
tree | 0abebe14dc6594fdeffc71617026250afdc88501 /drivers/pinctrl/intel/pinctrl.c | |
parent | 54bcca29737f8de2598b4a3f8f503290bd49eec0 (diff) | |
download | u-boot-4916f4586eab7941f38a89e4dacd103af1c4105f.tar.gz |
x86: pinctrl: Add a way to get the pinctrl reg address
At present we can query the offset of a pinctrl register within the p2sb.
For ACPI we need to get the actual address of the register. Add a function
to handle this and rename the old one to more accurately reflect its
purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Diffstat (limited to 'drivers/pinctrl/intel/pinctrl.c')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pinctrl/intel/pinctrl.c b/drivers/pinctrl/intel/pinctrl.c index ba8206350e..bf3989bf32 100644 --- a/drivers/pinctrl/intel/pinctrl.c +++ b/drivers/pinctrl/intel/pinctrl.c @@ -394,7 +394,7 @@ static int pinctrl_configure_pad(struct udevice *dev, return 0; } -u32 intel_pinctrl_get_config_reg_addr(struct udevice *dev, uint offset) +u32 intel_pinctrl_get_config_reg_offset(struct udevice *dev, uint offset) { struct intel_pinctrl_priv *priv = dev_get_priv(dev); const struct pad_community *comm = priv->comm; @@ -407,9 +407,16 @@ u32 intel_pinctrl_get_config_reg_addr(struct udevice *dev, uint offset) return config_offset; } +u32 intel_pinctrl_get_config_reg_addr(struct udevice *dev, uint offset) +{ + uint config_offset = intel_pinctrl_get_config_reg_offset(dev, offset); + + return (u32)(ulong)pcr_reg_address(dev, config_offset); +} + u32 intel_pinctrl_get_config_reg(struct udevice *dev, uint offset) { - uint config_offset = intel_pinctrl_get_config_reg_addr(dev, offset); + uint config_offset = intel_pinctrl_get_config_reg_offset(dev, offset); return pcr_read32(dev, config_offset); } |