Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2016 10:27:05 +0800
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        Stanislav Galabov <sgalabov@gmail.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Mediatek / Ralink status
Message-ID:  <20160505022705.GA95034@ns.kevlo.org>
In-Reply-To: <79DA8224-E857-4B86-81EC-D7A9E765E201@gmail.com>
References:  <79DA8224-E857-4B86-81EC-D7A9E765E201@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 28, 2016 at 05:11:56PM +0300, Stanislav Galabov wrote:
> Hi all,

Hi Stanislav,

> Just to let you know, basic support for the following Mediatek/Ralink SoCs (with FDT) should now be in -head [1]: RT3050, RT3052, RT3350, RT3352, RT5350, RT3662, RT3883, RT5350, MT7620 (A and N versions), MT7621, MT7628 and MT7688.
> 
> The following are the kernel configurations for the SoCs:
> RT3050_FDT -> for RT3050, RT3052 and RT3350 SoCs
> RT3352_FDT -> for RT3352 SoC
> RT3883_FDT -> for RT3662 and RT3883 SoCs
> RT5350_FDT -> for RT5350 SoC
> MT7620A_FDT -> for MT7620A SoC
> MT7620N_FDT -> for MT7620N SoC
> MT7621_FDT -> for MT7621 SoC
> MT7628_FDT -> for MT7628 and MT7688 SoCs
> 
> The DTS files for the supported SoCs and boards can be found in sys/gnu/dts/mips.
> 
> When compiling a kernel for a given board, the following should be taken into account:
> 1. Which SoC is the target board using.
> 2. Which DTS file describes the target board.
> 
> For example, if we look at the WiTi board, the SoC is MT7621 and the DTS file name is WITI.dts.
> 
> So, when building the kernel, we can follow the instructions at [2] (thanks, ray) and just replace the actual build line (the line after "Build mipsel toolchain and then kernel:”) with:
> bmake KERNCONF=<kern_name> FDT_DTS_FILE=<dts_name> TARGET=mips TARGET_ARCH=mipsel kernel-toolchain buildkernel
> where:
> - kern_name is the name of the kernel which supports the target SoC from the above list
> - dts_name is the name of the DTS file for the target board as found in sys/gnu/dts/mips.
> 
> So, again, for the WiTi board, we’d have:
> bmake KERNCONF=MT7621_FDT FDT_DTS_FILE=WITI.dts TARGET=mips TARGET_ARCH=mipsel kernel-toolchain buildkernel
> 
> Because this question was raised before, where the wiki page [2] refers to oldlzma or lzma 4.17, I actually have successfully used lzma-4.32.7 from here (built from source) [3].
> 
> At the moment the following things are supposed to be supported, depending on whether the target SoC has support for them: interrupt controllers, pinmux, gpio, uart, spi, usb (otg/ehci, ohci/xhci), ethernet, pci.
> 
> I would appreciate feedback on all this. I’ve tried to test with most of the SoCs listed above, but I don’t have RT3350 and MT7628 and I fried my last RT3052 in another experiment recently, so I haven’t tested specifically on these. I have, however, tested on RT3050 (supported by the same kernel as the RT3052 and RT3350) and MT7688 (supported by the same kernel as MT7628) and things seem fine on my boards. Who knows, though? I may have missed something..
> 

Thanks so much for all your hard work!  I can boot my WRTnode2P [1] with the
system on the USB stick.  Here's the dmesg: http://www.pastebin.ca/3591253

One minor tweak: for consistency it seems that devices use the mt7628an 
serial port lines for use as the console port (uartlite@c00 in the dts).
Here's the diff, ok?

Index: sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi
===================================================================
--- sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi	(revision 299107)
+++ sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi	(working copy)
@@ -3,7 +3,7 @@
 / {
 	/* Specify alias for serial0 so we have a working console */
 	aliases {
-		serial0 = "/palmbus@10000000/uart2@e00";
+		serial0 = "/palmbus@10000000/uartlite@c00";
 	};
 
 	/*

> Best wishes,
> Stanislav
> 
> [1] - https://svnweb.freebsd.org/changeset/base/298501
> [2] - https://wiki.freebsd.org/FreeBSD/mips/RT3052F
> [3] - http://tukaani.org/lzma/lzma-4.32.7.tar.gz

[1] http://wiki.wrtnode.cc/index.php?title=WRTnode2P%E8%AF%A6%E7%BB%86%E5%8F%82%E6%95%B0/en

	Kevin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160505022705.GA95034>