18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Old U-boot compatibility for Ebony
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Author: David Gibson <david@gibson.dropbear.id.au>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright 2007 David Gibson, IBM Corporatio.
88c2ecf20Sopenharmony_ci *   Based on cuboot-83xx.c, which is:
98c2ecf20Sopenharmony_ci * Copyright (c) 2007 Freescale Semiconductor, Inc.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include "ops.h"
138c2ecf20Sopenharmony_ci#include "stdio.h"
148c2ecf20Sopenharmony_ci#include "44x.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciBSS_STACK(4096);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define OPENBIOS_MAC_BASE	0xfffffe0c
198c2ecf20Sopenharmony_ci#define OPENBIOS_MAC_OFFSET	0xc
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_civoid platform_init(void)
228c2ecf20Sopenharmony_ci{
238c2ecf20Sopenharmony_ci	unsigned long end_of_ram = 0x8000000;
248c2ecf20Sopenharmony_ci	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci	simple_alloc_init(_end, avail_ram, 32, 64);
278c2ecf20Sopenharmony_ci	ebony_init((u8 *)OPENBIOS_MAC_BASE,
288c2ecf20Sopenharmony_ci		   (u8 *)(OPENBIOS_MAC_BASE + OPENBIOS_MAC_OFFSET));
298c2ecf20Sopenharmony_ci}
30