From patchwork Fri Oct 29 07:08:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav X-Patchwork-Id: 1547852 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=DpqLVwPO; dkim-atps=neutral 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=) 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) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HgYSG6970z9ssD for ; Fri, 29 Oct 2021 18:08:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A87CE82F9E; Fri, 29 Oct 2021 09:08:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.b="DpqLVwPO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9741082E7A; Fri, 29 Oct 2021 09:08:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from mx.msync.work (hh0.msync.work [95.217.35.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E77BD83216 for ; Fri, 29 Oct 2021 09:08:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C5926180B4F; Fri, 29 Oct 2021 07:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1635491306; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=CGgXzIYlCkWB4k1Y0lqCRFcLqVy9j+dYMQ82Pg38S0E=; b=DpqLVwPOkJNxWanioeFYyIpFZetoBhC7Rm/wj+HCe9cJywVaLgMq7iq9rOdIGcKy8t7XNh W+4bDn4KYZvuZfbfB8Gqw7bq5MC3nCWu6m9Q3wm/WBUdYnsHeEYYgsZI7Th/jZj39qDSCU 9s6R1w0Uaaag3LuaaDITEJCFtNXzP0IsQ+yV+6G7iWkmjPtiZKn9AxFxQ0Q9MQHhgdNBgO NKI/aLQz786ivCO7w5DSEDyM3BZU51ZgrCmr7em1j0wu3YvLAhmzN8uTHMQ1p31lc904Yt mU/OQAU4uqyImFHkr7vuKdYO65sJVTVvpXbJMqGoL2TZJahKO7Cd6x+gqLalfA== From: Vyacheslav Bocharov To: Neil Armstrong Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI Date: Fri, 29 Oct 2021 10:08:20 +0300 Message-Id: <20211029070820.3607994-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean JetHome has own MAC OUI. Add jethub-j100 board file. Update config. Signed-off-by: Vyacheslav Bocharov Signed-off-by: Vyacheslav Bocharov --- board/amlogic/jethub-j100/MAINTAINERS | 8 +++++ board/amlogic/jethub-j100/Makefile | 6 ++++ board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++ board/amlogic/jethub-j80/MAINTAINERS | 3 +- configs/jethub_j100_defconfig | 1 + 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 board/amlogic/jethub-j100/MAINTAINERS create mode 100644 board/amlogic/jethub-j100/Makefile create mode 100644 board/amlogic/jethub-j100/jethub-j100.c diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS new file mode 100644 index 0000000000..43f6a5fc86 --- /dev/null +++ b/board/amlogic/jethub-j100/MAINTAINERS @@ -0,0 +1,8 @@ +JetHome JetHub +M: Vyacheslav Bocharov +S: Maintained +L: u-boot-amlogic@groups.io +F: board/amlogic/jethub-j100/ +F: configs/jethub_j100_defconfig +F: doc/board/amlogic/jethub-j100.rst +F: include/configs/jethub.h diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile new file mode 100644 index 0000000000..4d935af984 --- /dev/null +++ b/board/amlogic/jethub-j100/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2021 Vyacheslav Bocharov +# Author: Vyacheslav Bocharov + +obj-y := jethub-j100.o diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c new file mode 100644 index 0000000000..575bb31573 --- /dev/null +++ b/board/amlogic/jethub-j100/jethub-j100.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021 Vyacheslav Bocharov + * Author: Vyacheslav Bocharov + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int misc_init_r(void) +{ + u8 mac_addr[ARP_HLEN]; + char serial[SM_SERIAL_SIZE]; + u32 sid; + + if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) { + sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE); + /* Ensure the NIC specific bytes of the mac are not all 0 */ + if ((sid & 0xffff) == 0) + sid |= 0x800000; + + /* OUI registered MAC address */ + mac_addr[0] = 0x10; + mac_addr[1] = 0x27; + mac_addr[2] = 0xBE; + mac_addr[3] = (sid >> 16) & 0xff; + mac_addr[4] = (sid >> 8) & 0xff; + mac_addr[5] = (sid >> 0) & 0xff; + + eth_env_set_enetaddr("ethaddr", mac_addr); + } + + return 0; +} diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS index 459e9f89da..a899153117 100644 --- a/board/amlogic/jethub-j80/MAINTAINERS +++ b/board/amlogic/jethub-j80/MAINTAINERS @@ -4,6 +4,5 @@ S: Maintained L: u-boot-amlogic@groups.io F: board/amlogic/jethub-j80/ F: configs/jethub_j80_defconfig -F: configs/jethub_j100_defconfig F: doc/board/amlogic/jethub-j80.rst -F: doc/board/amlogic/jethub-j100.rst +F: include/configs/jethub.h diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig index 290ce4db85..ad026a89e0 100644 --- a/configs/jethub_j100_defconfig +++ b/configs/jethub_j100_defconfig @@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_SYS_BOARD="jethub-j100" CONFIG_SYS_CONFIG_NAME="jethub" CONFIG_ARCH_MESON=y CONFIG_SYS_TEXT_BASE=0x01000000