2

I am working on RedPitaya FPGA board and want to use Asymmetric MultiProcessing on it. CPU0 will be running Linux and CPU1 will be running Baremetal or freeRTOS.

For that I need to change the Kernel Load address so that the application/FreeRTOS running on CPU1 can have access to memory. Does anyone know how to change the Kernel Load address?

I believe we will need to make changes in some configuration files, device tree and the address to which u-boot loads the kernel(not sure about this one). I think I can figure our the rest but I am having a hard time figuring out what to change in Kernel Configs or Source.

P.S: With PetaLinux SDK its done as described by OpenAMP Framework for Zynq Devices Page 17. I just need to figure out how to do it without using PetaLinux.

Cheers. Waqar Rashid

Waqar Rashid
  • 131
  • 5
  • Any comments on this one http://wiki.dreamrunner.org/public_html/Embedded-System/kernel/Linux-Kernel-Build.html – Waqar Rashid Jul 27 '19 at 17:32
  • Symbol: PHYSICAL_START [=0x1000000] Type : hex Prompt: Physical address where the kernel is loaded│ Location:│ (2) -> Processor type and features Defined at arch/x86/Kconfig:2047 Is it related? I found it in the "make menuconfig" – Waqar Rashid Jul 27 '19 at 17:39
  • Found a related question here: https://stackoverflow.com/questions/53195196/zynq-linux-kernel-load-address – Waqar Rashid Jul 27 '19 at 18:40
  • Looking at http://wiki.dreamrunner.org/public_html/Embedded-System/kernel/Linux-Kernel-Build.html and my redpitaya kernel configs it seems that we can load the kernel at a different location in RAM as CONFIG_ARM_PATCH_PHYS_VIRT and CONFIG_AUTO_ZRELADDR are enable by default. I will try the methods shown in this link and report back. – Waqar Rashid Jul 28 '19 at 17:46
  • Looks like passing a parameter LOADADDR or UIMAGE_LOADADDR to makefile will do the trick. not verified yet. Anyone knows how to get kernel start address at runtime? make ARCH=arm UIMAGE_LOADADDR=0x90008000 uImage – Waqar Rashid Jul 28 '19 at 18:35
  • Also a helpful article on the topic: http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html Here he talks about an important thing which is to leave 4MB after the zImage load address so ensure that the kernel can be loaded over there incase of error in decompressing to ZRELADDR or LOADADDR or UIMAGE_LOADADDR. Also make sure that these above load addresses are not within 4MB of zImage. What I don't understand now is how UIMAGE_LOADADDR is 0x8000 in most examples while its clearly conventional load address for zImage. Are these the same? Is my basic understanding wrong? – Waqar Rashid Jul 28 '19 at 19:01
  • How far along did you get? – Xofo Nov 08 '19 at 06:06
  • UIMAGE_LOADADDR did the trick. It's already defined to some value make sure that kernel has enough space before its starting address to store kernel parameters and some tables. – Waqar Rashid Nov 08 '19 at 13:40
  • I updated the answer, please feel free to add more details if you guys feel like its incomplete. @Xofo – Waqar Rashid Nov 08 '19 at 13:47

1 Answers1

1

For redpitaya the board I was working with, the solution was simple. All you need to do is to provide the kernel base address to make command that is used to compile the kernel. For redpitaya this can be found in the Makefile.x86 uImage traget (don't take my word for it).

I created a video tutorial on doing Asymmetric MultiProcessing in RedPitaya and this step can be found at the this time

Waqar Rashid
  • 131
  • 5