U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neha Malcom Francis <n-francis@ti.com>
To: "Kumar, Udit" <u-kumar1@ti.com>, <trini@konsulko.com>,
	<m-chawdhry@ti.com>
Cc: <afd@ti.com>, <christian.gmeiner@gmail.com>, <j-choudhary@ti.com>,
	<nm@ti.com>, <d.haller@phytec.de>, <joao.goncalves@toradex.com>,
	<u-boot@lists.denx.de>
Subject: Re: [PATCH] arm: mach-k3: j721s2_init: Support less than max DDR controllers
Date: Tue, 30 Jan 2024 14:01:43 +0530	[thread overview]
Message-ID: <283f3440-2c87-453e-9ec7-e4ff54821bc5@ti.com> (raw)
In-Reply-To: <d4ff51e8-9361-45ed-927b-96a5ce234849@ti.com>

Hi Udit

On 30/01/24 13:53, Kumar, Udit wrote:
> 
> On 1/30/2024 1:11 PM, Neha Malcom Francis wrote:
>> The number of DDR controllers to be initialised and used should depend
>> on the device tree with the constraint of the maximum number of
>> controllers the device supports. Since J721S2 has multiple (2)
>> controllers, instead of hardcoding the number of probes, move to
>> depending on the device tree UCLASS_RAM nodes present.
>>
>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>> ---
>> Boot logs:
>> https://gist.github.com/nehamalcom/07fedf4aa173590214b5cef6e1688fa1
>>
>> This was also parallely proposed in [1] on the mailing-list for J784S4.
>>
>> [1] https://lore.kernel.org/all/3a7c817b-de29-463a-b4b6-d62c0df66ade@ti.com/
>>
>>   arch/arm/mach-k3/j721s2_init.c | 15 +++++++++++----
>>   1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c
>> index fb0708bae1..ff21619506 100644
>> --- a/arch/arm/mach-k3/j721s2_init.c
>> +++ b/arch/arm/mach-k3/j721s2_init.c
>> @@ -213,10 +213,12 @@ bool check_rom_loaded_sysfw(void)
>>       return is_rom_loaded_sysfw(&bootdata);
>>   }
>> +#define J721S2_MAX_CONTROLLERS    2
>> +
>>   void k3_mem_init(void)
>>   {
>>       struct udevice *dev;
>> -    int ret;
>> +    int ret, ctr = 1;
>>       if (IS_ENABLED(CONFIG_K3_J721E_DDRSS)) {
>>           ret = uclass_get_device_by_name(UCLASS_MISC, "msmc", &dev);
>> @@ -227,9 +229,14 @@ void k3_mem_init(void)
>>           if (ret)
>>               panic("DRAM 0 init failed: %d\n", ret);
>> -        ret = uclass_next_device_err(&dev);
>> -        if (ret)
>> -            panic("DRAM 1 init failed: %d\n", ret);
> 
> Since there are two controllers only and you need to call uclass_get_device and 
> uclass_next_device_err
> 
> what about just checking error in above removed code, something like
> 
>          ret = uclass_next_device_err(&dev);
>          if (ret!=ENODEV)
>              panic("DRAM 1 init failed: %d\n", ret);
> 
> 

Yes... since AEP has only 2 controllers, this will suffice.

>> +        while (ctr < J721S2_MAX_CONTROLLERS) {
>> +            ret = uclass_next_device_err(&dev);
>> +            if (ret == -ENODEV)
>> +                break;
>> +            if (ret)
>> +                panic("DRAM %d init failed: %d\n", ctr, ret);
>> +            ctr++;
>> +        }
>>       }
>>       spl_enable_cache();
>>   }

-- 
Thanking You
Neha Malcom Francis

      reply	other threads:[~2024-01-30  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  7:41 [PATCH] arm: mach-k3: j721s2_init: Support less than max DDR controllers Neha Malcom Francis
2024-01-30  8:23 ` Kumar, Udit
2024-01-30  8:31   ` Neha Malcom Francis [this message]

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=283f3440-2c87-453e-9ec7-e4ff54821bc5@ti.com \
    --to=n-francis@ti.com \
    --cc=afd@ti.com \
    --cc=christian.gmeiner@gmail.com \
    --cc=d.haller@phytec.de \
    --cc=j-choudhary@ti.com \
    --cc=joao.goncalves@toradex.com \
    --cc=m-chawdhry@ti.com \
    --cc=nm@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=u-kumar1@ti.com \
    /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