From patchwork Wed Dec 2 20:37:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 551741 X-Patchwork-Delegate: jogo@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 31CFE1402DE for ; Thu, 3 Dec 2015 07:37:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Z09BMGEX; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C105A28C07B; Wed, 2 Dec 2015 21:37:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A33E828C07B for ; Wed, 2 Dec 2015 21:37:05 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 2 Dec 2015 21:37:05 +0100 (CET) Received: by wmec201 with SMTP id c201so74917716wme.1 for ; Wed, 02 Dec 2015 12:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=2+fx8x2N6N+IRNTfBplcfQzReQhOmweUsyiNMsF7jVU=; b=Z09BMGEXGiNKMWOcx4dSg/kKgNVowsJZ4jIUDxj3okiSWapVm98+LWWTkRCbxeV1tj enhF8J+tbcZrsaEY6DGbEtZGiE2e2BDbSGQNhc7+r0rk31tMFk9nrhIEfm3zSfvts4c5 dWm9OlKqzF+d1mUsZYh+9KWikJt5gazdEmvDMncvN4rJWU1utGpm0799ikXBDIYtJc+F hQwuI6QDmtKYYlGzLXkDhliSVEDED2pryOwYaK3UwMXbrCu5CsKYhoFOeoGQpspxAmRW HDRUo3yzNJS3PPLt/ceNUcNAh9HDqVH6KSNwcARarK0ukONnMwRaH7yuCTx4HaHStCQt PbSQ== X-Received: by 10.28.101.65 with SMTP id z62mr8383323wmb.84.1449088629955; Wed, 02 Dec 2015 12:37:09 -0800 (PST) Received: from tool.localnet ([77.231.193.240]) by smtp.googlemail.com with ESMTPSA id kj3sm4370231wjb.19.2015.12.02.12.37.08 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Dec 2015 12:37:09 -0800 (PST) From: dani To: openwrt-devel@lists.openwrt.org Date: Wed, 02 Dec 2015 21:37:21 +0100 Message-ID: <3460587.Oz56dTkAua@tool> User-Agent: KMail/4.14.10 (Linux/4.2.5-1-ARCH; KDE/4.14.14; x86_64; ; ) MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] brcm63xx: Let the CFE partition in HG556a to be writeable X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" In the HG556a router the partition mtd0, where CFE lives, is read only. This patch allows this partition to be writeable. The BCM6358 SoC has two cores, but they are not identical. The second core has half icache. core0: icache=32kB core1: icache=16kB As default the HG556a uses the second core as the main one (configured by CFE). Since currently there isn't SMP support for using both cores, we want to use the one with the best performance. For using the core0 as the main one, we need to write some bytes at the offset 0x014 of mtd0 (CFE). Therefore we need the mtd0 partition to be writeable. After setting the core0 as the main one, the performance can increase up to +20% (tested). The performance gain isn't marginal. For setting the core0 as the main one in an easy way I wrote a very simple utility: https://wiki.openwrt.org/_media/media/huawei/tp0set.tar.gz It can switch from core0 to core1 or vice versa in OpenWrt writing proper bytes into bcm6358 CFE (fully tested in the HG556a, no bricks). Signed-off-by: Daniel Gonzalez diff --git a/target/linux/brcm63xx/dts/hg556a-a.dts b/target/linux/brcm63xx/dts/hg556a-a.dts index 98e0a83..1b007c7 100644 --- a/target/linux/brcm63xx/dts/hg556a-a.dts +++ b/target/linux/brcm63xx/dts/hg556a-a.dts @@ -105,7 +105,6 @@ cfe@0 { label = "CFE"; reg = <0x000000 0x020000>; - read-only; }; linux@20000 { diff --git a/target/linux/brcm63xx/dts/hg556a-b.dts b/target/linux/brcm63xx/dts/hg556a-b.dts index 8a19856..950fd17 100644 --- a/target/linux/brcm63xx/dts/hg556a-b.dts +++ b/target/linux/brcm63xx/dts/hg556a-b.dts @@ -105,7 +105,6 @@ cfe@0 { label = "CFE"; reg = <0x000000 0x020000>; - read-only; }; linux@20000 { diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts b/target/linux/brcm63xx/dts/hg556a-c.dts index 9798091..f6b635d 100644 --- a/target/linux/brcm63xx/dts/hg556a-c.dts +++ b/target/linux/brcm63xx/dts/hg556a-c.dts @@ -100,7 +100,6 @@ cfe@0 { label = "CFE"; reg = <0x000000 0x020000>; - read-only; }; linux@20000 {