summaryrefslogtreecommitdiff
path: root/src/soc/intel/quark/reg_access.c
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-07-10 17:09:24 -0700
committerLee Leahy <leroy.p.leahy@intel.com>2016-07-12 18:50:47 +0200
commit660c67a01f93817efebf312c5f6d685e8329312e (patch)
treedbcc8d8c6aee76be9906817d641410d72aa323ef /src/soc/intel/quark/reg_access.c
parent89186b2eb8167b56bf76d9cc03587d678b9bc661 (diff)
downloadcoreboot-660c67a01f93817efebf312c5f6d685e8329312e.tar.xz
soc/intel/quark: Add host bridge access support
Add host bridge register access routines and macros. TEST=Build and run on Galileo Gen2 Change-Id: I52eb6a68e99533fbb69c0ae1e6d581e4c4fab9d2 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/15593 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/intel/quark/reg_access.c')
-rw-r--r--src/soc/intel/quark/reg_access.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/soc/intel/quark/reg_access.c b/src/soc/intel/quark/reg_access.c
index 1dd0d3c7db..c4688076ed 100644
--- a/src/soc/intel/quark/reg_access.c
+++ b/src/soc/intel/quark/reg_access.c
@@ -120,6 +120,24 @@ static void reg_gpio_write(uint32_t reg_address, uint32_t value)
*get_gpio_address(reg_address) = value;
}
+uint32_t reg_host_bridge_unit_read(uint32_t reg_address)
+{
+ /* Read the host bridge register */
+ mea_write(reg_address);
+ mcr_write(QUARK_OPCODE_READ, QUARK_NC_HOST_BRIDGE_SB_PORT_ID,
+ reg_address);
+ return mdr_read();
+}
+
+static void reg_host_bridge_unit_write(uint32_t reg_address, uint32_t value)
+{
+ /* Write the host bridge register */
+ mea_write(reg_address);
+ mdr_write(value);
+ mcr_write(QUARK_OPCODE_WRITE, QUARK_NC_HOST_BRIDGE_SB_PORT_ID,
+ reg_address);
+}
+
uint32_t reg_legacy_gpio_read(uint32_t reg_address)
{
/* Read the legacy GPIO register */
@@ -225,6 +243,11 @@ static uint64_t reg_read(struct reg_script_context *ctx)
value = reg_gpio_read(step->reg);
break;
+ case HOST_BRIDGE:
+ ctx->display_prefix = "Host Bridge";
+ value = reg_host_bridge_unit_read(step->reg);
+ break;
+
case LEG_GPIO_REGS:
ctx->display_prefix = "Legacy GPIO";
value = reg_legacy_gpio_read(step->reg);
@@ -274,6 +297,11 @@ static void reg_write(struct reg_script_context *ctx)
reg_gpio_write(step->reg, (uint32_t)step->value);
break;
+ case HOST_BRIDGE:
+ ctx->display_prefix = "Host Bridge";
+ reg_host_bridge_unit_write(step->reg, (uint32_t)step->value);
+ break;
+
case LEG_GPIO_REGS:
ctx->display_prefix = "Legacy GPIO";
reg_legacy_gpio_write(step->reg, (uint32_t)step->value);