[LEDE-DEV] Adding support for dlink dwr-512
John Crispin
john at phrozen.org
Wed Oct 5 00:20:12 PDT 2016
Hi,
congrats, please make sure to add a proper SoB line when you submit
this. also the changes to the kernel config look out of place, please
remove them when submitting the patch
John
On 04/10/2016 22:27, Giuseppe Lippolis wrote:
> Dear All,
> Today I reach an important milestone in " Adding support for dlink dwr-512":
>
> BusyBox v1.25.0 () built-in shell (ash)
>
> _________
> / /\ _ ___ ___ ___
> / LE / \ | | | __| \| __|
> / DE / \ | |__| _|| |) | _|
> /________/ LE \ |____|___|___/|___|
> lede-project.org
> \ \ DE /
> \ LE \ /
> -----------------------------------------------------------
> \ DE \ / Reboot (HEAD, r1727)
> \________\/
> -----------------------------------------------------------
>
> root at lede:/#
>
> Here is the complete bootlog:
>
> Starting kernel @80000000...
> [ 0.000000] Linux version 4.4.23 (lippo at nice) (gcc version 5.4.0 (LEDE
> GCC 5.4.0 r1727) ) #0 Fri Sep 30 18:08:21 2016
> [ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
> [ 0.000000] bootconsole [early0] enabled
> [ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
> [ 0.000000] MIPS: machine is D-Link DWR-512
> [ 0.000000] Determined physical RAM map:
> [ 0.000000] memory: 02000000 @ 00000000 (usable)
> [ 0.000000] Initrd not found or empty - disabling initrd
> [ 0.000000] Zone ranges:
> [ 0.000000] Normal [mem 0x0000000000000000-0x0000000001ffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000001ffffff]
> [ 0.000000] Initmem setup node 0 [mem
> 0x0000000000000000-0x0000000001ffffff]
> [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32
> bytes.
> [ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32
> bytes
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total
> pages: 8128
> [ 0.000000] Kernel command line: console=ttyS0,57600
> rootfstype=squashfs,jffs2
> [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
> [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
> [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
> [ 0.000000] Writing ErrCtl register=00008d10
> [ 0.000000] Readback ErrCtl register=00008d10
> [ 0.000000] Memory: 28496K/32768K available (2773K kernel code, 127K
> rwdata, 648K rodata, 156K init, 191K bss, 4272K reserved, 0K cma-reserved)
> [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> [ 0.000000] NR_IRQS:256
> [ 0.000000] CPU Clock: 360MHz
> [ 0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff,
> max_idle_ns: 583261500 ns
> [ 0.000000] systick: running - mult: 214748, shift: 32
> [ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff,
> max_idle_ns: 10618113593 ns
> [ 0.000016] sched_clock: 32 bits at 180MHz, resolution 5ns, wraps every
> 11930464253ns
> [ 0.015668] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
> [ 0.090893] pid_max: default: 32768 minimum: 301
> [ 0.100347] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
> [ 0.113437] Mountpoint-cache hash table entries: 1024 (order: 0, 4096
> bytes)
> [ 0.136931] clocksource: jiffies: mask: 0xffffffff max_cycles:
> 0xffffffff, max_idle_ns: 19112604462750000 ns
> [ 0.156782] pinctrl core: initialized pinctrl subsystem
> [ 0.168534] NET: Registered protocol family 16
> [ 0.217394] rt2880_gpio 10000600.gpio: registering 22 gpios
> [ 0.228519] rt2880_gpio 10000600.gpio: registering 22 irq handlers
> [ 0.243616] clocksource: Switched to clocksource MIPS
> [ 0.256384] NET: Registered protocol family 2
> [ 0.266738] TCP established hash table entries: 1024 (order: 0, 4096
> bytes)
> [ 0.280625] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
> [ 0.293209] TCP: Hash tables configured (established 1024 bind 1024)
> [ 0.306075] UDP hash table entries: 256 (order: 0, 4096 bytes)
> [ 0.317698] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
> [ 0.330709] NET: Registered protocol family 1
> [ 0.349053] rt-timer 10000100.timer: maximum frequency is 3662Hz
> [ 0.362894] futex hash table entries: 256 (order: -1, 3072 bytes)
> [ 0.375205] Crashlog allocated RAM at address 0x1f00000
> [ 0.419466] squashfs: version 4.0 (2009/01/31) Phillip Lougher
> [ 0.431111] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME)
> (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
> [ 0.457061] io scheduler noop registered
> [ 0.464867] io scheduler deadline registered (default)
> [ 0.475467] ralink-usb-phy usbphy: invalid resource
> [ 0.486505] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> [ 0.501454] console [ttyS0] disabled
> [ 0.508624] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20,
> base_baud = 2500000) is a Palmchip BK-3103
> [ 0.528334] console [ttyS0] enabled
> [ 0.528334] console [ttyS0] enabled
> [ 0.542123] bootconsole [early0] disabled
> [ 0.542123] bootconsole [early0] disabled
> [ 0.568380] spi spi0.0: force spi mode3
> [ 0.576950] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
> [ 0.586889] 6 ofpart partitions found on MTD device spi0.0
> [ 0.597884] Creating 6 MTD partitions on "spi0.0":
> [ 0.607508] 0x000000000000-0x000000010000 : "bootloader"
> [ 0.621807] 0x000000010000-0x000000150000 : "Kernel"
> [ 0.635788] 0x000000150000-0x000000330000 : "rootfs"
> [ 0.649501] mtd: device 2 (rootfs) set to be root filesystem
> [ 0.661044] 0x000000330000-0x000000710000 : "rootfs_data"
> [ 0.675774] 0x000000710000-0x0000007f0000 : "ui"
> [ 0.688954] 0x0000007f0000-0x000000800000 : "config"
> [ 0.708577] rt3050-esw 10110000.esw: link changed 0x00
> [ 0.721105] mtk_soc_eth 10100000.ethernet: generated random MAC address
> c6:bd:a8:72:d7:a2
> [ 0.738908] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at
> 0xb0100000, irq 5
> [ 0.756589] rt2880_wdt 10000120.watchdog: Initialized
> [ 0.769623] NET: Registered protocol family 10
> [ 0.786898] NET: Registered protocol family 17
> [ 0.796143] bridge: automatic filtering via arp/ip/ip6tables has been
> deprecated. Update your scripts to load br_netfilter if you need this.
> [ 0.821452] 8021q: 802.1Q VLAN Support v1.8
> [ 0.845658] VFS: Mounted root (squashfs filesystem) readonly on device
> 31:2.
> [ 0.861526] Freeing unused kernel memory: 156K (80379000 - 803a0000)
> [ 2.451549] init: Console is alive
> [ 2.459024] init: - watchdog -
> [ 3.703801] init: - preinit -
> [ 4.724641] rt3050-esw 10110000.esw: link changed 0x00
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> [ 8.255055] jffs2: notice: (284) jffs2_build_xattr_subsystem: complete
> building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref
> (0 dead, 0 orphan) found.
> [ 8.289393] mount_root: switching to jffs2 overlay
> [ 8.315605] urandom-seed: Seeding with /etc/urandom.seed
> [ 8.401053] procd: - early -
> [ 8.407241] procd: - watchdog -
> [ 9.308977] procd: - ubus -
> [ 9.555120] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.574319] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.592475] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.611641] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.629788] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.648459] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.667156] random: ubusd: uninitialized urandom read (4 bytes read, 15
> bits of entropy available)
> [ 9.686371] procd: - init -
> Please press Enter to activate this console.
> [ 10.135943] ip6_tables: (C) 2000-2006 Netfilter Core Team
> [ 10.173158] Loading modules backported from Linux version
> wt-2016-06-20-0-gbc17424
> [ 10.188390] Backport generated by backports.git
> backports-20160216-7-g5735958
> [ 10.210948] ip_tables: (C) 2000-2006 Netfilter Core Team
> [ 10.240783] nf_conntrack version 0.5.0 (447 buckets, 1788 max)
> [ 10.325466] xt_time: kernel timezone is -0000
> [ 10.443111] PPP generic driver version 2.4.2
> [ 10.457193] NET: Registered protocol family 24
> [ 10.516693] rt2800_wmac 10180000.wmac: failed to load eeprom property
> [ 10.529706] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading
> EEPROM data from 'soc_wmac.eeprom'.
> [ 10.549890] rt2800_wmac 10180000.wmac: Direct firmware load for
> soc_wmac.eeprom failed with error -2
> [ 10.568229] rt2800_wmac 10180000.wmac: Falling back to user helper
> [ 10.653813] firmware soc_wmac.eeprom: firmware_loading_store: map pages
> failed
> [ 10.668689] ieee80211 phy0: rt2x00lib_request_eeprom_file: Error - Failed
> to request EEPROM.
> [ 10.685757] rt2800_wmac: probe of 10180000.wmac failed with error -11
> [ 12.862054] random: jshn: uninitialized urandom read (4 bytes read, 20
> bits of entropy available)
> [ 13.016911] random: ubusd: uninitialized urandom read (4 bytes read, 20
> bits of entropy available)
> [ 13.035563] random: ubus: uninitialized urandom read (4 bytes read, 21
> bits of entropy available)
> [ 21.334581] device eth0.1 entered promiscuous mode
> [ 21.344276] device eth0 entered promiscuous mode
> [ 21.386394] br-lan: port 1(eth0.1) entered forwarding state
> [ 21.397740] br-lan: port 1(eth0.1) entered forwarding state
> [ 21.550873] br-lan: port 2(eth0) entered forwarding state
> [ 21.561862] br-lan: port 2(eth0) entered forwarding state
> [ 23.393736] br-lan: port 1(eth0.1) entered forwarding state
> [ 23.553724] br-lan: port 2(eth0) entered forwarding state
> [ 79.853694] random: nonblocking pool is initialized
>
>
> And here the temporary patch:
>
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index c8b57ca..719078c 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -71,6 +71,7 @@ ramips_setup_interfaces()
> dir-320-b1|\
> dir-610-a1|\
> dir-615-h1|\
> + dwr-512-b|\
> firewrt|\
> hlk-rm04|\
> mac1200rv2|\
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> b/target/linux/ramips/base-files/lib/ramips.sh
> index bb379f7..a0f041e 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -154,6 +154,9 @@ ramips_board_detect() {
> *"DIR-860L B1")
> name="dir-860l-b1"
> ;;
> + *"DWR-512 B")
> + name="dwr-512-b"
> + ;;
> *"Dovado Tiny AC")
> name="tiny-ac"
> ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 0ef2308..36ea469 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -50,6 +50,7 @@ platform_check_image() {
> dir-620-a1|\
> dir-620-d1|\
> dir-810l|\
> + dwr-512-b|\
> duzun-dm06|\
> e1700|\
> esr-9753|\
> diff --git a/target/linux/ramips/image/rt305x.mk
> b/target/linux/ramips/image/rt305x.mk
> index be21ac4..529727a 100644
> --- a/target/linux/ramips/image/rt305x.mk
> +++ b/target/linux/ramips/image/rt305x.mk
> @@ -168,6 +168,17 @@ endef
> TARGET_DEVICES += dir-620-d1
>
>
> +define Device/dwr-512-b
> + DTS := DWR-512-B
> + KERNEL := kernel-bin | patch-dtb | lzma
> + IMAGES := factory.bin
> + IMAGE/factory.bin := \
> + append-kernel
> + DEVICE_TITLE := D-Link DWR-512 B
> +endef
> +TARGET_DEVICES += dwr-512-b
> +
> +
> define Device/esr-9753
> DTS := ESR-9753
> BLOCKSIZE := 64k
> diff --git a/target/linux/ramips/rt305x/config-4.4
> b/target/linux/ramips/rt305x/config-4.4
> index b8f6cda..dcf318f 100644
> --- a/target/linux/ramips/rt305x/config-4.4
> +++ b/target/linux/ramips/rt305x/config-4.4
> @@ -132,9 +132,8 @@ CONFIG_MTD_M25P80=y
> CONFIG_MTD_PHYSMAP=y
> CONFIG_MTD_SPI_NOR=y
> CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
> -CONFIG_MTD_SPLIT_FIRMWARE=y
> -CONFIG_MTD_SPLIT_SEAMA_FW=y
> -CONFIG_MTD_SPLIT_UIMAGE_FW=y
> +# CONFIG_MTD_SPLIT is not set
> +# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_NEED_PER_CPU_KM=y
> CONFIG_NET_MEDIATEK_ESW_RT3050=y
> @@ -158,6 +157,7 @@ CONFIG_PHY_RALINK_USB=y
> CONFIG_PINCTRL=y
> CONFIG_PINCTRL_RT2880=y
> # CONFIG_PINCTRL_SINGLE is not set
> +CONFIG_PRINTK_TIME=y
> CONFIG_RALINK=y
> # CONFIG_RALINK_ILL_ACC is not set
> CONFIG_RALINK_WDT=y
>
> And here the temporary device tree:
>
> /dts-v1/;
>
> /include/ "rt5350.dtsi"
>
> / {
> compatible = "ralink,rt5350-soc";
> model = "D-Link DWR-512";
> };
>
> &spi0 {
> status = "okay";
>
> mx25l6405d at 0 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "macronix,mx25l6405d", "jedec,spi-nor";
> reg = <0>;
> spi-max-frequency = <30000000>;
> fast-read;
>
> partition at 0 {
> label = "bootloader";
> reg = <0x0 0x10000>;
> read-only;
> };
>
> partition at 10000 {
> label = "Kernel";
> reg = <0x10000 0x140000>;
> read-only;
> };
>
> partition at 150000 {
> label = "rootfs";
> reg = <0x150000 0x1e0000>;
> read-only;
> };
>
> partition at 330000 {
> label = "rootfs_data";
> reg = <0x330000 0x3e0000>;
> };
>
> partition at 710010 {
> label = "ui";
> reg = <0x710000 0xe0000>;
> };
>
> partition at 7f0000 {
> label = "config";
> reg = <0x7f0000 0x10000>;
> };
> };
> };
>
> &pinctrl {
> state_default: pinctrl0 {
> gpio {
> ralink,group = "i2c", "jtag", "uartf";
> ralink,function = "gpio";
> };
> };
> };
>
>
> For sure I need to found the wmac.eeprom
> dd if=/dev/mtdx of=soc_wmac.eeprom count=1
>
> to fix the wifi and then I will slowly check the whole system.
>
> Bye.
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>
More information about the Lede-dev
mailing list