Commit 503a6463 authored by David S. Miller's avatar David S. Miller

Merge branch 'DPAA-Ethernet-changes'

Madalin Bucur says:

====================
DPAA Ethernet changes

v3: add newline at the end of error messages
v2: resending with From: field matching signed-off-by

Here's a series of changes for the DPAA Ethernet, addressing minor
or unapparent issues in the codebase, adding probe ordering based on
a recently added DPAA QMan API, removing some redundant code.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fb8d1d7e 6e6583c9
...@@ -80,9 +80,11 @@ struct dpaa_fq_cbs { ...@@ -80,9 +80,11 @@ struct dpaa_fq_cbs {
struct qman_fq egress_ern; struct qman_fq egress_ern;
}; };
struct dpaa_priv;
struct dpaa_bp { struct dpaa_bp {
/* device used in the DMA mapping operations */ /* used in the DMA mapping operations */
struct device *dev; struct dpaa_priv *priv;
/* current number of buffers in the buffer pool alloted to each CPU */ /* current number of buffers in the buffer pool alloted to each CPU */
int __percpu *percpu_count; int __percpu *percpu_count;
/* all buffers allocated for this pool have this raw size */ /* all buffers allocated for this pool have this raw size */
...@@ -153,6 +155,8 @@ struct dpaa_priv { ...@@ -153,6 +155,8 @@ struct dpaa_priv {
u16 tx_headroom; u16 tx_headroom;
struct net_device *net_dev; struct net_device *net_dev;
struct mac_device *mac_dev; struct mac_device *mac_dev;
struct device *rx_dma_dev;
struct device *tx_dma_dev;
struct qman_fq *egress_fqs[DPAA_ETH_TXQ_NUM]; struct qman_fq *egress_fqs[DPAA_ETH_TXQ_NUM];
struct qman_fq *conf_fqs[DPAA_ETH_TXQ_NUM]; struct qman_fq *conf_fqs[DPAA_ETH_TXQ_NUM];
......
...@@ -634,6 +634,9 @@ static void set_port_liodn(struct fman *fman, u8 port_id, ...@@ -634,6 +634,9 @@ static void set_port_liodn(struct fman *fman, u8 port_id,
{ {
u32 tmp; u32 tmp;
iowrite32be(liodn_ofst, &fman->bmi_regs->fmbm_spliodn[port_id - 1]);
if (!IS_ENABLED(CONFIG_FSL_PAMU))
return;
/* set LIODN base for this port */ /* set LIODN base for this port */
tmp = ioread32be(&fman->dma_regs->fmdmplr[port_id / 2]); tmp = ioread32be(&fman->dma_regs->fmdmplr[port_id / 2]);
if (port_id % 2) { if (port_id % 2) {
...@@ -644,7 +647,6 @@ static void set_port_liodn(struct fman *fman, u8 port_id, ...@@ -644,7 +647,6 @@ static void set_port_liodn(struct fman *fman, u8 port_id,
tmp |= liodn_base << DMA_LIODN_SHIFT; tmp |= liodn_base << DMA_LIODN_SHIFT;
} }
iowrite32be(tmp, &fman->dma_regs->fmdmplr[port_id / 2]); iowrite32be(tmp, &fman->dma_regs->fmdmplr[port_id / 2]);
iowrite32be(liodn_ofst, &fman->bmi_regs->fmbm_spliodn[port_id - 1]);
} }
static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg) static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg)
...@@ -1942,6 +1944,8 @@ static int fman_init(struct fman *fman) ...@@ -1942,6 +1944,8 @@ static int fman_init(struct fman *fman)
fman->liodn_offset[i] = fman->liodn_offset[i] =
ioread32be(&fman->bmi_regs->fmbm_spliodn[i - 1]); ioread32be(&fman->bmi_regs->fmbm_spliodn[i - 1]);
if (!IS_ENABLED(CONFIG_FSL_PAMU))
continue;
liodn_base = ioread32be(&fman->dma_regs->fmdmplr[i / 2]); liodn_base = ioread32be(&fman->dma_regs->fmdmplr[i / 2]);
if (i % 2) { if (i % 2) {
/* FMDM_PLR LSB holds LIODN base for odd ports */ /* FMDM_PLR LSB holds LIODN base for odd ports */
......
...@@ -435,7 +435,6 @@ struct fman_port_cfg { ...@@ -435,7 +435,6 @@ struct fman_port_cfg {
struct fman_port_rx_pools_params { struct fman_port_rx_pools_params {
u8 num_of_pools; u8 num_of_pools;
u16 second_largest_buf_size;
u16 largest_buf_size; u16 largest_buf_size;
}; };
...@@ -946,8 +945,6 @@ static int set_ext_buffer_pools(struct fman_port *port) ...@@ -946,8 +945,6 @@ static int set_ext_buffer_pools(struct fman_port *port)
port->rx_pools_params.num_of_pools = ext_buf_pools->num_of_pools_used; port->rx_pools_params.num_of_pools = ext_buf_pools->num_of_pools_used;
port->rx_pools_params.largest_buf_size = port->rx_pools_params.largest_buf_size =
sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 1]]; sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 1]];
port->rx_pools_params.second_largest_buf_size =
sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 2]];
/* FMBM_RMPD reg. - pool depletion */ /* FMBM_RMPD reg. - pool depletion */
if (buf_pool_depletion->pools_grp_mode_enable) { if (buf_pool_depletion->pools_grp_mode_enable) {
...@@ -1728,6 +1725,20 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port) ...@@ -1728,6 +1725,20 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port)
} }
EXPORT_SYMBOL(fman_port_get_qman_channel_id); EXPORT_SYMBOL(fman_port_get_qman_channel_id);
/**
* fman_port_get_device
* port: Pointer to the FMan port device
*
* Get the 'struct device' associated to the specified FMan port device
*
* Return: pointer to associated 'struct device'
*/
struct device *fman_port_get_device(struct fman_port *port)
{
return port->dev;
}
EXPORT_SYMBOL(fman_port_get_device);
int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset) int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
{ {
if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE) if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE)
......
...@@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp); ...@@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp);
struct fman_port *fman_port_bind(struct device *dev); struct fman_port *fman_port_bind(struct device *dev);
struct device *fman_port_get_device(struct fman_port *port);
#endif /* __FMAN_PORT_H */ #endif /* __FMAN_PORT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment