Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47875 )
Change subject: soc/amd/common/block/cpu: move CAR-specific Makefile to sub-directory
......................................................................
soc/amd/common/block/cpu: move CAR-specific Makefile to sub-directory
Since there are sub-directories for both the cache-as-RAM case and the
non-CAR case where the RAM is already initialized when the x86 cores are
released from reset, move the CAR-specific parts of the Makefile.inc to
another Makefile.inc in the car sub-directory. Further patches will add
a Makefile.inc to the non-CAR directory.
Change-Id: I43a3039237d96e02baa33488e71c5f24effe8359
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/soc/amd/common/block/cpu/Makefile.inc
A src/soc/amd/common/block/cpu/car/Makefile.inc
2 files changed, 13 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/47875/1
diff --git a/src/soc/amd/common/block/cpu/Makefile.inc b/src/soc/amd/common/block/cpu/Makefile.inc
index 395ab08..df2ccfa 100644
--- a/src/soc/amd/common/block/cpu/Makefile.inc
+++ b/src/soc/amd/common/block/cpu/Makefile.inc
@@ -1,8 +1 @@
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/cache_as_ram.S
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/ap_exit_car.S
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/exit_car.S
-
-postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/exit_car.S
-
-romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/ap_exit_car.S
-romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car/exit_car.S
+subdirs-$(CONFIG_SOC_AMD_COMMON_BLOCK_CAR) += car
diff --git a/src/soc/amd/common/block/cpu/car/Makefile.inc b/src/soc/amd/common/block/cpu/car/Makefile.inc
new file mode 100644
index 0000000..130b34b
--- /dev/null
+++ b/src/soc/amd/common/block/cpu/car/Makefile.inc
@@ -0,0 +1,12 @@
+ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_CAR),y)
+
+bootblock-y += cache_as_ram.S
+bootblock-y += ap_exit_car.S
+bootblock-y += exit_car.S
+
+postcar-y += exit_car.S
+
+romstage-y += ap_exit_car.S
+romstage-y += exit_car.S
+
+endif # CONFIG_SOC_AMD_COMMON_BLOCK_CAR
--
To view, visit https://review.coreboot.org/c/coreboot/+/47875
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I43a3039237d96e02baa33488e71c5f24effe8359
Gerrit-Change-Number: 47875
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47402 )
Change subject: mb/siemens/mc_apl1: Deduplicate wait_for_legacy_dev()
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/47402
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4e35b58adc074831ccec433b8e014db0695b955e
Gerrit-Change-Number: 47402
Gerrit-PatchSet: 4
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Mario Scheithauer <mario.scheithauer(a)siemens.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: siemens-bot
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Mon, 30 Nov 2020 07:57:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47405 )
Change subject: mb/siemens/mc_apl1: Simplify is_mac_adr_valid() logic
......................................................................
mb/siemens/mc_apl1: Simplify is_mac_adr_valid() logic
A MAC address that is neither 00:00:00:00:00:00 nor ff:ff:ff:ff:ff:ff is
considered valid. Instead of using a temporary buffer and memcmp(), use
a single loop that exits as soon as the MAC cannot possibly be invalid.
Change-Id: I2b15b510092860fbbefd150c9060da38aeb13311
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47405
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh(a)siemens.com>
Reviewed-by: Mario Scheithauer <mario.scheithauer(a)siemens.com>
Reviewed-by: Uwe Poeche <uwe.poeche(a)siemens.com>
---
M src/mainboard/siemens/mc_apl1/mainboard.c
1 file changed, 7 insertions(+), 9 deletions(-)
Approvals:
build bot (Jenkins): Verified
Werner Zeh: Looks good to me, approved
Mario Scheithauer: Looks good to me, but someone else must approve
Uwe Poeche: Looks good to me, but someone else must approve
diff --git a/src/mainboard/siemens/mc_apl1/mainboard.c b/src/mainboard/siemens/mc_apl1/mainboard.c
index ff0cc59..9540d6d 100644
--- a/src/mainboard/siemens/mc_apl1/mainboard.c
+++ b/src/mainboard/siemens/mc_apl1/mainboard.c
@@ -35,15 +35,13 @@
*/
static uint8_t is_mac_adr_valid(uint8_t mac[MAC_ADDR_LEN])
{
- uint8_t buf[MAC_ADDR_LEN];
-
- memset(buf, 0, sizeof(buf));
- if (!memcmp(buf, mac, sizeof(buf)))
- return 0;
- memset(buf, 0xff, sizeof(buf));
- if (!memcmp(buf, mac, sizeof(buf)))
- return 0;
- return 1;
+ for (size_t i = 0; i < MAC_ADDR_LEN; i++) {
+ if (mac[i] != 0x00 && mac[i] != 0xff)
+ return 1;
+ if (mac[i] != mac[0])
+ return 1;
+ }
+ return 0;
}
/** \brief This function will search for a MAC address which can be assigned
--
To view, visit https://review.coreboot.org/c/coreboot/+/47405
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2b15b510092860fbbefd150c9060da38aeb13311
Gerrit-Change-Number: 47405
Gerrit-PatchSet: 5
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Mario Scheithauer <mario.scheithauer(a)siemens.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Uwe Poeche <uwe.poeche(a)siemens.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: merged
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47404 )
Change subject: drivers/intel/i210: Define MAC_ADDR_LEN
......................................................................
drivers/intel/i210: Define MAC_ADDR_LEN
Define and use the MAC_ADDR_LEN macro in place of the `6` magic value.
Change-Id: Icfa2ad9bca6668bea3d84b10f613d01e437ac6a2
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47404
Tested-by: siemens-bot
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh(a)siemens.com>
---
M src/drivers/intel/i210/i210.h
M src/mainboard/siemens/mc_apl1/mainboard.c
2 files changed, 7 insertions(+), 6 deletions(-)
Approvals:
build bot (Jenkins): Verified
siemens-bot: Verified
Werner Zeh: Looks good to me, approved
diff --git a/src/drivers/intel/i210/i210.h b/src/drivers/intel/i210/i210.h
index 718992e..1cc6a28 100644
--- a/src/drivers/intel/i210/i210.h
+++ b/src/drivers/intel/i210/i210.h
@@ -27,9 +27,10 @@
#define I210_CHECKSUM_ERROR 0x00000010
#define I210_FLASH_UPDATE_ERROR 0x00000020
+#define MAC_ADDR_LEN 6
+
/* We need one function we can call to get a MAC address to use */
/* This function can be coded somewhere else but must exist. */
-extern enum cb_err mainboard_get_mac_address(struct device *dev,
- uint8_t mac[6]);
+extern enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN]);
#endif /* _INTEL_I210_H_ */
diff --git a/src/mainboard/siemens/mc_apl1/mainboard.c b/src/mainboard/siemens/mc_apl1/mainboard.c
index 5b8f70f..ff0cc59 100644
--- a/src/mainboard/siemens/mc_apl1/mainboard.c
+++ b/src/mainboard/siemens/mc_apl1/mainboard.c
@@ -33,9 +33,9 @@
* @param mac Buffer to the MAC address to check
* @return 0 if address is not valid, otherwise 1
*/
-static uint8_t is_mac_adr_valid(uint8_t mac[6])
+static uint8_t is_mac_adr_valid(uint8_t mac[MAC_ADDR_LEN])
{
- uint8_t buf[6];
+ uint8_t buf[MAC_ADDR_LEN];
memset(buf, 0, sizeof(buf));
if (!memcmp(buf, mac, sizeof(buf)))
@@ -52,7 +52,7 @@
* @param mac buffer where to store the MAC address
* @return cb_err CB_ERR or CB_SUCCESS
*/
-enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[6])
+enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN])
{
struct bus *parent = dev->bus;
uint8_t buf[16], mapping[16], i = 0, chain_len = 0;
@@ -92,7 +92,7 @@
if (memcmp(buf, mapping, chain_len + 4))
continue;
/* There is a matching mapping available, get MAC address. */
- if (hwilib_get_field(XMac1 + i, mac, 6) == 6) {
+ if (hwilib_get_field(XMac1 + i, mac, MAC_ADDR_LEN) == MAC_ADDR_LEN) {
if (is_mac_adr_valid(mac))
return CB_SUCCESS;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/47404
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icfa2ad9bca6668bea3d84b10f613d01e437ac6a2
Gerrit-Change-Number: 47404
Gerrit-PatchSet: 5
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Mario Scheithauer <mario.scheithauer(a)siemens.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Uwe Poeche <uwe.poeche(a)siemens.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: siemens-bot
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: merged