diff mbox series

[v3,3/3] board/d-link/dns320l: new board

Message ID 20231006140511.3840643-4-enki@fsck.pl
State New
Headers show
Series Support for D-Link DNS-320L | expand

Commit Message

enki Oct. 6, 2023, 2:05 p.m. UTC
Add support for the D-Link DNS-320L using:

- U-Boot 1.1.4 (in device flash)
- Linux kernel 6.5.5

This is a 2-Bay 3.5'' SATA NAS with the following specs:

- Marvell 88F6702 (1 GHz) CPU
- 256 MiB DDR2 RAM
- 128 MiB NAND Flash
- 2 x SATA
- 1 x 1000 Mbit/s Ethernet port
- 1 x USB 2.0

The builtin bootloader banner is:
U-Boot 1.1.4 (Aug 22 2012 - 17:06:54) Marvell version: 3.6.0.DNS-320L.01

Manufacturer product page: http://sharecenter.dlink.com/products/DNS-320
Device wiki: https://wikidevi.wi-cat.ru/D-Link_DNS-320L_rev_A1

Signed-off-by: Maciej Grela <enki@fsck.pl>
---
 DEVELOPERS                                    |   6 +
 board/d-link/dns320l/dts/kirkwood-dns320l.dts | 218 ++++++++++++++++++
 configs/dns320l_defconfig                     |  16 ++
 3 files changed, 240 insertions(+)
 create mode 100644 board/d-link/dns320l/dts/kirkwood-dns320l.dts
 create mode 100644 configs/dns320l_defconfig

Comments

Giulio Benetti Feb. 5, 2024, 10:33 a.m. UTC | #1
Hi Maciej,

sorry for the late reply,

On 06/10/23 16:05, Maciej Grela wrote:
> Add support for the D-Link DNS-320L using:
> 
> - U-Boot 1.1.4 (in device flash)
> - Linux kernel 6.5.5
> 
> This is a 2-Bay 3.5'' SATA NAS with the following specs:
> 
> - Marvell 88F6702 (1 GHz) CPU
> - 256 MiB DDR2 RAM
> - 128 MiB NAND Flash
> - 2 x SATA
> - 1 x 1000 Mbit/s Ethernet port
> - 1 x USB 2.0
> 
> The builtin bootloader banner is:
> U-Boot 1.1.4 (Aug 22 2012 - 17:06:54) Marvell version: 3.6.0.DNS-320L.01
> 
> Manufacturer product page: http://sharecenter.dlink.com/products/DNS-320
> Device wiki: https://wikidevi.wi-cat.ru/D-Link_DNS-320L_rev_A1
> 
> Signed-off-by: Maciej Grela <enki@fsck.pl>
> ---
>   DEVELOPERS                                    |   6 +
>   board/d-link/dns320l/dts/kirkwood-dns320l.dts | 218 ++++++++++++++++++
>   configs/dns320l_defconfig                     |  16 ++
>   3 files changed, 240 insertions(+)
>   create mode 100644 board/d-link/dns320l/dts/kirkwood-dns320l.dts
>   create mode 100644 configs/dns320l_defconfig
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index c45e7315da..76e8644073 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1950,6 +1950,12 @@ N:	Ludwig Kormann <ludwig.kormann@ict42.de>
>   F:	board/in-circuit/
>   F:	configs/icnova*
>   
> +N:	Maciej Grela <enki@fsck.pl>
> +F:	board/d-link/dns320l/
> +F:	configs/dns320l_defconfig
> +F:	package/dns320l-daemon
> +F:	package/iniparser

The 2 lines above should be part of the respective patches and not of
this one,

