Building leon3 prom image for testing on renode

Joel Sherrill joel at rtems.org
Thu Jul 20 18:13:23 UTC 2023


On Wed, Jul 19, 2023 at 10:30 PM Alan Cudmore <alan.cudmore at gmail.com>
wrote:

> Hi Mazaya,
>
> On Tue, Jul 18, 2023 at 8:35 PM Muhammad Sulthan Mazaya <
> msulthanmazaya at gmail.com> wrote:
>
>> Hi Alan,
>>
>> > Also, as you mentioned, the renode Zephyr example runs directly from
>> RAM without a prom image. Is it that the RTEMS LEON3 BSP relies on
>> initialization done by the boot prom (GRMON or MKPROM2 based boot code)?
>>
>> Do you or anyone on the devel mailing list know where/how can I check
>> which kind of initialization rtems leon3 bsp rely on? Sorry, I am fairly
>> new to this
>>
>> The prom image source code is pretty simple, but it would take a little
> bit of time (for me at least) to decode since it is in SPARC assembly
> language:
> The code:
>
> https://github.com/TUT-ASI/leon3-grlib-gpl-mirror/blob/master/software/leon3/prom.S
> And the prom.h header they use for the renode prom image:
> https://github.com/antmicro/renode-rtems-leon3/blob/main/prom.h
>
> Essentially, it is setting up the processor including the stack pointer,
> and minimal configuration (AMBA Plug and play?). The idea would be to
> translate what the prom.S assembly program is doing into a set of .resc
> statements to program configuration registers and set up anything that
> RTEMS may need to run. It may be a subset of everything that the assembly
> code does - It may come down to just one or two statements. I'm not being
> specific with the steps, because I'm not sure myself.. I would have to take
> some time to figure out exactly what it's doing.
>

I think we rely on grmon passing us the size of RAM which might be via the
stack pointer we start on.

There is also CLOCK_SPEED in start.S which is info from grmon which appears
to be used in the clock driver.

If we are relying on specific state of device setup, I don't know. I don't
think we would by now given the use cases for this BSP.


> Here is an example for the K210 where some of the peripheral registers are
> programmed in the renode resc script:
>
> https://github.com/renode/renode/blob/master/scripts/single-node/kendryte_k210.resc#L10
>
> Replacing the prom with resc statements is one way to solve the problem -
> by understanding the assembly and the memory mapped registers that are
> being programmed. The other way to solve the problem is by figuring out the
> way to supply the prom.bin file to users that need to run RTEMS/LEON3
> binaries on renode. One is an embedded programming problem and the other is
> an automation problem. I think both are valid solutions.
>
> Regards,
> Alan
>
>
>
>> Thank you,
>> Mazaya
>>
>> On Tue, Jul 18, 2023 at 11:27 PM Alan Cudmore <alan.cudmore at gmail.com>
>> wrote:
>>
>>> Hi Mazaya,
>>> I wonder if it is possible to initialize the processor to the state
>>> where it can run the RTEMS image in RAM without using the prom image? The
>>> processor initialization would have to go in the resc script before the
>>> image is loaded and started.
>>> Also, as you mentioned, the renode Zephyr example runs directly from RAM
>>> without a prom image. Is it that the RTEMS LEON3 BSP relies on
>>> initialization done by the boot prom (GRMON or MKPROM2 based boot code)?
>>>
>>> https://github.com/renode/renode/blob/master/scripts/single-node/leon3_zephyr.resc
>>>
>>> I guess it ends up being a trade off of tooling vs. trying to program
>>> the necessary initialization in the resc script.
>>>
>>> Regards,
>>> Alan
>>>
>>> On Tue, Jul 18, 2023 at 2:46 AM Muhammad Sulthan Mazaya <
>>> msulthanmazaya at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was trying to implement renode for testing leon3 using rtems-test. I
>>>> noticed that from the example they provide
>>>> https://github.com/antmicro/renode-rtems-leon3/blob/main/leon3_rtems.resc,
>>>> it seems like the renode simulator needs the prom image of leon3 to do so.
>>>> I don't think an additional build step before testing a particular bsp is
>>>> something supported by the build config of rtems-tools + my mentors
>>>> also said it shouldn't be on the rtems-tools. Is it okay to have RSB build
>>>> that for us as part of the BSP?
>>>>
>>>> Thank you,
>>>> Mazaya
>>>> _______________________________________________
>>>> devel mailing list
>>>> devel at rtems.org
>>>> http://lists.rtems.org/mailman/listinfo/devel
>>>
>>> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230720/c92cb248/attachment.htm>


More information about the devel mailing list