mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-03 01:50:25 +00:00
f1df936445
This patch adds the DDR3 setup and training code taken from the Marvell U-Boot repository. This code used to be included as a binary (bin_hdr) into the Armada A38x boot image. Not linked with the main U-Boot. With this code addition and the serdes/PHY setup code, the Armada A38x support in mainline U-Boot is finally self-contained. So the complete image for booting can be built from mainline U-Boot. Without any additional external inclusion. Note: This code has undergone many hours (days!) of coding-style cleanup and refactoring. It still is not checkpatch clean though, I'm afraid. As the factoring of the code has so many levels of indentation that many lines are longer than 80 chars. Signed-off-by: Stefan Roese <sr@denx.de>
40 lines
671 B
C
40 lines
671 B
C
/*
|
|
* Copyright (C) Marvell International Ltd. and its affiliates
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <i2c.h>
|
|
#include <spl.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/cpu.h>
|
|
#include <asm/arch/soc.h>
|
|
|
|
#include "ddr3_init.h"
|
|
|
|
/*
|
|
* Name: ddr3_tip_init_silicon
|
|
* Desc: initiate silicon parameters
|
|
* Args:
|
|
* Notes:
|
|
* Returns: required value
|
|
*/
|
|
int ddr3_silicon_init(void)
|
|
{
|
|
int status;
|
|
static int init_done;
|
|
|
|
if (init_done == 1)
|
|
return MV_OK;
|
|
|
|
status = ddr3_tip_init_a38x(0, 0);
|
|
if (MV_OK != status) {
|
|
printf("DDR3 A38x silicon init - FAILED 0x%x\n", status);
|
|
return status;
|
|
}
|
|
|
|
init_done = 1;
|
|
|
|
return MV_OK;
|
|
}
|