upstream u-boot with additional patches for our devices/boards: https://lists.denx.de/pipermail/u-boot/2017-March/282789.html (AXP crashes) ; Gbit ethernet patch for some LIME2 revisions ; with SPI flash support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
u-boot/arch/powerpc/cpu/mpc8xx/commproc.c

70 lines
1.4 KiB

23 years ago
/*
* (C) Copyright 2000-2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* SPDX-License-Identifier: GPL-2.0+
23 years ago
*/
#include <common.h>
#include <commproc.h>
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SYS_ALLOC_DPRAM
23 years ago
int dpram_init (void)
{
/* Reclaim the DP memory for our use. */
gd->arch.dp_alloc_base = CPM_DATAONLY_BASE;
gd->arch.dp_alloc_top = CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE;
23 years ago
return (0);
}
/* Allocate some memory from the dual ported ram. We may want to
* enforce alignment restrictions, but right now everyone is a good
* citizen.
*/
uint dpram_alloc (uint size)
{
uint addr = gd->arch.dp_alloc_base;
23 years ago
if ((gd->arch.dp_alloc_base + size) >= gd->arch.dp_alloc_top)
23 years ago
return (CPM_DP_NOSPACE);
gd->arch.dp_alloc_base += size;
23 years ago
return addr;
}
uint dpram_base (void)
{
return gd->arch.dp_alloc_base;
23 years ago
}
/* Allocate some memory from the dual ported ram. We may want to
* enforce alignment restrictions, but right now everyone is a good
* citizen.
*/
uint dpram_alloc_align (uint size, uint align)
{
uint addr, mask = align - 1;
addr = (gd->arch.dp_alloc_base + mask) & ~mask;
23 years ago
if ((addr + size) >= gd->arch.dp_alloc_top)
23 years ago
return (CPM_DP_NOSPACE);
gd->arch.dp_alloc_base = addr + size;
23 years ago
return addr;
}
uint dpram_base_align (uint align)
{
uint mask = align - 1;
return (gd->arch.dp_alloc_base + mask) & ~mask;
23 years ago
}
#endif /* CONFIG_SYS_ALLOC_DPRAM */