summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-05-02 16:29:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-05-03 09:09:20 +0200
commit67acc03cd2d8384eece4ece6567360960c9f0cec (patch)
tree256da81e3c163c7aea4ee2ab5eaea77b8257be8b /arch/arm/boards
parentd702f02594f33a27be16246ef8ba892d0d895928 (diff)
downloadbarebox-67acc03cd2d8384eece4ece6567360960c9f0cec.tar.gz
barebox-67acc03cd2d8384eece4ece6567360960c9f0cec.tar.xz
ARM: rpi: fix CM3 breakage after multi-image rework
barebox used to apply quirks by asking VideoCore firmware. If this was not possible, an error message is printed, but other initialization happened as expected. With the move to board driver matched by DT, we incur two breakages: - Compute Module 3/3+ used to be explicitly supported, but are absent in new compatible list - Unsupported variants used to initialize with only an error message, but now their revision ID must be known Fix this by amending the compatible list with all non-Raspberry Pi 4 compatibles listed in the binding. We also make existence of a match data optional and error out if it doesn't exist. This is so far unused, but it conveys the intent for future users. Fixes: c062cd5cf47d ("ARM: rpi: validate devicetree compatible instead of changing model name") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220502142959.1325298-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/raspberry-pi/rpi-common.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 9aa150de56..c287b414c6 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -352,8 +352,10 @@ static const struct rpi_machine_data *rpi_get_dcfg(struct rpi_priv *priv)
const struct rpi_machine_data *dcfg;
dcfg = of_device_get_match_data(priv->dev);
- if (!dcfg)
- return ERR_PTR(-EINVAL);
+ if (!dcfg) {
+ dev_err(priv->dev, "Unknown board. Not applying fixups\n");
+ return NULL;
+ }
for (; dcfg->hw_id != U8_MAX; dcfg++) {
if (priv->hw_id & 0x800000) {
@@ -369,7 +371,7 @@ static const struct rpi_machine_data *rpi_get_dcfg(struct rpi_priv *priv)
return dcfg;
}
- dev_err(priv->dev, "Failed to get dcfg for board_id: 0x%x.\n",
+ dev_err(priv->dev, "dcfg 0x%x for board_id doesn't match DT compatible\n",
priv->hw_id);
return ERR_PTR(-ENODEV);
}
@@ -407,7 +409,7 @@ static int rpi_devices_probe(struct device_d *dev)
rpi_env_init();
rpi_vc_fdt();
- if (dcfg->init)
+ if (dcfg && dcfg->init)
dcfg->init(priv);
reg = regulator_get_name("bcm2835_usb");
@@ -586,6 +588,24 @@ static const struct rpi_machine_data rpi_3_model_b_plus[] = {
},
};
+static const struct rpi_machine_data rpi_compute_module_3[] = {
+ {
+ .hw_id = BCM2837_BOARD_REV_CM3,
+ }, {
+ .hw_id = BCM2837B0_BOARD_REV_CM3_PLUS,
+ }, {
+ .hw_id = U8_MAX
+ },
+};
+
+static const struct rpi_machine_data rpi_model_zero_2_w[] = {
+ {
+ .hw_id = BCM2837B0_BOARD_REV_ZERO_2,
+ }, {
+ .hw_id = U8_MAX
+ },
+};
+
static const struct of_device_id rpi_of_match[] = {
/* BCM2835 based Boards */
{ .compatible = "raspberrypi,model-a", .data = rpi_model_a },
@@ -606,6 +626,10 @@ static const struct of_device_id rpi_of_match[] = {
{ .compatible = "raspberrypi,3-model-a-plus", .data = rpi_3_model_a_plus },
{ .compatible = "raspberrypi,3-model-b", .data = rpi_3_model_b },
{ .compatible = "raspberrypi,3-model-b-plus", .data = rpi_3_model_b_plus },
+ { .compatible = "raspberrypi,model-zero-2-w", .data = rpi_model_zero_2_w },
+ { .compatible = "raspberrypi,3-compute-module", .data = rpi_compute_module_3 },
+ { .compatible = "raspberrypi,3-compute-module-lite", .data = rpi_compute_module_3 },
+
{ /* sentinel */ },
};
BAREBOX_DEEP_PROBE_ENABLE(rpi_of_match);