serial: add BCM283x mini UART driver
[oweals/u-boot.git] / drivers / net / fm / fm.h
index ba581e9ef6171f467cd62ea15c4472d4a921b817..fa9bc9f42dbcfbb424a8a7be7dc371fbd5527073 100644 (file)
@@ -1,29 +1,16 @@
 /*
  * Copyright 2009-2011 Freescale Semiconductor, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __FM_H__
 #define __FM_H__
 
 #include <common.h>
+#include <phy.h>
 #include <fm_eth.h>
-#include <asm/fsl_enet.h>
-#include <asm/fsl_fman.h>
+#include <fsl_fman.h>
 
 /* Port ID */
 #define OH_PORT_ID_BASE                0x01
 #define RX_PORT_1G_BASE                0x08
 #define MAX_NUM_RX_PORT_1G     CONFIG_SYS_NUM_FM1_DTSEC
 #define RX_PORT_10G_BASE       0x10
+#define RX_PORT_10G_BASE2      0x08
 #define TX_PORT_1G_BASE                0x28
 #define MAX_NUM_TX_PORT_1G     CONFIG_SYS_NUM_FM1_DTSEC
 #define TX_PORT_10G_BASE       0x30
+#define TX_PORT_10G_BASE2      0x28
+#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
 
@@ -105,12 +95,13 @@ struct fm_port_global_pram {
 #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);
 
 struct fsl_enet_mac {
        void *base; /* MAC controller registers base address */
@@ -152,6 +143,7 @@ struct fm_eth {
 #define MAX_RXBUF_LOG2         11
 #define MAX_RXBUF_LEN          (1 << MAX_RXBUF_LOG2)
 
-#define PORT_IS_ENABLED(port)  fm_info[fm_port_to_index(port)].enabled
+#define PORT_IS_ENABLED(port)  (fm_port_to_index(port) == -1 ? \
+       0 : fm_info[fm_port_to_index(port)].enabled)
 
 #endif /* __FM_H__ */