Skip to contentSkip to conversation

Inconsistent "compatible" string for Terasic DE0-Nano-SoC / Atlas SoC Kit

DISCUSSION Ian Abbott 2 participants 2 messages Nov 2, 2021 – Nov 4, 2021

lore
Share & tools
lore

Ian Abbott

author
#0 lore raw

Hi there!

I have a slight issue getting BootLoaderSpec entries for Terasic DE0-Nano-SoC to work:

barebox@Terasic DE0-Nano-SoC/Atlas-SoC Kit:/ boot mmc0
blspec: ignoring entry with incompatible devicetree "terasic,de0-atlas" Nothing bootable found on 'mmc0'
Nothing bootable found

From the (recent) Linux kernel sources "arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dts":

	model = "Terasic DE-0(Atlas)";
	compatible = "terasic,de0-atlas", "altr,socfpga-cyclone5", "altr,socfpga";

Of course, the above compatible string matches the barebox source "dts/src/arm/socfpga_cyclone5_de0_nano_soc.dts" file.

However the "model" and "compatible" strings get overridden by the barebox source "arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts":

	model = "Terasic DE0-Nano-SoC/Atlas-SoC Kit";
	compatible = "terasic,de0-nano-soc","altr,socfpga-cyclone5", 

"altr,socfpga";

The socfpga_init() function in "arch/arm/boards/terasic-de0-nano-soc/board.c" also checks the "compatible" string for registering a PHY fixup:

static int socfpga_init(void)

{
	if (!of_machine_is_compatible("terasic,de0-nano-soc"))
		return 0;

	if (IS_ENABLED(CONFIG_PHYLIB))
		phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, phy_fixup);

	return 0;
}

I think I can get everything working by changing barebox's "compatible" string to the following:

compatible = "terasic,de0-atlas", "terasic,de0-nano-soc",
"altr,socfpga-cyclone5", "altr,socfpga";

Then the socfpga_init() function and the blspec loader should both be happy.

Signature · 9 lines
-=( Ian Abbott <[email protected]> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

Hi Ian,

Quoted 41 lines · Ian Abbott

Hi there!

I have a slight issue getting BootLoaderSpec entries for Terasic DE0-Nano-SoC to work:

barebox@Terasic DE0-Nano-SoC/Atlas-SoC Kit:/ boot mmc0
blspec: ignoring entry with incompatible devicetree "terasic,de0-atlas" Nothing bootable found on 'mmc0'
Nothing bootable found

From the (recent) Linux kernel sources "arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dts":

	model = "Terasic DE-0(Atlas)";
	compatible = "terasic,de0-atlas", "altr,socfpga-cyclone5", "altr,socfpga";

Of course, the above compatible string matches the barebox source "dts/src/arm/socfpga_cyclone5_de0_nano_soc.dts" file.

However the "model" and "compatible" strings get overridden by the barebox source "arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts":

	model = "Terasic DE0-Nano-SoC/Atlas-SoC Kit";
	compatible = "terasic,de0-nano-soc","altr,socfpga-cyclone5",

"altr,socfpga";

The socfpga_init() function in "arch/arm/boards/terasic-de0-nano-soc/board.c" also checks the "compatible" string for registering a PHY fixup:

static int socfpga_init(void)

{
	if (!of_machine_is_compatible("terasic,de0-nano-soc"))
		return 0;

	if (IS_ENABLED(CONFIG_PHYLIB))
		phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, phy_fixup);

	return 0;
}
Quoted 5 lines

I think I can get everything working by changing barebox's "compatible" string to the following:

compatible = "terasic,de0-atlas", "terasic,de0-nano-soc",
"altr,socfpga-cyclone5", "altr,socfpga";

You can drop the model and compatible properties from arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts and change the of_machine_is_compatible check to the upstream dts string. I don't think we have a good reason to keep the terasic,de0-nano-soc compatible.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox