Skip to contentSkip to conversation

odroid: add CROS_EC to odroid_defconfig

PATCH In review Joost van Zwieten 4 participants 6 messages Jan 20, 2023 – Jan 24, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 odroid: add CROS_EC to odroid_defconfig

As of commit e44d7e73fe ("dm: core: Switch uclass_*_device_err to use uclass_*_device_check") U-Boot built with odroid_defconfig fails to initialize on an Odroid U2: board_late_init() (board/samsung/common/board.c) returns with an error due to the absence of the CROS_EC uclass, and the board resets. This patch adds CROS_EC to the defconfig, leading to a succcessful initialization of U-Boot.

---
configs/odroid_defconfig | 1 +

1 file changed, 1 insertion(+)
configs/odroid_defconfig +0 -0
index 6e1c29b355..b1ccabd0d2 100644
@@ -55,6 +55,7 @@ CONFIG_DFU_MMC=y

CONFIG_SET_DFU_ALT_INFO=y
CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
CONFIG_SYS_I2C_S3C24X0=y
+CONFIG_CROS_EC=y
CONFIG_MMC_DW=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y

Signature · 1 line
2.30.2
#1 lore raw
Quoted 10 lines · Joost van Zwieten

As of commit e44d7e73fe ("dm: core: Switch uclass_*_device_err to use uclass_*_device_check") U-Boot built with odroid_defconfig fails to initialize on an Odroid U2: board_late_init() (board/samsung/common/board.c)
returns with an error due to the absence of the CROS_EC uclass, and the board
resets. This patch adds CROS_EC to the defconfig, leading to a succcessful
initialization of U-Boot.

This doesn't seem to be the right fix to the problem, why would an odroid device have a need for a driver for the ChromeOS Embedded Controller?

Quoted 24 lines
---
 configs/odroid_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/odroid_defconfig +1 -1
index 6e1c29b355..b1ccabd0d2 100644
@@ -55,6 +55,7 @@ CONFIG_DFU_MMC=y
 CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_SYS_I2C_S3C24X0=y
+CONFIG_CROS_EC=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
--

2.30.2

#2 lore raw
Quoted 15 lines · Peter Robinson
Quoted 13 lines · Joost van Zwieten

As of commit e44d7e73fe ("dm: core: Switch uclass_*_device_err to
use
uclass_*_device_check") U-Boot built with odroid_defconfig fails
to
initialize on an Odroid U2: board_late_init() (board/samsung/common/board.c)
returns with an error due to the absence of the CROS_EC uclass, and
the
board
resets. This patch adds CROS_EC to the defconfig, leading to a succcessful
initialization of U-Boot.

Quoted 3 lines

This doesn't seem to be the right fix to the problem, why would an odroid device have a need for a driver for the ChromeOS Embedded Controller?

For reference, here's the thread that led to this patch: [1].

My board returns ENODEV when calling uclass_first_device_err(UCLASS_CROS_EC, &dev) with CROS_EC enabled, so I don't seem to have this device.

At the end of [1] I have suggested an alternative fix: enclosing a couple of statements that assume there's a CROS_EC driver inside an #ifdef CONFIG_CROS_EC. Do you think that is a viable approach? I'm not at all familiar with the U-Boot codebase, so forgive me if this doesn't make any sense.

[1]: https://lists.denx.de/pipermail/u-boot/2023-January/505627.html

Quoted 25 lines
Quoted 25 lines

---

  configs/odroid_defconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig index 6e1c29b355..b1ccabd0d2 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -55,6 +55,7 @@ CONFIG_DFU_MMC=y
CONFIG_SET_DFU_ALT_INFO=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_SYS_I2C_S3C24X0=y
+CONFIG_CROS_EC=y
CONFIG_MMC_DW=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
--
2.30.2

Reviewed-by
#3 lore raw

Hi,

Quoted 24 lines · Joost van Zwieten
Quoted 16 lines · Peter Robinson
Quoted 13 lines · Joost van Zwieten

As of commit e44d7e73fe ("dm: core: Switch uclass_*_device_err to
use
uclass_*_device_check") U-Boot built with odroid_defconfig fails
to
initialize on an Odroid U2: board_late_init() (board/samsung/common/board.c)
returns with an error due to the absence of the CROS_EC uclass, and
the
board
resets. This patch adds CROS_EC to the defconfig, leading to a succcessful
initialization of U-Boot.

Quoted 3 lines

This doesn't seem to be the right fix to the problem, why would an odroid device have a need for a driver for the ChromeOS Embedded Controller?

Quoted 5 lines

For reference, here's the thread that led to this patch: [1].

My board returns ENODEV when calling uclass_first_device_err(UCLASS_CROS_EC, &dev) with CROS_EC enabled, so I don't seem to have this device.

This is really adding the driver rather than the device. The device still does not exist. It is because the exynos boards share common code like board_init().

Quoted 6 lines

At the end of [1] I have suggested an alternative fix: enclosing a couple of statements that assume there's a CROS_EC driver inside an #ifdef CONFIG_CROS_EC. Do you think that is a viable approach? I'm not at all familiar with the U-Boot codebase, so forgive me if this doesn't make any sense.

That would be OK too, but if you do that, please use IS_ENABLED() rather than #ifdef

Quoted 30 lines

[1]: https://lists.denx.de/pipermail/u-boot/2023-January/505627.html

Quoted 25 lines
Quoted 25 lines

---

  configs/odroid_defconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig index 6e1c29b355..b1ccabd0d2 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -55,6 +55,7 @@ CONFIG_DFU_MMC=y
CONFIG_SET_DFU_ALT_INFO=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_SYS_I2C_S3C24X0=y
+CONFIG_CROS_EC=y
CONFIG_MMC_DW=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
--
2.30.2

Regards,
SImon

#4 lore raw
Quoted 53 lines · Simon Glass

Hi,

Quoted 28 lines · Joost van Zwieten
Quoted 1 line · Peter Robinson

On Fri, Jan 20, 2023 at 11:17 PM Joost van Zwieten

<[email protected]>

Quoted 3 lines
Quoted 2 lines · wrote:

As of commit e44d7e73fe ("dm: core: Switch uclass_*_device_err

to

Quoted 2 lines
Quoted 2 lines

use
uclass_*_device_check") U-Boot built with odroid_defconfig

fails

Quoted 4 lines
Quoted 4 lines

to
initialize on an Odroid U2: board_late_init() (board/samsung/common/board.c)
returns with an error due to the absence of the CROS_EC uclass,

and

Quoted 9 lines
Quoted 5 lines

the
board
resets. This patch adds CROS_EC to the defconfig, leading to a succcessful
initialization of U-Boot.

This doesn't seem to be the right fix to the problem, why would an odroid device have a need for a driver for the ChromeOS Embedded Controller?

Quoted 6 lines

For reference, here's the thread that led to this patch: [1].

My board returns ENODEV when calling uclass_first_device_err(UCLASS_CROS_EC, &dev) with CROS_EC
enabled,
so I don't seem to have this device.

This is really adding the driver rather than the device. The device still does not exist. It is because the exynos boards share common code like board_init().

Quoted 8 lines

At the end of [1] I have suggested an alternative fix: enclosing a couple of statements that assume there's a CROS_EC driver inside an #ifdef CONFIG_CROS_EC. Do you think that is a viable approach?
I'm not
at all familiar with the U-Boot codebase, so forgive me if this
doesn't
make any sense.

Quoted 2 lines

That would be OK too, but if you do that, please use IS_ENABLED() rather than #ifdef

I've tested the alternative, and that works for me as well. I am slightly in favour of the alternative, because it seems illogical to require building a driver that is never going to be used. On the other hand this patch only affects the Odroid U2, and the alternative every board using an Exnyos chip.

I'm still wondering why other boards, e.g. the Odroid XU3, are seemingly (I don't have any) unaffected by this.

Best regards,
Joost

Quoted 33 lines
Quoted 30 lines

[1]: https://lists.denx.de/pipermail/u-boot/2023-January/505627.html

Quoted 25 lines
Quoted 25 lines

---

  configs/odroid_defconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig index 6e1c29b355..b1ccabd0d2 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -55,6 +55,7 @@ CONFIG_DFU_MMC=y
CONFIG_SET_DFU_ALT_INFO=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_SYS_I2C_S3C24X0=y
+CONFIG_CROS_EC=y
CONFIG_MMC_DW=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
--
2.30.2

Regards,
SImon

#5 lore raw

Hi Joost,

[ ... ]

Quoted 11 lines
Quoted 2 lines

That would be OK too, but if you do that, please use IS_ENABLED() rather than #ifdef

I've tested the alternative, and that works for me as well. I am slightly in favour of the alternative, because it seems illogical to require building a driver that is never going to be used. On the other hand this patch only affects the Odroid U2, and the alternative every board using an Exnyos chip.

I'm still wondering why other boards, e.g. the Odroid XU3, are seemingly (I don't have any) unaffected by this.

Odroid-xu4 has the same issue, and the proposed solutions fixes the issue there as well. I also think the alternative #if IS_ENABLED(CONFIG_CROS_EC)-solution would be better.

Thanks for reporting the issue!

Best regards,
Henrik Grimler