OpenWrt Forum Archive

Topic: Tile/Tilera

The content of this topic has been archived between 15 Apr 2018 and 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Updates:
My conclusion around the USB part was completely wrong. The device is available it just needs a bit of time to initialize.
The main delay finding it was due to a nasty bug in the block device layer of the linux kernel (maybe only in tilegx ARCH).

If you try to boot initramfs  (cpio xz'ed image included in the kernel ELF) you might see this error:
[    6.705965] Unpacking initramfs...                                                                                             
[    6.710258] Initramfs unpacking failed: junk in compressed archive     

hidden in the history due to panic on unknown block device:
[    6.781978] List of all partitions:                                                                                           
[    6.784802] No filesystem could mount root, tried:                                                                             
[    6.790076] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)                                     
[    6.799139] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Disable "Enable the block layer" in the main kernel menu (CONFIG_BLOCK) and initramfs will work fine again.

After this fix I added a very limited busybox image (cross-compiled for tilegx), giving me at least some automatic output like lsusb, ps, ...
Serial input is not working, this may be due to some missing mikrotik kernel stuff (GPIO/UART/... sharing?) but at least we can see the output of custom sh scripts:
http://pastebin.com/W4JX824h

The nice surprise was that USB kicked in without notice, after some testing I concluded that we need at least 10sec wait before we try to use it as root device, linux append option rootdelay=15 works like expected:

[    6.320838] Kernel command line: init=/sbin/init rootdelay=15

[    6.823831] ohci-pci: OHCI PCI platform driver                                                                                 
[    6.829225] Waiting 15 sec before mounting root device...                                                                     
[   11.295838] usb 1-1: new high-speed USB device number 2 using tilegx-ehci                                                     
[   11.411313] usb 1-1: New USB device found, idVendor=1221, idProduct=3234                                                       
[   11.411359] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3                                                 
[   11.411400] usb 1-1: Product: USB Disk                                                                                         
[   11.411425] usb 1-1: Manufacturer: Flash                                                                                       
[   11.411452] usb 1-1: SerialNumber: ****                                                                       
[   21.829220] devtmpfs: mounted

Next step is to remove my initramfs (anyhow broken if I want to enable partitions/block devices in the kernel) and move the busybox install to this USB drive.
This should give me enough space for more tooling, just need to find a fix for the serial input issue.

Any progress with the CCR ?

Slow but steady, it's a hobby project so I am not able to spend a lot of time on it.

I have started to port parts of the Mikrotik 3.3.5 patch to my 3.17.2 kernel. GPIO is working, I am able to control USB power/display led/... out of the kernel.

Currently I am trying to get the MicroSD part running to get rid of my USB bootstick:

[    6.721637] Hello [CCR1036-8G-2S+] HW=00028000
...
[    6.940883] CCR with MicroSD slot!
[    6.940911] MicroSD power off
...
[    7.256396] Tilera SPI
[    7.258894] tilera-gpio-spi tilera-gpio-spi.0: master is unqueued, this is deprecated
...
[    7.464972] mmc_spi spi32766.0: ASSUMING 3.2-3.4 V slot power
[    7.492890] mmc_spi spi32766.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
[    7.492940] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz

If I insert a MicroSD card, it will be detected (GPIO will enable power) but I am still not able to see/find the card:

[  160.061681] MicroSD power on
[  160.162555] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz

@thomasthomas your work it's amazing. I'm very interested on it cause it's high performance hardware. For me it's more important OpenWRT than RouterOS cause then I can use Ansible and FWBuilder. Hope to hear from you more news about your tilera port.

Sounds interesting use case, without iptables the direct mPIPE interface might even allow you to do more cool stuff around high-performance filtering:
http://www.slideshare.net/wenroulei/ug506-m-pipeguide

I only got more minor stuff working:

[    7.227670] i2c-tile1: detected 9 I2C devices.

[    7.776252] Tilera watchdog found. Default timeout=20 sec, nowayout=0

Still stuck with MicroSD and network/mpipe.
I worked on patching my 3.17.2 kernel to have all required objects to load the mikortik included kernel modules (as we do not have source code for all the tilegx and phy/xaui/... stuff), modprobe works but no network cards sad .
Still something is missing in the init/activation of mpipe, I need to find a new method/idea how to approach this.

Module                  Size  Used by    Tainted: P 
tilegx                 89600  0
switch                 29256  1 tilegx
phy_ti_tlk10232         5640  1 tilegx
phy_atheros             2292  1 tilegx
phy_amcc_qt2025        36088  1 tilegx
phy_helper             13476  5 tilegx,switch,phy_ti_tlk10232,phy_atheros,phy_amcc_qt2025
skb_bin                 3304  2 tilegx,switch

I appreciate for your effort, thomasthomas.

How did you get through 'access_latch' and '__gxio_mpipe_init' issue?

To load tilegx module, kernel objects named 'access_latch' and '__gxio_mpipe_init' are required. But it is missing both kernel 3.17.2 and patched kernel 3.3.5.

Maybe '__gxio_mpipe_init' could be used with 'gxio_mpipe_init'.
But, I can't figure out where access_latch has come with.

(Last edited by ayumu270 on 5 Feb 2015, 04:13)

My dev-CCR blew it's USB port last week, I was trying to be lazy and add some usb network dongle to at least have a more interactive testing environment instead of the constant recompile/reboot/sh-scripting.
I don't blame the dongle but it might be more related to bad routerboard design (usb hub, usb stick and usb3 network card taking to much power)?

Nevertheless it showed another irritation in driver support on the Tilera platform, kernel panics due to misalignment (in this case in the AX88179/178A driver).
http://lxr.free-electrons.com/source/dr … 8a.c#L1361

Its similar to this problem:
http://comments.gmane.org/gmane.linux.kernel/1530567

Following line gives consistent kernel panic's:
1385                 pkt_len = (*pkt_hdr >> 16) & 0x1fff;

I was trying to resolve it with my limited programming knowledge, but the USB port forced a hard stop in my testing.

ayumu270 wrote:

I appreciate for your effort, thomasthomas.

How did you get through 'access_latch' and '__gxio_mpipe_init' issue?

To load tilegx module, kernel objects named 'access_latch' and '__gxio_mpipe_init' are required. But it is missing both kernel 3.17.2 and patched kernel 3.3.5.

Maybe '__gxio_mpipe_init' could be used with 'gxio_mpipe_init'.
But, I can't figure out where access_latch has come with.

I took a shortcut with both of these, being a wrapper function (including some printk's to see what the module actually tries to do):

arch/tile/gxio/mpipe.c wrote:

int __gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index) {
        return gxio_mpipe_init(context, mpipe_index);
}
EXPORT_SYMBOL(__gxio_mpipe_init);

arch/tile/include/gxio/iorpc_mpipe.h wrote:

int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index);

And a void one for the access latch as I do not have any clue yet what it's doing wink

void access_latch(void) {
}
EXPORT_SYMBOL(access_latch);

(Last edited by thomasthomas on 5 Feb 2015, 20:10)

Hey thomas, are you still around? Any news with the kernel?

I want to see a custom linux running on this board too, sadly I don't have one yet ... meanwhile I started gather some more info about HvFs.
I'm trying to put things together and I will release a small script to manipulate HvFs.

$ ./hvfs.py kernel-6.20
Skiped to the start of HvFs at 722642
Tilera Hypervisor file system built by build
     Start        End   Filesize Filename
    722822     723235        413 config
    723238    2761280    2038042 vmlinux
   2761286    2767122       5836 classifier
   2767126    3082958     315832 initramfs.cpio.gz
Total Files: 4, Total Length: 2360312, Header CRC: 6265E62C, Filesystem CRC:
Calculated Header CRC: 6265E62C

So .. no one with better C skills and kernel understanding are interested on this?

The ethernet driver (mpipe) initialization seems wrong/out of order, I got interfaces to show up ... but I'm still missing something for it to work.

Sadly I had to return my friend's CCR that he borrowed to me for the weekend.

# dmesg | grep -E 'Tilera|gbe'
Tilera Network Driver
gbe4 gbe5 gbe6 gbe7 gbe8 gbe9 gbe10 gbe11 gbe12 gbe13 gbe14 gbe15 xgbe16 xgbe17 gbe17 gbe18

# ifconfig gbe4
gbe4      Link encap:Ethernet  HWaddr 4C:5E:0C:XX:XX:XX
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

full kernel ourput

Cool! Nice to see some interesting responses on this project. I have been stuck with travel and other projects in the past few months and it seems the email notification function of this forum is not working.
Around hardware I was forced to move towards OpenNSL/ONIE based switches and Intel DPDK/openvswitch routers/servers to have some progress in my POC. For now this is OK as I do not see any CCR1072-1G-8S+ yet (gigabit is boring).

Lack of hardware is something I could potentially solve. I have 2 spare/unused toys (CCR1036-8G-2S+EM). Let me see if I can find a server with serial ports and free network ports that can be linked towards the BOOT/ETH8 port.
Getting the USB ethernet to work might be nice as well as we could load/unload the tilegx kernel module using ssh wink.

Hi Guys,
 
    I work on tilera board TilePro64 processor, during one of the trials, i accidentally flashed a default bootroom on the working device.Now am not able to access the board using ssh. Not sure how to debug or reboot the board further. Any of have experience in bringing up the board, kindly share your inputs, so that i can bring it back to working stage..

Hello,

I recently received one of these from a friend. I am working on this as well. I have figured out a little more about how the boot image is put together and have been able to increase the kernel space available as well as include an initramfs inside of the boot image.
I am working on getting the nand recognized by the kernel.

I will update this with my progress.

Hi josiah2009, thomasthomas and fgrep and thanks for your efforts.
If you made any progress, could you please update the rest on the community here? smile

I'd be happy to help, and I have some experience with (non-mikrotik) tilegx products.

I am still working on this project, using the tools from fgrep as a base I have been able to create a tool to put any size kernel images or initramfs file into a netbootable mikrotik format. The USB does not work out of the box with the kernel patches provided but it is a one line fix:

in arch/tile/rb/setup.c replace

set_gpio(0, GPO_USB_POWER);

with

set_gpio(GPO_USB_POWER, GPO_USB_POWER);

That fixed USB for me. I am also playing around with the MicroSD card slot.
I will be posting my tools soon in hopes others find them useful.
If someone would like to get in contact with me directly, you can find my email on my github page: https://github.com/protraf-josiah

(Last edited by josiah2009 on 16 Oct 2015, 18:32)

@thomasthomas, @josiah2009, @piguasco
I've got one 1036-8G-2S+ to play with and would be happy to help in making networking to work.

managed to boot 4.2.6 kernel on the 1036-8G-2S+, however serial console doesn't accept input out of the box, so will be working on a patch for it.

Hi everyone,
i 'm working on tilera board TilePro64 processor and i want to cross compile some application. If you have any idea of how i can do it i'll be very thankful.
Ps : i use the MDE(multicore Development Environment ) and there is a lot of Linux command witch doesn't exist here.
Thank you .

spooky_boogie wrote:

Hello,

Please try this kernel.
Target model is CCR1016,CCR1036-8G-2S+,CCR1009.

[tftp boot]
http://133.130.124.236/debian/kernel/vmlinux_initramfs


Fantastic!
Though SFP/SFP+ ports are not working, it's big walk for CCR.
(Not works entire port on CCR1072-1G-8S+, Not works SFP+ ports in CCR1036-8G-2S+)

spooky_boogie, Can you share Kernel source(maybe modified...) and kernel configuration?

(Last edited by ayumu270 on 12 Apr 2016, 10:02)

spooky_boogie wrote:

Hello,

Please try this kernel.
Target model is CCR1016,CCR1036-8G-2S+,CCR1009.

[tftp boot]
http://133.130.124.236/debian/kernel/vmlinux_initramfs

Great work, spooky_boogie! It's a huge leap for all of us!
Could you share the patch for the vanilla kernel, so we could also build it?

Also, It would be great if we could build a recent kernel - how do you think is it possible to port Mikrotik kernel changes to some 4.x branch ?

Update: confirming it booting on my CCR1036-8G-2S+, however 10Gig interfaces are not found.

(Last edited by arni on 12 Apr 2016, 09:56)

@spooky_boogie Any chance to make 10Gig to work and get the sources ?

@arni.
I'm sorry, I can not well explained by unusable English.

Although I can not explain it more because it does not has developed a device driver, can be development tools (MDE) to implement a 10G interface even without.
But it is not easy.

Based on thomasthomas's information of the success to start the kernel.
The driver implementation of LAN port was commissioned to other engineers.

Can offer now is the only pre-built binary information.

If the CCR of available applications is expanded to increase the information that can be provided accordingly.

Do arni expects to what use?
I want to release to the open source implement debian

Please let us know for future development.

@spooky_boogie I'll be happy to help you with open source implementation, just like few other enthusiasts from these forums. We could exchange contacts and correlate our reverse-engineering to avoid duplication of work.

I'm personally interested in making recent kernels to work on CCRs with 10Gig interfaces, to make a good firewall of it.

(Last edited by arni on 12 Apr 2016, 15:05)