> +
>   N:	Maeva Manuel <maeva.manuel@oss.nxp.com>
>   F:	board/freescale/imx8qmmek/
>   F:	configs/freescale_imx8qmmek_defconfig
> diff --git a/board/d-link/dns320l/dts/kirkwood-dns320l.dts b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
> new file mode 100644
> index 0000000000..660508a51a
> --- /dev/null
> +++ b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
> @@ -0,0 +1,218 @@
> +/dts-v1/;
> +
> +/*
> + * Device Tree file for DLINK DNS-320L
> + *
> + * Copyright (C) 2015, Sunke Schlüters <sunke-dev@schlueters.de>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + *
> + *
> + * This file is based on the work of Andreas Böhler <dev@aboehler.at>:
> + *   - http://www.aboehler.at/doku/doku.php/projects:dns320l
> + *   - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts
> + */
> +
> +#include "marvell/kirkwood.dtsi"
> +#include "marvell/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,115200n8 earlyprintk";
> +		stdout-path = &uart0;
> +	};
> +
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		pinctrl-0 = <&pmx_button_reset &pmx_button_usb_copy>;
> +		pinctrl-names = "default";
> +
> +		button@1 {
> +			label = "Reset push button";
> +			linux,code = <KEY_RESTART>;
> +			gpios = <&gpio0 28 1>;
> +		};
> +		button@2 {
> +			label = "USB unmount button";
> +			linux,code = <KEY_EJECTCD>;
> +			gpios = <&gpio0 27 1>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&pmx_led_usb_blue &pmx_led_red_right_hdd
> +			     &pmx_led_red_left_hdd  &pmx_led_usb_orange>;
> +		pinctrl-names = "default";
> +
> +		blue-usb {
> +			label = "usb_blue";
> +			gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
> +		};
> +		orange-usb {
> +			label = "usb_orange";
> +			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
> +		};
> +		orange-l_hdd {
> +			label = "hdd1_orange";
> +			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
> +		};
> +		orange-r_hdd {
> +			label = "hdd2_orange";
> +			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
> +		};
> +	};
> +
> + 	ocp@f1000000 {
> +		pinctrl: pin-controller@10000 {
> +
> +			pinctrl-0 = <&pmx_button_power>;
> +			pinctrl-names = "default";
> +
> +			pmx_sata0: pmx-sata0 {
> +				marvell,pins = "mpp20";
> +				marvell,function = "sata0";
> +			};
> +			pmx_sata1: pmx-sata1 {
> +				marvell,pins = "mpp21";
> +				marvell,function = "sata1";
> +			};
> +			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";
> +			};						
> +		};
> +		sata@80000 {
> +			status = "okay";
> +			nr-ports = <2>;
> +		};
> +		serial@12000 {
> +			status = "okay";
> +		};
> +
> +		serial@12100 {
> +			pinctrl-0 = <&pmx_uart1>;
> +			pinctrl-names = "default";
> +			status = "okay";
> +		};
> +	};
> +
> +	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 {
> +	pinctrl-0 = <&pmx_nand>;
> +	pinctrl-names = "default";
> +	status = "okay";
> +	chip-delay = <35>;
> +
> +	partition@0 {
> +		label = "u-boot";
> +		reg = <0x0000000 0x100000>;
> +		read-only;
> +	};
> +
> +	partition@100000 {
> +		label = "uImage";
> +		reg = <0x0100000 0x500000>;
> +	};
> +
> +	partition@600000 {
> +		label = "ramdisk";
> +		reg = <0x0600000 0x500000>;
> +	};
> +
> +	partition@b00000 {
> +		label = "image";
> +		reg = <0x0b00000 0x6400000>;
> +	};
> +
> +	partition@6f00000 {
> +		label = "mini firmware";
> +		reg = <0x6f00000 0xa00000>;
> +	};
> +
> +	partition@7900000 {
> +		label = "config";
> +		reg = <0x7900000 0x500000>;
> +	};
> +
> +	partition@7e00000 {
> +	    label = "my-dlink";
> +	    reg = <0x7e00000 0x200000>;
> +	};
> +};
> +
> +&mdio {
> +	status = "okay";
> +
> +	ethphy0: ethernet-phy@0 {
> +		reg = <0>;
> +	};
> +};
> +
> +&eth0 {
> +	status = "okay";
> +	ethernet0-port@0 {
> +		phy-handle = <&ethphy0>;
> +	};
> +};

Is this ^^^ dts pending upstream?

> diff --git a/configs/dns320l_defconfig b/configs/dns320l_defconfig
> new file mode 100644
> index 0000000000..f281984267
> --- /dev/null
> +++ b/configs/dns320l_defconfig
> @@ -0,0 +1,16 @@
> +BR2_arm=y

Here you haven't specified any particular Arm architecture but MV78260
is specified as a:
"
ARMv7-compliant CPU cores with the latest Marvell
micro-architecture enhancements, with a double
precision IEEE-compliant Floating Point Unit (FPU)
per core
"

Maybe you could give a try to enable VFP3-16 since the SoC supports it:
https://datasheet.datasheetarchive.com/originals/crawler/marvell.com/1657ba38481c63b54928f3c1d60858fd.pdf

Here instead you need:
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_5=y
because if not set if changes while Buildroot increase Latest Linux 
Version resulting in build failure:
"
Incorrect selection of kernel headers: expected 6.6.x, got 6.5.x
"

> +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> +BR2_SYSTEM_DHCP="eth0"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.5.5"
> +BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v5"
> +BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
> +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/d-link/dns320l/dts/kirkwood-dns320l.dts"
> +BR2_TARGET_ROOTFS_CPIO=y
> +BR2_TARGET_ROOTFS_CPIO_GZIP=y
> +BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
> +
> +# The package is required for proper power management
> +BR2_PACKAGE_DNS320L_DAEMON=y

I've built tested successfully with utils/docker-run so with the changes 
above:
Reviewed-by: Giulio Benetti <giulio.benetti@benettieneering.com>

Best regards
Giulio Benetti Feb. 5, 2024, 11:44 a.m. UTC | #2
Hi Maciej,

