Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use other Linux-stable version? #179

Open
hwirys opened this issue Aug 4, 2023 · 6 comments
Open

How to use other Linux-stable version? #179

hwirys opened this issue Aug 4, 2023 · 6 comments

Comments

@hwirys
Copy link

hwirys commented Aug 4, 2023

Thank you for making a great development tool.
The only one i want to change is Linux version with using latest version of generators(ex. BOOM, rocket-chip generators, ...)
I want to use past version(Linux stable-5.7.1).

So tried these methods, but they are all failed.

  1. Change the version of vivado-risc-v
    -> Tags v.2.2.0, But initrd & rfs is removed from your relases, so i can't build OS system.
  2. Change linux-stable folder
    -> The difference between older & newer patch make errors.
  3. Build Hardware in Newest Version(Tags: Master) & Build OS in Older version(Tags: v.3.0.0)
    -> The difference in bootloader makes error.(v3.0.0 using riscv-pk, and after 3.1.0 using OpenSBI)

Tags: v3.1.0's Linux-stable is so different with 5.7.1, so i can't change it.

Do you have any advice for changing Linux Kernel Version of using it?

@eugene-tarassov
Copy link
Owner

You cannot just change version of a component and expect it to work - there will be incompatibilities. I think the best way to change Linux version is your #2: checkout v5.7.1 in the linux-stable folder, then re-work patches to fix all errors.

@hwirys
Copy link
Author

hwirys commented Aug 5, 2023

Thank you for your advice.
But rfs(root file system) & initrd is invalid in your github releases.
So When i boot Linux, it stucked at "Starting Kernel..."
How could i get or make rfs & initrd for 5.7.1(or vivado-risc-v v2.2.0)

@eugene-tarassov
Copy link
Owner

rootfs & initrd have no dependencies on the kernel version. They should work with any (stable) kernel version. Anyway, I don't build rootfs & initrd, I download them from the Debian website.

But rfs(root file system) & initrd is invalid in your github releases.

What do you mean? They work fine for me.

@hwirys
Copy link
Author

hwirys commented Aug 6, 2023

I'm sorry for misunderstand.
I just thought these files have dependencies on kerenel version, because operations in Makefile which debian-riscv64/initrd and debian-riscv64/rootfs.tar.gz are trying to download rootfs.tar.gz & initrd files via vivado-risc-v github. And its site also change when vivado-risc-v version change.

I tried these steps to use linux-kernel v5.7.1
0. Program FPGA image with same version of vivado-risc-v.

  1. Go to linux-stable & git checkout v5.7.1
  2. Replace fpga-axi-eth.c, fpga-axi-sdc.c, linux.config, linux.patch for 5.7.1
    (Most instruction is copied from vivado-risc-v 2.2.0)
  3. run ./mk-sd-card (There are no errors)

But, it stucked at "Starting Kernel..."
I changed some lines in linux.config for checking Kernel, but they don't show any message.

Changed line:
"CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15
CONFIG_CONSOLE_LOGLEVEL_QUIET=15
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7"

image

Would i change any other sources like ethernet folder or otherelse?

[Edit]
I checked this worked well in QEMU, i think this problem is occured with lower-level H/W.
Could i ask which H/W source have kernel-dependency?

@eugene-tarassov
Copy link
Owner

Program FPGA image with same version of vivado-risc-v.

I'm not sure what you mean by "same version". I assume it is the latest version.

Replace fpga-axi-eth.c, fpga-axi-sdc.c, linux.config, linux.patch for 5.7.1

No, you cannot use old drivers (fpga-axi-eth.c, fpga-axi-sdc.c) with latest hardware design.
The latest hardware needs latest drivers.

But, it stucked at "Starting Kernel..."

Your kernel crashed. Probably because of bad drivers.

@hwirys
Copy link
Author

hwirys commented Aug 7, 2023

I'm not sure what you mean by "same version". I assume it is the latest version.
Yes I program FPGA in the latest version.

And when i try to make image by ./mk-sd-card with latest drivers.
it shows errors.

drivers/net/ethernet/fpga-axi-eth.c:669:6: error: ‘const struct net_device_ops’ has no member named ‘ndo_eth_ioctl’; did you mean ‘ndo_do_ioctl’?
669 | .ndo_eth_ioctl = axi_eth_ioctl,
| ^~~~~~~~~~~~~
| ndo_do_ioctl
drivers/net/ethernet/fpga-axi-eth.c:669:24: error: initialization of ‘netdev_tx_t (*)(struct sk_buff *, struct net_device )’ {aka ‘enum netdev_tx ()(struct sk_buff *, struct net_device )’} from incompatible pointer type ‘int ()(struct net_device *, struct ifreq *, int)’ [-Werror=incompatible-pointer-types]
669 | .ndo_eth_ioctl = axi_eth_ioctl,
| ^~~~~~~~~~~~~
drivers/net/ethernet/fpga-axi-eth.c:669:24: note: (near initialization for ‘axi_eth_ops.ndo_start_xmit’)
drivers/net/ethernet/fpga-axi-eth.c: In function ‘axi_eth_probe’:
drivers/net/ethernet/fpga-axi-eth.c:721:9: error: implicit declaration of function ‘dev_addr_set’; did you mean ‘dev_addr_del’? [-Werror=implicit-function-declaration]
721 | dev_addr_set(net_dev, maddr);
| ^~~~~~~~~~~~
| dev_addr_del

When i changed fpga-axi-eth.c from latest to v2.2.0(which is for Linux 5.7.1), It doesn't show any errors. But it also shows error in fpga-axi-sdc.c

drivers/mmc/host/fpga-axi-sdc.c:386:6: error: ‘const struct mmc_host_ops’ has no member named ‘card_hw_reset’; did you mean ‘hw_reset’?
386 | .card_hw_reset = sdc_card_reset,
| ^~~~~~~~~~~~~
| hw_reset
drivers/mmc/host/fpga-axi-sdc.c:386:22: error: initialization of ‘void (*)(struct mmc_host , int)’ from incompatible pointer type ‘void ()(struct mmc_host *)’ [-Werror=incompatible-pointer-types]
386 | .card_hw_reset = sdc_card_reset,
| ^~~~~~~~~~~~~~
drivers/mmc/host/fpga-axi-sdc.c:386:22: note: (near initialization for ‘axi_sdc_ops.enable_sdio_irq’)
drivers/mmc/host/fpga-axi-sdc.c: In function ‘axi_sdc_probe’:
drivers/mmc/host/fpga-axi-sdc.c:438:11: error: implicit declaration of function ‘request_irq’; did you mean ‘request_key’? [-Werror=implicit-function-declaration]
438 | ret = request_irq(host->irq, sdc_isr, IRQF_TRIGGER_HIGH, "fpga-axi-sdc", mmc);
| ^~~~~~~~~~~
| request_key
drivers/mmc/host/fpga-axi-sdc.c:438:43: error: ‘IRQF_TRIGGER_HIGH’ undeclared (first use in this function)
438 | ret = request_irq(host->irq, sdc_isr, IRQF_TRIGGER_HIGH, "fpga-axi-sdc", mmc);
| ^~~~~~~~~~~~~~~~~
drivers/mmc/host/fpga-axi-sdc.c:438:43: note: each undeclared identifier is reported only once for each function it appears in
drivers/mmc/host/fpga-axi-sdc.c: In function ‘axi_sdc_remove’:
drivers/mmc/host/fpga-axi-sdc.c:475:5: error: implicit declaration of function ‘free_irq’ [-Werror=implicit-function-declaration]
475 | free_irq(host->irq, mmc);
| ^~~~~~~~
cc1: some warnings being treated as errors

So, i changed fpga-axi-eth.c from latest to v2.2.0(which is for Linux 5.7.1), It doesn't show any errors.
But as you said, it occurs Kernel crash.

Is there any way to make a compatible fpga-axi-sdc.c & fpga-axi-eth.c for Kernel V5.7.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants