Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/29336
Change subject: mb/sifive/hifive-unleashed: Use if (IS_ENABLED(...))
......................................................................
mb/sifive/hifive-unleashed: Use if (IS_ENABLED(...))
"if" is preferable over "#if", because it lets the compiler perform
syntax and type checks even if CONFIG_CONSOLE_SERIAL is disabled.
Change-Id: I45a763f2d854fbe9082795bc74de7a9d0fded3c9
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
M src/mainboard/sifive/hifive-unleashed/romstage.c
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/29336/1
diff --git a/src/mainboard/sifive/hifive-unleashed/romstage.c b/src/mainboard/sifive/hifive-unleashed/romstage.c
index 3767491..8277141 100644
--- a/src/mainboard/sifive/hifive-unleashed/romstage.c
+++ b/src/mainboard/sifive/hifive-unleashed/romstage.c
@@ -36,9 +36,8 @@
clock_init();
// re-initialize UART
- #if (IS_ENABLED(CONFIG_CONSOLE_SERIAL))
+ if (IS_ENABLED(CONFIG_CONSOLE_SERIAL))
uart_init(CONFIG_UART_FOR_CONSOLE);
- #endif
sdram_init();
--
To view, visit https://review.coreboot.org/29336
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I45a763f2d854fbe9082795bc74de7a9d0fded3c9
Gerrit-Change-Number: 29336
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/29331 )
Change subject: src/drivers/pc80/tpm/tis.c: Dont use port value when invalid.
......................................................................
src/drivers/pc80/tpm/tis.c: Dont use port value when invalid.
port is allocated in ACPI, without checking for value.
Don't use port value when zero.
BUG=N/A
TEST=Portwell PQ-M107
Change-Id: Ia44281b82d003b29bffbf985b774ddd661b65c4e
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
Reviewed-on: https://review.coreboot.org/29331
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
---
M src/drivers/pc80/tpm/tis.c
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Philipp Deppenwiese: Looks good to me, approved
diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c
index 6b84614..f7d9d6f 100644
--- a/src/drivers/pc80/tpm/tis.c
+++ b/src/drivers/pc80/tpm/tis.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
+ * Copyright (C) 2018 Eltan B.V.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -911,7 +912,8 @@
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
acpigen_write_mem32fixed(1, CONFIG_TPM_TIS_BASE_ADDRESS, 0x5000);
- acpigen_write_io16(port, port, 1, 2, 1);
+ if (port)
+ acpigen_write_io16(port, port, 1, 2, 1);
if (CONFIG_TPM_PIRQ) {
/*
--
To view, visit https://review.coreboot.org/29331
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia44281b82d003b29bffbf985b774ddd661b65c4e
Gerrit-Change-Number: 29331
Gerrit-PatchSet: 2
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/29331 )
Change subject: src/drivers/pc80/tpm/tis.c: Dont use port value when invalid.
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/29331
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia44281b82d003b29bffbf985b774ddd661b65c4e
Gerrit-Change-Number: 29331
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 29 Oct 2018 14:26:36 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Jonathan Neuschäfer has posted comments on this change. ( https://review.coreboot.org/29335 )
Change subject: soc/sifive/fu540: Add helper function to get tlclk frequency
......................................................................
Patch Set 1:
Philipp, how does TLCLKSEL work?
Wesley Terpstra said on the forum that it determines if tlclk is coreclk or coreclk/2, but how does software read it out?
(https://forums.sifive.com/t/hifive-unleashed-documentation-is-here/1152/9)
--
To view, visit https://review.coreboot.org/29335
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I270920027f1132253e413a1bf9feb4fe279b651a
Gerrit-Change-Number: 29335
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Comment-Date: Mon, 29 Oct 2018 14:26:28 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/29335
Change subject: soc/sifive/fu540: Add helper function to get tlclk frequency
......................................................................
soc/sifive/fu540: Add helper function to get tlclk frequency
tlclk is not specific to the UART block in the FU540, so let's calculate
its frequency in clock.c.
Change-Id: I270920027f1132253e413a1bf9feb4fe279b651a
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
M src/soc/sifive/fu540/clock.c
M src/soc/sifive/fu540/include/soc/clock.h
M src/soc/sifive/fu540/uart.c
3 files changed, 13 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/29335/1
diff --git a/src/soc/sifive/fu540/clock.c b/src/soc/sifive/fu540/clock.c
index a8b61f1..edebe42 100644
--- a/src/soc/sifive/fu540/clock.c
+++ b/src/soc/sifive/fu540/clock.c
@@ -262,3 +262,14 @@
/ (divr + 1)
/ (1ul << divq);
}
+
+/* Get the TileLink clock's frequency, in KHz */
+int clock_get_tlclk_khz(void)
+{
+ /*
+ * The TileLink bus and most peripherals use tlclk, which is coreclk/2,
+ * as input.
+ */
+
+ return clock_get_coreclk_khz() / 2;
+}
diff --git a/src/soc/sifive/fu540/include/soc/clock.h b/src/soc/sifive/fu540/include/soc/clock.h
index d54c666..706c9c0 100644
--- a/src/soc/sifive/fu540/include/soc/clock.h
+++ b/src/soc/sifive/fu540/include/soc/clock.h
@@ -18,5 +18,6 @@
void clock_init(void);
int clock_get_coreclk_khz(void);
+int clock_get_tlclk_khz(void);
#endif /* __SOC_SIFIVE_HIFIFE_U_CLOCK_H__ */
diff --git a/src/soc/sifive/fu540/uart.c b/src/soc/sifive/fu540/uart.c
index 454b13d..b59b789 100644
--- a/src/soc/sifive/fu540/uart.c
+++ b/src/soc/sifive/fu540/uart.c
@@ -29,9 +29,5 @@
unsigned int uart_platform_refclk(void)
{
- /*
- * The SiFive UART uses tlclk, which is coreclk/2, as input
- */
-
- return clock_get_coreclk_khz() * KHz / 2;
+ return clock_get_tlclk_khz() * KHz;
}
--
To view, visit https://review.coreboot.org/29335
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I270920027f1132253e413a1bf9feb4fe279b651a
Gerrit-Change-Number: 29335
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>