]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
Merge branch 'u-boot-marvell/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / uniphier / ph1-ld4 / sg_init.c
1 /*
2  * Copyright (C) 2011-2014 Panasonic Corporation
3  *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/arch/sg-regs.h>
11
12 void sg_init(void)
13 {
14         u32 tmp;
15
16         /* Set DDR size */
17         tmp = sg_memconf_val_ch0(CONFIG_SDRAM0_SIZE, CONFIG_DDR_NUM_CH0);
18         tmp |= sg_memconf_val_ch1(CONFIG_SDRAM1_SIZE, CONFIG_DDR_NUM_CH1);
19 #if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE < CONFIG_SDRAM1_BASE
20         tmp |= SG_MEMCONF_SPARSEMEM;
21 #endif
22         writel(tmp, SG_MEMCONF);
23
24         /* Input ports must be enabled deasserting reset of cores */
25         tmp = readl(SG_IECTRL);
26         tmp |= 0x1;
27         writel(tmp, SG_IECTRL);
28 }