From patchwork Sat Jan 25 08:01:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1229178 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=O27VMcx4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 484T4s3CM6z9sRV for ; Sat, 25 Jan 2020 19:02:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AC097817EB; Sat, 25 Jan 2020 09:02:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1579939327; bh=fuOalAbWblWYor3gCRcIhSzIsPtjiT8HmcOE8IGL+fI=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=O27VMcx41WwZKt8uFsWX7iSQhzBWoTwO9mpklsmo+npi5PAnheZYaaAGbkn7HYPNJ ti7vm/GtZ8FQmieGJ/FswlxrhqLUdgJjCRIQwyLJw2s/04PYqAvPDgR5Z5bkrBmZr6 jDe4pdPUEXXR7f7f1eEecWpK0Uq9QKmOYP2TQJUB8OmePRCKvX4KwszV45LNovMFkP P+0ZQF/AVbzoNZQAIzBWK3hjZai9OgvyreVEBkxDJHSjRgLYmLseTz0orS/MwZStBp hQd4RKLkXX8UMiHKlnfUmzfYN1E0SK6lkpYJ4clRjP06bxsuXg8qpinthrZ2PRKRR2 DyKu9QmaIt+PA== Received: by phobos.denx.de (Postfix, from userid 109) id 92F1B817B6; Sat, 25 Jan 2020 09:02:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1476E81715 for ; Sat, 25 Jan 2020 09:01:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 484T4P64p3z1rW5x; Sat, 25 Jan 2020 09:01:57 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 484T4P5nZCz1qwyJ; Sat, 25 Jan 2020 09:01:57 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id QcNeBXWBvc5K; Sat, 25 Jan 2020 09:01:56 +0100 (CET) X-Auth-Info: RKlET7HzvobN5rz4hRGttBTcEuDnSl53s5Qdmc3PSXk= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 25 Jan 2020 09:01:56 +0100 (CET) From: Lukasz Majewski To: u-boot@lists.denx.de, Stefano Babic Subject: [PATCH v1 2/5] arm: xea: Provide function to set L2 switch 'local-mac-address' property Date: Sat, 25 Jan 2020 09:01:37 +0100 Message-Id: <20200125080140.1267-3-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable. Signed-off-by: Lukasz Majewski --- board/liebherr/xea/xea.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index 1d47f67a7f..bdc073664c 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -150,4 +150,36 @@ int dram_init(void) return mxs_dram_init(); } +#ifdef CONFIG_OF_BOARD_SETUP +static int fdt_fixup_l2switch(void *blob) +{ + u8 ethaddr[6]; + int ret; + + if (eth_env_get_enetaddr("ethaddr", ethaddr)) { + ret = fdt_find_and_setprop(blob, + "/ahb@80080000/switch@800f0000", + "local-mac-address", ethaddr, 6, 1); + if (ret < 0) + printf("%s: can't find usbether@1 node: %d\n", + __func__, ret); + } + + return 0; +} + +int ft_board_setup(void *blob, bd_t *bd) +{ + /* + * i.MX28 L2 switch needs manual update (fixup) of eth MAC address + * (in 'local-mac-address' property) as it uses "switch@800f0000" + * node, not set by default FIT image handling code in + * "ethernet@800f0000" + */ + fdt_fixup_l2switch(blob); + + return 0; +} +#endif + #endif /* CONFIG_SPL_BUILD */