sifive / freedom

Source files for SiFive's Freedom platforms
Apache License 2.0
1.11k stars 284 forks source link

Instructions for vc707 without PCIe #116

Closed mcd500 closed 5 years ago

mcd500 commented 5 years ago

This is not an issue, it is request for comments.

Do you mind anybody trying the branch in my repo for no pcie on vc707? I am planning to make a pull request when I have time to bump them up to latest in master.

The source and instruction of building Rocket for vc707 with no-pcie. The readme: https://github.com/mcd500/freedom/tree/vc707-nopci To build,

git clone https://github.com/mcd500/freedom.git
cd freedom
git checkout -b vc707-nopci remotes/origin/vc707-nopci
git submodule update --init --recursive --force
export RISCV=/home/riscv/riscv64-elf-tc <- please change it accordingly to your env
export PATH=${PATH}:/opt/Xilinx/Vivado/2016.4/bin <- please change it accordingly to your env
make -f Makefile.vc707-u500devkit nopcie
make -f Makefile.vc707-u500devkit verilog
make -f Makefile.vc707-u500devkit mcs

then write the bitstream to vc707.

The source and instruction of building linux of sd-boot image for vc707 with no-pcie. The readme: https://github.com/mcd500/freedom-u-sdk/tree/linux_u500vc707devkit_config To build,

git clone https://github.com/mcd500/freedom-u-sdk.git
cd freedom-u-sdk
git checkout -b linux_u500vc707devkit_config remotes/origin/linux_u500vc707devkit_config
git submodule update --init --recursive --force
cd buildroot
git checkout -b sifive remotes/origin/sifive
cd ..
make -j4 BOARD=vc707devkit_nopci

This will write the image to SD card.

make DISK=/dev/whereisSDcard vc707-sd-write

Please let me know if anything does not work, so I could revise it before I create pull request.

mcd500 commented 5 years ago

This is the extracted log when booted on vc707:

INIT
CMD0
CMD8
ACMD41
CMD58
CMD16
CMD18
LOADING  
BOOT
bbl loader

                SIFIVE, INC.

         5555555555555555555555555
        5555                   5555
       5555                     5555
      5555                       5555
     5555       5555555555555555555555
    5555       555555555555555555555555
   5555                             5555
  5555                               5555
 5555                                 5555
5555555555555555555555555555          55555
 55555           555555555           55555
   55555           55555           55555
     55555           5           55555
       55555                   55555
         55555               55555
           55555           55555
             55555       55555
               55555   55555
                 555555555
                   55555
                     5

           SiFive RISC-V Coreplex
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 4.15.0-00047-g2751b6aad368 () (gcc version 7.2.0 (G9
[    0.000000] bootconsole [early0] enabled
[    0.000000] Initial ramdisk at: 0x        (ptrval) (9457664 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000]   Normal   [mem 0x00000000c0000000-0x00000bffffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] software IO TLB [mem 0xbb1fb000-0xbf1fb000] (64MB) mapped at [        (ptrval)-     ]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 14 pages/cpu @        (ptrval) s28568 r0 d28776 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258055
[    0.000000] Kernel command line: earlyprintk
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 950520K/1046528K available (2810K kernel code, 196K rwdata, 735K rodata, 939)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU event tracing is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,1: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,2: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,3: 64 local interrupts mapped
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 3 PID: 0 at /home/riscv/projects/freedom-u-sdk-bbl/linux/drivers/irqch4
[    0.000000] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.15.0-00047-g2751b6aad368 #1
[    0.000000] Call Trace:
[    0.000000] [<        (ptrval)>] walk_stackframe+0x0/0xa2
[    0.000000] [<        (ptrval)>] show_stack+0x26/0x34
[    0.000000] [<        (ptrval)>] dump_stack+0x5e/0x7c
[    0.000000] [<        (ptrval)>] __warn+0xc6/0xdc
[    0.000000] [<        (ptrval)>] warn_slowpath_null+0x2c/0x3e
[    0.000000] [<        (ptrval)>] riscv_irq_enable+0x8e/0x94
[    0.000000] [<        (ptrval)>] irq_enable+0x3a/0x6a
[    0.000000] [<        (ptrval)>] __irq_startup+0x80/0x88
[    0.000000] [<        (ptrval)>] irq_startup+0x4e/0xe2
[    0.000000] [<        (ptrval)>] irq_activate_and_startup+0x1c/0x28
[    0.000000] [<        (ptrval)>] __irq_do_set_handler+0x6e/0x134
[    0.000000] [<        (ptrval)>] irq_set_chained_handler_and_data+0x2c/0x4a
[    0.000000] [<        (ptrval)>] plic_init+0x1ea/0x316
[    0.000000] [<        (ptrval)>] of_irq_init+0x136/0x252
[    0.000000] [<        (ptrval)>] irqchip_init+0x10/0x1c
[    0.000000] [<        (ptrval)>] init_IRQ+0x8/0x14
[    0.000000] [<        (ptrval)>] start_kernel+0x20a/0x350
[    0.000000] [<        (ptrval)>] _sinittext+0x4e/0x56
[    0.000000] random: get_random_bytes called from print_oops_end_marker+0x3a/0x52 with crng_init=0
[    0.000000] ---[ end trace 66814e3a8c80ec10 ]---
[    0.000000] riscv,plic0,c000000: mapped 6 interrupts to 4/8 handlers
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, mas
[    0.000119] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.009048] console [hvc0] enabled
[    0.009048] console [hvc0] enabled
[    0.015241] bootconsole [early0] disabled
[    0.015241] bootconsole [early0] disabled
[    0.023995] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 Bogo)
[    0.034066] pid_max: default: 32768 minimum: 301
[    0.041480] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.048576] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.082401] Hierarchical SRCU implementation.
[    0.099930] smp: Bringing up secondary CPUs ...
[    0.114459] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, mas
[    0.114738] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.129084] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, mas
[    0.129355] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.143495] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, mas
[    0.143769] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.146832] smp: Brought up 1 node, 4 CPUs
[    0.219826] devtmpfs: initialized
[    0.256139] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604s
[    0.266103] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.281978] NET: Registered protocol family 16
[    0.408584] SCSI subsystem initialized
[    0.417608] usbcore: registered new interface driver usbfs
[    0.424581] usbcore: registered new interface driver hub
[    0.430997] usbcore: registered new device driver usb
[    0.447776] clocksource: Switched to clocksource riscv_clocksource
[    0.478410] NET: Registered protocol family 2
[    0.493759] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.504449] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[    0.515810] TCP: Hash tables configured (established 8192 bind 8192)
[    0.526859] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.533645] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.544224] NET: Registered protocol family 1
[    2.064862] Unpacking initramfs...
[    3.708134] Initialise system trusted keyrings
[    3.714360] workingset: timestamp_bits=62 max_order=18 bucket_order=0
[    3.865051] random: fast init done
[    3.933330] Key type asymmetric registered
[    3.936923] Asymmetric key parser 'x509' registered
[    3.942457] io scheduler noop registered
[    3.951212] io scheduler cfq registered (default)
[    3.955424] io scheduler mq-deadline registered
[    3.960253] io scheduler kyber registered
[    3.982237] sifive_gpio 64002000.gpio: SiFive GPIO chip registered 4 GPIOs
[    5.140791] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    5.167098] 64000000.serial: ttySI0 at MMIO 0x64000000 (irq = 1, base_baud = 0) is a sifive-seril
[    5.209134] sifive_spi 64001000.spi: mapped; irq=2, cs=1
[    5.224052] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.231241] usbcore: registered new interface driver usb-storage
[    5.241372] usbcore: registered new interface driver usbhid
[    5.246386] usbhid: USB HID core driver
[    5.255629] NET: Registered protocol family 17
[    5.269690] Loading compiled-in X.509 certificates
[    5.559970] Freeing unused kernel memory: 9392K
[    5.563967] This architecture does not have kernel memory protection.
Starting logging: OK
Starting mdev...
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network...
Waiting for interface eth0 to appear............... timeout!
run-parts: /etc/network/if-pre-up.d/wait_iface: exit status 1
Starting dropbear sshd: OK

Welcome to Buildroot
buildroot login: 
tmagik commented 5 years ago

@erikdanie is there any way we can support both VC707 configs (with and without the PCI HMC expansion) from the same bitstream?

erikdanie commented 5 years ago

I think this idea is good, and we need to make it easier to generate a no-pcie bitstream, but using sed in the makefile to comment out the line isn't the ideal way to do it. Instead, what should happen (and what I will do eventually when I get time, or if you want to try it on your own that would be awesome!) is that we should have 2 "shells" in VC707NewShell.scala. One class is the "VC707BasicShell", which includes all the peripherals and additions that are standard, and the other is "VC707PCIeShell", which extends VC707BasicShell, but then adds in the pcie. You can see an example of this in the master branch of fpga-shells in VCU118NewShell.scala. Then, in the makefile, depending on if the user passed in the "nopcie" argument, it would either do MODEL = VC707BasicShell or MODEL := VC707PCIeShell

Thanks for submitting this though! The makefile additions are helpful, and I'd merge those in separately if you were to put in a PR

mcd500 commented 5 years ago

Hi @tmagik and @erikdanie, thank you for the comments, I will revise them to use MODEL = VC707BasicShell or MODEL := VC707PCIeShell and make the pull request probably this weekend.

mcd500 commented 5 years ago

Hi @tmagik and @erikdanie, I pushed the changes to my repo. I removed using sed and it will use MODEL= with selecting the build for with/without PCIe board. The VC707BaseShell extends VC707BaseShell for selecting which bitstream to build. Is my change matches your thoughts?

$ git clone https://github.com/mcd500/freedom.git
$ cd freedom
$ git checkout vc707-nopcie-switchable-not-fully-tested-builds-ok
$ git submodule update --init --recursive --force
$ export RISCV=/home/riscv/riscv64-elf-tc <- please change it accordingly to your env
$ export PATH=${PATH}:/opt/Xilinx/Vivado/2016.4/bin <- please change it accordingly to your env

With PCIe-HMD board
$ make -f Makefile.vc707-u500devkit verilog
$ make -f Makefile.vc707-u500devkit mcs

For no PCIe-HMD board
$ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit verilog
$ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit mcs

The links are here. I tested and it looks working so might need to change the branch name before I make the pull request. https://github.com/mcd500/freedom/tree/vc707-nopcie-switchable-not-fully-tested-builds-ok https://github.com/mcd500/fpga-shells/commits/vc707-nopcie-switchable

mcd500 commented 5 years ago

The log when I tested the above changes.

INIT
CMD0
CMD8
ACMD41
CMD58
CMD16
CMD18
LOADING  
BOOT
bbl loader

                SIFIVE, INC.

         5555555555555555555555555
        5555                   5555
       5555                     5555
      5555                       5555
     5555       5555555555555555555555
    5555       555555555555555555555555
   5555                             5555
  5555                               5555
 5555                                 5555
5555555555555555555555555555          55555
 55555           555555555           55555
   55555           55555           55555
     55555           5           55555
       55555                   55555
         55555               55555
           55555           55555
             55555       55555
               55555   55555
                 555555555
                   55555
                     5

           SiFive RISC-V Coreplex
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 4.15.0-00047-g2751b6aad368-dirty (vc707@vc707-desktop) (gcc version 7.2.0 (GCC)) #1 SMP Fri Apr 19 11:01:18 JST 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] Initial ramdisk at: 0x        (ptrval) (9457664 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000]   Normal   [mem 0x00000000c0000000-0x00000bffffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] software IO TLB [mem 0xbb1fb000-0xbf1fb000] (64MB) mapped at [        (ptrval)-        (ptrval)]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 14 pages/cpu @        (ptrval) s28568 r0 d28776 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258055
[    0.000000] Kernel command line: earlyprintk
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 950520K/1046528K available (2810K kernel code, 199K rwdata, 732K rodata, 9395K init, 777K bss, 96008K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU event tracing is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,1: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,2: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,3: 64 local interrupts mapped
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 3 PID: 0 at /var/www/html/git/freedom-u-sdk/linux/drivers/irqchip/irq-riscv-intc.c:167 riscv_irq_enable+0x92/0x94
[    0.000000] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.15.0-00047-g2751b6aad368-dirty #1
[    0.000000] Call Trace:
[    0.000000] [<        (ptrval)>] walk_stackframe+0x0/0xa2
[    0.000000] [<        (ptrval)>] show_stack+0x26/0x34
[    0.000000] [<        (ptrval)>] dump_stack+0x5e/0x7c
[    0.000000] [<        (ptrval)>] __warn+0xc6/0xdc
[    0.000000] [<        (ptrval)>] warn_slowpath_null+0x2c/0x3e
[    0.000000] [<        (ptrval)>] riscv_irq_enable+0x8e/0x94
[    0.000000] [<        (ptrval)>] irq_enable+0x3a/0x6a
[    0.000000] [<        (ptrval)>] __irq_startup+0x80/0x88
[    0.000000] [<        (ptrval)>] irq_startup+0x4e/0xe2
[    0.000000] [<        (ptrval)>] irq_activate_and_startup+0x1c/0x28
[    0.000000] [<        (ptrval)>] __irq_do_set_handler+0x6e/0x134
[    0.000000] [<        (ptrval)>] irq_set_chained_handler_and_data+0x2c/0x4a
[    0.000000] [<        (ptrval)>] plic_init+0x1ea/0x316
[    0.000000] [<        (ptrval)>] of_irq_init+0x136/0x252
[    0.000000] [<        (ptrval)>] irqchip_init+0x10/0x1c
[    0.000000] [<        (ptrval)>] init_IRQ+0x8/0x14
[    0.000000] [<        (ptrval)>] start_kernel+0x20a/0x350
[    0.000000] [<        (ptrval)>] _sinittext+0x4e/0x56
[    0.000000] random: get_random_bytes called from print_oops_end_marker+0x3a/0x52 with crng_init=0
[    0.000000] ---[ end trace 66814e3a8c80ec10 ]---
[    0.000000] riscv,plic0,c000000: mapped 6 interrupts to 4/8 handlers
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.000127] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.009057] console [hvc0] enabled
[    0.009057] console [hvc0] enabled
[    0.015271] bootconsole [early0] disabled
[    0.015271] bootconsole [early0] disabled
[    0.024028] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)
[    0.034091] pid_max: default: 32768 minimum: 301
[    0.041522] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.048608] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.082308] Hierarchical SRCU implementation.
[    0.099973] smp: Bringing up secondary CPUs ...
[    0.114454] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.114737] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.128990] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.129265] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.143717] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.143989] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.146713] smp: Brought up 1 node, 4 CPUs
[    0.219741] devtmpfs: initialized
[    0.255994] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.265945] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.281904] NET: Registered protocol family 16
[    0.407627] SCSI subsystem initialized
[    0.416813] usbcore: registered new interface driver usbfs
[    0.423766] usbcore: registered new interface driver hub
[    0.430169] usbcore: registered new device driver usb
[    0.447004] clocksource: Switched to clocksource riscv_clocksource
[    0.477493] NET: Registered protocol family 2
[    0.492990] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.503673] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[    0.515069] TCP: Hash tables configured (established 8192 bind 8192)
[    0.526080] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.532803] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.543423] NET: Registered protocol family 1
[    2.047644] Unpacking initramfs...
[    3.669306] Initialise system trusted keyrings
[    3.675805] workingset: timestamp_bits=62 max_order=18 bucket_order=0
[    3.827468] random: fast init done
[    3.895938] Key type asymmetric registered
[    3.900051] Asymmetric key parser 'x509' registered
[    3.904596] io scheduler noop registered
[    3.914394] io scheduler cfq registered (default)
[    3.918954] io scheduler mq-deadline registered
[    3.923102] io scheduler kyber registered
[    3.945413] sifive_gpio 64002000.gpio: SiFive GPIO chip registered 4 GPIOs
[    5.108225] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    5.134197] 64000000.serial: ttySI0 at MMIO 0x64000000 (irq = 1, base_baud = 0) is a sifive-serial
[    5.174678] sifive_spi 64001000.spi: mapped; irq=2, cs=1
[    5.191002] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.198154] usbcore: registered new interface driver usb-storage
[    5.208174] usbcore: registered new interface driver usbhid
[    5.213192] usbhid: USB HID core driver
[    5.222408] NET: Registered protocol family 17
[    5.235770] Loading compiled-in X.509 certificates
[    5.528082] Freeing unused kernel memory: 9392K
[    5.532069] This architecture does not have kernel memory protection.
Starting logging: OK
Starting mdev...
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network...
Waiting for interface eth0 to appear............... timeout!
run-parts: /etc/network/if-pre-up.d/wait_iface: exit status 1
Starting dropbear sshd: OK

Welcome to Buildroot
buildroot login: root
Password: 
# echo Great Working!
Great Working!
# 
tmagik commented 5 years ago

On Apr 18, 2019, at 7:40 PM, Akira Tsukamoto notifications@github.com wrote:

Hi @tmagik and @erikdanie, I pushed the changes to my repo. I removed using sed and it will use MODEL= with selecting the build with/without PCIe board. The VC707BaseShell extends VC707BaseShell for selecting which bitstream to build. Is my changes matches your thoughts?

With PCIe-HMD board $ make -f Makefile.vc707-u500devkit verilog $ make -f Makefile.vc707-u500devkit mcs

For no PCIe-HMD board $ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit verilog $ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit mcs

The links are here. I tested and it looks working so might need to change the branch name before I make the pull request. https://github.com/mcd500/freedom/tree/vc707-nopcie-switchable-not-fully-tested-builds-ok https://github.com/mcd500/fpga-shells/commits/vc707-nopcie-switchable

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

This looks right to me. Does the build pass timing? I’ve had to slow some builds down to 100mhz clock to get it to pass timing without violations.

We also had a discussion today about moving from the FMC connector (which is quite expensive), and instead using an edge-card connector which I currently don’t have the part number or link for, and using the card-edge PCI, as it’s a lot simpler that way.

mcd500 commented 5 years ago

Hi @tmagik, yes the build passed the timing, the default was DevKitU500FPGADesign_WithDevKit50MHz in the Makefile.vc707-u500devkit. Running on 50MHz was perfectly fine. I also tried

$ make CONFIG=DevKitU500FPGADesign_WithDevKit100MHz MODEL=VC707BaseShell -f Makefile.vc707-u500devkit verilog
$ make CONFIG=DevKitU500FPGADesign_WithDevKit100MHz MODEL=VC707BaseShell -f Makefile.vc707-u500devkit mcs

and

$ make CONFIG=DevKitU500FPGADesign_WithDevKit150MHz MODEL=VC707BaseShell -f Makefile.vc707-u500devkit verilog
$ make CONFIG=DevKitU500FPGADesign_WithDevKit150MHz MODEL=VC707BaseShell -f Makefile.vc707-u500devkit mcs

The 100MHz was no problem. The 150Mhz did not pass the timing on the build but the generated bitstream is working OK with 150Mhz so far :-)

wwMark commented 5 years ago

https://github.com/mcd500/freedom-u-sdk/tree/linux_u500vc707devkit_config

@mcd500 Hello, I have tried your vc707-nopci and linux_u500vc707devkit_config on my vc707 board, it could show the sifive logo on boot, but then it did nothing. Then I have tried vc707-nopcie-switchable-not-fully-tested-builds-ok and vc707-nopcie-switchable, but both of them had the same result as the vc707-nopci. Do you have a clue of what is going on?

mcd500 commented 5 years ago

Hi @wwMark , not really, it was working on my place at the office. Did you tried the command I added bellow when you write to SD card?

sodo make DISK=/dev/whereisSDcard vc707-sd-write

since the bellow do not work for vc707.

sudo make DISK=/dev/sdX format-boot-loader

It is in the readme here. https://github.com/mcd500/freedom-u-sdk/tree/linux_u500vc707devkit_config

wwMark commented 5 years ago

Hi @wwMark , not really, it was working on my place at the office. Did you tried the command I added bellow when you write to SD card?

sodo make DISK=/dev/whereisSDcard vc707-sd-write

since the bellow do not work for vc707.

sudo make DISK=/dev/sdX format-boot-loader

It is in the readme here. https://github.com/mcd500/freedom-u-sdk/tree/linux_u500vc707devkit_config

Hello @mcd500, I have tried with these commands, and they didn't work. Then my advisor tried them again, and everything succeeded now. We are trying to find out the reason. Thank you for your help.

rgb000000 commented 5 years ago

Hello @mcd500, thanks your work. Now, following your instructions I boot linux on VC707 without PCIe successfully. It's funny. But I am a newbie, I don't know how to run my program or accelerator, this Linux doesn't have some tools like gcc.So I ask for some advice about how to use this linux? Thanks in advance.

mcd500 commented 5 years ago

Hi @s1104439112 , the current Linux boot image for vc707 is buildroot which is not able to install packages with apt or yum tools. I am pretty busy at the moment, so I am not sure when I could post it here, creating Debian rootfs for vc707 will be able to install gcc and etc for development.

jalezeta commented 5 years ago

First of all thanks @mcd500 for your support. I can boot Linux without the external PCI clock. However, the eth0 port is not available, which I can appreciate it in your boot sequence as well (timeout message showing up). I guess this happens because we are not using the external PCIe NIC, which it would not work without the external PCIe clock generator. On top of that I do not see a reason why we need to use the external PCI clock generator since both clock frequencies in the range of 200MHz.

erikdanie commented 5 years ago

Your above statement is correct. The reason the external generator is used is to more easily sync the PCIe clock and reset with the board, plus I believe the oscillator on the PCIe card is supposed to be better than the one on the board by default.

jalezeta commented 5 years ago

Thank you @erikdanie for solving these doubts! Moreover, I am interested in compiling some c files on my ubuntu host with the risc-v linux toochain and run it in the Freedom implementation target which is running linux. The problem is that I cannot see my root file system in the sd in my host computer after running the command "sudo make DISK=/dev/whereisSDcard vc707-sd-write". Basically, I cannot even mount the SD card and see the root file system. But still, linux is booting up correctly in the VC707. I was thinking on sending the files through ethernet, but I cannot do it since we are not using PCI, thus, we cannot use the ethernet NIC. Is there any way of using the VC707 on-board ethernet port instead? I think this might be interesting for anyone who might want to use this implementation without PCIe. Thanks in advance!

mcd500 commented 5 years ago

Thanks, forgot to close this. The changes are merged at https://github.com/sifive/freedom/pull/118 and https://github.com/sifive/freedom/pull/133

minisparrow commented 4 years ago

Hi @mcd500 , does vc707BaseShell support interface eth0 ? When i boot the fpga board and connect to the host cpu via ethnet wire, it appears as follows:

starting network...
Waiting for interface eth0 to appear............... timeout!
run-parts: /etc/network/if-pre-up.d/wait_iface: exit status 1
Starting dropbear sshd: OK

How should I enable the eth0 interface in the fpga board? Looking forward to your reply.Thanks very much.

krabo0om commented 4 years ago

@minisparrow Hi, the FMC extension card offers a PCIe slot in which an ethernet card can be plugged. The on-board ethernet is not supported. You can have a look at the Ariane Pulp Plattform, they appear to have at least some support for the VC707 on-board ethernet. Please let me know if you get it working without extension cards.