X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fnet%2Ffm%2Ffm.h;h=2379b3a11cabeb37bf3c93aa72f340d34a2d0a4f;hb=04da42770b0cc3bea8841972bfc9568299ece826;hp=316e06e17e4db68f49ba33395d78e6e885e94bc5;hpb=e82abaeb7f2a0833fccf90460c48b9f2100258f8;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/net/fm/fm.h b/drivers/net/fm/fm.h index 316e06e..2379b3a 100644 --- a/drivers/net/fm/fm.h +++ b/drivers/net/fm/fm.h @@ -1,16 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2009-2011 Freescale Semiconductor, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __FM_H__ #define __FM_H__ #include +#include #include -#include -#include +#include /* Port ID */ #define OH_PORT_ID_BASE 0x01 @@ -26,10 +25,10 @@ #define MIIM_TIMEOUT 0xFFFF struct fm_muram { - u32 base; - u32 top; - u32 size; - u32 alloc; + void *base; + void *top; + size_t size; + void *alloc; }; #define FM_MURAM_RES_SIZE 0x01000 @@ -58,6 +57,18 @@ struct fm_port_bd { #define TxBD_READY 0x8000 #define TxBD_LAST BD_LAST +#ifdef CONFIG_DM_ETH +enum fm_mac_type { +#ifdef CONFIG_SYS_FMAN_V3 + FM_MEMAC, +#else + FM_DTSEC, + FM_TGEC, +#endif +}; +#endif + +/* Fman ethernet private struct */ /* Rx/Tx queue descriptor */ struct fm_port_qd { u16 gen; @@ -88,20 +99,25 @@ struct fm_port_global_pram { #define PRAM_MODE_GLOBAL 0x20000000 #define PRAM_MODE_GRACEFUL_STOP 0x00800000 -#if defined(CONFIG_P1017) || defined(CONFIG_P1023) +#if defined(CONFIG_ARCH_P1023) #define FM_FREE_POOL_SIZE 0x2000 /* 8K bytes */ #else #define FM_FREE_POOL_SIZE 0x20000 /* 128K bytes */ #endif #define FM_FREE_POOL_ALIGN 256 -u32 fm_muram_alloc(int fm_idx, u32 size, u32 align); -u32 fm_muram_base(int fm_idx); +void *fm_muram_alloc(int fm_idx, size_t size, ulong align); +void *fm_muram_base(int fm_idx); int fm_init_common(int index, struct ccsr_fman *reg); int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info); phy_interface_t fman_port_enet_if(enum fm_port port); void fman_disable_port(enum fm_port port); void fman_enable_port(enum fm_port port); +int fman_id(struct udevice *dev); +void *fman_port(struct udevice *dev, int num); +#ifdef CONFIG_DM_ETH +void *fman_mdio(struct udevice *dev, enum fm_mac_type type, int num); +#endif struct fsl_enet_mac { void *base; /* MAC controller registers base address */ @@ -127,7 +143,13 @@ struct fm_eth { struct mii_dev *bus; struct phy_device *phydev; int phyaddr; +#ifndef CONFIG_DM_ETH struct eth_device *dev; +#else + enum fm_mac_type mac_type; + struct udevice *dev; + struct udevice *pcs_mdio; +#endif int max_rx_len; struct fm_port_global_pram *rx_pram; /* Rx parameter table */ struct fm_port_global_pram *tx_pram; /* Tx parameter table */