2 Replies Latest reply on Sep 17, 2020 1:36 AM by prasannakotrappa

    How to change kernel base address in ZedBoard

    prasannakotrappa

      Hi There,

      I am new to petalinux and  trying to configure petalinux on zynq 7000.

      My Zynq PL section is programmed for DRAM address 0x40000000 to 7FFFFFFF, and tested its working in bare metal. However, now I want Petalinux to see PL address(0x40000000 to 7FFFFFFF) as the DRAM.

      When I executed below petalinux-config command, I am unable to change kernel base address and System memory base address to 0x40000000 under Subsystem AUTO Hardware Setting, It says "You have made an invalid entry."

      "petalinux-config --get-hw-description=</projects/zynq70000_ps-pl>"

      I followed this article which tries to achieve similar goal but still no luck, https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842219/Zynq-7000+AP+SoC+-+32+Bit+DDR+Access+with+ECC+Tech+Tip

      please help me how to get this working, I am stuck here since 2 weeks.

      PS: I am using vivado 2020.1

       

      Regards,

      Prasanna

        • Re: How to change kernel base address in ZedBoard
          narrucmot

          This Xilinx forum post, although for a MicroBlaze CPU, seems to describe what you want to do:

          https://forums.xilinx.com/t5/Embedded-Linux/Moving-kernel-base-address/td-p/1001835

           

          --Tom

            • Re: How to change kernel base address in ZedBoard
              prasannakotrappa

              Hello,

              Thanks for your response,

              I tried that, but my case is different,

               

              Let me describe my design clearly, I have a address translation device in my PL and I want all the memory request has to passed through the PL and PL will access the DDR for read/store.

              I am currently working on Zedboard,

              whose DDR address is from 0x00000000 to 0x3FFFFFFF and

              my PL address range is from 0x40000000 to 0x7FFFFFFF.

              I tested working of this design in Vitis, and confirmed that if I write anything in the address range from 0x40000000 to 0x7FFFFFFF, it is will go through my PL and it writes to DDR in the backend(Exactly how I wanted).

              Now I am trying to boot petalinux and wants petalinux to write to address only to my PL address range,

              Here's the steps I followed,

              petalinux-create -t project -s avnet-digilent-zedboard-v2020.1-final.bsp

              petalinux-config --get-hw-description=<path to my xsa>

              When I executed petalinux-config command, I could not change kernel base address and System memory base address to 0x40000000 under Subsystem AUTO Hardware Setting, It says "You have made an invalid entry." so I kept them as it is i.e. kernel base address 0x0.

              However, I modified system-user.dtsi file as mentioned by @aravindb , and it looks like this,

              /include/ "system-conf.dtsi"
              / {
              /* PS DDR Range <0x00 0x00 0x00 0x7ff00000> */
              /* PL DDR Range <0x04 0x00 0x01 0x00>  */
              memory {
              device_type = "memory";
              reg = <0x40000000 0x3fffffff>;
              };

              };

              Built the project using the below command,

              petalinux-build

              petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga /<path to bit stream>design_1_wrapper.bit --u-boot

              I copied BOOT.BIN boot.scr image.ub system.dtb files from /image/linux directory to SD card and tried to boot on the board, below is the error what I get,

              U-Boot 2020.01 (Sep 16 2020 - 09:17:15 +0000)

              CPU: Zynq 7z020
              Silicon: v3.1
              Model: Zynq Zed Development Board
              DRAM: ECC disabled 1024 MiB
              Flash: 0 Bytes
              NAND: 0 MiB
              MMC: mmc@e0100000: 0
              Loading Environment from SPI Flash... SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
              *** Warning - bad CRC, using default environment

              In: serial@e0001000
              Out: serial@e0001000
              Err: serial@e0001000
              Net:
              ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 0, interface rgmii-id

              Warning: ethernet@e000b000 using MAC address from DT
              eth0: ethernet@e000b000
              Hit any key to stop autoboot: 0
              switch to partitions #0, OK
              mmc0 is current device
              Scanning mmc 0:1...
              Found U-Boot script /boot.scr
              2010 bytes read in 49 ms (40 KiB/s)
              ## Executing script at 43000000
              ** Reading file would overwrite reserved memory **
              Wrong Image Format for bootm command
              ERROR: can't get kernel image!
              SCRIPT FAILED: continuing...
              ## Executing script at 43000000
              ** Reading file would overwrite reserved memory **
              Wrong Image Format for bootm command
              ERROR: can't get kernel image!
              SCRIPT FAILED: continuing...
              switch to partitions #0, OK
              mmc0 is current device
              Scanning mmc 0:1...
              Found U-Boot script /boot.scr
              2010 bytes read in 49 ms (40 KiB/s)
              ## Executing script at 43000000
              ** Reading file would overwrite reserved memory **
              Wrong Image Format for bootm command
              ERROR: can't get kernel image!
              SCRIPT FAILED: continuing...
              MMC Device 1 not found
              no mmc device at slot 1
              SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
              device 0 offset 0xfc0000, size 0x40000
              SF: 262144 bytes @ 0xfc0000 Read: OK
              ## Executing script at 43000000
              Wrong image format for "source" command
              SCRIPT FAILED: continuing...


              no devices available
              SCRIPT FAILED: continuing...
              ## Executing script at 43000000
              Wrong image format for "source" command
              SCRIPT FAILED: continuing...
              starting USB...
              Bus usb@e0002000: USB EHCI 1.00
              scanning bus usb@e0002000 for devices... 1 USB Device(s) found
              scanning usb for storage devices... 0 Storage Device(s) found

              Device 0: unknown device

              Device 1: unknown device
              ethernet@e000b000 Waiting for PHY auto negotiation to complete................

              _------------------------------------------------------------------------

              How do I fix this, or did I miss something ??

              Regards,

              Prasanna