On 04/02/2017 05:48 PM, Hauke Mehrtens wrote: > On 04/02/2017 05:02 PM, Baptiste Jonglez wrote: >> Hi, >> >> I am currently adding LEDE support for the Netgear DM200 VDSL modem >> [https://wiki.openwrt.org/toh/netgear/dm200], which uses a Lantiq VR9 SoC. >> >> I was able to boot LEDE from RAM, and got the LEDs working, but I cannot >> get the flash to work with LEDE :( >> >> The bootloader (u-boot) has access to the flash and says this after >> initialisation: >> >> 8192 KiB W25Q64 at 0:3 is now current device >> >> I assumed that it's a NOR flash chip given the size, connected via SPI. > I found the data sheet here: > https://www.pjrc.com/store/w25q64fv.pdf > >> The stock firmware only calls it "ltq_sflash" without being more specific. >> For instance, here is the kernel cmdline from the stock firmware: >> >> root=/dev/mtdblock4 ro rootfstype=squashfs >> ip=192.168.1.1:192.168.1.10::::eth0:on console=ttyLTQ0,115200 >> ethaddr=00:E0:92:00:01:40 mem=62M panic=1 >> mtdparts=ltq_sflash:128k(uboot),64k(gphyfirmware),1600k(kernel),512k(firmware),5120k(rootfs),7232k@0x30000(image),64k(dniconfig),64k(log),512k(language),64k(sysconfig),8k(ubootconfig),4k(ART),4k(pot),-(ret) >> init=/etc/preinit vpe1_load_addr=0x83f00000 vpe1_mem=1M >> ubootver=U-Boot-2010.06-LANTIQ-v-2.3.16.1 >> >> >> So, assuming it's similar to other VR9 devices, I used this DTS: >> >> fpi@10000000 { >> localbus@0 { >> nor-boot@0 { >> compatible = "lantiq,nor"; >> bank-width = <2>; >> reg = <0 0x0 0x0800000>; >> #address-cells = <1>; >> #size-cells = <1>; >> >> partitions { >> // etc >> >> >> But with this DTS, LEDE fails to initialize the flash chip ("probing >> failed" and nothing in /proc/mtd): >> >> [ 1.936821] lantiq nor flash device: 00800000 at 10000000 >> [ 1.941431] ltq-nor 10000000.nor-boot: probing failed >> [ 2.054037] libphy: lantiq,xrx200-mdio: probed >> [ 2.078013] net-xrx200: invalid MAC, using random >> >> I tried setting the CS (Chip Select) in the DTS, because the bootloader >> uses bus 0 and CS 3 to access the flash. I added this line to the >> nor-boot@0 tree: >> >> lantiq,cs = <3>; >> >> but it didn't change anything, LEDE still cannot access the flash. > > It could be that the chip is connected to the SPI controller like on the > Netgear DGN1000B: > target/linux/lantiq/dts/DGN1000B.dts > >> How can I find the right parameters for the flash and set them in the DTS? >> Any guidance would be appreciated! > > Often you can find something in the vendor GPL code, you can get it here: > http://www.downloads.netgear.com/files/GPL/DM200_GPL_src_V1.0.0.44.tar.gz
The Vendor SDK is based on UGW 6.1.1, based on OpenWrt 12.09 with kernel 3.10 and device tree support. Probably even the vendor image uses a device tree compiled into the kernel image. According to the configuration file in /DM200-V1.0.0.44_gpl_src/config/defconfig_dm200 it would include this dts file: /DM200-V1.0.0.44_gpl_src/target/linux/lantiq/image/dts/EASY220.dts In this dts file the flash is connected to the SPI controller. Hauke
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev