board: adi: sc846: fix carrier-board config and boot SPI bus - #146
board: adi: sc846: fix carrier-board config and boot SPI bus#146ozan956 wants to merge 6 commits into
Conversation
sc846-som and sc846-som-ezkit each carried their own board_init(), differing only by the carrier-board ethernet init and RGMII enable call. Move the shared logic into common-sc846-som/sc846-som.c, gated on CONFIG_ADI_CARRIER_SOMCRR2_EZKIT, matching the pattern already used by common-sc594-som and common-sc598-som. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
LLM reviewThis series unifies the ADSP-SC846 run: 31019236773
|
Liked the how it found the error, but did not like the suggested solution. I dig in why the carrier symbol is defined even for just SoM. Then I saw that its kinda forced. Fixed that by making that choice based on TARGET_SC846_SOM_EZKIT. |
The "Analog Devices SC84x SOM Carrier Board Variant" choice depended on SC846 (the whole SoC family) with default ADI_CARRIER_SOMCRR2_EZKIT, so the symbol was always true regardless of which SC846 target was selected. board_init gates adi_somcrr_init_ethernet on this symbol. On the bare SOM it now called into adi_somcrr_enable_ethernet, which looks up the "eth0-reset" gpio-hog. That hog only exists in sc846-som-ezkit.dts, not sc846-som.dts, so gpio_hog_lookup_name returns NULL. Scope the choice to TARGET_SC846_SOM_EZKIT so ADI_CARRIER_SOMCRR2_EZKIT is only set for the carrier-board target, matching the SC59x pattern where carrier selection is tied to the specific board target rather than the SoC family. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
9b9b050 to
9caa2f8
Compare
GIC_600_CLEAR_RDPD not mentioned anywhere else. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
0f68f34 to
7866610
Compare
IS25WP02GG is wired to SPI1 per schematic and the board dts, matching SF_DEFAULT_BUS=1 already set. Without an explicit CONFIG_SC_BOOT_SPI_BUS, the SOM defconfig fell back to the Kconfig default of 2, mismatching the ezkit defconfig and the actual wiring. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
081cdcf to
dea2d72
Compare
|
I believe the SoM config was not working, since I saw that when compiled, the ezkit gets CONFIG_SC_BOOT_SPI_BUS=1, but just SoM does not define it so gets 2. One of them must not working. I checked the schematics, I think the SoM config was not working -> https://www.analog.com/media/en/technical-documentation/eval-board-schematic/ev-sc846-som-schem.pdf
If someone has bare SoM setup, worth confirming this was actually failing to boot before the fix. |
You are correct, the SOM is the broken one, we fixed the EZKIT defconfig a while back. Do we have a setup with just the sc846 SOM we could run tests on in the future? Would be nice to have to catch things like this if we are going to support the sc846 with and without a carrier. |
Our all SC846s has the carrier and intensively used 😅 Maybe @artursartamonovsadi have one 🤔 |
I think everyone's SC846 will be tied up for this bring-up. Maybe something worth revisiting in the future once the sc846 initial support rush has calmed down. |
9690677 to
dea2d72
Compare
|
We don't support a SoM only config for the SC59x boards and now isn't the time to do it for SC846, without supporting it for SC59x. Drop the SoM only config and board configuration |
TARGET_SC846_SOM offered a no-carrier SC846 configuration, but the SC59x boards never supported that mode and now isn't the time to add it for SC846 either without also adding it there. Drop TARGET_SC846_SOM, its board dir, and sc846-som_defconfig, leaving sc846-som-ezkit as the only SC846 target. This matches the SC594/SC598 pattern where board selection is always tied to a specific carrier. board_init() no longer needs to branch on the carrier symbol since SOMCRR2-EZKIT is now unconditionally selected by the sole remaining target. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Makes sense. Removed everything related with bare SoM. |
adi_somcrr_enable_ethernet/disable_ethernet ignored the lookup result and dereferenced eth0_reset unconditionally. somcrr_ezkit.c and somcrr_ezlite.c already guard this call; somcrr2_ezkit.c did not. Match the sibling carriers and skip dm_gpio_set_value on lookup failure. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>

sc846-som and sc846-som-ezkit each carried their own board_init(),
differing only by the carrier-board ethernet init and RGMII enable
call. Move the shared logic into common-sc846-som/sc846-som.c, gated
on CONFIG_ADI_CARRIER_SOMCRR2_EZKIT, matching the pattern already used
by common-sc594-som and common-sc598-som.
While doing so, found ADI_CARRIER_SOMCRR2_EZKIT was forced on for any
SC846 target, not just the ezkit carrier board, so the shared
board_init would call into ethernet gpio-hog lookups missing on the
bare SOM's dts. Scoped the choice to TARGET_SC846_SOM_EZKIT.
Also drops an unused symbol (GIC_600_CLEAR_RDPD) found along the way,
and fixes sc846-som_defconfig missing CONFIG_SC_BOOT_SPI_BUS, which
left it defaulting to bus 2 instead of the SPI1 bus the boot flash is
actually wired to (confirmed against schematic).