| // SPDX-License-Identifier: GPL-2.0+ |
| * Actions Semi Owl SoCs platform support. |
| * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
| #include <asm/global_data.h> |
| #include <linux/arm-smccc.h> |
| #include <asm/mach-types.h> |
| #define DMM_INTERLEAVE_PER_CH_CFG 0xe0290028 |
| unsigned int owl_get_ddrcap(void) |
| /* ddr capacity register initialized by ddr driver |
| #if defined(CONFIG_MACH_S700) |
| val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0x7; |
| #elif defined(CONFIG_MACH_S900) |
| val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0xf; |
| * dram_init - sets uboots idea of sdram size |
| gd->ram_size = owl_get_ddrcap() * 1024 * 1024; |
| /* This is called after dram_init() so use get_ram_size result */ |
| int dram_init_banksize(void) |
| gd->bd->bi_dram[0].start = CFG_SYS_SDRAM_BASE; |
| gd->bd->bi_dram[0].size = gd->ram_size; |
| static void show_psci_version(void) |
| struct arm_smccc_res res; |
| arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res); |
| printf("PSCI: v%ld.%ld\n", |
| PSCI_VERSION_MAJOR(res.a0), |
| PSCI_VERSION_MINOR(res.a0)); |