element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Ultrazed Hardware Design Cache Library on the UltraZed
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 6 replies
  • Answers 5 answers
  • Subscribers 340 subscribers
  • Views 1261 views
  • Users 0 members are here
  • debian buster
  • cacheflush.h
  • arm cortex a53
  • embedded linux
  • xilinx zynq ultrascale+
  • kernel modules
  • gnu linux
  • cacheflush
  • linux device drivers
  • petalinux
  • xilinx
  • linux kernel
  • linux debian
  • ultrazed-eg
  • linux modules
  • petalinux tools
  • cache
  • arm-64-bit
  • xilinx zynq® ultrascale+ mpsoc
  • Embedded Systems
  • xilinx-linux
  • cache.h
  • ultrazed-eg-iocc
  • kernel
  • outercache.h
  • debian10
  • module
Related

Cache Library on the UltraZed

bhoevding
bhoevding over 6 years ago

Hello,

 

I am currently trying to build a kernel module, which contains functions like cache-flushing.

 

Some background Information as to how my System is generated:

I am using the Xilinx-V2019.1-Toolchain (Vivado & SDK, PetaLinux Tools) to generate all the required Embedded Linux components like bootloader, kernel image and device tree. Furthermore I have cloned the Xilinx-Linux-Repository, switched to the V2019.1 branch and configured PetaLinux Tools to use the specific Xilinx-Linux-Repo to generate the components using the repository. My platform is the Avnet-UltraZed-EG-IOCC Board and I am using a Debian-10 root filesystem for development. The Module I am trying to compile has worked on other Zynq-7000 Dev. Boards which have a different CPU-Architecture (32-Bit).

 

The issue:

The module won't compile, because I am trying to use kernel functions form a header which doesn't exist (outercache.h).

 

Regarding the outercache.h header, someone pointed out to me that this library can only be used on ARM-32-Bit-CPUs. As of right now I have worked through the arch/arm/include/asm/*.h and arch/arm64/include/asm/*.h within the Xilinx-Linux-Repository and found some other headers. But the problem persists, that the relevant headers (for example from the arm64-dir: cache.h, cacheflush.h) are not build. I have tried building the headers using PetaLinux Tools, as well as Cross Compiling using make xilinx_zynqmp_defconfig, make deb-pkg, make headers_install. Using the find command I have not figured out how to generate these cache headers, which could be the solution to my problem.

Another tip which I received on the Xilinx Forum was to include the following line CONFIG_OUTER_CACHE=y in the  xilinx_zynqmp_defconfig, which seemed promising but also didn't help me generating the required headers.

The only cache-relevant header being built on my system is located under /usr/include/linux/bcache.h, but doesn't contain any helpful functions for my module.

 

So as of right now I am really desperate to find out, how the cache can be flushed on 64-Bit Architectures from the Xilinx Zynq UltraScale+ Series. Hopefully someone can help me out with this issue, it might also help future developers.

I am depending on this to work for my application which is why I am trying to get help from both Forums here as well as the Xilinx Forum (see https://forums.xilinx.com/t5/Embedded-Linux/Cacheflush-not-working/m-p/1009218#M35867)

 

I would appreciate all the help I can get and please reply should you need more details, screenshots or other information,

 

best regards,

Bjørn

 

Message was edited by: Bjørn Hövding

  • Sign in to reply
  • Cancel

Top Replies

  • bhoevding
    bhoevding over 6 years ago in reply to clem57 +1
    Hello @BB-Sphere, could you explain your question, I am not sure what you mean. Goal: I am trying to flush the Cache using Kernel functions. Problem: The Kernel library which is built through PetaLinux…
  • clem57
    clem57 over 6 years ago +1 suggested
    I think this blog points to your issue https://forums.xilinx.com/t5/Embedded-Development-Tools/Trouble-creating-Linux-Application-in-SDK-2016-2-or-2016-4/td-p/… Have you seen https://www.instructables…
  • bhoevding
    bhoevding over 6 years ago in reply to clem57 +1 suggested
    Hello clem57 and Using Xilinx Tools Forum , Avnet Board Forums , UltraZed , Avnet , Xilinx , first of all thank you for looking into this matter and helping me out with your expertise. I have looked into…
Parents
  • aswinvenu
    0 aswinvenu over 6 years ago

    Hi,

     

    Can you provide the Makefile? I think Makefile will lead us to some clue.

    Btw are you able to locate asm/outercache.h file in linux/arch?

     

    Regards,

    Aswin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • bhoevding
    0 bhoevding over 6 years ago in reply to aswinvenu

    Hello,

     

    The asm/outercache.h is located under linux/arch, but it seems like a configuration prevents the header from being built into the system.

    I am unsure as to what extent this is an issue with my build-process, configuration or architecture. (see Answer in Xilinx Forum)

     

    Makefile for the Module:

    ifneq ($(KERNELRELEASE),)
    
    
    EXTRA_CFLAGS := -I$(src)/build
    obj-m := module.o
    asterics-objs := build/driver.o build/support.o build/memio.o build/reader.o  build/writer.o
    
    
    else
    
    
    SOURCE_DIR = ../../sources/
    SRC_DIR = ./
    KDIR    := /lib/modules/$(uname -r)/build
    PWD     := $(shell pwd)
    
    
    default:
      mkdir -p build
      cp driver.[hc] build/
      cp $(SRC_DIR)config.h build/
      cp linux_kernel_if.h build/
      cp $(SOURCE_DIR)support.[hc] build/
      cp $(SOURCE_DIR)memio.[hc] build/
      cp $(SOURCE_DIR)reader.[hc] build/
      cp $(SOURCE_DIR)writer.[hc] build/
    
    
      $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    
    
      rm -fr build
    
    
    clean:
      ...
    
    
    endif

     

    eventually my build steps will help as well:

     

    #1 Using PetaLinux to build the Boot-Files, Kernel Image and Device Tree
    Host $ petalinux-config <hw-desc>
    Host $ petalinux-build
    Host $ petalinux-package ...
    
    #2 cloning the Xilinx-Linux-Repo and building the Header Files
    Host $ git clone <xlnx-lnx-repo>; cd <xlnx-lnx-repo>
    Host $ make xilinx_zynqmp
    Host $ make deb-pkg
    Host $ make headers_install
    Host $ ls usr/include/*
    Host $ find usr/include/ -name "outercache.h" # Header not found
    Host $ find <xlnx-lnx-repo>/ -name "outercache.h" # Header found under arch/arm/include/asm/outercache.h
    
    
    #3 booting the System with Debian
    UZ3EG $ find /usr/include/ -name "outercache.h" #Header not found
    UZ3EG $ sudo dpkg -I linux-header* linux-image* linux-libc*
    UZ3EG $ cd /lib/modules/<uname -r>/build
    UZ3EG $ make headers_install
    UZ3EG $ make modules
    UZ3EG $ find usr/include/ -name "outercache.h" # Header not found

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • bhoevding
    0 bhoevding over 6 years ago in reply to aswinvenu

    Hello,

     

    The asm/outercache.h is located under linux/arch, but it seems like a configuration prevents the header from being built into the system.

    I am unsure as to what extent this is an issue with my build-process, configuration or architecture. (see Answer in Xilinx Forum)

     

    Makefile for the Module:

    ifneq ($(KERNELRELEASE),)
    
    
    EXTRA_CFLAGS := -I$(src)/build
    obj-m := module.o
    asterics-objs := build/driver.o build/support.o build/memio.o build/reader.o  build/writer.o
    
    
    else
    
    
    SOURCE_DIR = ../../sources/
    SRC_DIR = ./
    KDIR    := /lib/modules/$(uname -r)/build
    PWD     := $(shell pwd)
    
    
    default:
      mkdir -p build
      cp driver.[hc] build/
      cp $(SRC_DIR)config.h build/
      cp linux_kernel_if.h build/
      cp $(SOURCE_DIR)support.[hc] build/
      cp $(SOURCE_DIR)memio.[hc] build/
      cp $(SOURCE_DIR)reader.[hc] build/
      cp $(SOURCE_DIR)writer.[hc] build/
    
    
      $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    
    
      rm -fr build
    
    
    clean:
      ...
    
    
    endif

     

    eventually my build steps will help as well:

     

    #1 Using PetaLinux to build the Boot-Files, Kernel Image and Device Tree
    Host $ petalinux-config <hw-desc>
    Host $ petalinux-build
    Host $ petalinux-package ...
    
    #2 cloning the Xilinx-Linux-Repo and building the Header Files
    Host $ git clone <xlnx-lnx-repo>; cd <xlnx-lnx-repo>
    Host $ make xilinx_zynqmp
    Host $ make deb-pkg
    Host $ make headers_install
    Host $ ls usr/include/*
    Host $ find usr/include/ -name "outercache.h" # Header not found
    Host $ find <xlnx-lnx-repo>/ -name "outercache.h" # Header found under arch/arm/include/asm/outercache.h
    
    
    #3 booting the System with Debian
    UZ3EG $ find /usr/include/ -name "outercache.h" #Header not found
    UZ3EG $ sudo dpkg -I linux-header* linux-image* linux-libc*
    UZ3EG $ cd /lib/modules/<uname -r>/build
    UZ3EG $ make headers_install
    UZ3EG $ make modules
    UZ3EG $ find usr/include/ -name "outercache.h" # Header not found

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube