blob: 7399b0f59547aa839eb336c9f83787281219a1f4 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Frank Vibrans63e62b02011-02-14 18:38:14 +00003
Frank Vibrans63e62b02011-02-14 18:38:14 +00004#include <stdint.h>
Michał Żygowski287ce5f2019-12-01 17:41:23 +01005#include <amdblocks/acpimmio.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +00006#include "SBPLATFORM.h"
Kerry Shefeed3292011-08-18 18:03:44 +08007#include "sb_cimx.h"
Frank Vibrans63e62b02011-02-14 18:38:14 +00008#include "cfg.h" /*sb800_cimx_config*/
9
Frank Vibrans63e62b02011-02-14 18:38:14 +000010/**
Frank Vibrans63e62b02011-02-14 18:38:14 +000011 * @brief South Bridge CIMx romstage entry,
12 * wrapper of sbPowerOnInit entry point.
13 */
Kerry Shefeed3292011-08-18 18:03:44 +080014void sb_Poweron_Init(void)
Frank Vibrans63e62b02011-02-14 18:38:14 +000015{
16 AMDSBCFG sb_early_cfg;
17
18 sb800_cimx_config(&sb_early_cfg);
19 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
20 //AmdSbDispatcher(&sb_early_cfg);
21 //TODO
22 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
Martin Rothd630c132014-12-17 09:14:17 -070023 // VerifyImage() will fail, LocateImage() takes minutes to find the image.
Frank Vibrans63e62b02011-02-14 18:38:14 +000024 sbPowerOnInit(&sb_early_cfg);
25}
Kerry Shefeed3292011-08-18 18:03:44 +080026
27/**
28 * CIMX not set the clock to 48Mhz until sbBeforePciInit,
29 * coreboot may need to set this even more earlier
30 */
31void sb800_clk_output_48Mhz(void)
32{
Kerry Shefeed3292011-08-18 18:03:44 +080033
Michał Żygowski287ce5f2019-12-01 17:41:23 +010034 misc_write32(0x40, misc_read32(0x40) & (~5));
35 misc_write32(0x40, misc_read32(0x40) | 2);
Kerry Shefeed3292011-08-18 18:03:44 +080036}