[PATCH v2] arm: mvebu: Espressobin: Set environment variable fdtfile

Andre Heider a.heider at gmail.com
Sat Sep 26 11:09:59 CEST 2020


On 25/09/2020 09:46, Pali Rohár wrote:
> On Friday 11 September 2020 06:35:10 Andre Heider wrote:
...
>>   
>> +#ifdef CONFIG_BOARD_LATE_INIT
>> +int board_late_init(void)
>> +{
>> +	bool ddr4, emmc;
>> +
>> +	if (env_get("fdtfile"))
>> +		return 0;
>> +
>> +	if (!of_machine_is_compatible("globalscale,espressobin"))
>> +		return 0;
>> +
>> +	/* If the memory controller has been configured for DDR4, we're running on v7 */
>> +	ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS)
>> +		& A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4;
>> +
>> +	emmc = of_machine_is_compatible("globalscale,espressobin-emmc");
> 
> Maybe stupid question, but are not we able to detect if eMMC is
> connected or not at runtime? That could simplify setup and avoid usage
> of additional special DTS file for eMMC in U-Boot.

At some point I wondered about the same.

IIRC armbian just enables it and uses one u-boot binary everywhere. A 
non-existing chip won't get detected, so that shouldn't be a problem.

But I think it has more to do with enabling/powering up hardware blocks, 
which is not wanted or may even problematic.

Regards,
Andre



More information about the U-Boot mailing list