element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Kernel Upgrade, broken SPI
  • 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 Not Answered
  • Replies 3 replies
  • Subscribers 329 subscribers
  • Views 862 views
  • Users 0 members are here
Related

Kernel Upgrade, broken SPI

buckd
buckd over 9 years ago

Hi,

I am using a MicroZed 7z010 with Linux kernel 3.9.0 (xilinx-v14.6.02) from:

https://github.com/Xilinx/linux-xlnx/

I am attempting to upgrade the kernel to the latest version (4.4.0) from the same repo but it broke the SPI communication to an Analog Devices PLL that is connected.  The spidev module in the kernel is enabled, as well as all the other xilinx/zynq modules.  A C program is run, using spidev, to communicate to the PLL.

The two main issues I am seeing are:

  1.   SPI transfer timed out after every byte (either transfering the bytes one-by-one or using the C function 'SPI_IOC_MESSAGE'.
  2.   With an oscilloscope, I see that the chip-select signal starts high when rebooting the board, but then stays low after the first transfer attempt - the old kernel would return it to high.


I admit that I'm a bit new to using this technology, but I have Linux and C experience.  Things that I have attempted:

  •   Modifying the device-tree in dozens of ways
  •   Modified the SPI C code to send SPI using a number of different parameters
  •   Modified the Linux kernel module (spi.c and/or spi-cadence.c)
  •   Too much trial-and-error


The best of the outcomes would still give me those two problems mentioned above.

Is there something I'm doing wrong?

Thanks for any help!

  • Sign in to reply
  • Cancel
Parents
  • buckd
    0 buckd over 9 years ago

    Here are my device tree settings (because otherwise the first post would have been marked as SPAM):

    The old device tree looks like this (kernel 3.9.0):

            ps7-spi@e0007000 {
                #addresss-cells = <0x1>;
                #size-cells = <0x0>;
                bus-num = <0x0>;
                compatible = "xlnx,ps7-spi-1.00.a";
                interrupt-parent = <0x1>;
                interrupts = <0x0 0x31 0x4>;
                num-chip-select = <0x4>;
                reg = <0xe0007000 0x1000>;
                speed-hz = <0xf42400>;
                xlnx,has-ss0 = <0x0>;
                xlnx,has-ss1 = <0x1>;
                xlnx,has-ss2 = <0x0>;
                xlnx,spi-clk-freq-hz = <0xf42400>;

                device@0 {
                    compatible = "rohm,dh2228fv";
                    spi-max-frequency = <0x3d0900>;
                    reg = <0x0>;
                };
            };

    The new looks like this (kernel 4.4.0, I know this is very messy):

            spi@e0007000 {
                compatible = "xlnx,zynq-spi-r1p6";
                reg = <0xe0007000 0x1000>;
                interrupt-parent = <0x3>;
                interrupts = <0x0 0x31 0x4>;
                clocks = <0x1 0x1a 0x1 0x23>;
                clock-names = "ref_clk", "pclk";
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                num-chip-select = <0x4>;
                num-cs = <0x4>;
                speed-hz = <0xf42400>;
                xlnx,has-ss0 = <0x0>;
                xlnx,has-ss1 = <0x1>;
                xlnx,has-ss2 = <0x0>;
                xlnx,spi-clk-freq-hz = <0xf42400>;
                
                device@0 {
                    compatible = "rohm,dh2228fv";
                    spi-max-frequency = <0x3d0900>;
                    reg = <0x0>;
                };
            };

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • buckd
    0 buckd over 9 years ago

    Here are my device tree settings (because otherwise the first post would have been marked as SPAM):

    The old device tree looks like this (kernel 3.9.0):

            ps7-spi@e0007000 {
                #addresss-cells = <0x1>;
                #size-cells = <0x0>;
                bus-num = <0x0>;
                compatible = "xlnx,ps7-spi-1.00.a";
                interrupt-parent = <0x1>;
                interrupts = <0x0 0x31 0x4>;
                num-chip-select = <0x4>;
                reg = <0xe0007000 0x1000>;
                speed-hz = <0xf42400>;
                xlnx,has-ss0 = <0x0>;
                xlnx,has-ss1 = <0x1>;
                xlnx,has-ss2 = <0x0>;
                xlnx,spi-clk-freq-hz = <0xf42400>;

                device@0 {
                    compatible = "rohm,dh2228fv";
                    spi-max-frequency = <0x3d0900>;
                    reg = <0x0>;
                };
            };

    The new looks like this (kernel 4.4.0, I know this is very messy):

            spi@e0007000 {
                compatible = "xlnx,zynq-spi-r1p6";
                reg = <0xe0007000 0x1000>;
                interrupt-parent = <0x3>;
                interrupts = <0x0 0x31 0x4>;
                clocks = <0x1 0x1a 0x1 0x23>;
                clock-names = "ref_clk", "pclk";
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                num-chip-select = <0x4>;
                num-cs = <0x4>;
                speed-hz = <0xf42400>;
                xlnx,has-ss0 = <0x0>;
                xlnx,has-ss1 = <0x1>;
                xlnx,has-ss2 = <0x0>;
                xlnx,spi-clk-freq-hz = <0xf42400>;
                
                device@0 {
                    compatible = "rohm,dh2228fv";
                    spi-max-frequency = <0x3d0900>;
                    reg = <0x0>;
                };
            };

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify 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