Welcome! Log In Create A New Profile

Advanced

Debian on Action Tech SG200 and MI424WR-rev-I

Posted by veriqster 
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 02, 2021 05:30AM
bodhi,

root@OpenWrt:/# dmesg | grep -i pci
[    0.035130] PCI: CLS 0 bytes, default 32
[    0.186546] mvebu-pcie mbus:pcie@82000000: PCI host bridge to bus 0000:00
[    0.186565] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.186578] pci_bus 0000:00: root bus resource [mem 0xf3000000-0xf3ffffff]
[    0.186590] pci_bus 0000:00: root bus resource [io  0x1000-0xeffff]
[    0.186724] pci 0000:00:02.0: [11ab:6500] type 01 class 0x060400
[    0.186758] pci 0000:00:02.0: reg 0x38: [mem 0x00000000-0x000007ff pref]
[    0.187962] PCI: bus0: Fast back to back transfers disabled
[    0.187978] pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.189152] PCI: bus1: Fast back to back transfers enabled
[    0.189170] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.189378] pci 0000:00:02.0: BAR 6: assigned [mem 0xf3000000-0xf30007ff pref]
[    0.189393] pci 0000:00:02.0: PCI bridge to [bus 01]
root@OpenWrt:/# lsmod
cfg80211              299008  2 rtlwifi,mac80211
compat                 16384  4 rtl8192ce,rtlwifi,mac80211,cfg80211
crc_ccitt              16384  1 ppp_async
ehci_fsl               16384  0
ehci_hcd               45056  3 ehci_platform,ehci_orion,ehci_fsl
ehci_orion             16384  0
ehci_platform          16384  0
exfat                  73728  0
ext4                  405504  0
fat                    65536  2 msdos,vfat
fsl_mph_dr_of          16384  0
gpio_button_hotplug    16384  0
ip_tables              20480  4 iptable_nat,iptable_mangle,iptable_filter
ip6_tables             20480 24 ip6table_mangle,ip6table_filter
ip6t_REJECT            16384  2
ip6table_filter        16384  1
ip6table_mangle        16384  0
ipt_REJECT             16384  2
iptable_filter         16384  1
iptable_mangle         16384  0
iptable_nat            16384  1
jbd2                   65536  1 ext4
mac80211              544768  3 rtl8192ce,rtl_pci,rtlwifi
mbcache                16384  1 ext4
msdos                  20480  0
nf_conntrack           73728  7 xt_state,xt_nat,xt_conntrack,xt_REDIRECT,xt_MASQUERADE,nf_nat,nf_flow_table
nf_defrag_ipv4         16384  1 nf_conntrack
nf_defrag_ipv6         16384  1 nf_conntrack
nf_flow_table          24576  2 xt_FLOWOFFLOAD,nf_flow_table_hw
nf_flow_table_hw       16384  1
nf_log_common          16384  2 nf_log_ipv4,nf_log_ipv6
nf_log_ipv4            16384  0
nf_log_ipv6            16384  0
nf_nat                 28672  4 iptable_nat,xt_nat,xt_REDIRECT,xt_MASQUERADE
nf_reject_ipv4         16384  1 ipt_REJECT
nf_reject_ipv6         16384  1 ip6t_REJECT
nls_cp437              16384  0
nls_iso8859_1          16384  0
nls_utf8               16384  0
ntfs                  110592  0
ppp_async              20480  0
ppp_generic            32768  3 pppoe,ppp_async,pppox
pppoe                  20480  0
pppox                  16384  1 pppoe
rtl_pci                28672  1 rtl8192ce
rtl8192c_common        40960  1 rtl8192ce
rtl8192ce              57344  0
rtlwifi                61440  3 rtl8192ce,rtl8192c_common,rtl_pci
slhc                   16384  1 ppp_generic
vfat                   20480  0
x_tables               24576 23 xt_state,xt_nat,xt_conntrack,xt_REDIRECT,xt_MASQUERADE,xt_FLOWOFFLOAD,ipt_REJECT,xt_time,xt_tcpudp,xt_multiport,xt_mark,xt_mac,xt_limit,xt_comment,xt_TCPMSS,xt_LOG,iptable_mangle,iptable_filter,ip_tables,ip6table_mangle,ip6table_filter,ip6_tables,ip6t_REJECT
xt_FLOWOFFLOAD         16384  0
xt_LOG                 16384  0
xt_MASQUERADE          16384  1
xt_REDIRECT            16384  0
xt_TCPMSS              16384  0
xt_comment             16384107
xt_conntrack           16384 12
xt_limit               16384 20
xt_mac                 16384  0
xt_mark                16384  0
xt_multiport           16384  0
xt_nat                 16384  0
xt_state               16384  0
xt_tcpudp              16384  8
xt_time                16384  0
root@OpenWrt:/#
These information seemed useless, they are just the values in the DTS. At least we should compile MvPex.c to a binary or .ko file and have another try. I'm quite sure the key to the problem is here.

8086k
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 02, 2021 05:09PM
8086k

Download the Debian kernel linux-5.12.6-kirkwood-tld-1-bodhi.tar.bz2 here:

https://forum.doozan.com/read.php?2,12096

Create uImage (for now just use avanta-mi424wr.dtb to test).

cp -a zImage-5.12.6-kirkwood-tld-1  zImage.fdt
cat dts/avanta-mi424wr.dtb  >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 5.12.6-kirkwood-tld-1 -d zImage.fdt  uImage

And then use tftp to boot this kernel uImage.

See how far you go in booting it and if the PCIe port is initialized OK.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 04, 2021 05:28AM
bodhi,

!! this file is out of date, please scroll down to get the newest hacked uboot for F420/F660

I find another way to 'autoboot' openwrt. I can use the tftp upgrade function. This function will be called when pushing reset button. Tftp means ethernet must be initialized that time. But a problem is not solved yet. I still can't make the uboot header. Do you have any ideas about that?

edit: I have tested my idea and it works well. To my surprise, this also fixes the serial problem! I'm very happy. Now it's time to figure out how to remake the header of this uboot image to flash it into nand. I have proved bootrom uses checksum, when I flash it directly, bootrom won't boot it.

The hacked file is here, now users must use kwboot to boot it, it can solve the serial console problem. When booting this image, keep press the reset button, or it won't run bootcmd automatically. Finally, don't forget to change 'bootcmd' env to ''wdtdbg watchdog 0; nand read 0x2000000 0x80000 0x200000; bootm''.

8086k



Edited 4 time(s). Last edit at 06/07/2021 05:50AM by 8086k.
Attachments:
open | download - uboot-hacked.bin (239.7 KB)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 05, 2021 11:04PM
bodhi,

I'm trying to use doimage to create an image, but everytime when I run it, it returns 'segmentation fault' . Have you got this error when building sg200 uboot? I am using the same argument as makefile.

edit: The problem is solved. I use the binary which is compiled already and make the nand boot image succeasfully. Now the uboot hack is done. :)

edit2: 88f6560's boot image does have an 32bit checksum, but it is located at the end of the image.

8086k



Edited 2 time(s). Last edit at 06/05/2021 11:58PM by 8086k.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 06, 2021 12:53AM
bodhi,

This is the final hacked u-boot file.

To use it, follow the following steps:
1,Flash it to the NAND in uboot or linux(the uboot partition is 512KB)
2,Make sure you have flashed openwrt or other custom OS
3,Change 'bootcmd' to a suitable command for your OS(when using openwrt, you can leave it alone, because I have changed it for my openwrt)
4,Turn off your F660 or F420, keep pressing 'reset' button and power it on(you need to press it for 5 seconds)
5,Then your OS should be booted without problems

8086k



Edited 1 time(s). Last edit at 06/07/2021 05:30AM by 8086k.
Attachments:
open | download - F660_u-boot-hacked-full.bin (512 KB)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 06, 2021 03:23PM
8086k Wrote:
-------------------------------------------------------
> bodhi,
>
> This is the final hacked u-boot file.
>
> 8086k

Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 07, 2021 05:20AM
bodhi,

Please run 'mpp' command in uboot and post the output. This may help me figure out the buttons' or LEDs' gpio in F660.

8086k
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 07, 2021 04:44PM
8086k,

Somewhere in this thread, there is a link to the MI424WR-rev-I GPL source. That's where you can find more info about stock u-boot.

My MI424WR-rev-I has been shut down and put back in the shelf. It will be a while until I play with this box again.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/07/2021 04:46PM by bodhi.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 08, 2021 06:41AM
bodhi,

Okay, I think this is enough. Without buttons and LEDs it works well too. I will have a rest from doing it.

8086k



Edited 1 time(s). Last edit at 06/08/2021 06:41AM by 8086k.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 13, 2021 08:56AM
bodhi,

I pushed the code to github, this is my repositry.
github.com/msdos03/openwrt-f660
To compile it for f660, just select mi424wr in menuconfig. I can't add a target to it successfully.

8086k
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 13, 2021 08:58AM
bodhi,

Hope to see the neta driver of new kernel versions will be available soon.

8086k
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 18, 2021 08:13AM
bodhi,

I run sg200's uboot on F660 successfully. But the whole network config is a mess. I compared mi424wr's uboot and sg200's uboot and can't find anything about ethernet config. It will shut down the switch and the 3xFE PHYs. Can you discover any of these configs in uboot code?

8086k
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 18, 2021 05:23PM
8086k,

The MI424WR-rev-I patches are quite clearly documented in the GPL source. So you could look at the part where the switch is configured in MI424WR-rev-I code. And modify it for the F660.

I'm not at all interested in this stock u-boot, so cannot be of much help to you. My goal was to have the DTS defined in the latest kernel for the MI424WR-rev-I, and then the variants. But some other more important stuff have taken priority.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Action Tech SG200 and MI424WR-rev-I
June 19, 2021 10:59AM
bodhi,

I build mi424wr's uboot. Hope to find an easier way to make it work.

8086k
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: