Hello. I'm trying to build image for dlink dns320l. I did this:
diff --git a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-dns320.dts b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-dns320.dts
new file mode 100644
index 0000000000..58bf1face0
--- /dev/null
+++ b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -0,0 +1,183 @@
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+
+/ {
+ model = "D-Link DNS-320L";
+ compatible = "dlink,dns-320l", "marvell,kirkwood-88f6702", "marvell,kirkwood";
+
+ memory {
+ device_type = "memory";
+ reg = <0x00000000 0x10000000>;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ ocp@f1000000 {
+ serial@12000 {
+ status = "okay";
+ };
+
+ serial@12100 {
+ pinctrl-0 = <&pmx_uart1>;
+ pinctrl-names = "default";
+ status = "okay";
+ };
+
+ sata@80000 {
+ status = "okay";
+ nr-ports = <2>;
+ };
+
+ };
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&pmx_button_reset &pmx_button_usb_copy>;
+ pinctrl-names = "default";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ button@1 {
+ label = "Reset push button";
+ linux,code = <0x198>;
+ gpios = <&gpio0 28 1>;
+ };
+ button@2 {
+ label = "USB unmount button";
+ linux,code = <161>;
+ gpios = <&gpio0 27 1>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ pinctrl-0 = <&pmx_led_usb_blue &pmx_led_usb_orange
+ &pmx_led_red_left_hdd &pmx_led_red_right_hdd>;
+ pinctrl-names = "default";
+
+ blue-usb {
+ label = "dns320l:blue:usb";
+ gpios = <&gpio0 25 0>;
+ };
+ orange-l_hdd {
+ label = "dns320l:orange:l_hdd";
+ gpios = <&gpio0 22 0>;
+ };
+ orange-r_hdd {
+ label = "dns320l:orange:r_hdd";
+ gpios = <&gpio0 23 0>;
+ };
+ orange-usb {
+ label = "dns320l:orange:usb";
+ gpios = <&gpio0 26 0>;
+ };
+ };
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-0 = <&pmx_power_sata>;
+ pinctrl-names = "default";
+
+ sata_power: regulator@1 {
+ compatible = "regulator-fixed";
+ reg = <1>;
+ regulator-name = "SATA Power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio1 24 0>;
+ };
+ };
+};
+
+&nand {
+ status = "okay";
+ chip-delay = <35>;
+ pinctrl-0 = <&pmx_nand>;
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0000000 0x100000>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "firmware";
+ reg = <0x0100000 0x7a00000>;
+ };
+
+ partition@07b00000 {
+ label = "config";
+ reg = <0x7b00000 0x0500000>;
+ read-only;
+ };
+};
+
+
+&pinctrl {
+ pinctrl-0 = <&pmx_button_power>;
+ pinctrl-names = "default";
+
+ pmx_sata0: pmx-sata0 {
+ marvell,pins = "mpp20";
+ marvell,function = "sata1";
+ };
+ pmx_sata1: pmx-sata1 {
+ marvell,pins = "mpp21";
+ marvell,function = "sata0";
+ };
+ pmx_led_red_right_hdd: pmx-led-red-right-hdd {
+ marvell,pins = "mpp22";
+ marvell,function = "gpio";
+ };
+ pmx_led_red_left_hdd: pmx-led-red-left-hdd {
+ marvell,pins = "mpp23";
+ marvell,function = "gpio";
+ };
+ pmx_power_sata: pmx-power-sata {
+ marvell,pins = "mpp24";
+ marvell,function = "gpio";
+ };
+ pmx_led_usb_blue: pmx-led-usb-blue {
+ marvell,pins = "mpp25";
+ marvell,function = "gpio";
+ };
+ pmx_led_usb_orange: pmx-led-usb-orange {
+ marvell,pins = "mpp26";
+ marvell,function = "gpio";
+ };
+ pmx_button_usb_copy: pmx-button-usb-copy {
+ marvell,pins = "mpp27";
+ marvell,function = "gpio";
+ };
+ pmx_button_reset: pmx-button-reset {
+ marvell,pins = "mpp28";
+ marvell,function = "gpio";
+ };
+ pmx_button_power: pmx-button-power { // I can't get this one to trigger a button press...
+ marvell,pins = "mpp29";
+ marvell,function = "gpio";
+ };
+};
+&mdio {
+ status = "okay";
+
+ ethphy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ };
+};
+
+ð0 {
+ status = "okay";
+ ethernet0-port@0 {
+ phy-handle = <ðphy0>;
+ };
+};
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 60e8654ad3..4e6b9e1f8e 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -140,6 +140,17 @@ define Device/ctera_c200-v1
endef
TARGET_DEVICES += ctera_c200-v1
+define Device/dlink_dns320
+ DEVICE_VENDOR := D-Link
+ DEVICE_MODEL := DNS320
+ KERNEL_SIZE := 4096k
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+ DEVICE_PACKAGES := \
+ kmod-ata-core kmod-ata-marvell-sata \
+ kmod-usb2 kmod-usb-storage
+endef
+TARGET_DEVICES += dlink_dns320
+
define Device/endian_4i-edge-200
DEVICE_VENDOR := Endian
DEVICE_MODEL := 4i Edge 200
I've tried flashing it through uboot with:
tftp 0xa00000 firmware.bin; nand erase 0x0100000 0x7a00000; nand write 0xa00000 0x0100000 0x940000; nand read 0xa00000 0x100000 0x400000; bootm 0xa00000
after boot kernel see splitted "kernel" and "ubi" and dies with millions __nand_correct_data: uncorrectable ECC error
errors while attaching ubi.
I've tried booting from tftp with initrd erasing the mtd first from uboot:
nand erase 0x0100000 0x7a00000
nandtest /dev/mtd1
# right after boot works fine. 0 errors, 0 ecc corrections, 0 badblocks
dd if=/dev/zero | nandwrite /dev/mtd1 ; nandtest /dev/mtd1
# works fine
dd if=/dev/random | nandwrite /dev/mtd1; nandtest /dev/mtd1
# works just fine as well
nandwrite /dev/mtd1 /mnt/firmware.bin
works fine, but
dd if=/dev/mtd1 of=/dev/null
starting to throw tons of __nand_correct_data: uncorrectable ECC error
if i try to dd if=/dev/zero | nandwrite /dev/mtd1
after that it won't recover and keeps throwing errors.
and nandtest keeps showing same ecc errors:
root@OpenWrt:/# nandtest /dev/mtd1
ECC corrections: 22
ECC failures : 250
Bad blocks : 0
BBT blocks : 0
erasing from uboot helps until i try to flash the image.
What am i doing so wrong or what is so wrong with the image?