arm: kirkwood: iConnect : Add Ethernet support
PATCH 1/1 arm: kirkwood: iConnect : Add Ethernet support
- 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.
---
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
board/iomega/iconnect/iconnect.c +14 -3
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * Copyright (C) 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]>
@@ -7,15 +8,20 @@#include <common.h> #include <init.h> -#include <miiphy.h> +#include <netdev.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> #include <asm/global_data.h> -#include "iconnect.h" +#include <linux/bitops.h> 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 ;
board/iomega/iconnect/iconnect.h deleted +0 -24
@@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Copyright (C) 2009-2012 -* Wojciech Dubowik <[email protected]> -* Luka Perkov <[email protected]> -*/ - -#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 */
configs/iconnect_defconfig +5 -1
@@ -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
include/configs/iconnect.h +7 -14
@@ -1,5 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * (C) Copyright 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]>
@@ -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 */
Signature · 1 line
2.30.2
Quoted 11 lines · Tony Dinh
- Currently,
CONFIG_RESET_PHY_Rsymbol is used inarch/arm/mach-kirkwood/include/mach/config.hfor all Kirkwood boards with mv8831116 PHY, with each board defines the functionreset_phy(). Undefine it for this board.
- Addboard_eth_init(),CONFIG_DM_ETH, andCONFIG_PHY_MARVELLto bring up Ethernet.
- Miscellaneous changes: Move constants to .c file and remove header fileboard/iomega/iconnect/iconnect.h. AddCONFIG_HUSH_PARSER, use BIT macro, and cleanup comments.Signed-off-by Tony Dinh <[email protected]>
Thanks,
Stefan
Quoted 158 lines
---
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.hboard/iomega/iconnect/iconnect.c +14
-3@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * Copyright (C) 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]> @@ -7,15 +8,20 @@#include <common.h> #include <init.h> -#include <miiphy.h> +#include <netdev.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> #include <asm/global_data.h> -#include "iconnect.h" +#include <linux/bitops.h> 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 ;board/iomega/iconnect/iconnect.h deleted +0
-24@@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Copyright (C) 2009-2012 -* Wojciech Dubowik <[email protected]> -* Luka Perkov <[email protected]> -*/ - -#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 */ configs/iconnect_defconfig +5
-1@@ -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=yinclude/configs/iconnect.h +4
-10@@ -1,5 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * (C) Copyright 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]> @@ -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
include/configs/iconnect.h line 34
Quoted 10 lines
include/configs/iconnect.h +3
-4+#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 */
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 11 lines · Tony Dinh
- Currently,
CONFIG_RESET_PHY_Rsymbol is used inarch/arm/mach-kirkwood/include/mach/config.hfor all Kirkwood boards with mv8831116 PHY, with each board defines the functionreset_phy(). Undefine it for this board.
- Addboard_eth_init(),CONFIG_DM_ETH, andCONFIG_PHY_MARVELLto bring up Ethernet.
- Miscellaneous changes: Move constants to .c file and remove header fileboard/iomega/iconnect/iconnect.h. AddCONFIG_HUSH_PARSER, use BIT macro, and cleanup comments.Signed-off-by Tony Dinh <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 158 lines
---
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.hboard/iomega/iconnect/iconnect.c +14
-3@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * Copyright (C) 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]> @@ -7,15 +8,20 @@#include <common.h> #include <init.h> -#include <miiphy.h> +#include <netdev.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> #include <asm/global_data.h> -#include "iconnect.h" +#include <linux/bitops.h> 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 ;board/iomega/iconnect/iconnect.h deleted +0
-24@@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Copyright (C) 2009-2012 -* Wojciech Dubowik <[email protected]> -* Luka Perkov <[email protected]> -*/ - -#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 */ configs/iconnect_defconfig +5
-1@@ -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=yinclude/configs/iconnect.h +4
-10@@ -1,5 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* +* Copyright (C) 2022 Tony Dinh <[email protected]> * (C) Copyright 2009-2012 * Wojciech Dubowik <[email protected]> * Luka Perkov <[email protected]> @@ -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
include/configs/iconnect.h line 34
Quoted 10 lines
include/configs/iconnect.h +3
-4+#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 */
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]