Hello Shawn Chang, Jonathan Neuschäfer, build bot (Jenkins), Philipp Hug,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29024
to look at the new patch set (#8).
Change subject: riscv: add support to block smp in each stage
......................................................................
riscv: add support to block smp in each stage
Change-Id: I8d508c3d0f65a022010e74f8edad7ad2cfdc7dee
Signed-off-by: Xiang Wang <wxjstz(a)126.com>
---
M src/arch/riscv/boot.c
M src/arch/riscv/bootblock.S
M src/arch/riscv/ramstage.S
M src/arch/riscv/stages.c
M src/soc/sifive/fu540/Kconfig
M src/soc/sifive/fu540/Makefile.inc
A src/soc/ucb/riscv/ipi.c
7 files changed, 40 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/29024/8
--
To view, visit https://review.coreboot.org/29024
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8d508c3d0f65a022010e74f8edad7ad2cfdc7dee
Gerrit-Change-Number: 29024
Gerrit-PatchSet: 8
Gerrit-Owner: Xiang Wang <wxjstz(a)126.com>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: Shawn Chang <citypw(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/29062
Change subject: google/kukui: Add board id support
......................................................................
google/kukui: Add board id support
Get board id from AUXIN4 and ram code from AUXIN3.
BUG=b:80501386
BRANCH=none
TEST=AUXIN4 is 0.074v and AUXIN3 is 0.212v on P0.
AUXIN4 is 0.212v and AUXIN3 is 0.212v on P1.
Change-Id: I50533e851d2fae66ae8c5e4e1aa36708d9058e94
Signed-off-by: Tristan Shieh <tristan.shieh(a)mediatek.com>
---
M src/mainboard/google/kukui/Makefile.inc
A src/mainboard/google/kukui/boardid.c
2 files changed, 63 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/29062/1
diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc
index aa6bf11..a98541a 100644
--- a/src/mainboard/google/kukui/Makefile.inc
+++ b/src/mainboard/google/kukui/Makefile.inc
@@ -1,3 +1,4 @@
+bootblock-y += boardid.c
bootblock-y += bootblock.c
bootblock-y += chromeos.c
bootblock-y += memlayout.ld
@@ -6,10 +7,12 @@
verstage-y += chromeos.c
verstage-y += memlayout.ld
+romstage-y += boardid.c
romstage-y += chromeos.c
romstage-y += memlayout.ld
romstage-y += romstage.c
+ramstage-y += boardid.c
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += memlayout.ld
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c
new file mode 100644
index 0000000..82d4915
--- /dev/null
+++ b/src/mainboard/google/kukui/boardid.c
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 MediaTek Inc.
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <boardid.h>
+#include <soc/auxadc.h>
+
+static uint32_t get_board_id(void)
+{
+ int auxin4 = auxadc_get_voltage(4);
+
+ if ((auxin4 > 64000) && (auxin4 < 84000)) /* 74mv +/- 10mv */
+ return 0;
+
+ if ((auxin4 > 202000) && (auxin4 < 222000)) /* 212mv +/- 10mv */
+ return 1;
+
+ return BOARD_ID_UNKNOWN;
+}
+
+uint32_t board_id(void)
+{
+ static uint32_t cached_board_id = BOARD_ID_UNKNOWN;
+
+ if (cached_board_id == BOARD_ID_UNKNOWN)
+ cached_board_id = get_board_id();
+
+ return cached_board_id;
+}
+
+static uint32_t get_ram_code(void)
+{
+ int auxin3 = auxadc_get_voltage(3);
+
+ if ((auxin3 > 202000) && (auxin3 < 222000)) /* 212mv +/- 10mv */
+ return 0;
+
+ return BOARD_ID_UNKNOWN;
+}
+
+uint32_t ram_code(void)
+{
+ static uint32_t cached_ram_code = BOARD_ID_UNKNOWN;
+
+ if (cached_ram_code == BOARD_ID_UNKNOWN)
+ cached_ram_code = get_ram_code();
+
+ return cached_ram_code;
+}
--
To view, visit https://review.coreboot.org/29062
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: I50533e851d2fae66ae8c5e4e1aa36708d9058e94
Gerrit-Change-Number: 29062
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Hsieh <tristan.shieh(a)mediatek.com>
Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/29061
Change subject: mediatek/mt8183: Add AUXADC driver
......................................................................
mediatek/mt8183: Add AUXADC driver
We plan to get board id and ram code from AUXADC on Kukui. Add AUXADC
driver to support it.
BUG=b:80501386
BRANCH=none
TEST=Boots correctly on Kukui
Change-Id: I121a6a0240f9c517c0cbc07e0c18b09167849ff1
Signed-off-by: jg_poxu <jg_poxu(a)mediatek.com>
---
M src/soc/mediatek/mt8183/Makefile.inc
A src/soc/mediatek/mt8183/auxadc.c
M src/soc/mediatek/mt8183/include/soc/addressmap.h
A src/soc/mediatek/mt8183/include/soc/auxadc.h
4 files changed, 101 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/29061/1
diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc
index 8fece79..01cf8ef 100644
--- a/src/soc/mediatek/mt8183/Makefile.inc
+++ b/src/soc/mediatek/mt8183/Makefile.inc
@@ -1,5 +1,6 @@
ifeq ($(CONFIG_SOC_MEDIATEK_MT8183),y)
+bootblock-y += auxadc.c
bootblock-y += bootblock.c
bootblock-y += ../common/gpio.c gpio.c
bootblock-y += ../common/pll.c pll.c
@@ -14,12 +15,14 @@
decompressor-y += ../common/mmu_operations.c
decompressor-y += ../common/timer.c
+verstage-y += auxadc.c
verstage-y += ../common/gpio.c gpio.c
verstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
verstage-y += ../common/timer.c
verstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c
verstage-y += ../common/wdt.c
+romstage-y += auxadc.c
romstage-y += ../common/cbmem.c emi.c
romstage-y += ../common/gpio.c gpio.c
romstage-y += ../common/mmu_operations.c mmu_operations.c
@@ -28,6 +31,7 @@
romstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c
romstage-y += ../common/wdt.c
+ramstage-y += auxadc.c
ramstage-y += ../common/cbmem.c emi.c
ramstage-y += ../common/gpio.c gpio.c
ramstage-y += ../common/mmu_operations.c mmu_operations.c
diff --git a/src/soc/mediatek/mt8183/auxadc.c b/src/soc/mediatek/mt8183/auxadc.c
new file mode 100644
index 0000000..e911be3
--- /dev/null
+++ b/src/soc/mediatek/mt8183/auxadc.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 MediaTek Inc.
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/io.h>
+#include <assert.h>
+#include <console/console.h>
+#include <delay.h>
+#include <soc/addressmap.h>
+#include <soc/auxadc.h>
+#include <soc/infracfg.h>
+
+static struct mtk_auxadc_regs *const mtk_auxadc = (void *)AUXADC_BASE;
+
+static uint32_t auxadc_get_rawdata(int channel)
+{
+ setbits_le32(&mt8183_infracfg->module_sw_cg_1_clr, 1 << 10);
+
+ int idle_timeout = 300;
+ while (read32(&mtk_auxadc->auxadc_con2) & 0x1) {
+ udelay(1000);
+ assert(--idle_timeout > 0);
+ }
+
+ clrbits_le32(&mtk_auxadc->auxadc_con1, 1 << channel);
+
+ int data_ready_timeout = 300;
+ while (0 != (read32(&mtk_auxadc->auxadc_data[channel]) & (1 << 12))) {
+ udelay(1000);
+ assert(--data_ready_timeout > 0);
+ }
+
+ setbits_le32(&mtk_auxadc->auxadc_con1, 1 << channel);
+ udelay(25);
+
+ while (0 == (read32(&mtk_auxadc->auxadc_data[channel]) & (1 << 12))) {
+ udelay(1000);
+ assert(--data_ready_timeout > 0);
+ }
+
+ uint32_t value = read32(&mtk_auxadc->auxadc_data[channel]) & 0x0FFF;
+
+ setbits_le32(&mt8183_infracfg->module_sw_cg_1_set, 1 << 10);
+
+ return value;
+}
+
+int auxadc_get_voltage(int channel)
+{
+ return (int)((int64_t)auxadc_get_rawdata(channel) * 1500000 / 4096);
+}
diff --git a/src/soc/mediatek/mt8183/include/soc/addressmap.h b/src/soc/mediatek/mt8183/include/soc/addressmap.h
index de7eb1f..f70f6b2 100644
--- a/src/soc/mediatek/mt8183/include/soc/addressmap.h
+++ b/src/soc/mediatek/mt8183/include/soc/addressmap.h
@@ -30,6 +30,7 @@
RGU_BASE = IO_PHYS + 0x00007000,
GPT_BASE = IO_PHYS + 0x00008000,
APMIXED_BASE = IO_PHYS + 0x0000C000,
+ AUXADC_BASE = IO_PHYS + 0x01001000,
UART0_BASE = IO_PHYS + 0x01002000,
SPI0_BASE = IO_PHYS + 0x0100A000,
SPI1_BASE = IO_PHYS + 0x01010000,
diff --git a/src/soc/mediatek/mt8183/include/soc/auxadc.h b/src/soc/mediatek/mt8183/include/soc/auxadc.h
new file mode 100644
index 0000000..601a6f1
--- /dev/null
+++ b/src/soc/mediatek/mt8183/include/soc/auxadc.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 MediaTek Inc.
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _MTK_ADC_H
+#define _MTK_ADC_H
+
+#include <stdint.h>
+
+typedef struct mtk_auxadc_regs {
+ uint32_t auxadc_con0;
+ uint32_t auxadc_con1;
+ uint32_t auxadc_con1_set;
+ uint32_t auxadc_con1_clr;
+ uint32_t auxadc_con2;
+ uint32_t auxadc_data[16];
+ uint32_t reserved[16];
+ uint32_t auxadc_misc;
+} mtk_auxadc_regs;
+
+/* This function voltage unit is uvolt */
+int auxadc_get_voltage(int channel);
+#endif
--
To view, visit https://review.coreboot.org/29061
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: I121a6a0240f9c517c0cbc07e0c18b09167849ff1
Gerrit-Change-Number: 29061
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Hsieh <tristan.shieh(a)mediatek.com>
Hello Shawn Chang, Jonathan Neuschäfer, build bot (Jenkins), Philipp Hug,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29023
to look at the new patch set (#5).
Change subject: riscv: add support smp_pause / smp_resume
......................................................................
riscv: add support smp_pause / smp_resume
See https://doc.coreboot.org/arch/riscv/ we know that we need to execute
smp_pause at the start of each stage and smp_resume at the end of each
stage.
Change-Id: I6f8159637bfb15f54f0abeb335de2ba6e9cf82fb
Signed-off-by: Xiang Wang <wxjstz(a)126.com>
---
M src/arch/riscv/Kconfig
M src/arch/riscv/Makefile.inc
A src/arch/riscv/include/arch/smp/smp.h
M src/arch/riscv/include/mcall.h
A src/arch/riscv/smp.c
5 files changed, 88 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/29023/5
--
To view, visit https://review.coreboot.org/29023
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6f8159637bfb15f54f0abeb335de2ba6e9cf82fb
Gerrit-Change-Number: 29023
Gerrit-PatchSet: 5
Gerrit-Owner: Xiang Wang <wxjstz(a)126.com>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: Shawn Chang <citypw(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Hello Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/28954
to look at the new patch set (#2).
Change subject: mb/*/*/Makefile.inc: No need to include acpi_tables.c to Makefiles
......................................................................
mb/*/*/Makefile.inc: No need to include acpi_tables.c to Makefiles
It always included if ACP is supported since commit
822bc65b0e8cb9c17721b8b776ec7ecf6ac4129e.
Change-Id: If17a6f43e368ccf850031b349714fa1ec4d02c1d
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
---
M src/mainboard/compulab/intense_pc/Makefile.inc
M src/mainboard/intel/harcuvar/Makefile.inc
M src/mainboard/lenovo/l520/Makefile.inc
M src/mainboard/lenovo/t430/Makefile.inc
M src/mainboard/scaleway/tagada/Makefile.inc
5 files changed, 0 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/28954/2
--
To view, visit https://review.coreboot.org/28954
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If17a6f43e368ccf850031b349714fa1ec4d02c1d
Gerrit-Change-Number: 28954
Gerrit-PatchSet: 2
Gerrit-Owner: Peter Lemenkov <lemenkov(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Hello Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29033
to look at the new patch set (#4).
Change subject: mb/lenovo/*/smihandler: Remove some unused includes
......................................................................
mb/lenovo/*/smihandler: Remove some unused includes
Tried to build all affected mainboards - still compiles fine.
Change-Id: I385cac1a75cee13453b831bd75b3ecc7a6d229fa
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
---
M src/mainboard/lenovo/t420s/smihandler.c
M src/mainboard/lenovo/t430/smihandler.c
M src/mainboard/lenovo/t430s/smihandler.c
M src/mainboard/lenovo/t520/smihandler.c
M src/mainboard/lenovo/t530/smihandler.c
M src/mainboard/lenovo/x220/smihandler.c
6 files changed, 10 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/29033/4
--
To view, visit https://review.coreboot.org/29033
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I385cac1a75cee13453b831bd75b3ecc7a6d229fa
Gerrit-Change-Number: 29033
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Lemenkov <lemenkov(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/28976
to look at the new patch set (#3).
Change subject: mb/lenovo/*/romstage: Use macros instead of magic numbers
......................................................................
mb/lenovo/*/romstage: Use macros instead of magic numbers
Apparently coreboot still uses magic numbers instead of macros in some
Lenovo mainboards. Let's use macros instead.
Also removed some board names from comments since these functions
sometimes are very similar, so no need to add extra difference between
them.
Change-Id: I6468e3357f8eed434f8527a852e134380f486d9a
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
---
M src/mainboard/lenovo/l520/romstage.c
M src/mainboard/lenovo/s230u/romstage.c
M src/mainboard/lenovo/t520/romstage.c
M src/mainboard/lenovo/t530/romstage.c
M src/mainboard/lenovo/x1_carbon_gen1/romstage.c
M src/mainboard/lenovo/x201/romstage.c
M src/mainboard/lenovo/x220/romstage.c
M src/mainboard/lenovo/x230/romstage.c
8 files changed, 26 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/28976/3
--
To view, visit https://review.coreboot.org/28976
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6468e3357f8eed434f8527a852e134380f486d9a
Gerrit-Change-Number: 28976
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Lemenkov <lemenkov(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Hello Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29033
to look at the new patch set (#3).
Change subject: mb/lenovo: Remove some unused includes
......................................................................
mb/lenovo: Remove some unused includes
Tried to build all affected mainboards - still compiles fine.
Change-Id: I385cac1a75cee13453b831bd75b3ecc7a6d229fa
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
---
M src/mainboard/lenovo/t420s/smihandler.c
M src/mainboard/lenovo/t430/smihandler.c
M src/mainboard/lenovo/t430s/smihandler.c
M src/mainboard/lenovo/t520/smihandler.c
M src/mainboard/lenovo/t530/smihandler.c
M src/mainboard/lenovo/x220/smihandler.c
6 files changed, 10 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/29033/3
--
To view, visit https://review.coreboot.org/29033
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I385cac1a75cee13453b831bd75b3ecc7a6d229fa
Gerrit-Change-Number: 29033
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Lemenkov <lemenkov(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Hello Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29031
to look at the new patch set (#2).
Change subject: mb/lenovo/t430: Set USB always on when calling SMI sleep
......................................................................
mb/lenovo/t430: Set USB always on when calling SMI sleep
Looks like we must do it in the same way as in l520, t420, t420s,
t430s, t520, t530, x201, x220, x230 models. No idea why t430 should be
handled differently.
Change-Id: Ic4851022267caca267b667b4e3c327838e0a0b66
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
---
M src/mainboard/lenovo/t430/smihandler.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/29031/2
--
To view, visit https://review.coreboot.org/29031
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic4851022267caca267b667b4e3c327838e0a0b66
Gerrit-Change-Number: 29031
Gerrit-PatchSet: 2
Gerrit-Owner: Peter Lemenkov <lemenkov(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>