Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright IBM Corporation, 2007
0004  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
0005  *
0006  * Based on ebony wrapper:
0007  * Copyright 2007 David Gibson, IBM Corporation.
0008  */
0009 #include "ops.h"
0010 #include "stdio.h"
0011 #include "44x.h"
0012 #include "stdlib.h"
0013 
0014 BSS_STACK(4096);
0015 
0016 #define PIBS_MAC0 0xfffc0400
0017 #define PIBS_MAC1 0xfffc0500
0018 char pibs_mac0[6];
0019 char pibs_mac1[6];
0020 
0021 static void read_pibs_mac(void)
0022 {
0023     unsigned long long mac64;
0024 
0025     mac64 = strtoull((char *)PIBS_MAC0, 0, 16);
0026     memcpy(&pibs_mac0, (char *)&mac64+2, 6);
0027 
0028     mac64 = strtoull((char *)PIBS_MAC1, 0, 16);
0029     memcpy(&pibs_mac1, (char *)&mac64+2, 6);
0030 }
0031 
0032 void platform_init(void)
0033 {
0034     unsigned long end_of_ram = 0x8000000;
0035     unsigned long avail_ram = end_of_ram - (unsigned long)_end;
0036 
0037     simple_alloc_init(_end, avail_ram, 32, 64);
0038     read_pibs_mac();
0039     bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1);
0040 }