1*b886d83cSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
22ba4573cSJosh Boyer /*
32ba4573cSJosh Boyer * Copyright IBM Corporation, 2007
42ba4573cSJosh Boyer * Josh Boyer <jwboyer@linux.vnet.ibm.com>
52ba4573cSJosh Boyer *
62ba4573cSJosh Boyer * Based on ebony wrapper:
72ba4573cSJosh Boyer * Copyright 2007 David Gibson, IBM Corporation.
82ba4573cSJosh Boyer */
92ba4573cSJosh Boyer #include "ops.h"
102ba4573cSJosh Boyer #include "stdio.h"
112ba4573cSJosh Boyer #include "44x.h"
12658e8170SJosh Boyer #include "stdlib.h"
132ba4573cSJosh Boyer
142ba4573cSJosh Boyer BSS_STACK(4096);
152ba4573cSJosh Boyer
16658e8170SJosh Boyer #define PIBS_MAC0 0xfffc0400
17658e8170SJosh Boyer #define PIBS_MAC1 0xfffc0500
18658e8170SJosh Boyer char pibs_mac0[6];
19658e8170SJosh Boyer char pibs_mac1[6];
20658e8170SJosh Boyer
read_pibs_mac(void)21658e8170SJosh Boyer static void read_pibs_mac(void)
22658e8170SJosh Boyer {
23658e8170SJosh Boyer unsigned long long mac64;
24658e8170SJosh Boyer
25658e8170SJosh Boyer mac64 = strtoull((char *)PIBS_MAC0, 0, 16);
26658e8170SJosh Boyer memcpy(&pibs_mac0, (char *)&mac64+2, 6);
27658e8170SJosh Boyer
28658e8170SJosh Boyer mac64 = strtoull((char *)PIBS_MAC1, 0, 16);
29658e8170SJosh Boyer memcpy(&pibs_mac1, (char *)&mac64+2, 6);
30658e8170SJosh Boyer }
31658e8170SJosh Boyer
platform_init(void)322ba4573cSJosh Boyer void platform_init(void)
332ba4573cSJosh Boyer {
342ba4573cSJosh Boyer unsigned long end_of_ram = 0x8000000;
352ba4573cSJosh Boyer unsigned long avail_ram = end_of_ram - (unsigned long)_end;
362ba4573cSJosh Boyer
372ba4573cSJosh Boyer simple_alloc_init(_end, avail_ram, 32, 64);
38658e8170SJosh Boyer read_pibs_mac();
39658e8170SJosh Boyer bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1);
402ba4573cSJosh Boyer }
41