blob: 7ea179c94e2809364dfbc7c9a1ba8071de3c8cea [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Frank Vibrans63e62b02011-02-14 18:38:14 +00002
Michał Żygowski287ce5f2019-12-01 17:41:23 +01003#include <amdblocks/acpimmio.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +00004#include "SBPLATFORM.h"
Kerry Shefeed3292011-08-18 18:03:44 +08005#include "sb_cimx.h"
Frank Vibrans63e62b02011-02-14 18:38:14 +00006#include "cfg.h" /*sb800_cimx_config*/
7
Frank Vibrans63e62b02011-02-14 18:38:14 +00008/**
Frank Vibrans63e62b02011-02-14 18:38:14 +00009 * @brief South Bridge CIMx romstage entry,
10 * wrapper of sbPowerOnInit entry point.
11 */
Kerry Shefeed3292011-08-18 18:03:44 +080012void sb_Poweron_Init(void)
Frank Vibrans63e62b02011-02-14 18:38:14 +000013{
14 AMDSBCFG sb_early_cfg;
15
16 sb800_cimx_config(&sb_early_cfg);
17 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
18 //AmdSbDispatcher(&sb_early_cfg);
19 //TODO
20 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
Martin Rothd630c132014-12-17 09:14:17 -070021 // VerifyImage() will fail, LocateImage() takes minutes to find the image.
Frank Vibrans63e62b02011-02-14 18:38:14 +000022 sbPowerOnInit(&sb_early_cfg);
23}
Kerry Shefeed3292011-08-18 18:03:44 +080024
25/**
26 * CIMX not set the clock to 48Mhz until sbBeforePciInit,
27 * coreboot may need to set this even more earlier
28 */
29void sb800_clk_output_48Mhz(void)
30{
Kerry Shefeed3292011-08-18 18:03:44 +080031
Michał Żygowski287ce5f2019-12-01 17:41:23 +010032 misc_write32(0x40, misc_read32(0x40) & (~5));
33 misc_write32(0x40, misc_read32(0x40) | 2);
Kerry Shefeed3292011-08-18 18:03:44 +080034}