On 05/02/24 11:33, Giulio Benetti wrote:
> Hi Maciej,
> 
> sorry for the late reply,
> 
> On 06/10/23 16:05, Maciej Grela wrote:
>> Add support for the D-Link DNS-320L using:
>>
>> - U-Boot 1.1.4 (in device flash)
>> - Linux kernel 6.5.5
>>
>> This is a 2-Bay 3.5'' SATA NAS with the following specs:
>>
>> - Marvell 88F6702 (1 GHz) CPU
>> - 256 MiB DDR2 RAM
>> - 128 MiB NAND Flash
>> - 2 x SATA
>> - 1 x 1000 Mbit/s Ethernet port
>> - 1 x USB 2.0
>>
>> The builtin bootloader banner is:
>> U-Boot 1.1.4 (Aug 22 2012 - 17:06:54) Marvell version: 3.6.0.DNS-320L.01
>>
>> Manufacturer product page: http://sharecenter.dlink.com/products/DNS-320
>> Device wiki: https://wikidevi.wi-cat.ru/D-Link_DNS-320L_rev_A1
>>
>> Signed-off-by: Maciej Grela <enki@fsck.pl>
>> ---
>>   DEVELOPERS                                    |   6 +
>>   board/d-link/dns320l/dts/kirkwood-dns320l.dts | 218 ++++++++++++++++++
>>   configs/dns320l_defconfig                     |  16 ++
>>   3 files changed, 240 insertions(+)
>>   create mode 100644 board/d-link/dns320l/dts/kirkwood-dns320l.dts
>>   create mode 100644 configs/dns320l_defconfig
>>
>> diff --git a/DEVELOPERS b/DEVELOPERS
>> index c45e7315da..76e8644073 100644
>> --- a/DEVELOPERS
>> +++ b/DEVELOPERS
>> @@ -1950,6 +1950,12 @@ N:    Ludwig Kormann <ludwig.kormann@ict42.de>
>>   F:    board/in-circuit/
>>   F:    configs/icnova*
>> +N:    Maciej Grela <enki@fsck.pl>
>> +F:    board/d-link/dns320l/
>> +F:    configs/dns320l_defconfig
>> +F:    package/dns320l-daemon
>> +F:    package/iniparser
> 
> The 2 lines above should be part of the respective patches and not of
> this one,
> 
>> +
>>   N:    Maeva Manuel <maeva.manuel@oss.nxp.com>
>>   F:    board/freescale/imx8qmmek/
>>   F:    configs/freescale_imx8qmmek_defconfig
>> diff --git a/board/d-link/dns320l/dts/kirkwood-dns320l.dts 
>> b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
>> new file mode 100644
>> index 0000000000..660508a51a
>> --- /dev/null
>> +++ b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
>> @@ -0,0 +1,218 @@
>> +/dts-v1/;
>> +
>> +/*
>> + * Device Tree file for DLINK DNS-320L
>> + *
>> + * Copyright (C) 2015, Sunke Schlüters <sunke-dev@schlueters.de>
>> + *
>> + * This program is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License
>> + * as published by the Free Software Foundation; either version
>> + * 2 of the License, or (at your option) any later version.
>> + *
>> + *
>> + * This file is based on the work of Andreas Böhler <dev@aboehler.at>:
>> + *   - http://www.aboehler.at/doku/doku.php/projects:dns320l
>> + *   - 
>> http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts
>> + */
>> +
>> +#include "marvell/kirkwood.dtsi"
>> +#include "marvell/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,115200n8 earlyprintk";
>> +        stdout-path = &uart0;
>> +    };
>> +
>> +    gpio-keys {
>> +        compatible = "gpio-keys";
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        pinctrl-0 = <&pmx_button_reset &pmx_button_usb_copy>;
>> +        pinctrl-names = "default";
>> +
>> +        button@1 {
>> +            label = "Reset push button";
>> +            linux,code = <KEY_RESTART>;
>> +            gpios = <&gpio0 28 1>;
>> +        };
>> +        button@2 {
>> +            label = "USB unmount button";
>> +            linux,code = <KEY_EJECTCD>;
>> +            gpios = <&gpio0 27 1>;
>> +        };
>> +    };
>> +
>> +    gpio-leds {
>> +        compatible = "gpio-leds";
>> +        pinctrl-0 = <&pmx_led_usb_blue &pmx_led_red_right_hdd
>> +                 &pmx_led_red_left_hdd  &pmx_led_usb_orange>;
>> +        pinctrl-names = "default";
>> +
>> +        blue-usb {
>> +            label = "usb_blue";
>> +            gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
>> +        };
>> +        orange-usb {
>> +            label = "usb_orange";
>> +            gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
>> +        };
>> +        orange-l_hdd {
>> +            label = "hdd1_orange";
>> +            gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
>> +        };
>> +        orange-r_hdd {
>> +            label = "hdd2_orange";
>> +            gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
>> +        };
>> +    };
>> +
>> +     ocp@f1000000 {
>> +        pinctrl: pin-controller@10000 {
>> +
>> +            pinctrl-0 = <&pmx_button_power>;
>> +            pinctrl-names = "default";
>> +
>> +            pmx_sata0: pmx-sata0 {
>> +                marvell,pins = "mpp20";
>> +                marvell,function = "sata0";
>> +            };
>> +            pmx_sata1: pmx-sata1 {
>> +                marvell,pins = "mpp21";
>> +                marvell,function = "sata1";
>> +            };
>> +            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";
>> +            };
>> +        };
>> +        sata@80000 {
>> +            status = "okay";
>> +            nr-ports = <2>;
>> +        };
>> +        serial@12000 {
>> +            status = "okay";
>> +        };
>> +
>> +        serial@12100 {
>> +            pinctrl-0 = <&pmx_uart1>;
>> +            pinctrl-names = "default";
>> +            status = "okay";
>> +        };
>> +    };
>> +
>> +    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 {
>> +    pinctrl-0 = <&pmx_nand>;
>> +    pinctrl-names = "default";
>> +    status = "okay";
>> +    chip-delay = <35>;
>> +
>> +    partition@0 {
>> +        label = "u-boot";
>> +        reg = <0x0000000 0x100000>;
>> +        read-only;
>> +    };
>> +
>> +    partition@100000 {
>> +        label = "uImage";
>> +        reg = <0x0100000 0x500000>;
>> +    };
>> +
>> +    partition@600000 {
>> +        label = "ramdisk";
>> +        reg = <0x0600000 0x500000>;
>> +    };
>> +
>> +    partition@b00000 {
>> +        label = "image";
>> +        reg = <0x0b00000 0x6400000>;
>> +    };
>> +
>> +    partition@6f00000 {
>> +        label = "mini firmware";
>> +        reg = <0x6f00000 0xa00000>;
>> +    };
>> +
>> +    partition@7900000 {
>> +        label = "config";
>> +        reg = <0x7900000 0x500000>;
>> +    };
>> +
>> +    partition@7e00000 {
>> +        label = "my-dlink";
>> +        reg = <0x7e00000 0x200000>;
>> +    };
>> +};
>> +
>> +&mdio {
>> +    status = "okay";
>> +
>> +    ethphy0: ethernet-phy@0 {
>> +        reg = <0>;
>> +    };
>> +};
>> +
>> +&eth0 {
>> +    status = "okay";
>> +    ethernet0-port@0 {
>> +        phy-handle = <&ethphy0>;
>> +    };
>> +};
> 
> Is this ^^^ dts pending upstream?
> 
>> diff --git a/configs/dns320l_defconfig b/configs/dns320l_defconfig
>> new file mode 100644
>> index 0000000000..f281984267
>> --- /dev/null
>> +++ b/configs/dns320l_defconfig
>> @@ -0,0 +1,16 @@
>> +BR2_arm=y
> 
> Here you haven't specified any particular Arm architecture but MV78260
> is specified as a:
> "
> ARMv7-compliant CPU cores with the latest Marvell
> micro-architecture enhancements, with a double
> precision IEEE-compliant Floating Point Unit (FPU)
> per core
> "
> 
> Maybe you could give a try to enable VFP3-16 since the SoC supports it:
> https://datasheet.datasheetarchive.com/originals/crawler/marvell.com/1657ba38481c63b54928f3c1d60858fd.pdf
> 
> Here instead you need:
> BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_5=y
> because if not set if changes while Buildroot increase Latest Linux 
> Version resulting in build failure:
> "
> Incorrect selection of kernel headers: expected 6.6.x, got 6.5.x
> "
> 
>> +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
>> +BR2_SYSTEM_DHCP="eth0"
>> +BR2_LINUX_KERNEL=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.5.5"
>> +BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v5"
>> +BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
>> +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/d-link/dns320l/dts/kirkwood-dns320l.dts"

