mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
net: mvpp2: fix second cp110 initialization
Since the mdio code got upstreamed it is not possible to activate network ports on CP110 Master and Slave. The problem is in mvpp2_base_probe which is called for each CP110 and it initializes the buffer area for descs and rx_buffers. This should only happen once though and the bd space is actually set to 0 after the first run of the function. This leads to an error when the second CP110 tries the initialization again and disables all network ports on this CP110. This patch adds a static variable to check if the buffer area is initialized only once globally. Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
21b1c75f9d
commit
3078e03516
1 changed files with 33 additions and 28 deletions
|
@ -1263,6 +1263,7 @@ struct buffer_location {
|
|||
* can be enabled at once
|
||||
*/
|
||||
static struct buffer_location buffer_loc;
|
||||
static int buffer_loc_init;
|
||||
|
||||
/*
|
||||
* Page table entries are set to 1MB, or multiples of 1MB
|
||||
|
@ -5247,6 +5248,7 @@ static int mvpp2_base_probe(struct udevice *dev)
|
|||
* be active. Make this area DMA-safe by disabling the D-cache
|
||||
*/
|
||||
|
||||
if (!buffer_loc_init) {
|
||||
/* Align buffer area for descs and rx_buffers to 1MiB */
|
||||
bd_space = memalign(1 << MMU_SECTION_SHIFT, BD_SPACE);
|
||||
mmu_set_region_dcache_behaviour((unsigned long)bd_space,
|
||||
|
@ -5281,6 +5283,9 @@ static int mvpp2_base_probe(struct udevice *dev)
|
|||
/* Clear the complete area so that all descriptors are cleared */
|
||||
memset(bd_space, 0, size);
|
||||
|
||||
buffer_loc_init = 1;
|
||||
}
|
||||
|
||||
/* Save base addresses for later use */
|
||||
priv->base = (void *)devfdt_get_addr_index(dev, 0);
|
||||
if (IS_ERR(priv->base))
|
||||
|
|
Loading…
Reference in a new issue