blob: 2ee4d40230b0e6ec641c92239adc226ecfe9a084 [file] [log] [blame]
Frank Vibrans63e62b02011-02-14 18:38:14 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Frank Vibrans63e62b02011-02-14 18:38:14 +000014 */
15
Frank Vibrans63e62b02011-02-14 18:38:14 +000016#include <stdint.h>
Michał Żygowski287ce5f2019-12-01 17:41:23 +010017#include <amdblocks/acpimmio.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +000018#include "SBPLATFORM.h"
Kerry Shefeed3292011-08-18 18:03:44 +080019#include "sb_cimx.h"
Frank Vibrans63e62b02011-02-14 18:38:14 +000020#include "cfg.h" /*sb800_cimx_config*/
21
Frank Vibrans63e62b02011-02-14 18:38:14 +000022/**
Frank Vibrans63e62b02011-02-14 18:38:14 +000023 * @brief South Bridge CIMx romstage entry,
24 * wrapper of sbPowerOnInit entry point.
25 */
Kerry Shefeed3292011-08-18 18:03:44 +080026void sb_Poweron_Init(void)
Frank Vibrans63e62b02011-02-14 18:38:14 +000027{
28 AMDSBCFG sb_early_cfg;
29
30 sb800_cimx_config(&sb_early_cfg);
31 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
32 //AmdSbDispatcher(&sb_early_cfg);
33 //TODO
34 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
Martin Rothd630c132014-12-17 09:14:17 -070035 // VerifyImage() will fail, LocateImage() takes minutes to find the image.
Frank Vibrans63e62b02011-02-14 18:38:14 +000036 sbPowerOnInit(&sb_early_cfg);
37}
Kerry Shefeed3292011-08-18 18:03:44 +080038
39/**
40 * CIMX not set the clock to 48Mhz until sbBeforePciInit,
41 * coreboot may need to set this even more earlier
42 */
43void sb800_clk_output_48Mhz(void)
44{
Kerry Shefeed3292011-08-18 18:03:44 +080045
Michał Żygowski287ce5f2019-12-01 17:41:23 +010046 misc_write32(0x40, misc_read32(0x40) & (~5));
47 misc_write32(0x40, misc_read32(0x40) | 2);
Kerry Shefeed3292011-08-18 18:03:44 +080048}