Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EEC0C433F5 for ; Wed, 2 Feb 2022 06:00:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4378983388; Wed, 2 Feb 2022 07:00:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="SLUGipXf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BCB78341A; Wed, 2 Feb 2022 07:00:07 +0100 (CET) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 753C683003 for ; Wed, 2 Feb 2022 07:00:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-qk1-x731.google.com with SMTP id 13so17233011qkd.13 for ; Tue, 01 Feb 2022 22:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3BBZ2ivOryRUOubfvq63OlMVo8uVRRyUN3UFGjdh2Q=; b=SLUGipXff5ypg8ruuuR9zEIlL+OsdEUPDiuTzGIlyKybtKCMaGYgZcm/3PC/G6Zraw rqgKNfoV8k6hCeF6/+zS0RXdNYp2QRyu91SluMiOZt4AJCbNU75pLc2NQIsO33aSPABV 9TgpZSM21vkVLMjGxVzO568qQLMeovAvXCUNZYU3JOS1H1Xb1lpcrMimWrxAnexDv+QK Xq9Wjh13VAUDkRuKvvqfZXtASxlIBnLyrIm+1qQDh0CBLEA7hj/hhY84K4WeVXq4bo1/ z3L7IchcMhLlj0Iy62QsZf46/TnjE3XhbUlWVOseI7L0qEBkf/Im5V3iS4EWjs5qD1RY go4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3BBZ2ivOryRUOubfvq63OlMVo8uVRRyUN3UFGjdh2Q=; b=3cZcKedRuCabHzQHK8I6Z3OobG3prpJVPwScizK+VQinDGs0FGNCOev25kI/X6qUWu 60Sy9b6Y8rynQQ4pIe6OhvOtq+hhnUY7vaLz5oYjlHLKTg+uw60WguB1ULF84DB0isKN hd0sdRwIPmHCwgZMqrLmAMD9nlQM47l1fwXbI4qq6mYlighvRvDp4cPvItuCPtsU07aZ elYzVCWe1K7Eet3NCo8PZ6dVUNN8F+9vY+me1TYJEPSr7U5bqBSVmCB/2cOeavTThhm5 JQKE1w7DljLDI4tTbp6xi9e0aZO6Sj48wTzIAAgrKcfc0GqPrgBHIvyADTfWsnrBgOEj E7iQ== X-Gm-Message-State: AOAM531zdieBM2lqsCxUr6TKClSvug2YR35uBo3Wv/tzsjkWl0KHF3ql x7yyZ1UoFKUhI+vjhVRhQcLSMPOxWrY= X-Google-Smtp-Source: ABdhPJwFJpFoyR4/Pt7/v5muXnZwFPRZ39XBpFgnzONZqRFoqlbRnFdyy2WpHc5JJc1aEZTgffkeLQ== X-Received: by 2002:a05:620a:29ce:: with SMTP id s14mr18985138qkp.355.1643781599938; Tue, 01 Feb 2022 21:59:59 -0800 (PST) Received: from localhost.localdomain (76-229-100-169.lightspeed.irvnca.sbcglobal.net. [76.229.100.169]) by smtp.gmail.com with ESMTPSA id p9sm7909469qtw.43.2022.02.01.21.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 21:59:59 -0800 (PST) From: Tony Dinh To: U-Boot Mailing List , Stefan Roese Cc: Tom Rini , =?UTF-8?q?Pali=20Roh=E1r?= , =?UTF-8?q?Marek=20Beh=FAn?= , Tony Dinh , Luka Perkov Subject: [PATCH] arm: kirkwood: iConnect : Add Ethernet support Date: Tue, 1 Feb 2022 21:59:27 -0800 Message-Id: <20220202055928.2971-1-mibodhi@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean - Currently, CONFIG_RESET_PHY_R symbol is used in arch/arm/mach-kirkwood/include/mach/config.h for all Kirkwood boards with mv8831116 PHY, with each board defines the function reset_phy(). Undefine it for this board. - Add board_eth_init(), CONFIG_DM_ETH, and CONFIG_PHY_MARVELL to bring up Ethernet. - Miscellaneous changes: Move constants to .c file and remove header file board/iomega/iconnect/iconnect.h. Add CONFIG_HUSH_PARSER, use BIT macro, and cleanup comments. Signed-off-by: Tony Dinh --- board/iomega/iconnect/iconnect.c | 17 ++++++++++++++--- board/iomega/iconnect/iconnect.h | 24 ------------------------ configs/iconnect_defconfig | 6 +++++- include/configs/iconnect.h | 21 +++++++-------------- 4 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 board/iomega/iconnect/iconnect.h diff --git a/board/iomega/iconnect/iconnect.c b/board/iomega/iconnect/iconnect.c index 9e123aab00..0387160200 100644 --- a/board/iomega/iconnect/iconnect.c +++ b/board/iomega/iconnect/iconnect.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* + * Copyright (C) 2022 Tony Dinh * Copyright (C) 2009-2012 * Wojciech Dubowik * Luka Perkov @@ -7,15 +8,20 @@ #include #include -#include +#include #include #include #include #include -#include "iconnect.h" +#include DECLARE_GLOBAL_DATA_PTR; +#define ICONNECT_OE_LOW (~BIT(7)) +#define ICONNECT_OE_HIGH (~BIT(10)) +#define ICONNECT_OE_VAL_LOW (0) +#define ICONNECT_OE_VAL_HIGH BIT(10) + int board_early_init_f(void) { /* @@ -85,9 +91,14 @@ int board_early_init_f(void) return 0; } +int board_eth_init(struct bd_info *bis) +{ + return cpu_eth_init(bis); +} + int board_init(void) { - /* adress of boot parameters */ + /* address of boot parameters */ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; return 0; diff --git a/board/iomega/iconnect/iconnect.h b/board/iomega/iconnect/iconnect.h deleted file mode 100644 index 4f0be71918..0000000000 --- a/board/iomega/iconnect/iconnect.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2009-2012 - * Wojciech Dubowik - * Luka Perkov - */ - -#ifndef __ICONNECT_H -#define __ICONNECT_H - -#define ICONNECT_OE_LOW (~(1 << 7)) -#define ICONNECT_OE_HIGH (~(1 << 10)) -#define ICONNECT_OE_VAL_LOW (0) -#define ICONNECT_OE_VAL_HIGH (1 << 10) - -/* PHY related */ -#define MV88E1116_LED_FCTRL_REG 10 -#define MV88E1116_CPRSP_CR3_REG 21 -#define MV88E1116_MAC_CTRL_REG 21 -#define MV88E1116_PGADR_REG 22 -#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) -#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) - -#endif /* __ICONNECT_H */ diff --git a/configs/iconnect_defconfig b/configs/iconnect_defconfig index 1c9c77a292..336fae270a 100644 --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig @@ -20,7 +20,8 @@ CONFIG_BOOTCOMMAND="setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi CONFIG_USE_PREBOOT=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_BOARD_LATE_INIT=y -CONFIG_SYS_PROMPT="iconnect => " +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="iConnect> " # CONFIG_CMD_FLASH is not set CONFIG_CMD_NAND=y CONFIG_CMD_PCI=y @@ -39,11 +40,14 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_NAND=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y CONFIG_DM=y # CONFIG_MMC is not set CONFIG_MTD=y CONFIG_MTD_RAW_NAND=y +CONFIG_PHY_MARVELL=y +CONFIG_DM_ETH=y CONFIG_MVGBE=y CONFIG_MII=y CONFIG_PCI=y diff --git a/include/configs/iconnect.h b/include/configs/iconnect.h index f1aad1efde..44a4b4409f 100644 --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* + * Copyright (C) 2022 Tony Dinh * (C) Copyright 2009-2012 * Wojciech Dubowik * Luka Perkov @@ -10,32 +11,24 @@ #include "mv-common.h" -/* - * Environment variables configuration - */ - -/* - * Default environment variables - */ - #define CONFIG_EXTRA_ENV_SETTINGS \ "console=console=ttyS0,115200\0" \ "mtdids=nand0=orion_nand\0" \ - "mtdparts="CONFIG_MTDPARTS_DEFAULT \ + "mtdparts=" CONFIG_MTDPARTS_DEFAULT \ "kernel=/boot/uImage\0" \ "bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0" /* * Ethernet driver configuration + * + * This board has PCIe Wifi card, so allow Ethernet to be disabled */ #ifdef CONFIG_CMD_NET #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ #define CONFIG_PHY_BASE_ADR 11 -#undef CONFIG_RESET_PHY_R +#ifdef CONFIG_RESET_PHY_R +#undef CONFIG_RESET_PHY_R /* remove legacy reset_phy() */ +#endif #endif /* CONFIG_CMD_NET */ -/* - * File system - */ - #endif /* _CONFIG_ICONNECT_H */ -- 2.30.2