mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 11/15] ARM: at91: skov-arm9cpu: Add SD-Card xload support
Date: Tue, 20 Feb 2024 10:25:37 +0100	[thread overview]
Message-ID: <fd232d89-e78f-4a51-b5f4-6778ca378c13@pengutronix.de> (raw)
In-Reply-To: <20240215222928.GA1462714@ravnborg.org>

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 |




  reply	other threads:[~2024-02-20  9:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 16:29 [PATCH v3 00/15] ARM: at91: skov-arm9cpu (SAM9263) first stage support Ahmad Fatoum
2024-02-15 16:29 ` [PATCH v3 01/15] mci: atmel_mci: disable power save mode Ahmad Fatoum
2024-02-15 16:29 ` [PATCH v3 02/15] mci: atmel_mci: fix zeroing of block length on AT91SAM9263 Ahmad Fatoum
2024-02-15 16:29 ` [PATCH v3 03/15] ARM: replace ENTRY_FUNCTION_HEAD with ENTRY_FUNCTION_WITHSTACK_HEAD Ahmad Fatoum
2024-02-15 16:29 ` [PATCH v3 04/15] ARM: at91: use AT91 header instead of generic barebox ARM's Ahmad Fatoum
2024-02-15 16:29 ` [PATCH v3 05/15] ARM: at91: implement SAM9_ENTRY_FUNCTION Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 06/15] ARM: at91: sam9263_ll: drop PLL charge pump initialization Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 07/15] ARM: at91: sam9263_ll: pass AT91_PMC_LL_AT91SAM9263 to PMC functions Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 08/15] ARM: at91: sam9263_ll: refactor MCK switch to PLLA for clarity Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 09/15] ARM: at91: sam9263_ll: support configuration of PLLB Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 10/15] ARM: dts: AT91: skov-arm9cpu: remove barebox environment on NOR Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 11/15] ARM: at91: skov-arm9cpu: Add SD-Card xload support Ahmad Fatoum
2024-02-15 22:29   ` Sam Ravnborg
2024-02-20  9:25     ` Ahmad Fatoum [this message]
2024-02-21 16:28       ` Sam Ravnborg
2024-02-15 16:30 ` [PATCH v3 12/15] ARM: at91: skov-arm9cpu: configure SMC for NOR flash use Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 13/15] ARM: at91: skov-arm9cpu: configure more appropriate hostname Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 14/15] ARM: AT91: skov-arm9cpu: support environment on SD-Card Ahmad Fatoum
2024-02-15 16:30 ` [PATCH v3 15/15] usb: ohci-at91: fix possible hang chainloading barebox Ahmad Fatoum
2024-02-16 13:15   ` Sascha Hauer
2024-02-20  9:26     ` Ahmad Fatoum
2024-02-15 22:33 ` [PATCH v3 00/15] ARM: at91: skov-arm9cpu (SAM9263) first stage support Sam Ravnborg
2024-02-20  9:27   ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd232d89-e78f-4a51-b5f4-6778ca378c13@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox