From patchwork Wed May 2 07:53:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 907366 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hzcOD8XM"; dkim-atps=neutral Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40bVvH2NbVz9rx7 for ; Wed, 2 May 2018 17:55:37 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 184DAB8025D; Wed, 2 May 2018 09:55:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 2 May 2018 09:55:32 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BFCD5B800CE for ; Wed, 2 May 2018 09:55:30 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .linaro. - helo: .mail-lf0-f65.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 2 May 2018 09:55:29 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id j193-v6so19481125lfg.6 for ; Wed, 02 May 2018 00:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=jmc5402M2sGM8xjvYIFW/+Si3PlGtGp+O2X4y17e3cU=; b=hzcOD8XMkPkX1k6NGwO5a7izKSb3Qgg5DwNzD7d0ETb9ZDkHLP3D2311GzhdAga4Jj +sib/Li7fOyFrvED1XNrDYySLCZo1TmrpCuKgtdQp27gNzrVjSHpTBmc+s0FL6mvAhRQ aQP2lHJE/LL57rEM9tQ7/WbMw5ef0meRuk7jA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jmc5402M2sGM8xjvYIFW/+Si3PlGtGp+O2X4y17e3cU=; b=tR5iFgmE3eWSv884+d+J+LVCnGOz4TPUuCmZugfFIsVDdJoapimrEHtTbTk6pVLWn/ 9bfwEyDyWNdpH/lI4ulCIhWmWzqVE4nQFL9sC0z/86X552YYGhXZtODkw1pPx29EK47x VxL/gWh2L9KPkVKa/wVP9TsgTlRGUeeKHg2fIUgMT9NHbIpowsddRD6KK8nGsltLiVNt oM+T5NVowUmbHypTTAFYiKKwqt3lM2MZc33AhRwAocMjO2v2FqyFlf52ZMQ46OJvbtOK 0IKqSDWWijRZvZYFBBBPHYaqrLgGo7dJw/o0Z4BagJBiV2zsaSNTBeR+qq/EhUUMGb35 kb3w== X-Gm-Message-State: ALQs6tAkW6rDnA4RobwOnysnQPPedHN/au5VpMsMZWgkKgmiwwT6rAhI ol2L7EGa99LsOoZCkXKhtC/Yow== X-Google-Smtp-Source: AB8JxZqg/q9PY+ZlJXbBobpqeIS+ayiiSyemi4zf8GICLnOw17lIHVHR7ybDmLxZEH6B5PO5EEgkoQ== X-Received: by 2002:a2e:4082:: with SMTP id r2-v6mr13036072lje.48.1525247728940; Wed, 02 May 2018 00:55:28 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r72-v6sm2328386lfi.78.2018.05.02.00.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 00:55:28 -0700 (PDT) From: Linus Walleij To: Roman Yeryomin , Sebastian Luft , Hans Ulli Kroll , Hauke Mehrtens Date: Wed, 2 May 2018 09:53:21 +0200 Message-Id: <20180502075321.4831-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 Subject: [OpenWrt-Devel] [PATCH] gemini: Fix hard disk boot on D-Link devices X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: LEDE Development List , openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Since the D-Link devices boot from hard disk we need to add the following changes to Gemini: - Supply a bootarg in the device tree so we can boot from the right partition (/dev/sda4 on DNS-313) - Disable forced command line in config so the kernel picks up the right bootargs from the device tree - Enable EXT4 in the config as this is used for rootfs else we get nowhere, we cannot load this as a module because, well, it is supposed to be loaded from the root partition (chicken and egg problem). Also clean out the premature attempts to dynamically modify the command line in the Image makefile: we should pass this with the device tree bootargs instead, it works much better. Signed-off-by: Linus Walleij --- target/linux/gemini/config-4.14 | 2 +- target/linux/gemini/image/Makefile | 6 --- ...ts-Fix-bootargs-for-Gemini-D-Link-devices.patch | 45 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 target/linux/gemini/patches-4.14/0033-ARM-dts-Fix-bootargs-for-Gemini-D-Link-devices.patch diff --git a/target/linux/gemini/config-4.14 b/target/linux/gemini/config-4.14 index 034bbcf6054a..d6dfef0bcacd 100644 --- a/target/linux/gemini/config-4.14 +++ b/target/linux/gemini/config-4.14 @@ -56,7 +56,6 @@ CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="console=ttyS0,19200n8" -CONFIG_CMDLINE_FORCE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y CONFIG_COMPACTION=y @@ -153,6 +152,7 @@ CONFIG_ELF_CORE=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_EXPERT is not set CONFIG_EXPORTFS=y +CONFIG_EXT4_FS=y CONFIG_FARADAY_FTINTC010=y CONFIG_FHANDLE=y CONFIG_FIRMWARE_IN_KERNEL=y diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index dca3b63b19ce..2e3bcdb21ccd 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -75,19 +75,15 @@ GEMINI_NAS_PACKAGES:=kmod-md-mod kmod-md-linear kmod-md-multipath \ kmod-nls-utf8 kmod-usb-storage-extras \ samba36-server mdadm cfdisk fdisk e2fsprogs badblocks -DIR685_CMDLINE:=-console=ttyS0,19200n8 root=/dev/sda1 rw rootwait define Device/dlink-dir-685 DEVICE_TITLE := D-Link DIR-685 Xtreme N Storage Router - CMDLINE := $(DIR685_CMDLINE) DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) \ kmod-switch-rtl8366rb swconfig endef TARGET_DEVICES += dlink-dir-685 -DNS313_CMDLINE:=-console=ttyS0,19200n8 root=/dev/sda4 rw rootwait define Device/dlink-dns-313 DEVICE_TITLE := D-Link DNS-313 1-Bay Network Storage Enclosure - CMDLINE := $(DNS313_CMDLINE) DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) IMAGES += dns313-image IMAGE/dns313-image := dns313-images @@ -108,10 +104,8 @@ define Device/rut1xx endef TARGET_DEVICES += rut1xx -SQ201_CMDLINE:=-console=ttyS0,115200n8 define Device/sq201 DEVICE_TITLE := ITian Square One SQ201 - CMDLINE := $(SQ201_CMDLINE) DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) rt61-pci-firmware endef TARGET_DEVICES += sq201 diff --git a/target/linux/gemini/patches-4.14/0033-ARM-dts-Fix-bootargs-for-Gemini-D-Link-devices.patch b/target/linux/gemini/patches-4.14/0033-ARM-dts-Fix-bootargs-for-Gemini-D-Link-devices.patch new file mode 100644 index 000000000000..f8cf123d7b2e --- /dev/null +++ b/target/linux/gemini/patches-4.14/0033-ARM-dts-Fix-bootargs-for-Gemini-D-Link-devices.patch @@ -0,0 +1,45 @@ +From 5813b729eb9fe91fcf895a5c2f30bf34fbd46379 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 2 May 2018 09:17:25 +0200 +Subject: [PATCH] ARM: dts: Fix bootargs for Gemini D-Link devices + +These machines need to be booted from very specific harddisk +partitions (as the D-Link DNS-313 boots specifically from +partition 4). Add the proper bootargs so that everything works +smoothly. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/gemini-dlink-dir-685.dts | 3 ++- + arch/arm/boot/dts/gemini-dlink-dns-313.dts | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/gemini-dlink-dir-685.dts b/arch/arm/boot/dts/gemini-dlink-dir-685.dts +index a39914dece98..840f4a32f37c 100644 +--- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts ++++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts +@@ -20,7 +20,8 @@ + }; + + chosen { +- stdout-path = "uart0:115200n8"; ++ bootargs = "console=ttyS0,19200n8 root=/dev/sda1 rw rootwait"; ++ stdout-path = "uart0:19200n8"; + }; + + gpio_keys { +diff --git a/arch/arm/boot/dts/gemini-dlink-dns-313.dts b/arch/arm/boot/dts/gemini-dlink-dns-313.dts +index 4904f1251671..685719a0b8c0 100644 +--- a/arch/arm/boot/dts/gemini-dlink-dns-313.dts ++++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts +@@ -26,6 +26,7 @@ + }; + + chosen { ++ bootargs = "console=ttyS0,19200n8 root=/dev/sda4 rw rootwait"; + stdout-path = "uart0:19200n8"; + }; + +-- +2.14.3 +