[PATCH 1/7] mach-k3: am62a7_init: Add FS and raw mode for eMMC

Judith Mendez jm at ti.com
Fri Dec 20 21:29:20 CET 2024


Hi Bryan,

On 12/20/24 1:45 PM, Bryan Brattlof wrote:
> Hi Judith!
> 
> On December 20, 2024 thus sayeth Judith Mendez:
>> From: Vignesh Raghavendra <vigneshr at ti.com>
>>
>> This adds FS and raw boot mode support for eMMC similar to other K3
>> platforms
>>
>> Signed-off-by: Vignesh Raghavendra <vigneshr at ti.com>
>> ---
>>   arch/arm/mach-k3/am62ax/am62a7_init.c | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
> 
> Hmmm Are you on -next? this doesn't seem to apply :/

So sorry (: Will rebase, thanks!

~ Judith

> 
> ~Bryan
> 
>> diff --git a/arch/arm/mach-k3/am62ax/am62a7_init.c b/arch/arm/mach-k3/am62ax/am62a7_init.c
>> index 0f62f39075b..abf04970a2b 100644
>> --- a/arch/arm/mach-k3/am62ax/am62a7_init.c
>> +++ b/arch/arm/mach-k3/am62ax/am62a7_init.c
>> @@ -171,6 +171,25 @@ void board_init_f(ulong dummy)
>>   	debug("am62a_init: %s done\n", __func__);
>>   }
>>   
>> +u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
>> +{
>> +	u32 devstat = readl(CTRLMMR_MAIN_DEVSTAT);
>> +	u32 bootmode = (devstat & MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK) >>
>> +				MAIN_DEVSTAT_PRIMARY_BOOTMODE_SHIFT;
>> +	u32 bootmode_cfg = (devstat & MAIN_DEVSTAT_PRIMARY_BOOTMODE_CFG_MASK) >>
>> +			    MAIN_DEVSTAT_PRIMARY_BOOTMODE_CFG_SHIFT;
>> +
>> +	switch (bootmode) {
>> +	case BOOT_DEVICE_EMMC:
>> +		return MMCSD_MODE_EMMCBOOT;
>> +	case BOOT_DEVICE_MMC:
>> +		if (bootmode_cfg & MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK)
>> +			return MMCSD_MODE_RAW;
>> +	default:
>> +		return MMCSD_MODE_FS;
>> +	}
>> +}
>> +
>>   static u32 __get_backup_bootmedia(u32 devstat)
>>   {
>>   	u32 bkup_bootmode = (devstat & MAIN_DEVSTAT_BACKUP_BOOTMODE_MASK) >>
>> -- 
>> 2.47.1
>>



More information about the U-Boot mailing list