Add initrd support for Clearfog

Add missing DTB files for all Clearfog branches
Add parameter for loading Clearfog Base DTB
This commit is contained in:
zador-blood-stained
2016-11-20 15:45:26 +03:00
parent be1841aa50
commit 5d3820e09a
8 changed files with 267 additions and 28 deletions

View File

@@ -0,0 +1,2 @@
verbosity=1
board_model=pro

View File

@@ -1,30 +1,38 @@
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
# default values
setenv rootdev "/dev/mmcblk0p1"
setenv rootfstype "ext4"
setenv verbosity "1"
setenv board_model "pro"
setenv ethaddr "00:50:43:84:fb:2f"
setenv eth1addr "00:50:43:25:fb:84"
setenv eth2addr "00:50:43:84:25:2f"
setenv eth3addr "00:50:43:0d:19:18"
if ext4load mmc 0:1 0x00000000 /boot/.verbose
then
setenv verbosity 7
else
setenv verbosity 1
if ext4load mmc 0:1 ${loadaddr} /boot/armbianEnv.txt || ext4load mmc 0:1 ${loadaddr} armbianEnv.txt; then
env import -t ${loadaddr} ${filesize}
fi
# configure addresses
setenv kerneladdr 0x2000000
setenv fdtaddr 0x5F00000
setenv ramdiskaddr 0x6000000
setenv fdt_high 0x07a12000
if test "${board_model}" = "base"; then
setenv fdtfile "armada-388-clearfog-base.dtb"
else
setenv fdtfile "armada-388-clearfog.dtb"
fi
setenv bootargs "selinux=0 cgroup_disable=memory scandelay root=${rootdev} rw rootfstype=${rootfstype} console=ttyS0,115200 loglevel=${verbosity} rootwait ${extraargs}"
ext4load mmc 0:1 ${fdt_addr} boot/dtb/${fdtfile} || ext4load mmc 0:1 ${fdt_addr} dtb/${fdtfile}
ext4load mmc 0:1 ${ramdisk_addr_r} boot/uInitrd || ext4load mmc 0:1 ${ramdisk_addr_r} uInitrd
ext4load mmc 0:1 ${kernel_addr_r} boot/zImage || ext4load mmc 0:1 ${kernel_addr_r} zImage
setenv fdt_high 0xffffffff
setenv initrd_high 0xffffffff
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr}
setenv ethaddr 00:50:43:84:fb:2f
setenv eth1addr 00:50:43:25:fb:84
setenv eth2addr 00:50:43:84:25:2f
setenv eth3addr 00:50:43:0d:19:18
#
setenv bootargs "selinux=0 cgroup_disable=memory scandelay root=${rootdev} rw rootfstype=ext4 console=ttyS0,115200 loglevel=${verbosity} rootwait ${extraargs}"
ext2load mmc 0:1 ${fdtaddr} boot/dtb/armada-388-clearfog.dtb
ext2load mmc 0:1 ${ramdiskaddr} boot/uInitrd
ext2load mmc 0:1 ${loadaddr} boot/zImage
bootz ${loadaddr} - ${fdtaddr}
#ramdisk currently broken
#bootz ${loadaddr} ${ramdiskaddr} ${fdtaddr}
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

View File

@@ -7,6 +7,9 @@ UBOOT_NEEDS_GCC='< 5.0'
UBOOT_COMPILER="arm-linux-gnueabi-"
UBOOT_TARGET="u-boot.mmc"
UBOOT_FILES="u-boot.mmc"
BOOTENV_FILE='clearfog-default.txt'
HAS_UUID_SUPPORT=yes
case $BRANCH in
default)
@@ -32,8 +35,6 @@ CPUMIN=800000
CPUMAX=1600000
GOVERNOR=ondemand
UBOOT_FILES="u-boot.mmc"
write_uboot_platform()
{
dd if=$1/u-boot.mmc of=$2 bs=512 seek=1 status=noxfer > /dev/null 2>&1

View File

@@ -0,0 +1,199 @@
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 04f1729..df7fade 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -96,7 +96,8 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-38x-modular.dtb \
armada-385-customer1.dtb \
armada-382-customer2.dtb \
armada-385-customer3.dtb \
- armada-388-clearfog.dtb
+ armada-388-clearfog.dtb \
+ armada-388-clearfog-base.dtb
dtb-$(CONFIG_ARCH_MXC) += \
imx25-karo-tx25.dtb \
imx25-pdk.dtb \
diff --git a/arch/arm/boot/dts/armada-388-clearfog-base.dts b/arch/arm/boot/dts/armada-388-clearfog-base.dts
new file mode 100644
index 0000000..63046d4
--- /dev/null
+++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts
@@ -0,0 +1,179 @@
+/*
+ * Device Tree file for SolidRun's ClearFog-a1 board
+ *
+ * Rabeeh Khoury <rabeeh@solid-run.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-385-388.dtsi"
+
+/ {
+ model = "SolidRun ClearFog a1 board";
+ compatible = "marvell,a388-db-gp", "marvell,armada388", "marvell,armada38x";
+
+ chosen {
+ bootargs = "console=ttyS0,115200 earlyprintk";
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x00000000 0x10000000>; /* 256 MB */
+ };
+
+ soc {
+ internal-regs {
+ ethernet@70000 {
+ status = "okay";
+ phy = <&phy0>;
+ phy-mode = "rgmii";
+ };
+
+ ethernet@30000 {
+ status = "okay";
+ phy = <&phy1>;
+ phy-mode = "sgmii";
+ };
+
+ ethernet@34000 {
+ status = "okay";
+ phy = <&phy2>;
+ phy-mode = "sgmii";
+ };
+
+ i2c0: i2c@11000 {
+ status = "okay";
+ clock-frequency = <100000>;
+ };
+
+ i2c1: i2c@11100 {
+ status = "okay";
+ clock-frequency = <100000>;
+ };
+
+ mdio {
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ phy1: ethernet-phy@1 {
+ reg = <999>;
+ };
+ phy2: ethernet-phy@2 {
+ reg = <999>;
+ };
+ };
+
+ sata@a8000 {
+ status = "okay";
+ };
+
+ sata@e0000 {
+ status = "okay";
+ };
+
+ tdm@b0000 {
+ pinctrl-0 = <&tdm_pins>;
+ pinctrl-names = "default";
+ pclk-freq-mhz = <8>;
+ };
+
+ sdhci@d8000 {
+ broken-cd;
+ wp-inverted;
+ bus-width = <4>;
+ status = "okay";
+ no-1-8-v;
+ };
+
+ serial@12000 {
+ status = "okay";
+ };
+
+ serial@12100 {
+ status = "okay";
+ };
+
+ spi1: spi@10680 {
+ pinctrl-0 = <&spi1_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ spi-flash@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "w25q32";
+ reg = <0>; /* Chip select 0 */
+ spi-max-frequency = <3000000>;
+ };
+ slic@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "mv_slic";
+ reg = <1>; /* Chip select 1 */
+ spi-max-frequency = <3000000>;
+ spi-1byte-cs;
+ spi-cpol;
+ spi-cpha;
+ };
+ };
+
+ crypto@9D000 {
+ status = "okay";
+ };
+ };
+
+ pcie-controller {
+ status = "okay";
+ /*
+ * The two PCIe units are accessible through
+ * standard PCIe slots on the board.
+ */
+ pcie@2,0 {
+ /* Port 1, Lane 0 */
+ status = "okay";
+ };
+ pcie@3,0 {
+ /* Port 2, Lane 0 */
+ status = "okay";
+ };
+
+ };
+ };
+};

View File

@@ -0,0 +1,29 @@
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index face816..9dc5e06 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -751,6 +751,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
armada-385-linksys-cobra.dtb \
armada-388-clearfog-base.dtb \
armada-388-clearfog-pro.dtb \
+ armada-388-clearfog.dtb \
armada-388-db.dtb \
armada-388-gp.dtb \
armada-388-rd.dtb
diff --git a/arch/arm/boot/dts/armada-388-clearfog.dts b/arch/arm/boot/dts/armada-388-clearfog.dts
new file mode 100644
index 0000000..7d906da
--- /dev/null
+++ b/arch/arm/boot/dts/armada-388-clearfog.dts
@@ -0,0 +1,11 @@
+/*
+ * Device Tree file for backwards compatibility with old file name expected by boot script
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include "armada-388-clearfog-pro.dts"

View File

@@ -7,7 +7,7 @@ index 4b43a9c..5489685 100755
env = getenv("bootcmd");
if (!env)
- setenv("bootcmd", "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
+ setenv("bootcmd", "ext2load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ setenv("bootcmd", "ext4load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
"setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath "
"ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params "

View File

@@ -7,7 +7,7 @@ index 4b43a9c..5489685 100755
env = getenv("bootcmd");
if (!env)
- setenv("bootcmd", "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
+ setenv("bootcmd", "ext2load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ setenv("bootcmd", "ext4load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
"setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath "
"ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params "

View File

@@ -7,7 +7,7 @@ index 4b43a9c..5489685 100755
env = getenv("bootcmd");
if (!env)
- setenv("bootcmd", "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
+ setenv("bootcmd", "ext2load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ setenv("bootcmd", "ext4load mmc 0:1 ${script_addr_r} boot/boot.scr;source ${script_addr_r};"
+ "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
"setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath "
"ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params "