forgotten to mention you also need:
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

>> +BR2_TARGET_ROOTFS_CPIO=y
>> +BR2_TARGET_ROOTFS_CPIO_GZIP=y
>> +BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
>> +
>> +# The package is required for proper power management
>> +BR2_PACKAGE_DNS320L_DAEMON=y
> 
> I've built tested successfully with utils/docker-run so with the changes 
> above:
> Reviewed-by: Giulio Benetti <giulio.benetti@benettieneering.com>
> 
> Best regards
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index c45e7315da..76e8644073 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1950,6 +1950,12 @@  N:	Ludwig Kormann <ludwig.kormann@ict42.de>
 F:	board/in-circuit/
 F:	configs/icnova*
 
+N:	Maciej Grela <enki@fsck.pl>
+F:	board/d-link/dns320l/
+F:	configs/dns320l_defconfig
+F:	package/dns320l-daemon
+F:	package/iniparser
+
 N:	Maeva Manuel <maeva.manuel@oss.nxp.com>
 F:	board/freescale/imx8qmmek/
 F:	configs/freescale_imx8qmmek_defconfig
diff --git a/board/d-link/dns320l/dts/kirkwood-dns320l.dts b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
new file mode 100644
index 0000000000..660508a51a
--- /dev/null
+++ b/board/d-link/dns320l/dts/kirkwood-dns320l.dts
@@ -0,0 +1,218 @@ 
+/dts-v1/;
+
+/*
+ * Device Tree file for DLINK DNS-320L
+ *
+ * Copyright (C) 2015, Sunke Schlüters <sunke-dev@schlueters.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ *
+ * This file is based on the work of Andreas Böhler <dev@aboehler.at>:
+ *   - http://www.aboehler.at/doku/doku.php/projects:dns320l
+ *   - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts
+ */
+
+#include "marvell/kirkwood.dtsi"
+#include "marvell/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,115200n8 earlyprintk";
+		stdout-path = &uart0;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_button_reset &pmx_button_usb_copy>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "Reset push button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 28 1>;
+		};
+		button@2 {
+			label = "USB unmount button";
+			linux,code = <KEY_EJECTCD>;
+			gpios = <&gpio0 27 1>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&pmx_led_usb_blue &pmx_led_red_right_hdd
+			     &pmx_led_red_left_hdd  &pmx_led_usb_orange>;
+		pinctrl-names = "default";
+
+		blue-usb {
+			label = "usb_blue";
+			gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; 
+		};
+		orange-usb {
+			label = "usb_orange";
+			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; 
+		};
+		orange-l_hdd {
+			label = "hdd1_orange";
+			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; 
+		};
+		orange-r_hdd {
+			label = "hdd2_orange";
+			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; 
+		};
+	};
+
+ 	ocp@f1000000 {
+		pinctrl: pin-controller@10000 {
+
+			pinctrl-0 = <&pmx_button_power>;
+			pinctrl-names = "default";
+
+			pmx_sata0: pmx-sata0 {
+				marvell,pins = "mpp20";
+				marvell,function = "sata0";
+			};
+			pmx_sata1: pmx-sata1 {
+				marvell,pins = "mpp21";
+				marvell,function = "sata1";
+			};
+			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";
+			};						
+		};
+		sata@80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+		serial@12000 {
+			status = "okay";
+		};
+
+		serial@12100 {
+			pinctrl-0 = <&pmx_uart1>;
+			pinctrl-names = "default";
+			status = "okay";
+		};
+	};
+
+	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 {
+	pinctrl-0 = <&pmx_nand>;
+	pinctrl-names = "default";
+	status = "okay";
+	chip-delay = <35>;
+
+	partition@0 {
+		label = "u-boot";
+		reg = <0x0000000 0x100000>;
+		read-only;
+	};
+
+	partition@100000 {
+		label = "uImage";
+		reg = <0x0100000 0x500000>;
+	};
+
+	partition@600000 {
+		label = "ramdisk";
+		reg = <0x0600000 0x500000>;
+	};
+
+	partition@b00000 {
+		label = "image";
+		reg = <0x0b00000 0x6400000>;
+	};
+
+	partition@6f00000 {
+		label = "mini firmware";
+		reg = <0x6f00000 0xa00000>;
+	};
+
+	partition@7900000 {
+		label = "config";
+		reg = <0x7900000 0x500000>;
+	};
+
+	partition@7e00000 {
+	    label = "my-dlink";
+	    reg = <0x7e00000 0x200000>;
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port@0 {
+		phy-handle = <&ethphy0>;
+	};
+};
diff --git a/configs/dns320l_defconfig b/configs/dns320l_defconfig
new file mode 100644
index 0000000000..f281984267
--- /dev/null
+++ b/configs/dns320l_defconfig
@@ -0,0 +1,16 @@ 
+BR2_arm=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_SYSTEM_DHCP="eth0"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.5.5"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v5"
+BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/d-link/dns320l/dts/kirkwood-dns320l.dts"
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+
+# The package is required for proper power management
+BR2_PACKAGE_DNS320L_DAEMON=y