]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - api/api_platform-powerpc.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007 Semihalf
5 * Written by: Rafal Jaworowski <raj@semihalf.com>
7 * This file contains routines that fetch data from PowerPC-dependent sources
12 #include <linux/types.h>
13 #include <api_public.h>
15 #include <asm/u-boot.h>
16 #include <asm/global_data.h>
18 #include "api_private.h"
20 DECLARE_GLOBAL_DATA_PTR
;
23 * Important notice: handling of individual fields MUST be kept in sync with
24 * include/asm-ppc/u-boot.h and include/asm-ppc/global_data.h, so any changes
25 * need to reflect their current state and layout of structures involved!
27 int platform_sys_info(struct sys_info
*si
)
29 si
->clk_bus
= gd
->bus_clk
;
30 si
->clk_cpu
= gd
->cpu_clk
;
32 #if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
33 #define bi_bar bi_immr_base
34 #elif defined(CONFIG_MPC83xx)
35 #define bi_bar bi_immrbar
39 si
->bar
= gd
->bd
->bi_bar
;
45 platform_set_mr(si
, gd
->bd
->bi_memstart
, gd
->bd
->bi_memsize
, MR_ATTR_DRAM
);
46 platform_set_mr(si
, gd
->bd
->bi_flashstart
, gd
->bd
->bi_flashsize
, MR_ATTR_FLASH
);
47 platform_set_mr(si
, gd
->bd
->bi_sramstart
, gd
->bd
->bi_sramsize
, MR_ATTR_SRAM
);