[PATCH v3 11/15] ARM: at91: skov-arm9cpu: Add SD-Card xload support

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Feb 20 01:25:37 PST 2024


Hello Sam,


On 15.02.24 23:29, Sam Ravnborg wrote:
>> +static noinline void continue_skov_arm9cpu_xload_mmc(void)
>> +{
>> +	sam9263_lowlevel_init(0x2031B004, 0x10053001);
> Can this be made more verbose using the existing defines?
> The above hex codes are not friendly to read, and using the original
> defines used in the previous patch would help a lot on the readability.

I will use the defines for v2. I am not in favor or going back to define
it as a struct though as it make sit needlessly cumbersome to port board
support from at91bootstrap, where the straight hex values are used.

Thanks,
Ahmad

> 
> 	Sam
> 
>> +	sam92_dbgu_setup_ll(MASTER_CLOCK);
>> +
>> +	sam92_udelay_init(MASTER_CLOCK);
>> +	sam9263_sdramc_init();
>> +	sam9263_atmci_start_image(1, MASTER_CLOCK, 0);
>> +}
>> +
>> +SAM9_ENTRY_FUNCTION(start_skov_arm9cpu_xload_mmc)
>> +{
>> +	/* Configure system so we are less constrained */
>> +	arm_cpu_lowlevel_init();
>> +	relocate_to_current_adr();
>> +	setup_c();
>> +
>> +	continue_skov_arm9cpu_xload_mmc();
>>  }
>>  
>>  extern char __dtb_at91_skov_arm9cpu_start[];
>> @@ -118,10 +113,12 @@ AT91_ENTRY_FUNCTION(start_skov_arm9cpu, r0, r1, r2)
>>  {
>>  	void *fdt;
>>  
>> +	/*
>> +	 * We may be running after at91bootstrap, so redo the initialization to
>> +	 * be sure, everything is as we expect it.
>> +	 */
>>  	arm_cpu_lowlevel_init();
>>  
>> -	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE);
>>  	fdt = __dtb_at91_skov_arm9cpu_start + get_runtime_offset();
>> -
>> -	skov_arm9cpu_init(fdt);
>> +	barebox_arm_entry(AT91_CHIPSELECT_1, at91sam9263_get_sdram_size(0), fdt);
>>  }
>> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
>> index 69edf3dbdc4e..0e89916c9c32 100644
>> --- a/arch/arm/mach-at91/Kconfig
>> +++ b/arch/arm/mach-at91/Kconfig
>> @@ -603,9 +603,7 @@ config MACH_SKOV_ARM9CPU
>>  	select SOC_AT91SAM9263
>>  	select OFDEVICE
>>  	select COMMON_CLK_OF_PROVIDER
>> -	select HAVE_AT91_USB_CLK
>> -	select HAVE_AT91_BOOTSTRAP
>> -	select AT91SAM926X_BOARD_INIT
>> +	select MCI_ATMEL_PBL
>>  	help
>>  	  Say y here if you are using SKOV's ARM9 CPU board
>>  
>> diff --git a/images/Makefile.at91 b/images/Makefile.at91
>> index 523dc5f499f0..06f8936893ae 100644
>> --- a/images/Makefile.at91
>> +++ b/images/Makefile.at91
>> @@ -56,9 +56,13 @@ FILE_barebox-groboards-sama5d27-giantboard-xload-mmc.img = start_sama5d27_giantb
>>  MAX_PBL_IMAGE_SIZE_start_sama5d27_giantboard_xload_mmc = 0xffff
>>  image-$(CONFIG_MACH_SAMA5D27_GIANTBOARD) += barebox-groboards-sama5d27-giantboard-xload-mmc.img
>>  
>> +pblb-$(CONFIG_MACH_SKOV_ARM9CPU) += start_skov_arm9cpu_xload_mmc
>> +FILE_barebox-skov-arm9cpu-xload-mmc.img = start_skov_arm9cpu_xload_mmc.pblb
>> +MAX_PBL_MEMORY_SIZE_start_skov_arm9cpu = 0x12000
>> +image-$(CONFIG_MACH_SKOV_ARM9CPU) += barebox-skov-arm9cpu-xload-mmc.img
>> +
>>  pblb-$(CONFIG_MACH_SKOV_ARM9CPU) += start_skov_arm9cpu
>>  FILE_barebox-skov-arm9cpu.img = start_skov_arm9cpu.pblb
>> -MAX_PBL_MEMORY_SIZE_start_skov_arm9cpu = 0x12000
>>  image-$(CONFIG_MACH_SKOV_ARM9CPU) += barebox-skov-arm9cpu.img
>>  
>>  pblb-$(CONFIG_MACH_SAMA5D4_WIFX) += start_sama5d4_wifx_l1
>> -- 
>> 2.39.2
> 

-- 
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 |




More information about the barebox mailing list