[uboot] porting cvitek asic chips:

1. add cvitek folders to u-boot-2021.10
	2. add cv183x/cv182x part
	3. add cv181x/cv180x part

Change-Id: I6dc2e5ff509dbab16bd60bfb3fd61852da5e01f6
This commit is contained in:
sam.xiang
2023-02-22 13:43:23 +08:00
parent f8fc109960
commit 3a4bcfca2f
244 changed files with 41355 additions and 1273 deletions

View File

@ -11,6 +11,9 @@
#include <lmb.h>
#include <log.h>
#include <malloc.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
#define LMB_ALLOC_ANYWHERE 0
@ -113,6 +116,37 @@ void lmb_init(struct lmb *lmb)
lmb->reserved.cnt = 0;
}
void arch_lmb_reserve_generic(struct lmb *lmb, ulong sp, ulong end, ulong align)
{
ulong bank_end;
int bank;
/*
* Reserve memory from aligned address below the bottom of U-Boot stack
* until end of U-Boot area using LMB to prevent U-Boot from overwriting
* that memory.
*/
debug("## Current stack ends at 0x%08lx ", sp);
/* adjust sp by 4K to be safe */
sp -= align;
for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
if (!gd->bd->bi_dram[bank].size ||
sp < gd->bd->bi_dram[bank].start)
continue;
/* Watch out for RAM at end of address space! */
bank_end = gd->bd->bi_dram[bank].start +
gd->bd->bi_dram[bank].size - 1;
if (sp > bank_end)
continue;
if (bank_end > end)
bank_end = end - 1;
lmb_reserve(lmb, sp, bank_end - sp + 1);
break;
}
}
static void lmb_reserve_common(struct lmb *lmb, void *fdt_blob)
{
arch_lmb_reserve(lmb);